@elyx-code/project-logic-tree 0.0.6392 → 0.0.6393
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.d.ts +9 -8
- package/dist/index.js +6 -2
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2937,7 +2937,7 @@ export declare enum DynamicValueTypes {
|
|
|
2937
2937
|
|
|
2938
2938
|
export declare const EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS: IEditableEntityPersistanceRepository;
|
|
2939
2939
|
|
|
2940
|
-
export declare class EditorContext extends ExtensionContextBase implements Omit<IEditor, 'onLogicLoadingComplete' | 'onLogicLoadingCompleteCallback' | 'onProjectHeadLoaded' | 'onProjectHeadLoadedCallback' | 'onProjectSetupError' | 'onProjectSetupErrorCallback' | 'extensions' | 'onRenderedCallback' | 'handleIncommingWebsocketMessage' | 'handleNotificationChannelsMessage' | 'handlePersistChangeSetMessage' | 'getLogic' | 'injectLocalImplementationOfSearchExecution' | 'setup' | 'destroy' | 'requestModule' | 'socket' | 'events'> {
|
|
2940
|
+
export declare class EditorContext extends ExtensionContextBase implements Omit<IEditor, 'onLogicLoadingComplete' | 'onLogicLoadingCompleteCallback' | 'onProjectHeadLoaded' | 'onProjectHeadLoadedCallback' | 'onProjectSetupError' | 'onProjectSetupErrorCallback' | 'extensions' | 'onRenderedCallback' | 'handleIncommingWebsocketMessage' | 'handleNotificationChannelsMessage' | 'handlePersistChangeSetMessage' | 'getLogic' | 'injectLocalImplementationOfSearchExecution' | 'setup' | 'destroy' | 'requestModule' | 'socket' | 'events' | 'initRegistry'> {
|
|
2941
2941
|
private readonly _editor;
|
|
2942
2942
|
readonly id: string;
|
|
2943
2943
|
constructor(registry: ExtensionsRegistry, _editor: IEditor, id?: string);
|
|
@@ -2968,7 +2968,7 @@ export declare class EditorContext extends ExtensionContextBase implements Omit<
|
|
|
2968
2968
|
undo(): Promise<void>;
|
|
2969
2969
|
redo(): Promise<void>;
|
|
2970
2970
|
initTest(entryPoint: TestableEntityState, autoExecute: boolean): Promise<ITest>;
|
|
2971
|
-
removeTest(): Promise<
|
|
2971
|
+
removeTest(): Promise<ITest>;
|
|
2972
2972
|
copyEntities(entities: CanvasEntityState[]): Promise<ChangeSet>;
|
|
2973
2973
|
resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
|
|
2974
2974
|
publish(): Promise<void>;
|
|
@@ -3655,16 +3655,16 @@ export declare enum ExtensionPermissions {
|
|
|
3655
3655
|
UpdateGUIGlobalTheme = "update:gui:global:theme"
|
|
3656
3656
|
}
|
|
3657
3657
|
|
|
3658
|
-
export declare class ExtensionsRegistry implements Omit<IEventsBus, 'destroy'> {
|
|
3658
|
+
export declare class ExtensionsRegistry<TEditorContext extends EditorContext = EditorContext, TProjectLogicContext extends ProjectLogicContext = ProjectLogicContext> implements Omit<IEventsBus, 'destroy'> {
|
|
3659
3659
|
private events;
|
|
3660
3660
|
private extensions;
|
|
3661
|
-
onResolveEditorContextCallback: () =>
|
|
3662
|
-
onResolveProjectLogicContextCallback: () =>
|
|
3661
|
+
onResolveEditorContextCallback: () => TEditorContext | null;
|
|
3662
|
+
onResolveProjectLogicContextCallback: () => TProjectLogicContext | null;
|
|
3663
3663
|
onResolveGUIContextCallback: () => null;
|
|
3664
3664
|
onResolveCompileContextCallback: () => null;
|
|
3665
3665
|
constructor(events?: Events);
|
|
3666
|
-
onResolveEditorContext(callback: () =>
|
|
3667
|
-
onResolveProjectLogicContext(callback: () =>
|
|
3666
|
+
onResolveEditorContext(callback: () => TEditorContext | null): void;
|
|
3667
|
+
onResolveProjectLogicContext(callback: () => TProjectLogicContext | null): void;
|
|
3668
3668
|
onResolveGUIContext(callback: () => null): void;
|
|
3669
3669
|
onResolveCompileContext(callback: () => null): void;
|
|
3670
3670
|
get extensionInOrder(): IRegisteredExtension[];
|
|
@@ -9554,12 +9554,13 @@ export declare interface IEditor extends IUndoableInterface, IValueResolutionCon
|
|
|
9554
9554
|
}): Promise<void>;
|
|
9555
9555
|
destroy(): Promise<void>;
|
|
9556
9556
|
initTest(entryPoint: TestableEntityState, autoExecute: boolean): Promise<ITest>;
|
|
9557
|
-
removeTest(): Promise<
|
|
9557
|
+
removeTest(): Promise<ITest>;
|
|
9558
9558
|
copyEntities(entities: CanvasEntityState[]): Promise<ChangeSet>;
|
|
9559
9559
|
resolveInitialChildrenPositions(parent: CanvasEntityState | null, children: CanvasEntityState[], changeSet: ChangeSet | null): CanvasEntityState[];
|
|
9560
9560
|
publish(): Promise<void>;
|
|
9561
9561
|
loadActivePublication(publicationId: string): Promise<IPublication>;
|
|
9562
9562
|
requestModule<T = any>(moduleId: string): T;
|
|
9563
|
+
initRegistry(): Promise<ExtensionsRegistry>;
|
|
9563
9564
|
}
|
|
9564
9565
|
|
|
9565
9566
|
export declare interface IEntityActionRequestPayload<P extends {
|
package/dist/index.js
CHANGED
|
@@ -90489,7 +90489,9 @@ class A1 extends it {
|
|
|
90489
90489
|
const w = new pn(
|
|
90490
90490
|
p.logic,
|
|
90491
90491
|
[T],
|
|
90492
|
-
T
|
|
90492
|
+
T,
|
|
90493
|
+
null,
|
|
90494
|
+
this.registry
|
|
90493
90495
|
);
|
|
90494
90496
|
return w.inheritValuesFromContext(p), w;
|
|
90495
90497
|
}).map(
|
|
@@ -90558,7 +90560,9 @@ class w1 extends it {
|
|
|
90558
90560
|
])[0], T = new pn(
|
|
90559
90561
|
v.logic,
|
|
90560
90562
|
[e],
|
|
90561
|
-
e
|
|
90563
|
+
e,
|
|
90564
|
+
null,
|
|
90565
|
+
this.registry
|
|
90562
90566
|
);
|
|
90563
90567
|
T.inheritValuesFromContext(v);
|
|
90564
90568
|
const w = await T.execute();
|
package/dist/index.umd.cjs
CHANGED
|
@@ -196,7 +196,7 @@ ${Yn({describe_entity:y.error.id})}`,issue:null}))),{errors:p,modifiedData:l}}va
|
|
|
196
196
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(u){return u instanceof this?u:new this(u)}static concat(u,...i){const a=new this(u);return i.forEach(l=>a.set(l)),a}static accessor(u){const a=(this[v6]=this[v6]={accessors:{}}).accessors,l=this.prototype;function p(e){const y=Jp(e);a[y]||(ATe(l,e),a[y]=!0)}return Ae.isArray(u)?u.forEach(p):p(u),this}}zy.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ae.reduceDescriptors(zy.prototype,({value:d},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>d,set(a){this[i]=a}}}),Ae.freezeMethods(zy);const In=zy;function HA(d,u){const i=this||JA,a=u||i,l=In.from(a.headers);let p=a.data;return Ae.forEach(d,function(y){p=y.call(i,p,l.normalize(),u?u.status:void 0)}),l.normalize(),p}function E6(d){return!!(d&&d.__CANCEL__)}function Wd(d,u,i){Ot.call(this,d??"canceled",Ot.ERR_CANCELED,u,i),this.name="CanceledError"}Ae.inherits(Wd,Ot,{__CANCEL__:!0});function T6(d,u,i){const a=i.config.validateStatus;!i.status||!a||a(i.status)?d(i):u(new Ot("Request failed with status code "+i.status,[Ot.ERR_BAD_REQUEST,Ot.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function bTe(d){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(d);return u&&u[1]||""}function wTe(d,u){d=d||10;const i=new Array(d),a=new Array(d);let l=0,p=0,e;return u=u!==void 0?u:1e3,function(v){const T=Date.now(),w=a[p];e||(e=T),i[l]=v,a[l]=T;let A=p,P=0;for(;A!==l;)P+=i[A++],A=A%d;if(l=(l+1)%d,l===p&&(p=(p+1)%d),T-e<u)return;const V=w&&T-w;return V?Math.round(P*1e3/V):void 0}}function RTe(d,u){let i=0,a=1e3/u,l,p;const e=(T,w=Date.now())=>{i=w,l=null,p&&(clearTimeout(p),p=null),d.apply(null,T)};return[(...T)=>{const w=Date.now(),A=w-i;A>=a?e(T,w):(l=T,p||(p=setTimeout(()=>{p=null,e(l)},a-A)))},()=>l&&e(l)]}const Xy=(d,u,i=3)=>{let a=0;const l=wTe(50,250);return RTe(p=>{const e=p.loaded,y=p.lengthComputable?p.total:void 0,v=e-a,T=l(v),w=e<=y;a=e;const A={loaded:e,total:y,progress:y?e/y:void 0,bytes:v,rate:T||void 0,estimated:T&&y&&w?(y-e)/T:void 0,event:p,lengthComputable:y!=null,[u?"download":"upload"]:!0};d(A)},i)},I6=(d,u)=>{const i=d!=null;return[a=>u[0]({lengthComputable:i,total:d,loaded:a}),u[1]]},A6=d=>(...u)=>Ae.asap(()=>d(...u)),_Te=Gi.hasStandardBrowserEnv?((d,u)=>i=>(i=new URL(i,Gi.origin),d.protocol===i.protocol&&d.host===i.host&&(u||d.port===i.port)))(new URL(Gi.origin),Gi.navigator&&/(msie|trident)/i.test(Gi.navigator.userAgent)):()=>!0,gTe=Gi.hasStandardBrowserEnv?{write(d,u,i,a,l,p){const e=[d+"="+encodeURIComponent(u)];Ae.isNumber(i)&&e.push("expires="+new Date(i).toGMTString()),Ae.isString(a)&&e.push("path="+a),Ae.isString(l)&&e.push("domain="+l),p===!0&&e.push("secure"),document.cookie=e.join("; ")},read(d){const u=document.cookie.match(new RegExp("(^|;\\s*)("+d+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove(d){this.write(d,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function DTe(d){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(d)}function OTe(d,u){return u?d.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):d}function b6(d,u,i){let a=!DTe(u);return d&&(a||i==!1)?OTe(d,u):u}const w6=d=>d instanceof In?{...d}:d;function bl(d,u){u=u||{};const i={};function a(T,w,A,P){return Ae.isPlainObject(T)&&Ae.isPlainObject(w)?Ae.merge.call({caseless:P},T,w):Ae.isPlainObject(w)?Ae.merge({},w):Ae.isArray(w)?w.slice():w}function l(T,w,A,P){if(Ae.isUndefined(w)){if(!Ae.isUndefined(T))return a(void 0,T,A,P)}else return a(T,w,A,P)}function p(T,w){if(!Ae.isUndefined(w))return a(void 0,w)}function e(T,w){if(Ae.isUndefined(w)){if(!Ae.isUndefined(T))return a(void 0,T)}else return a(void 0,w)}function y(T,w,A){if(A in u)return a(T,w);if(A in d)return a(void 0,T)}const v={url:p,method:p,data:p,baseURL:e,transformRequest:e,transformResponse:e,paramsSerializer:e,timeout:e,timeoutMessage:e,withCredentials:e,withXSRFToken:e,adapter:e,responseType:e,xsrfCookieName:e,xsrfHeaderName:e,onUploadProgress:e,onDownloadProgress:e,decompress:e,maxContentLength:e,maxBodyLength:e,beforeRedirect:e,transport:e,httpAgent:e,httpsAgent:e,cancelToken:e,socketPath:e,responseEncoding:e,validateStatus:y,headers:(T,w,A)=>l(w6(T),w6(w),A,!0)};return Ae.forEach(Object.keys(Object.assign({},d,u)),function(w){const A=v[w]||l,P=A(d[w],u[w],w);Ae.isUndefined(P)&&A!==y||(i[w]=P)}),i}const R6=d=>{const u=bl({},d);let{data:i,withXSRFToken:a,xsrfHeaderName:l,xsrfCookieName:p,headers:e,auth:y}=u;u.headers=e=In.from(e),u.url=f6(b6(u.baseURL,u.url,u.allowAbsoluteUrls),d.params,d.paramsSerializer),y&&e.set("Authorization","Basic "+btoa((y.username||"")+":"+(y.password?unescape(encodeURIComponent(y.password)):"")));let v;if(Ae.isFormData(i)){if(Gi.hasStandardBrowserEnv||Gi.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if((v=e.getContentType())!==!1){const[T,...w]=v?v.split(";").map(A=>A.trim()).filter(Boolean):[];e.setContentType([T||"multipart/form-data",...w].join("; "))}}if(Gi.hasStandardBrowserEnv&&(a&&Ae.isFunction(a)&&(a=a(u)),a||a!==!1&&_Te(u.url))){const T=l&&p&&gTe.read(p);T&&e.set(l,T)}return u},CTe=typeof XMLHttpRequest<"u"&&function(d){return new Promise(function(i,a){const l=R6(d);let p=l.data;const e=In.from(l.headers).normalize();let{responseType:y,onUploadProgress:v,onDownloadProgress:T}=l,w,A,P,V,U;function G(){V&&V(),U&&U(),l.cancelToken&&l.cancelToken.unsubscribe(w),l.signal&&l.signal.removeEventListener("abort",w)}let K=new XMLHttpRequest;K.open(l.method.toUpperCase(),l.url,!0),K.timeout=l.timeout;function J(){if(!K)return;const X=In.from("getAllResponseHeaders"in K&&K.getAllResponseHeaders()),re={data:!y||y==="text"||y==="json"?K.responseText:K.response,status:K.status,statusText:K.statusText,headers:X,config:d,request:K};T6(function(Y){i(Y),G()},function(Y){a(Y),G()},re),K=null}"onloadend"in K?K.onloadend=J:K.onreadystatechange=function(){!K||K.readyState!==4||K.status===0&&!(K.responseURL&&K.responseURL.indexOf("file:")===0)||setTimeout(J)},K.onabort=function(){K&&(a(new Ot("Request aborted",Ot.ECONNABORTED,d,K)),K=null)},K.onerror=function(){a(new Ot("Network Error",Ot.ERR_NETWORK,d,K)),K=null},K.ontimeout=function(){let ce=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const re=l.transitional||y6;l.timeoutErrorMessage&&(ce=l.timeoutErrorMessage),a(new Ot(ce,re.clarifyTimeoutError?Ot.ETIMEDOUT:Ot.ECONNABORTED,d,K)),K=null},p===void 0&&e.setContentType(null),"setRequestHeader"in K&&Ae.forEach(e.toJSON(),function(ce,re){K.setRequestHeader(re,ce)}),Ae.isUndefined(l.withCredentials)||(K.withCredentials=!!l.withCredentials),y&&y!=="json"&&(K.responseType=l.responseType),T&&([P,U]=Xy(T,!0),K.addEventListener("progress",P)),v&&K.upload&&([A,V]=Xy(v),K.upload.addEventListener("progress",A),K.upload.addEventListener("loadend",V)),(l.cancelToken||l.signal)&&(w=X=>{K&&(a(!X||X.type?new Wd(null,d,K):X),K.abort(),K=null)},l.cancelToken&&l.cancelToken.subscribe(w),l.signal&&(l.signal.aborted?w():l.signal.addEventListener("abort",w)));const ie=bTe(l.url);if(ie&&Gi.protocols.indexOf(ie)===-1){a(new Ot("Unsupported protocol "+ie+":",Ot.ERR_BAD_REQUEST,d));return}K.send(p||null)})},$Te=(d,u)=>{const{length:i}=d=d?d.filter(Boolean):[];if(u||i){let a=new AbortController,l;const p=function(T){if(!l){l=!0,y();const w=T instanceof Error?T:this.reason;a.abort(w instanceof Ot?w:new Wd(w instanceof Error?w.message:w))}};let e=u&&setTimeout(()=>{e=null,p(new Ot(`timeout ${u} of ms exceeded`,Ot.ETIMEDOUT))},u);const y=()=>{d&&(e&&clearTimeout(e),e=null,d.forEach(T=>{T.unsubscribe?T.unsubscribe(p):T.removeEventListener("abort",p)}),d=null)};d.forEach(T=>T.addEventListener("abort",p));const{signal:v}=a;return v.unsubscribe=()=>Ae.asap(y),v}},PTe=function*(d,u){let i=d.byteLength;if(!u||i<u){yield d;return}let a=0,l;for(;a<i;)l=a+u,yield d.slice(a,l),a=l},NTe=async function*(d,u){for await(const i of VTe(d))yield*PTe(i,u)},VTe=async function*(d){if(d[Symbol.asyncIterator]){yield*d;return}const u=d.getReader();try{for(;;){const{done:i,value:a}=await u.read();if(i)break;yield a}}finally{await u.cancel()}},_6=(d,u,i,a)=>{const l=NTe(d,u);let p=0,e,y=v=>{e||(e=!0,a&&a(v))};return new ReadableStream({async pull(v){try{const{done:T,value:w}=await l.next();if(T){y(),v.close();return}let A=w.byteLength;if(i){let P=p+=A;i(P)}v.enqueue(new Uint8Array(w))}catch(T){throw y(T),T}},cancel(v){return y(v),l.return()}},{highWaterMark:2})},Qy=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",g6=Qy&&typeof ReadableStream=="function",LTe=Qy&&(typeof TextEncoder=="function"?(d=>u=>d.encode(u))(new TextEncoder):async d=>new Uint8Array(await new Response(d).arrayBuffer())),D6=(d,...u)=>{try{return!!d(...u)}catch{return!1}},MTe=g6&&D6(()=>{let d=!1;const u=new Request(Gi.origin,{body:new ReadableStream,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!u}),O6=64*1024,WA=g6&&D6(()=>Ae.isReadableStream(new Response("").body)),em={stream:WA&&(d=>d.body)};Qy&&(d=>{["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!em[u]&&(em[u]=Ae.isFunction(d[u])?i=>i[u]():(i,a)=>{throw new Ot(`Response type '${u}' is not supported`,Ot.ERR_NOT_SUPPORT,a)})})})(new Response);const BTe=async d=>{if(d==null)return 0;if(Ae.isBlob(d))return d.size;if(Ae.isSpecCompliantForm(d))return(await new Request(Gi.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(Ae.isArrayBufferView(d)||Ae.isArrayBuffer(d))return d.byteLength;if(Ae.isURLSearchParams(d)&&(d=d+""),Ae.isString(d))return(await LTe(d)).byteLength},UTe=async(d,u)=>{const i=Ae.toFiniteNumber(d.getContentLength());return i??BTe(u)},YA={http:iTe,xhr:CTe,fetch:Qy&&(async d=>{let{url:u,method:i,data:a,signal:l,cancelToken:p,timeout:e,onDownloadProgress:y,onUploadProgress:v,responseType:T,headers:w,withCredentials:A="same-origin",fetchOptions:P}=R6(d);T=T?(T+"").toLowerCase():"text";let V=$Te([l,p&&p.toAbortSignal()],e),U;const G=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let K;try{if(v&&MTe&&i!=="get"&&i!=="head"&&(K=await UTe(w,a))!==0){let re=new Request(u,{method:"POST",body:a,duplex:"half"}),he;if(Ae.isFormData(a)&&(he=re.headers.get("content-type"))&&w.setContentType(he),re.body){const[Y,H]=I6(K,Xy(A6(v)));a=_6(re.body,O6,Y,H)}}Ae.isString(A)||(A=A?"include":"omit");const J="credentials"in Request.prototype;U=new Request(u,{...P,signal:V,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:J?A:void 0});let ie=await fetch(U);const X=WA&&(T==="stream"||T==="response");if(WA&&(y||X&&G)){const re={};["status","statusText","headers"].forEach(pe=>{re[pe]=ie[pe]});const he=Ae.toFiniteNumber(ie.headers.get("content-length")),[Y,H]=y&&I6(he,Xy(A6(y),!0))||[];ie=new Response(_6(ie.body,O6,Y,()=>{H&&H(),G&&G()}),re)}T=T||"text";let ce=await em[Ae.findKey(em,T)||"text"](ie,d);return!X&&G&&G(),await new Promise((re,he)=>{T6(re,he,{data:ce,headers:In.from(ie.headers),status:ie.status,statusText:ie.statusText,config:d,request:U})})}catch(J){throw G&&G(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new Ot("Network Error",Ot.ERR_NETWORK,d,U),{cause:J.cause||J}):Ot.from(J,J&&J.code,d,U)}})};Ae.forEach(YA,(d,u)=>{if(d){try{Object.defineProperty(d,"name",{value:u})}catch{}Object.defineProperty(d,"adapterName",{value:u})}});const C6=d=>`- ${d}`,jTe=d=>Ae.isFunction(d)||d===null||d===!1,$6={getAdapter:d=>{d=Ae.isArray(d)?d:[d];const{length:u}=d;let i,a;const l={};for(let p=0;p<u;p++){i=d[p];let e;if(a=i,!jTe(i)&&(a=YA[(e=String(i)).toLowerCase()],a===void 0))throw new Ot(`Unknown adapter '${e}'`);if(a)break;l[e||"#"+p]=a}if(!a){const p=Object.entries(l).map(([y,v])=>`adapter ${y} `+(v===!1?"is not supported by the environment":"is not available in the build"));let e=u?p.length>1?`since :
|
|
197
197
|
`+p.map(C6).join(`
|
|
198
198
|
`):" "+C6(p[0]):"as no adapter specified";throw new Ot("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return a},adapters:YA};function zA(d){if(d.cancelToken&&d.cancelToken.throwIfRequested(),d.signal&&d.signal.aborted)throw new Wd(null,d)}function P6(d){return zA(d),d.headers=In.from(d.headers),d.data=HA.call(d,d.transformRequest),["post","put","patch"].indexOf(d.method)!==-1&&d.headers.setContentType("application/x-www-form-urlencoded",!1),$6.getAdapter(d.adapter||JA.adapter)(d).then(function(a){return zA(d),a.data=HA.call(d,d.transformResponse,a),a.headers=In.from(a.headers),a},function(a){return E6(a)||(zA(d),a&&a.response&&(a.response.data=HA.call(d,d.transformResponse,a.response),a.response.headers=In.from(a.response.headers))),Promise.reject(a)})}const N6="1.9.0",tm={};["object","boolean","number","function","string","symbol"].forEach((d,u)=>{tm[d]=function(a){return typeof a===d||"a"+(u<1?"n ":" ")+d}});const V6={};tm.transitional=function(u,i,a){function l(p,e){return"[Axios v"+N6+"] Transitional option '"+p+"'"+e+(a?". "+a:"")}return(p,e,y)=>{if(u===!1)throw new Ot(l(e," has been removed"+(i?" in "+i:"")),Ot.ERR_DEPRECATED);return i&&!V6[e]&&(V6[e]=!0,console.warn(l(e," has been deprecated since v"+i+" and will be removed in the near future"))),u?u(p,e,y):!0}},tm.spelling=function(u){return(i,a)=>(console.warn(`${a} is likely a misspelling of ${u}`),!0)};function xTe(d,u,i){if(typeof d!="object")throw new Ot("options must be an object",Ot.ERR_BAD_OPTION_VALUE);const a=Object.keys(d);let l=a.length;for(;l-- >0;){const p=a[l],e=u[p];if(e){const y=d[p],v=y===void 0||e(y,p,d);if(v!==!0)throw new Ot("option "+p+" must be "+v,Ot.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Ot("Unknown option "+p,Ot.ERR_BAD_OPTION)}}const rm={assertOptions:xTe,validators:tm},Wn=rm.validators;class im{constructor(u){this.defaults=u||{},this.interceptors={request:new h6,response:new h6}}async request(u,i){try{return await this._request(u,i)}catch(a){if(a instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const p=l.stack?l.stack.replace(/^.+\n/,""):"";try{a.stack?p&&!String(a.stack).endsWith(p.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
199
|
-
`+p):a.stack=p}catch{}}throw a}}_request(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=bl(this.defaults,i);const{transitional:a,paramsSerializer:l,headers:p}=i;a!==void 0&&rm.assertOptions(a,{silentJSONParsing:Wn.transitional(Wn.boolean),forcedJSONParsing:Wn.transitional(Wn.boolean),clarifyTimeoutError:Wn.transitional(Wn.boolean)},!1),l!=null&&(Ae.isFunction(l)?i.paramsSerializer={serialize:l}:rm.assertOptions(l,{encode:Wn.function,serialize:Wn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),rm.assertOptions(i,{baseUrl:Wn.spelling("baseURL"),withXsrfToken:Wn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=p&&Ae.merge(p.common,p[i.method]);p&&Ae.forEach(["delete","get","head","post","put","patch","common"],U=>{delete p[U]}),i.headers=In.concat(e,p);const y=[];let v=!0;this.interceptors.request.forEach(function(G){typeof G.runWhen=="function"&&G.runWhen(i)===!1||(v=v&&G.synchronous,y.unshift(G.fulfilled,G.rejected))});const T=[];this.interceptors.response.forEach(function(G){T.push(G.fulfilled,G.rejected)});let w,A=0,P;if(!v){const U=[P6.bind(this),void 0];for(U.unshift.apply(U,y),U.push.apply(U,T),P=U.length,w=Promise.resolve(i);A<P;)w=w.then(U[A++],U[A++]);return w}P=y.length;let V=i;for(A=0;A<P;){const U=y[A++],G=y[A++];try{V=U(V)}catch(K){G.call(this,K);break}}try{w=P6.call(this,V)}catch(U){return Promise.reject(U)}for(A=0,P=T.length;A<P;)w=w.then(T[A++],T[A++]);return w}getUri(u){u=bl(this.defaults,u);const i=b6(u.baseURL,u.url,u.allowAbsoluteUrls);return f6(i,u.params,u.paramsSerializer)}}Ae.forEach(["delete","get","head","options"],function(u){im.prototype[u]=function(i,a){return this.request(bl(a||{},{method:u,url:i,data:(a||{}).data}))}}),Ae.forEach(["post","put","patch"],function(u){function i(a){return function(p,e,y){return this.request(bl(y||{},{method:u,headers:a?{"Content-Type":"multipart/form-data"}:{},url:p,data:e}))}}im.prototype[u]=i(),im.prototype[u+"Form"]=i(!0)});const sm=im;class XA{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(p){i=p});const a=this;this.promise.then(l=>{if(!a._listeners)return;let p=a._listeners.length;for(;p-- >0;)a._listeners[p](l);a._listeners=null}),this.promise.then=l=>{let p;const e=new Promise(y=>{a.subscribe(y),p=y}).then(l);return e.cancel=function(){a.unsubscribe(p)},e},u(function(p,e,y){a.reason||(a.reason=new Wd(p,e,y),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=a=>{u.abort(a)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new XA(function(l){u=l}),cancel:u}}}const FTe=XA;function GTe(d){return function(i){return d.apply(null,i)}}function STe(d){return Ae.isObject(d)&&d.isAxiosError===!0}const QA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(QA).forEach(([d,u])=>{QA[u]=d});const KTe=QA;function L6(d){const u=new sm(d),i=XG(sm.prototype.request,u);return Ae.extend(i,sm.prototype,u,{allOwnKeys:!0}),Ae.extend(i,u,null,{allOwnKeys:!0}),i.create=function(l){return L6(bl(d,l))},i}const fi=L6(JA);fi.Axios=sm,fi.CanceledError=Wd,fi.CancelToken=FTe,fi.isCancel=E6,fi.VERSION=N6,fi.toFormData=Wy,fi.AxiosError=Ot,fi.Cancel=fi.CanceledError,fi.all=function(u){return Promise.all(u)},fi.spread=GTe,fi.isAxiosError=STe,fi.mergeConfig=bl,fi.AxiosHeaders=In,fi.formToJSON=d=>m6(Ae.isHTMLForm(d)?new FormData(d):d),fi.getAdapter=$6.getAdapter,fi.HttpStatusCode=KTe,fi.default=fi;const kTe=fi;class eb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Addition);l&&(l.autoexecutable=!0,l.implementation=eb.prototype.module.main)}},main:async(...i)=>{try{const l=i.reduce((p,e)=>p+e,0);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class tb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Subtraction);l&&(l.autoexecutable=!0,l.implementation=tb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i,p=a-l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class rb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Multiplication);l&&(l.autoexecutable=!0,l.implementation=rb.prototype.module.main)}},main:async(...i)=>{try{const l=i.reduce((p,e)=>p*e,1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ib extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Division);l&&(l.autoexecutable=!0,l.implementation=ib.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i;if(l===0)throw new Error("Division by zero is not allowed");const p=a/l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class sb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Remainder);l&&(l.autoexecutable=!0,l.implementation=sb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i;if(l===0)throw new Error("Division by zero is not allowed");const p=a%l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class nb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Exponentiation);l&&(l.autoexecutable=!0,l.implementation=nb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i,p=Math.pow(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ab extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomInteger);l&&(l.autoexecutable=!0,l.implementation=ab.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=pEe(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ob extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomFloat);l&&(l.autoexecutable=!0,l.implementation=ob.prototype.module.main)}},main:async(...i)=>{try{const a=HG();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class lb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomHexadecimal);l&&(l.autoexecutable=!0,l.implementation=lb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=WG(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class db extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomBase62);l&&(l.autoexecutable=!0,l.implementation=db.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=YG(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ub extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomBase64);l&&(l.autoexecutable=!0,l.implementation=ub.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=hEe(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class cb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomAlphanumeric);l&&(l.autoexecutable=!0,l.implementation=cb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=yEe(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class pb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateIdentifier);l&&(l.autoexecutable=!0,l.implementation=pb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=zG(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class fb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomUUIDv4);l&&(l.autoexecutable=!0,l.implementation=fb.prototype.module.main)}},main:async(...i)=>{try{const a=mEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class hb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateShortIdentifier);l&&(l.autoexecutable=!0,l.implementation=hb.prototype.module.main)}},main:async(...i)=>{try{const a=vEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class yb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateHexadecimalToken);l&&(l.autoexecutable=!0,l.implementation=yb.prototype.module.main)}},main:async(...i)=>{try{const a=EEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class mb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Join);l&&(l.autoexecutable=!0,l.implementation=mb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],p=i.slice(1).join(a);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class vb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT,version:"1.0.0",description:"String split operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Split);l&&(l.autoexecutable=!0,l.implementation=vb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=a.split(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Eb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST,version:"1.0.0",description:"String delete last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteLast);l&&(l.autoexecutable=!0,l.implementation=Eb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.slice(0,-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Tb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST,version:"1.0.0",description:"String delete first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteFirst);l&&(l.autoexecutable=!0,l.implementation=Tb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.slice(1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ib extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Reverse);l&&(l.autoexecutable=!0,l.implementation=Ib.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.split("").reverse().join("");return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ab extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ToLowerCase);l&&(l.autoexecutable=!0,l.implementation=Ab.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.toLowerCase();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class bb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ToUpperCase);l&&(l.autoexecutable=!0,l.implementation=bb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.toUpperCase();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class wb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteIndex);l&&(l.autoexecutable=!0,l.implementation=wb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const p=a.slice(0,l)+a.slice(l+1);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Rb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.AddIndex);l&&(l.autoexecutable=!0,l.implementation=Rb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=a.slice(0,l)+p+a.slice(l);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class _b extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceFirst);l&&(l.autoexecutable=!0,l.implementation=_b.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.replace(l,p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class gb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceLast);l&&(l.autoexecutable=!0,l.implementation=gb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.lastIndexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=a.slice(0,e)+a.slice(e).replace(l,p);return{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Db extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceIndex);l&&(l.autoexecutable=!0,l.implementation=Db.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=a.slice(0,l)+p+a.slice(l+1);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ob extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_SINGLE_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceSingleMatch);l&&(l.autoexecutable=!0,l.implementation=Ob.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.replace(l,p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Cb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceAllMatches);l&&(l.autoexecutable=!0,l.implementation=Cb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.split(l).join(p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class $b extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetIndexItem);l&&(l.autoexecutable=!0,l.implementation=$b.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.charAt(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Pb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST,version:"1.0.0",description:"String get first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetFirst);l&&(l.autoexecutable=!0,l.implementation=Pb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.charAt(0);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Nb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST,version:"1.0.0",description:"String get last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetLast);l&&(l.autoexecutable=!0,l.implementation=Nb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.charAt(a.length-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Vb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetIndexOf);l&&(l.autoexecutable=!0,l.implementation=Vb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.indexOf(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Lb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Append);l&&(l.autoexecutable=!0,l.implementation=Lb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a+l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Mb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Prepend);l&&(l.autoexecutable=!0,l.implementation=Mb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=l+a;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Bb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Join);l&&(l.autoexecutable=!0,l.implementation=Bb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=a.join(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ub extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Split);l&&(l.autoexecutable=!0,l.implementation=Ub.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.split(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class jb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Reverse);l&&(l.autoexecutable=!0,l.implementation=jb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice().reverse();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class xb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.DeleteLast);l&&(l.autoexecutable=!0,l.implementation=xb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice(0,-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Fb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.DeleteFirst);l&&(l.autoexecutable=!0,l.implementation=Fb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice(1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Gb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.AddIndex);l&&(l.autoexecutable=!0,l.implementation=Gb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=[...a.slice(0,l),p,...a.slice(l)];return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Sb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceIndex);l&&(l.autoexecutable=!0,l.implementation=Sb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=[...a];return e[l]=p,{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Kb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceFirst);l&&(l.autoexecutable=!0,l.implementation=Kb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const e=a.indexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=[...a];return y[e]=p,{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class kb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceLast);l&&(l.autoexecutable=!0,l.implementation=kb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const e=a.lastIndexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=[...a];return y[e]=p,{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class qb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetIndexItem);l&&(l.autoexecutable=!0,l.implementation=qb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const p=a[l];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Jb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetFirst);l&&(l.autoexecutable=!0,l.implementation=Jb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a[0];return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Zb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetLast);l&&(l.autoexecutable=!0,l.implementation=Zb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a[a.length-1];return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Hb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Append);l&&(l.autoexecutable=!0,l.implementation=Hb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=[...a,l];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Wb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Prepend);l&&(l.autoexecutable=!0,l.implementation=Wb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=[l,...a];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Yb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_PARALLEL,version:"1.0.0",description:"Execution parallel operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Parallel);l&&(l.implementation=Yb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(a))return{value:se.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const p=this.registry.requestContexts(this,[ue.Editor])[0],y=a.map(T=>{const w=new Ws(p.logic,[T],T);return w.inheritValuesFromContext(p),w}).map(T=>T.execute()),v=await Promise.all(y);return{value:se.Success,error:null,results:[v]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class zb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SEQUENTIAL,version:"1.0.0",description:"Execution sequential operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Sequential);l&&(l.implementation=zb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(a))return{value:se.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const l=[];for(let p=0;p<a.length;p++){const e=a[p],v=this.registry.requestContexts(this,[ue.Editor])[0],T=new Ws(v.logic,[e],e);T.inheritValuesFromContext(v);const w=await T.execute();l.push(w)}return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Xb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Wait);l&&(l.implementation=Xb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];return typeof a!="number"||a<0?{value:se.Error,error:"Invalid wait time provided",results:[]}:(await new Promise(l=>setTimeout(l,a)),{value:se.Success,error:null,results:[]})}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Qb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CREATE_NEW_INSTANCE,version:"1.0.0",description:"Entity create new instance operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(cr.CreateNewInstance);l&&(l.implementation=Qb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No entity template provided",results:[]};if(!(a instanceof Qn))return{value:se.Error,error:"Invalid entity template value provided",results:[]};const l=i[1]||{},e=Pi(a).map(v=>v.name);let y=l;if(e.includes(Be.PERSISTED_ENTITY)){const v=a.properties.find(w=>{var A;return((A=w.implements)==null?void 0:A.id)===Te["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id});if(!v)return{value:se.Error,error:"No database property found in entity",results:[]};if(!v.getDefaultValue())return{value:se.Error,error:"Database property has no database as entity as default value",results:[]}}return{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ew extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(cr.Validate);l&&(l.autoexecutable=!0,l.implementation=ew.prototype.module.main)}},main:async(...i)=>{try{const l=rT(i[0]).safeParse(i[1]);return l.success?{value:se.Success,error:null,results:[i[1]]}:{value:se.Error,error:l.error.errors,results:[]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class tw extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(yi.HttpRequest);l&&(l.implementation=tw.prototype.module.main)}},main:async(...i)=>{try{const a=i[3]||{},l={method:i[0],url:i[1],params:i[2],headers:a,data:i[4]};console.log("Axios request config: ",l);const p=await kTe(l);return{value:se.Success,error:null,results:[p.status,p.headers,p.data]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}function qTe(d){d.register(new ZG(d)),d.register(new JG(d)),d.register(new KG(d)),d.register(new qG(d)),d.register(new kG(d)),d.register(new eb(d)),d.register(new tb(d)),d.register(new rb(d)),d.register(new sb(d)),d.register(new ib(d)),d.register(new nb(d)),d.register(new ab(d)),d.register(new ob(d)),d.register(new lb(d)),d.register(new db(d)),d.register(new ub(d)),d.register(new cb(d)),d.register(new pb(d)),d.register(new fb(d)),d.register(new hb(d)),d.register(new yb(d)),d.register(new mb(d)),d.register(new vb(d)),d.register(new Eb(d)),d.register(new Tb(d)),d.register(new Ib(d)),d.register(new Ab(d)),d.register(new bb(d)),d.register(new wb(d)),d.register(new Rb(d)),d.register(new _b(d)),d.register(new gb(d)),d.register(new Db(d)),d.register(new Ob(d)),d.register(new Cb(d)),d.register(new $b(d)),d.register(new Pb(d)),d.register(new Nb(d)),d.register(new Vb(d)),d.register(new Lb(d)),d.register(new Mb(d)),d.register(new Bb(d)),d.register(new Ub(d)),d.register(new jb(d)),d.register(new xb(d)),d.register(new Fb(d)),d.register(new Gb(d)),d.register(new Sb(d)),d.register(new Kb(d)),d.register(new kb(d)),d.register(new qb(d)),d.register(new Jb(d)),d.register(new Zb(d)),d.register(new Hb(d)),d.register(new Wb(d)),d.register(new Yb(d)),d.register(new zb(d)),d.register(new Xb(d)),d.register(new Qb(d)),d.register(new ew(d)),d.register(new tw(d))}class M6{constructor(u=new Sp){g(this,"extensions",new Map);g(this,"onResolveEditorContextCallback",()=>null);g(this,"onResolveProjectLogicContextCallback",()=>null);g(this,"onResolveGUIContextCallback",()=>null);g(this,"onResolveCompileContextCallback",()=>null);this.events=u}onResolveEditorContext(u){this.onResolveEditorContextCallback=u}onResolveProjectLogicContext(u){this.onResolveProjectLogicContextCallback=u}onResolveGUIContext(u){this.onResolveGUIContextCallback=u}onResolveCompileContext(u){this.onResolveCompileContextCallback=u}get extensionInOrder(){return Array.from(this.extensions.values()).sort((u,i)=>(u.manifest.initPriority||Xe.Normal)-(i.manifest.initPriority||Xe.Normal))}async setup(){qTe(this),await this.initAll()}requestContext(u){switch(u){case ue.Editor:return this.onResolveEditorContextCallback();case ue.Logic:return this.onResolveProjectLogicContextCallback();case ue.GUI:return this.onResolveGUIContextCallback();case ue.Compile:return this.onResolveCompileContextCallback();default:throw new Error(`Unknown context type: ${u}`)}}requestContexts(u,i=[]){const a=[];i.length===0&&(i=u.manifest.contexts);for(const l of i){const p=this.requestContext(l);p&&a.push(p)}return a}requestModule(u){const i=this.extensions.get(u);if(i){if(i.module)return i.module;throw new Error(`Module ${u} is not registered properly.`)}throw new Error(`Unknown module: ${u}`)}register(u){this.extensions.set(u.manifest.id,u)}async initAll(){var u,i;for(const a of this.extensionInOrder)if(a.module.init){const l=a.manifest.contexts.map(p=>this.requestContext(p)).filter(p=>p!==null);l.length&&await((i=(u=a.module).init)==null?void 0:i.call(u,l))}}async destroyAll(){for(const u of[...this.extensionInOrder].reverse())u.module.destroy&&await u.module.destroy();this.events.destroy()}on(u,i){this.events.on(u,i)}emit(u,...i){this.events.emit(u,...i)}off(u,i){this.events.off(u,i)}}let nm=null;const rw={requestModule:d=>(nm||(nm=new M6,nm.setup()),nm.requestModule(d))},ho={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var iw=(d=>(d.FinishedSuccess="finished-success",d.FinishedError="finished-error",d.Running="running",d.Paused="paused",d.Stopped="stopped",d.NotStarted="not-started",d))(iw||{});const B6={...rw};class Ws extends Sp{constructor(i,a,l,p=null,e=B6){super();g(this,"project");g(this,"entryPoint");g(this,"state","not-started");g(this,"events",new Sp);g(this,"entities",[]);g(this,"parentExecution",null);g(this,"executing",[]);g(this,"executed",[]);g(this,"skipped",[]);g(this,"scheduled",[]);g(this,"localTestValues");g(this,"resolvedValues");g(this,"persistedExecutionResults");g(this,"lastExecutionResults");g(this,"onAddToSkippedListCallback",null);g(this,"onRemoveFromSkippedListCallback",null);g(this,"onAddEntityCallback",null);g(this,"onRemoveEntityCallback",null);this.parentContext=e,this.entities=a,this.entryPoint=l,this.project=i,this.parentExecution=p,this.localTestValues=new Mp(N.UUID.uuid(),this.project),this.resolvedValues=new Mp(N.UUID.uuid(),this.project),this.persistedExecutionResults=new Mp(N.UUID.uuid(),this.project),this.lastExecutionResults=new Mp(N.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults}}skip(i){this.hasEntity(i)&&(this.skipped.includes(i)||(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),Ss.includes(i.type)&&[...i.successCalls||[],...i.errorCalls||[],...i.calls||[]].forEach(a=>this.skip(a))))}async schedule(i,a,l){if(this.hasExecuted(i))return null;if(pr.includes(i.type))return this.executeBranch(i,l,a);if(Gs.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,l,a);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,a){const l=[];return[...mr,...pr].includes(a.type)?l.push(...a.inputs):Ar.includes(a.type)&&l.push(...a.outputs),l.map(e=>{var v;let y=i.find(T=>T.valueOwner.id===e.id);if(y)return y;if(!y&&pr.includes(a.type)&&(y=i.find(T=>{var w;return((w=T.valueOwner.declaration)==null?void 0:w.id)===e.id})),y){const T=(v=y.value)==null?void 0:v.clone(null);return T==null||T.setStandaloneParent(e),{...y,valueOwner:e,value:T||null,inheritanceLink:{sources:[y],target:e}}}return Vn.includes(e.type)?Ky(e,this.valueResolutionContext):vl(e,this.valueResolutionContext)}).reduce((e,y)=>{const v=En(y==null?void 0:y.valueOwner,this.project),T=y?[y]:[];return v.forEach(w=>{var V,U,G;if(w.id===(y==null?void 0:y.valueOwner.id))return;const A=dt(w.getDataType(null),w,this.project);A==null||A.metaSync({value:(V=y==null?void 0:y.value)==null?void 0:V.value},null),A==null||A.setValueAsTypeList(((U=y==null?void 0:y.value)==null?void 0:U.valueAsTypeList)||null),A==null||A.setValueAsTypeSingle(((G=y==null?void 0:y.value)==null?void 0:G.valueAsTypeSingle)||null);const P={...y,valueOwner:w,value:A};T.push(P)}),[...e,...T]},[]).sort((e,y)=>e.valueOwner.index-y.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};if(a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),Object.values(ki).includes(i.declaration.id)){const w=this.parentContext.requestModule(Kp+i.declaration.id).main;w?T=await w(i,a):ke.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{T=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,l,e);const w=i.outputs.map(P=>{var J,ie,X,ce;const V=[...P.declaration.getCounterparts(),P.declaration],U=T.results.find(re=>V.some(Y=>re.valueOwner.id===Y.id)),G=P==null?void 0:P.getDataType(null),K=dt(G,P,l);return G!=null&&G.asType?Array.isArray((J=U==null?void 0:U.value)==null?void 0:J.valueAsType)?K==null||K.setValueAsTypeList((ie=U==null?void 0:U.value)==null?void 0:ie.valueAsTypeList):K==null||K.setValueAsTypeSingle(((X=U==null?void 0:U.value)==null?void 0:X.valueAsType)||null):K==null||K.metaSync({value:(ce=U==null?void 0:U.value)==null?void 0:ce.value},null),{valueOwner:P,type:be.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(T.error){ke.warn("Raw error executing entity: ",T.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,l);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(T.error):V==null||V.metaSync({value:T.error},null),A={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:V}}return{value:T.value,entity:i,error:A,results:w}}return{...T,entity:i}}catch(T){ke.warn("Operation execution error: ",T);let w=null;if(i.error){const A=(v=i.error)==null?void 0:v.getDataType(null),P=dt(A,i.error,l);A!=null&&A.asType?P==null||P.setValueAsTypeSingle(T):P==null||P.metaSync({value:T},null),w={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:P}}return{value:se.Error,entity:i,error:w,results:[]}}}static async executeOperation(i,a,l){var p,e;try{let y={value:se.Success,error:null,results:[]};a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(y=await i.declaration.implementation(i,a));const v=i.outputs.map((w,A)=>{const P=w==null?void 0:w.getDataType(null),V=dt(P,w,l);return P!=null&&P.asType?V==null||V.setValueAsTypeSingle(y.results[A]):V==null||V.metaSync({value:y.results[A]},null),{valueOwner:w,type:be.ExecutionResult,inheritanceLink:null,value:V}});let T=null;if(y.error&&i.error){ke.warn("Raw error executing entity: ",y.error);const w=((p=i.error)==null?void 0:p.getDataType(null))||null,A=dt(w,i.error,l);w!=null&&w.asType?A==null||A.setValueAsTypeSingle(y.error):A==null||A.metaSync({value:y.error},null),T={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A}}return{value:y.value,entity:i,error:T,results:v}}catch(y){ke.warn("Operation execution error: ",y);let v=null;if(i.error){const T=(e=i.error)==null?void 0:e.getDataType(null),w=dt(T,i.error,l);T!=null&&T.asType?w==null||w.setValueAsTypeSingle(y):w==null||w.metaSync({value:y},null),v={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:w}}return{value:se.Error,entity:i,error:v,results:[]}}}async executeSearch(i,a,l){var p;try{let e={value:se.Success,error:null,results:[]};const y=i.outputs[0];if(!y)return{value:se.Success,entity:i,error:null,results:[]};let v={value:null,valueOwner:y,type:be.ExecutionResult,inheritanceLink:null};const T=await this.parentContext.requestModule(it.SEARCH_NODE_IMPLEMENTATION).main(i,a),w=y==null?void 0:y.getDataType(null),A=dt(w,y,l);return A==null||A.metaSync({value:T.data},null),v.value=A,{value:e.value,entity:i,error:null,results:[v]}}catch(e){if(ke.warn(`Search node execution error: ${e}`),!i.error)return{value:se.Error,entity:i,error:null,results:[]};const y=(p=i.error)==null?void 0:p.getDataType(null),v=dt(y,i.error,l);return v==null||v.metaSync({value:e},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:v},results:[]}}}async executeLoop(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};const w=a.map(K=>{var J,ie;return((J=K==null?void 0:K.value)==null?void 0:J.valueAsType)||((ie=K==null?void 0:K.value)==null?void 0:ie.value)});let A={};i.getUniqueReturnDeclarations().forEach(K=>{const J=i.body.inputs.find(re=>ne(re,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(K)),ie=K==null?void 0:K.getDataType(null),X=dt(ie,J,l);ie!=null&&ie.asType?X==null||X.setValueAsTypeList([]):X==null||X.metaSync({value:[]},null),this.lastExecutionResults.writeValue(J,X);const ce={value:X,valueOwner:J,type:be.ExecutionResult,inheritanceLink:null};A[J.id]=ce});let V={value:se.Success,entity:i.body,error:null,results:[]};switch(i.declaration.id){case Te.loop["counted-loop"].id:{const K=w[0];let J=1;for(;J<=K&&J<=50;){const ie=i.body.inputs.map(ce=>{if(ce===i.currentIterationNumberArgumentDeclaration){const re=i.currentIterationNumberArgumentDeclaration.getDataType(null),he=ml(re),Y=this.lastExecutionResults.readValue(ce.id);if(Y){Y.metaSync({value:J},null),this.lastExecutionResults.writeValue(ce,Y);const oe={value:Y,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null};return A[ce.id]=oe,oe}const H={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:J,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:he,standaloneParent:ce.toReference()},pe=or(H,l);this.lastExecutionResults.writeValue(ce,pe);const z={value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null};return A[ce.id]=z,z}else return A[ce.id]}).filter(ce=>!!ce),X=await this.executeFullFunctionDeclarationLogic(i.body,ie,e);if(V=X,V.results.forEach(ce=>{var H,pe,z,oe;if(ce.valueOwner.type!==f.ReturnDeclaration)return;const re=i.body.inputs.find(we=>ne(we,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(ce.valueOwner)),Y=[...((pe=(H=A==null?void 0:A[re.id])==null?void 0:H.value)==null?void 0:pe.value)||[],((z=ce==null?void 0:ce.value)==null?void 0:z.value)||null];(oe=A[re.id].value)==null||oe.metaSync({value:Y},null),this.lastExecutionResults.writeValue(re,A[re.id].value)}),[se.Error,se.Break,se.Return].includes(X.value))break;J++}break}case Te.loop["manual-flow-loop"].id:{let K=1;for(;K<=50;){const J=i.body.inputs.map(X=>{if(X===i.currentIterationNumberArgumentDeclaration){const ce=this.lastExecutionResults.readValue(X.id);if(ce){ce.metaSync({value:K},null),this.lastExecutionResults.writeValue(X,ce);const H={value:ce,valueOwner:X,type:be.ExecutionResult,inheritanceLink:null};return A[X.id]=H,H}const re=i.currentIterationNumberArgumentDeclaration.getDataType(null),he=dt(re,X,l);return he==null||he.metaSync({value:K},null),this.lastExecutionResults.writeValue(X,he),{value:he,valueOwner:X,type:be.ExecutionResult,inheritanceLink:null}}else return A[X.id]}).filter(X=>!!X),ie=await this.executeFullFunctionDeclarationLogic(i.body,J,e);if(V=ie,V.results.forEach(X=>{var Y,H,pe;if(X.valueOwner.type!==f.ReturnDeclaration)return;const ce=i.body.inputs.find(z=>ne(z,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(X.valueOwner)),he=[...(Y=A[ce.id].value)==null?void 0:Y.value,((H=X.value)==null?void 0:H.value)||null];(pe=A[ce.id].value)==null||pe.metaSync({value:he},null),this.lastExecutionResults.writeValue(ce,A[ce.id].value)}),[se.Error,se.Break,se.Return].includes(ie.value))break;K++}break}case Te.loop["list-loop"].id:{const K=w[0];let J=1;const ie=K;for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["object-keys-loop"].id:{const K=w[0];let J=1;const ie=K?Object.keys(K):[];for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["object-values-loop"].id:{const K=w[0];let J=1;const ie=K?Object.values(K):[];for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["string-loop"].id:{const K=w[0];let J=1;const ie=K.split("");for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}}let U=[];i.body.inputs.forEach(K=>{var ie;const J=A[K.id];if(J){const X=(ie=J.value)==null?void 0:ie.clone(null),ce=i.outputs.find(re=>re.declaration&&ji.fromLoopOutputDeclarationToBodyArgumentDeclarationName(re.declaration)===ne(K,l));if(!ce)return;U.push({valueOwner:ce,type:be.ExecutionResult,inheritanceLink:null,value:X})}}),T={value:[se.Error,se.Return].includes(V.value)?V.value:se.Success,error:null,results:U};let G=null;if(T.error&&i.error){ke.warn("Raw error executing entity: ",T.error);const K=(y=i.error)==null?void 0:y.getDataType(null),J=dt(K||null,i.error,l);K!=null&&K.asType?J==null||J.setValueAsTypeSingle(T.error):J==null||J.metaSync({value:T.error},null),G={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:J}}return{value:T.value,entity:i,error:G,results:T.results}}catch(T){if(ke.warn("Error executing loop: ",T),i.error){const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,l);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(T):A==null||A.metaSync({value:T},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A},results:[]}}else return{value:se.Error,entity:i,error:null,results:[]}}}async executeFunctionCall(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};T=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,l,e);const w=i.outputs.map(P=>{var J,ie,X,ce;const V=[...P.declaration.getCounterparts(),P.declaration],U=T.results.find(re=>V.some(Y=>re.valueOwner.id===Y.id)),G=P==null?void 0:P.getDataType(null),K=dt(G,P,l);return G!=null&&G.asType?Array.isArray((J=U==null?void 0:U.value)==null?void 0:J.valueAsType)?K==null||K.setValueAsTypeList((ie=U==null?void 0:U.value)==null?void 0:ie.valueAsTypeList):K==null||K.setValueAsTypeSingle(((X=U==null?void 0:U.value)==null?void 0:X.valueAsType)||null):K==null||K.metaSync({value:(ce=U==null?void 0:U.value)==null?void 0:ce.value},null),{valueOwner:P,type:be.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(T.error&&i.error){ke.warn("Raw error executing entity: ",T.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,l);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(T.error):V==null||V.metaSync({value:T.error},null),A={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:V}}return{value:T.value,entity:i,error:A,results:w}}catch(T){if(!i.error)return{value:se.Error,entity:i,error:null,results:[]};const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,l);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(T):A==null||A.metaSync({value:T},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A},results:[]}}}static async executeCondition(i,a){var p,e,y,v,T,w,A,P,V,U,G,K,J,ie,X,ce,re,he,Y,H,pe,z,oe,we,je,Ne,$e,Pe,Je,xe,lt,Rt,dr,br,xr,ei;let l=!1;switch(i.declaration.id){case zr.Empty:{l=!((e=(p=a[0])==null?void 0:p.value)!=null&&e.value);break}case zr.NotEmpty:{l=!!((v=(y=a[0])==null?void 0:y.value)!=null&&v.value);break}case _r.Equal:{if([Q.String,Q.Number,Q.Boolean,Q.Null,Q.Enum,Q.Date,Q.UUID].includes((w=(T=a[0])==null?void 0:T.value)==null?void 0:w.name)){l=((P=(A=a[0])==null?void 0:A.value)==null?void 0:P.value)===((U=(V=a[1])==null?void 0:V.value)==null?void 0:U.value);break}if(((K=(G=a[0])==null?void 0:G.value)==null?void 0:K.name)===Q.KeyValue||((ie=(J=a[0])==null?void 0:J.value)==null?void 0:ie.name)===Q.Untyped){const ai=(ce=(X=a[0])==null?void 0:X.value)==null?void 0:ce.value,es=(he=(re=a[1])==null?void 0:re.value)==null?void 0:he.value;l=JSON.stringify(ai)===JSON.stringify(es);break}break}case _r.NotEqual:{if([Q.String,Q.Number,Q.Boolean,Q.Null,Q.Enum,Q.Date,Q.UUID].includes((H=(Y=a[0])==null?void 0:Y.value)==null?void 0:H.name)){l=((z=(pe=a[0])==null?void 0:pe.value)==null?void 0:z.value)!==((we=(oe=a[1])==null?void 0:oe.value)==null?void 0:we.value);break}if(((Ne=(je=a[0])==null?void 0:je.value)==null?void 0:Ne.name)===Q.Untyped||((Pe=($e=a[0])==null?void 0:$e.value)==null?void 0:Pe.name)===Q.KeyValue){const ai=(xe=(Je=a[0])==null?void 0:Je.value)==null?void 0:xe.value,es=(Rt=(lt=a[1])==null?void 0:lt.value)==null?void 0:Rt.value;l=JSON.stringify(ai)!==JSON.stringify(es);break}break}case _r.MoreThanOrEqual:{l=((br=(dr=a[0])==null?void 0:dr.value)==null?void 0:br.value)>=((ei=(xr=a[1])==null?void 0:xr.value)==null?void 0:ei.value);break}}return{value:l?se.Success:se.Error,entity:i,error:null,results:[]}}async executeDetachedFullFunctionDeclarationLogic(i,a,l,p={}){const e={...ho,...p,onBeforeEntityExecution:(T,w,A)=>{var P;return((P=p==null?void 0:p.onBeforeEntityExecution)==null?void 0:P.call(p,T,w,{...A,detached:!0}))||Promise.resolve()},onEntityExecuted:(T,w,A)=>{var P;return((P=p==null?void 0:p.onEntityExecuted)==null?void 0:P.call(p,T,w,{...A,detached:!0}))||Promise.resolve()}},y=new Ws(l,[i,...Om(i)],i,this,this.parentContext);return y.inheritValuesFromContext(this),await y.execute(e,a)}async executeFullFunctionDeclarationLogic(i,a,l={}){const p={...ho,...l},e=Om(i);e.forEach(A=>{this.addEntity(A)}),e.reduce((A,P)=>Ar.includes(P.type)?[...A,...P.outputs]:mr.includes(P.type)&&P.type!==f.Condition?[...A,...P.outputs,...P.inputs]:P.type===f.Condition?[...A,...P.inputs]:A,[]).forEach(A=>{this.lastExecutionResults.removeValue(A.id)});const v=await this.executeBranch(i,p,a),w=i.getUniqueReturnDeclarations().reduce((A,P)=>{const V=v==null?void 0:v.results.find(U=>U.valueOwner.id===P.id);return V?[...A,V]:A},[]);return{...v||{},value:(v==null?void 0:v.value)||se.Success,entity:i,error:(v==null?void 0:v.error)||null,results:w}}static async executeEntryPointEntity(i,a){return{value:se.Success,entity:i,error:null,results:a}}static async executeVariable(i,a){return{value:se.Success,entity:i,error:null,results:[a]}}static async executeReturnStatement(i,a){return{value:i.throws?se.Error:se.Return,entity:i,error:null,results:a}}static async executeContinueStatement(i,a){return{value:se.Continue,entity:i,error:null,results:a}}static async executeBreakStatement(i,a){return{value:se.Break,entity:i,error:null,results:a}}mergeValues(i,a){const l=[];for(let p=0;p<a.length;p++)i!=null&&i[p]?l.push(i[p]):l.push(a[p]);return l}async executeEntity(i,a=[],l={}){var y,v,T,w,A,P,V,U,G,K,J,ie,X,ce,re,he,Y;const p={...ho,...l},e={detached:!1};switch(i.type){case f.Condition:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((y=p.onBeforeEntityExecution)==null?void 0:y.call(p,i,H,e)),Ws.executeCondition(i,H)}case f.InternalCall:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((v=p.onBeforeEntityExecution)==null?void 0:v.call(p,i,H,e)),this.executeInternalCall(i,H,this.project)}case f.Operation:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((T=p.onBeforeEntityExecution)==null?void 0:T.call(p,i,H,e)),Ws.executeOperation(i,H,this.project)}case f.VariableInstance:case f.VariableDeclaration:{let H=Ky(i,this.valueResolutionContext);const pe=Ci(i),z=pe.getDataType(null);if(z!=null&&z.isObject()){let je={};if(((w=z==null?void 0:z.entity)==null?void 0:w.type)===f.DefinitionEntity&&(je={...je,...z.entity.getActiveRawDefaultValue()}),H!=null&&H.value)Tr((A=H==null?void 0:H.value)==null?void 0:A.value)&&(je={...je,...(P=H==null?void 0:H.value)==null?void 0:P.value}),H==null||H.value.metaSync({value:je},null);else{const Ne=dt(z,i,this.project);Ne==null||Ne.metaSync({value:je},null),H={valueOwner:pe,type:be.ExecutionResult,inheritanceLink:null,value:Ne}}this.lastExecutionResults.writeValue(pe,H.value),pe.inputs.forEach(Ne=>{var $e;if((($e=Ne.declaration)==null?void 0:$e.type)===f.Property&&Ne.declaration.static){const Pe=this.lastExecutionResults.readValue(Ne.declaration.id),Je=ne(Ne,this.project),xe=jr(Je);if(Pe)Pe.metaSync({value:je[xe]},null),this.lastExecutionResults.writeValue(Ne.declaration,Pe);else{const lt=dt(Ne.getDataType(null),Ne,this.project);lt==null||lt.metaSync({value:je[xe]},null),this.lastExecutionResults.writeValue(Ne.declaration,lt)}}})}else this.lastExecutionResults.writeValue(pe,H==null?void 0:H.value);const oe=[],we=(V=H==null?void 0:H.value)!=null&&V.value&&Tr((U=H.value)==null?void 0:U.value)?((G=H.value)==null?void 0:G.value)||{}:{};return i.outputs.map(je=>{const Ne=jr(ne(je,this.project)),$e=we[Ne],Pe=dt(je.getDataType(null),je,this.project);Pe==null||Pe.metaSync({value:$e},null);const Je={value:Pe,valueOwner:je,type:be.ExecutionResult,inheritanceLink:H?{sources:[H],target:i}:null};oe.push(Je)}),H.type=be.ExecutionResult,{value:se.Success,entity:i,error:null,results:[H,...oe]}}case f.FunctionCall:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((K=p.onBeforeEntityExecution)==null?void 0:K.call(p,i,H,e)),this.executeFunctionCall(i,H,this.project)}case f.FunctionDeclaration:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((J=p.onBeforeEntityExecution)==null?void 0:J.call(p,i,H,e)),Ws.executeEntryPointEntity(i,H)}case f.Search:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((ie=p.onBeforeEntityExecution)==null?void 0:ie.call(p,i,H,e)),this.executeSearch(i,H,this.project)}case f.Loop:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((X=p.onBeforeEntityExecution)==null?void 0:X.call(p,i,H,e)),this.executeLoop(i,H,this.project,p)}case f.ReturnStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((ce=p.onBeforeEntityExecution)==null?void 0:ce.call(p,i,H,e)),Ws.executeReturnStatement(i,H)}case f.ContinueStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((re=p.onBeforeEntityExecution)==null?void 0:re.call(p,i,H,e)),Ws.executeContinueStatement(i,H)}case f.BreakStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((he=p.onBeforeEntityExecution)==null?void 0:he.call(p,i,H,e)),Ws.executeBreakStatement(i,H)}case f.GlobalEvent:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((Y=p.onBeforeEntityExecution)==null?void 0:Y.call(p,i,H,e)),Ws.executeEntryPointEntity(i,H)}default:return{value:se.Error,entity:i,error:null,results:[]}}}storeLastExecutionValues(i){i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),i.results.forEach(a=>{const l=En(a.valueOwner,this.project);a.value?l.forEach(p=>{this.lastExecutionResults.writeValue(p,a.value)}):l.forEach(p=>{this.lastExecutionResults.removeValue(p.id)})})}async executeBranch(i,a={},l=[]){var T;const p={...ho,...a},e={detached:!1};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const v=await this.executeEntity(i,l,p);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(v),await((T=p.onEntityExecuted)==null?void 0:T.call(p,i,v,e)),v.value===se.Success){const w=(i.successCalls||i.calls||[]).filter(G=>this.hasEntity(G));(i.errorCalls||[]).forEach(G=>{this.skip(G)});let P=[];const V=(await Promise.all(w.map(G=>this.schedule(G,v.results,p)))).filter(G=>!!G),U=V.filter(G=>!!G).find(G=>G.value===se.Error||G.value===se.Return||G.value===se.Break||G.value===se.Continue);return U||(P=[...P,...V],v)}else if(v.value===se.Error){const w=(i.errorCalls||[]).filter(G=>this.hasEntity(G));(i.successCalls||i.calls||[]).forEach(G=>{this.skip(G)});let P=[];const V=(await Promise.all(w.map(G=>this.schedule(G,v.results,p)))).filter(G=>!!G),U=V.filter(G=>!!G).find(G=>G.value===se.Error||G.value===se.Return||G.value===se.Break||G.value===se.Continue);return U||(P=[...P,...V],v)}else{if(v.value===se.Return)return v;if(v.value===se.Break)return v;if(v.value===se.Continue)return v}return v}async execute(i={},a=[]){const l={...ho,...i};this.state="running";const p=await this.executeBranch(this.entryPoint,l,a);return this.state="finished-success",p}addEntity(i){var a;this.entities.includes(i)||(this.entities.push(i),(a=this.onAddEntityCallback)==null||a.call(this,i))}addEntities(i){i.forEach(a=>this.addEntity(a))}removeEntity(i){var a;if(i!==this.entryPoint){const l=this.entities.indexOf(i);l>-1&&(this.entities.splice(l,1),(a=this.onRemoveEntityCallback)==null||a.call(this,i))}}hasEntity(i){var p,e,y;if(this.entities.includes(i))return!0;if(((p=i.parent)==null?void 0:p.type)===f.FunctionDeclaration&&((y=(e=i.parent)==null?void 0:e.parent)==null?void 0:y.type)===f.DefinitionEntity)return this.entities.includes(i.parent);const a=Er(i);if(!a)return!1;const l=a.type===f.Loop&&i.parent===a.body?a.body:null;return l?this.entities.includes(l)||this.entities.includes(a):this.entities.includes(a)}removeScheduled(i){const a=this.scheduled.indexOf(i);a>-1&&this.scheduled.splice(a,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const a=this.project.get(i);return a?this.hasEntity(a):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}removeFromExecutingList(i){const a=this.executing.indexOf(i);a>-1&&this.executing.splice(a,1)}removeFromAlreadyExecutedList(i){const a=this.executed.indexOf(i);a>-1&&this.executed.splice(a,1)}removeFromSkippedList(i){var l;const a=this.skipped.indexOf(i);a>-1&&(this.skipped.splice(a,1),(l=this.onRemoveFromSkippedListCallback)==null||l.call(this,i))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var a;this.skipped.includes(i)||(this.skipped.push(i),(a=this.onAddToSkippedListCallback)==null||a.call(this,i))}}function JTe(d){var u,i;if(d.isList)return"list";if(((u=d.entity)==null?void 0:u.type)===f.DefinitionEntity)return"definition-entity";switch((i=d.entity)==null?void 0:i.name){case Q.Number:return"number";case Q.String:return"text";case Q.Boolean:return"boolean";case Q.UUID:return"uuid";case Q.Date:return"date-time";default:return"definition-entity"}}const sw={[f.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[f.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[f.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[f.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[f.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[f.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[f.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[f.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[f.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[f.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[f.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[f.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[f.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[f.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[f.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[f.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[f.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[f.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[f.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[f.ReturnDeclaration]:{singular:"Output definition",plural:"Output definitions",shortSingular:"Output",shortPlural:"Outputs"},[f.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"}};function nw(d){const u=Cm(d);if(!u){const a=tu(d);if(a.includes(Be.HTTP_ENDPOINT))return"HTTP endpoint";if(a.includes(Be.PERSISTED_ENTITY))return"Persisted entity";if(a.includes(Be.CRON_JOB))return"Scheduled execution";if(a.includes(Be.RELATIONAL_DATABASE))return"Relational database"}if(u){let a="Extension of "+ne(u,u.project)+" entity",l=_d(a);const p=tu(d);return p.includes(Be.HTTP_ENDPOINT)?"HTTP endpoint"+(l?", "+l:""):p.includes(Be.PERSISTED_ENTITY)?"Persisted entity"+(l?", "+l:""):p.includes(Be.CRON_JOB)?"Scheduled execution"+(l?", "+l:""):p.includes(Be.RELATIONAL_DATABASE)?"Relational database"+(l?", "+l:""):a}let i="";return d.abstract&&(i="Template "),d.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function U6(d){return d.parent.type===f.DefinitionEntity||d.parent.type===f.InstalledProject?"Internal action of "+ne(d.parent,d.project):d.parent.type===f.Loop?"Action repeated on every iteration":"Internal action of entity"}function aw(d){return Gw(d)?U6(d):"Custom trigger"}function ZTe(d){var u;switch(d.type){case f.DefinitionEntity:return nw(d);case f.FunctionDeclaration:return aw(d)}return(u=sw[d.type])==null?void 0:u.singular}function HTe(d){var u;switch(d.type){case f.DefinitionEntity:return nw(d);case f.FunctionDeclaration:return aw(d)}return(u=sw[d.type])==null?void 0:u.singular}const ow=4e4,j6=280,WTe=300,lw=65,Yd=32,am=39,x6=26,F6=49,om=44,YTe=35,lm=52,dw=10,Ma=dw*2,dm=38,um=90,uw=270,G6=ow/2+120,S6=ow/2+180;function K6(d){let i=Yd+om+dm+dw;const a=[...d.inputs];return a.length&&(i+=Ma,a.forEach(()=>{i+=x6})),{height:i,width:280}}function k6(d){let i=lw;const a=[];if([f.DefinitionEntity].includes(d.type)){const v=[...d.suggestedProperties||[],...d.properties||[]];v.length&&(i+=Ma,v.forEach(T=>{i+=T.static?F6:am}))}if([f.DefinitionEntity,f.InstalledProject,f.Loop].includes(d.type)){const v=[...(d==null?void 0:d.suggestedMethods)||[],...d.methods||[],...d.functions||[],...d.body?[d.body]:[]];v.length&&(i+=Ma,v.forEach(T=>{const w=K6(T);i+=w.height}))}mr.includes(d.type)?(mt.includes(d.type)?a.push(...(d.usedInputs||[]).flatMap(v=>[v])||[]):a.push(...(d.inputs||[]).flatMap(v=>[v])||[]),d.error&&(i+=lm)):[f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)?(a.push(...d.outputs||[]),d.throws&&(i+=lm)):d.type===f.Condition&&(a.push(d.inputs[0]),d.inputs[1]&&a.push(d.inputs[1]));const l=a.length;l&&(i+=l*am,i+=Ma);const p=[];if(d.type===f.FunctionDeclaration||d.type===f.GlobalEvent?p.push(...d.inputs||[]):mr.includes(d.type)&&(mt.includes(d.type)?p.push(...d.usedOutputs||[]):p.push(...d.outputs||[])),mt.includes(d.type)){d.readsValue&&(i+=Ma,i+=om),d.writesValues.length&&(i+=Ma,i+=om),d.internalCalls.length&&d.usedInternalCalls.forEach(()=>i+=lm+Ma);const v=d.getDataType(null);(!v||v.inferred)&&(i+=dm)}const e=p.length;return e&&(i+=e*am,i+=Ma),[f.DefinitionEntity,f.FunctionDeclaration,f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)&&(i+=dm),{height:i,width:280}}function Zp(d){return`${d.split("-").map((a,l)=>l===0?a.charAt(0).toUpperCase()+a.slice(1):a.toLowerCase()).join(" ")}.`}function zTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case le.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case le.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case le.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case le.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case le.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case le.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case ae.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case ae.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case le.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case le.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case ae.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case le.NoProperties:return"This entity has no properties, so it doesn't do anything";case le.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case le.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case le.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case le.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case le.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case le.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case le.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case le.PropertyImplementsNonAbstact:return"This property implements a non-template property";case le.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case le.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case le.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case le.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case le.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case ae.InternalCallDeclarationIsNotFunctionDeclaration:return"This internal call is not an action";case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case ae.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case ae.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case ae.UnreachableEntity:return"This entity is unreachable";case le.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";default:return Zp(d.code)}}function XTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case le.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case le.IncorrectEntityImplementation:return"Incorrect implementation";case le.IncorrectMethodImplementation:return"Incorrect action implementation";case le.IncorrectPropertyImplementation:return"Incorrect property implementation";case le.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case le.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case ae.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case ae.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case le.MissingMethodImplementation:return"Missing action";case le.MissingPropertyImplementation:return"Missing property";case ae.NameNotUniqueInScope:return"Duplicate name";case le.NoProperties:return"No properties";case le.NonStaticPropertyInStaticEntity:return"Non-static property";case le.StaticEntityWithNonStaticProperties:return"Non-static properties";case le.ReadingFromIncompatibleType:return"Read from different type";case le.WritingToIncompatibleType:return"Write to different type";case le.ScopeWithoutLogic:return"No logic";case le.NonStaticPropertyImplementsStatic:return"Invalid static property";case le.PropertyImplementsIncompatibleType:return"Incompatible data type";case le.PropertyImplementsNonAbstact:return"Non-template property";case le.StaticPropertyImplementsNonStatic:return"Non-static property";case le.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case le.VariableHasInputsAndInternalCall:return"Bad internal call";case le.VariableHasOutputsAndInternalCall:return"Bad internal call";case le.VariableIsCalledAndHasInternalCall:return"Bad internal call";case ae.InternalCallDeclarationIsNotFunctionDeclaration:return"Declaration not an action";case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case ae.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case ae.InternalCallParentMissingDataType:return"Parent has no data type";case ae.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case ae.UnreachableEntity:return"Unreachable entity";case le.DisconnectedCallableEntity:return"Disconnected entity";default:return Zp(d.code)}}function QTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return`${ne(d.entity,d.entity.project)} has non-template actions`;case le.AbstractEntityWithNonAbstractProperties:return`${ne(d.entity,d.entity.project)} has non-template properties`;case le.IncorrectEntityImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements template`;case le.IncorrectMethodImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template`;case le.IncorrectPropertyImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template`;case le.AbstractMethodInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} can't be a template`;case le.AbstractPropertyInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} can't be a template`;case ae.MethodOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites action`;case ae.PropertyOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites property`;case le.MissingMethodImplementation:return`${ne(d.entity,d.entity.project)} is missing action`;case le.MissingPropertyImplementation:return`${ne(d.entity,d.entity.project)} is missing property`;case ae.NameNotUniqueInScope:return`${ne(d.entity,d.entity.project)} name is not unique`;case le.NoProperties:return`${ne(d.entity,d.entity.project)} has no properties`;case le.NonStaticPropertyInStaticEntity:return`${ne(d.entity,d.entity.project)} has non-static property`;case le.StaticEntityWithNonStaticProperties:return`${ne(d.entity,d.entity.project)} has non-static properties`;case le.ReadingFromIncompatibleType:return`${ne(d.entity,d.entity.project)} reads from different type`;case le.WritingToIncompatibleType:return`${ne(d.entity,d.entity.project)} writes to different type`;case le.ScopeWithoutLogic:return`${ne(d.entity,d.entity.project)} has no logic`;case le.NonStaticPropertyImplementsStatic:return`${ne(d.entity,d.entity.project)} has invalid static property`;case le.PropertyImplementsIncompatibleType:return`${ne(d.entity,d.entity.project)} has incompatible data type`;case le.PropertyImplementsNonAbstact:return`${ne(d.entity,d.entity.project)} has non-template property`;case le.StaticPropertyImplementsNonStatic:return`${ne(d.entity,d.entity.project)} has non-static property`;case le.VariableCallsOthersAndHasInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableHasInputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableHasOutputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableIsCalledAndHasInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case ae.InternalCallDeclarationIsNotFunctionDeclaration:return`${ne(d.entity,d.entity.project)} has declaration that is not an action`;case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has declaration that is not found in parent`;case ae.InternalCallParentDeclarationEntityInvalidType:return`${ne(d.entity,d.entity.project)} has invalid parent declaration type`;case ae.InternalCallParentMissingDataType:return`${ne(d.entity,d.entity.project)}'s parent has no data type`;case ae.InternalCallDeclarationNotInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has declaration that is not in parent`;case ae.UnreachableEntity:return`${ne(d.entity,d.entity.project)} is unreachable`;case le.DisconnectedCallableEntity:return`${ne(d.entity,d.entity.project)} is not executed by any entity`;default:return`${ne(d.entity,d.entity.project)} Error: ${Zp(d.code)}`}}function eIe(d){var u,i,a,l;switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return`${ne(d.entity,d.entity.project)} has non-template actions`;case le.AbstractEntityWithNonAbstractProperties:return`${ne(d.entity,d.entity.project)} has non-template properties`;case le.IncorrectEntityImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template entity`;case le.IncorrectMethodImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template action it's based on`;case le.IncorrectPropertyImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template property it's based on`;case le.AbstractMethodInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} is a template action in a non-template entity`;case le.AbstractPropertyInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} is a template property in a non-template entity`;case ae.MethodOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites an action in the template entity`;case ae.PropertyOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites a property in the template entity`;case le.MissingMethodImplementation:return`${ne(d.entity,d.entity.project)} is missing an action implementation from the template entity`;case le.MissingPropertyImplementation:return`${ne(d.entity,d.entity.project)} is missing a property implementation from the template entity`;case ae.NameNotUniqueInScope:return`${ne(d.entity,d.entity.project)} has a duplicate name in the same scope`;case le.NoProperties:return`${ne(d.entity,d.entity.project)} has no properties, so it doesn't do anything`;case le.NonStaticPropertyInStaticEntity:return`${ne(d.entity,d.entity.project)} has a non-static property in a static entity`;case le.StaticEntityWithNonStaticProperties:return`${ne(d.entity,d.entity.project)} has non-static properties in a static entity`;case le.ReadingFromIncompatibleType:return`${ne(d.entity,d.entity.project)} reads data from a value of a different data type`;case le.WritingToIncompatibleType:return`${ne(d.entity,d.entity.project)} writes data to a value of a different data type`;case le.ScopeWithoutLogic:return`${ne(d.entity,d.entity.project)} has no logic`;case le.NonStaticPropertyImplementsStatic:return`${ne(d.entity,d.entity.project)} has a static property in a non-static entity`;case le.PropertyImplementsIncompatibleType:return`${ne(d.entity,d.entity.project)} implements a property of a different data type`;case le.PropertyImplementsNonAbstact:return`${ne(d.entity,d.entity.project)} implements a non-template property`;case le.StaticPropertyImplementsNonStatic:return`${ne(d.entity,d.entity.project)} has a static property in a non-static entity`;case le.VariableCallsOthersAndHasInternalCall:return`${ne(d.entity,d.entity.project)} calls other entities while being used to execute internal logic`;case le.VariableHasInputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has inputs while being used to execute internal logic`;case le.VariableHasOutputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has outputs while being used to execute internal logic`;case le.VariableIsCalledAndHasInternalCall:return`${ne(d.entity,d.entity.project)} is called while being used to execute internal logic`;case ae.InternalCallDeclarationIsNotFunctionDeclaration:return`${ne(d.entity,d.entity.project)} has a declaration that is not an action`;case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has a declaration that is not found in ${(u=d.entity.parent.getDataType(null))!=null&&u.entity?ne((i=d.entity.parent.getDataType(null))==null?void 0:i.entity,d.entity.project):"the variable's data-type entity"}`;case ae.InternalCallParentDeclarationEntityInvalidType:return`${ne(d.entity,d.entity.project)} is part of a variable whos data-type entity can't have actions`;case ae.InternalCallParentMissingDataType:return`${ne(d.entity,d.entity.project)} is part of a variable with no data-type entity`;case ae.InternalCallDeclarationNotInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has a declaration doesn't belong to ${(a=d.entity.parent.getDataType(null))!=null&&a.entity?ne((l=d.entity.parent.getDataType(null))==null?void 0:l.entity,d.entity.project):"the variable's data-type entity"}`;case ae.UnreachableEntity:return`${ne(d.entity,d.entity.project)} is unreachable`;case le.DisconnectedCallableEntity:return`${ne(d.entity,d.entity.project)} is disconnected and won't be executed by anything after publishing`;default:return`${ne(d.entity,d.entity.project)} Error: ${Zp(d.code)}`}}var cw=(d=>(d.ValuesAlreadyConnected="values-already-connected",d.CannotReadMoreThanOneValue="cannot-read-more-than-one-value",d.CannotReadValueFromChildren="cannot-read-value-from-children",d.CannotWriteValueToChildren="cannot-write-value-to-children",d.CannotBeCalledByChildren="cannot-be-called-by-children",d.ExecutionsAlreadyConnected="executions-already-connected",d.DataTypesNotCompatible="data-types-not-compatible",d.CannotCallAncestor="cannot-call-ancestor",d.CannotConnectToItself="cannot-connect-to-itself",d.CannotWriteValueToAncestor="cannot-write-value-to-ancestor",d.NotInScope="not-in-scope",d.IsNotValueWrittingEntity="is-not-value-writting-entity",d.IsNotValueReadingEntity="is-not-value-reading-entity",d.ContinueOrBreakStatementCalledFromOutsideLoop="continue-or-break-statement-called-from-outside-loop",d.ElementInLoopBodyCallingOutsideLoop="element-in-loop-body-calling-outside-loop",d.CallerIsInHigherScope="caller-is-in-higher-scope",d.CallerIsInLowerScope="caller-is-in-lower-scope",d.CallIsInHigherScope="call-is-in-higher-scope",d.CallIsInLowerScope="call-is-in-lower-scope",d.OtherIncompatibleScopeReason="other-incompatible-scope-reason",d.SiblingInternalCallAlreadyUsedInParentVariable="sibling-internal-call-already-used-in-parent-variable",d))(cw||{});const tIe=Object.values(cw);var pw=(d=>(d.NotPartOfOngoingTest="not-part-of-ongoing-test",d.CannotBeAddedToTest="cannot-be-added-to-test",d))(pw||{});const rIe=Object.values(pw);var fw=(d=>(d.Suggestion="suggestion",d.CanvasGloballyDisabled="canvas-globally-disabled",d.CannotInteractWithInputInVariableWithInternalCalls="cannot-interact-with-input-in-variable-with-internal-calls",d.CannotInteractWithOutputInVariableWithInternalCalls="cannot-interact-with-output-in-variable-with-internal-calls",d))(fw||{});const iIe=Object.values(fw);function sIe(d,u){const i=[...d,...u];return Array.from(new Set(i))}function nIe(d,u){const i=[...d,...u],a=Array.from(new Set(i));return{hasChanged:a.length!==d.length,reasons:a}}function aIe(d,u){const i=d.filter(l=>!u.includes(l));return{hasChanged:i.length!==d.length,reasons:i}}function oIe(d,u){return d.find(i=>i.entity.id===u)||null}function q6(d){return d.filter((u,i)=>d.indexOf(u)===i)}class Ai{constructor(u,i,a=null,l){g(this,"ids",[]);g(this,"entity");g(this,"entityCardHeight");g(this,"entityCardWidth");g(this,"index");g(this,"childEntities",[]);g(this,"children",[]);g(this,"parents",[]);g(this,"calculationEntryPoint");g(this,"_onlyEntities",null);g(this,"_changeSet",null);if(this.index=i,this.entity=u,this.calculationEntryPoint=a||this,this===this.calculationEntryPoint&&!l)throw new Error("Change set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(u,i,a){const l=G6-uw-j6,p=S6-um-lw;u.metaSync({x:u.x||l,y:u.y||p},i);const e=new Ai(u,0,null,i);e._onlyEntities=a||[],e.ids=["0"];const y=[];e.next(T=>{y.push(...T)}),Ai.recursivelyAssembleChildrenAreas(y),e.resolveChildrenOverlaps();const v=e.flattenChildEntities();return e._onlyEntities?v.filter(T=>(e._onlyEntities||[]).includes(T)):v}static recursivelyAssembleChildrenAreas(u){const i=[];u.forEach(a=>{a.next(l=>{i.push(...l)})}),i.length>0&&Ai.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(u){this.calculationEntryPoint._changeSet=u}findAreaInChildrenFromEntity(u){if(this.entity===u)return this;const i=this.children.find(l=>l.entity===u);return i||this.children.reduce((l,p)=>l||p.findAreaInChildrenFromEntity(u),null)}findAreaFromEntity(u){if(this.entity===u)return this;const i=this.calculationEntryPoint.children,a=i.find(p=>p.entity===u);return a||i.reduce((p,e)=>p||e.findAreaInChildrenFromEntity(u),null)}addParent(u){if(!this.parents.includes(u)){const i=Ai.resolveIds(u,this.index);this.ids.push(...i),this.parents.push(u)}}static resolveIds(u,i){return u?u.ids.map(a=>`${a}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const u=bn(this.entity,!0);if(this.entity.type===f.Project){const i=[],a=[],l=[];u.forEach(e=>{if(f.DefinitionEntity===e.type){a.push(e);return}else if(pr.includes(e.type)){l.push(e);return}i.push(e)});const p=i.sort((e,y)=>{const v=!!Am(e,y).length,T=bn(e),w=bn(y);return v?0:T.length&&!w.length?-1:!T.length&&w.length?1:0}).filter(e=>!Io(e).length);this.childEntities=[...a,...l,...p]}else{const i=[],a=[],l=[],p=[],e=[];Ss.includes(this.entity.type)&&wm(this.entity).forEach(T=>{if(mt.includes(T.type)){l.push(T);return}const w=Er(T);i.push(w)}),Mr.includes(this.entity.type)&&a.push(...this.entity.detachedChildren);const y=u.filter(v=>{const T=i.includes(v);return T||l.includes(v)||a.includes(v)?!1:mt.includes(v.type)?(l.push(v),!1):Gs.includes(v.type)&&!T?(p.push(v),!1):v.type===f.DefinitionEntity?(e.push(v),!1):!0});i.sort((v,T)=>Rl(v,T)?-1:0),p.sort((v,T)=>Rl(v,T)?-1:0),l.sort((v,T)=>Vw(v,T)?1:Vw(T,v)?-1:0),this.childEntities=[...e,...i,...p,...y,...l,...a]}}calculateCardSize(){const u=k6(this.entity);this.entityCardWidth=u.width,this.entityCardHeight=u.height}static getBoundriesOfTwoAreas(u,i){return{top:Math.min(u.top,i.top),left:Math.min(u.left,i.left),bottom:Math.max(u.bottom,i.bottom),right:Math.max(u.right,i.right)}}static getBoundriedOfCombinedAreas(u,i){const a=u.filter(p=>!i.includes(p));return a.reduce((p,e)=>i.includes(e)?p:Ai.getBoundriesOfTwoAreas(p,e.fullBranchArea),a[0].fullBranchArea)}getFullAreaUntilAny(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!u.includes(e)).map(e=>e.getFullAreaUntilAny(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),i)}getFullAreaUntilAreaOrAnyChildren(u){const i=[u,...u.flattenChildren()],a=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),a)}getFullAreaUntil(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(p=>p!==u).map(p=>p.getFullAreaUntil(u)).reduce((p,e)=>Ai.getBoundriesOfTwoAreas(p,e),i)}get fullBranchArea(){const u=this.ownEntityPlusBufferArea;return this.children.map(l=>l.fullBranchArea).reduce((l,p)=>Ai.getBoundriesOfTwoAreas(l,p),u)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const u=this.ownEntityArea;return{top:u.top,left:u.left,bottom:u.bottom+um,right:u.right+uw}}static filterOutRepeatedAreas(u){return u.filter((i,a)=>u.indexOf(i)===a)}getEarliestId(u,i){const a=u.split("-"),l=i.split("-");return a.length<l.length?u:a.length>l.length?i:a.reduce((e,y,v)=>y<l[v]?u:i,u)}getEarliestLevel(){return this.ids.reduce((a,l)=>this.getEarliestId(a,l),this.ids[0]).split("-").length}countColumns(){let u=0;if(this!==this.calculationEntryPoint)u++;else return u;if(!this.parents.length)return u;const a=this.parents.reduce((l,p)=>p.getEarliestLevel()>l.getEarliestLevel()?p:l,this.parents[0]).countColumns();return u+=a,u}getLatestId(u,i){if(u===i)return u;const a=u.split("-"),l=i.split("-");return a.length<l.length?i:a.length>l.length?u:a.reduce((e,y,v)=>y>l[v]?u:i,u)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((a,l)=>this.getLatestId(a,l),this.ids[0]).split("-").length}smoothPosition(){const u=this.flattenSiblings();if(!u.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(a=>{a!==this.calculationEntryPoint&&a.shiftDownAlone(i)})}else if([...pr].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=u.filter(a=>!this.parents.includes(a));i.length?i.every(l=>{const p=this.countColumns(),e=l.countColumns();return p>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(u,i){if(u.includes(this))return u;this.move(this.entity,{y:this.entity.y+i});let a=[...u,this];return this.children.forEach(l=>{if(Ai.getEarliestParentInChain(l)!==this)return;const e=oIe(a,l.entity.id);a=Ai.filterOutRepeatedAreas([...a]),e||(a=a.filter(v=>v!==l));const y=l.shiftDownUntilAny(a,i);a.push(...y)}),a}shiftRightUntilAny(u,i){u.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(a=>{const l=Ai.filterOutRepeatedAreas([...this.flattenSiblings(),...u]);Ai.getEarliestParentInChain(a)===this&&a.shiftRightUntilAny(l,i)}))}shiftRight(u){this.move(this.entity,{x:this.entity.x+u}),this.children.forEach(i=>{const l=i.flattenSiblings().filter(p=>p!==i);i.shiftRightUntilAny(l,u)})}shiftDownAlone(u){this.move(this.entity,{y:this.entity.y+u})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const u=this.parents.reduce((l,p)=>{const e=p.ownEntityArea,y=e.top+Yd,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(l,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Yd;this.shiftDownAlone(a)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const u=this.children.reduce((l,p)=>{const e=p.ownEntityArea,y=e.top+Yd,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(l,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Yd;return this.shiftDownAlone(a),a}resolveChildrenOverlaps(){const u=this.flattenChildren();let i=[];u.forEach(a=>{const l=a.adjustVerticallyToAvoidOverlaps();i.push(...l)}),u.forEach(a=>{a.smoothPosition()})}static getEarliestParentInChain(u){let i=u.parents[0];return u.parents.length&&(i=u.parents.sort((a,l)=>{if(!a.ids.length)return-1;if(!l.ids.length)return 1;const p=a.ids.sort((y,v)=>y.length<v.length?-1:0),e=l.ids.sort((y,v)=>y.length<v.length?-1:0);return p[0].length-e[0].length})[0]),i}flattenEarlierSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,l)=>{if(u.has(l.entity.id))return a;u.add(l.entity.id);const e=l.children.slice(0,l.children.indexOf(this)).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,l)=>{if(u.has(l.entity.id))return a;u.add(l.entity.id);const e=l.children.filter(y=>y!==this).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenChildren(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a,...a.flattenChildren(u)]),[])}flattenParents(u=new Set){return this.parents.reduce((a,l)=>u.has(l.entity.id)?a:(u.add(l.entity.id),[...a,l,...l.flattenParents(u)]),[])}getAreaIfRendered(u){return this.calculationEntryPoint.flattenChildren().find(l=>l.entity.id===u.id)||null}getLowerSiblings(){const u=this.parents.reduce((i,a)=>{const l=a.children.indexOf(this),p=a.children.slice(l+1);return[...i,...p]},[]);return q6(u)}getLowerAreas(){const u=this.getLowerSiblings(),i=this.parents.reduce((a,l)=>[...a,...l.getLowerAreas()],[]);return q6([...u,...i])}adjustVerticallyToAvoidOverlaps(u=[]){const a=Ai.getEarliestParentInChain(this).children[this.index-1];if(!a)return u;const l=this.flattenEarlierSiblings(),p=this.flattenParents(),e=[...l,...p,a],T=R(e.flatMap(V=>Am(this.entity,V.entity))).filter(V=>V.id!==this.entity.id).map(V=>this.findAreaFromEntity(V)).filter(V=>!!V),w=this.getFullAreaUntilAny(T),A=a.getFullAreaUntilAny(T),P=e.reduce((V,U)=>U===this||U.fullBranchArea.left!==w.left?V:Math.max(V,U.fullBranchArea.bottom),A.bottom);if(w.top<P){const V=P-w.top+um;return this.shiftDownUntilAny(u,V)}return u}move(u,i){(this.onlyEntities||[]).includes(u)&&u.metaSync(i,this.changeSet)}addChild(u){const i=this.childEntities[u];let a=null;i.x&&i.y?a=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),a||(a=new Ai(i,u,this.calculationEntryPoint));const l=this.ownEntityPlusBufferArea;this.children.includes(a)||(this.children.push(a),a.addParent(this));const p=a.fullBranchArea;if(p.left<l.right){const e=l.right-p.left;a.shiftRight(e)}return a}flattenChildEntities(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a.entity,...a.flattenChildEntities(u)]),[])}next(u){const i=[];this.childEntities.forEach((a,l)=>{const p=this.addChild(l);p&&i.push(p)}),u(i)}}var Hp=(d=>(d.Amazon="amazon",d.Google="google",d.Microsoft="microsoft",d))(Hp||{}),Jr=(d=>(d.RelationalDatabase="relational-database",d.CompiledLocalCodebase="compiled-local-codebase",d.CloudHostedCodebase="cloud-hosted-codebase",d.HttpApi="http-api",d.HttpEndpoint="http-endpoint",d.ServerlessFunction="serverless-function",d))(Jr||{}),hw=(d=>(d.Post="post",d.Get="get",d.Acknowledgement="acknowledgment",d.Progress="progress",d.Error="error",d.Complete="complete",d))(hw||{}),wl=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.Skipped="skipped",d.AbortedByUser="aborted-by-user",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(wl||{}),yw=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(yw||{}),ht=(d=>(d.ProjectNotFound="project-not-found",d.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",d.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",d.DeploymentCompleted="deployment-completed",d.DeploymentStarted="deployment-started",d.DeploymentFailed="deployment-failed",d.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",d.RequestPayloadValidationFailed="request-payload-validation-failed",d.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",d.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",d.ProjectAlreadyBeingPublished="project-already-being-published",d.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",d.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",d.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",d.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",d.CreatingNewRelationalDatabase="creating-new-relational-database",d.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",d.RelationalDatabaseAlreadyExists="relational-database-already-exists",d.RelationalDatabaseDeletionStarted="relational-database-deletion-started",d.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",d.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",d.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",d.HttpApiDeploymentStarted="http-api-deployment-started",d.HttpApiDeploymentCompleted="http-api-deployment-completed",d.HttpApiDeploymentFailed="http-api-deployment-failed",d.CreatingNewHttpApi="creating-new-http-api",d.HttpApiAlreadyExists="http-api-already-exists",d.HttpApiDeletionStarted="http-api-deletion-started",d.HttpApiDeletionCompleted="http-api-deletion-completed",d.HttpApiDeletionFailed="http-api-deletion-failed",d.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",d.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",d.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",d.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",d.BundlingCodebaseForDownload="bundling-codebase-for-download",d.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",d.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",d.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",d.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",d.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",d.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",d.CodeCompilationStarted="code-compilation-started",d.CodeCompilationCompleted="code-compilation-completed",d.CodeCompilationFailed="code-compilation-failed",d.BundleCodebaseStarted="bundle-codebase-started",d.BundleCodebaseCompleted="bundle-codebase-completed",d.BundleCodebaseFailed="bundle-codebase-failed",d.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",d.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",d.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",d.MigrateRelationalDatabaseStarted="migrate-relational-database-started",d.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",d.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",d))(ht||{}),An=(d=>(d.CodeCompilation="code-compilation",d.RelationalDatabaseDeployment="relational-database-deployment",d.RelationalDatabaseDeletion="relational-database-deletion",d.HttpApiDeployment="http-api-deployment",d.HttpApiDeletion="http-api-deletion",d.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",d.BundleCodebase="bundle-codebase",d.MigrateRelationalDatabase="migrate-relational-database",d.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",d.CodebaseCleanup="codebase-cleanup",d))(An||{});Jr.CloudHostedCodebase,Jr.HttpApi,Jr.RelationalDatabase,Jr.CloudHostedCodebase,Jr.CloudHostedCodebase,Jr.RelationalDatabase,Jr.CloudHostedCodebase,Jr.CloudHostedCodebase;function J6(d){return`project-${d}-http-api`}function Z6(d){return`entity-${d}-database`}class H6{constructor(u,i,a,l,p,e,y,v,T){g(this,"stepType");g(this,"id");g(this,"resourceType");g(this,"index");g(this,"dependency",[]);g(this,"lastEvent",null);g(this,"lasEventTimestamp",null);g(this,"status",wl.Queued);g(this,"publicationRun");g(this,"resource");this.stepType=u,this.id=i,this.resourceType=a,this.status=l,this.dependency=p,this.index=e,this.lasEventTimestamp=y,this.publicationRun=v,this.resource=T}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(u){var i,a;this.status=u.status,this.dependency=u.dependency,this.index=u.index,this.stepType=u.stepType,this.resourceType=u.resourceType,this.lastEvent=u.lastEvent,this.id=u.id,(a=this.resource)==null||a.setDetails((i=u.resource)==null?void 0:i.details)}}var W6=(d=>(d.Ready="ready",d.Provisioning="provisioning",d.Queued="queued",d.ProvisioningFailed="provisioning-failed",d.Deleting="deleting",d.DeletingFailed="deleting-failed",d.Deleted="deleted",d))(W6||{});class mw{constructor(u,i,a){g(this,"provisionedBy");g(this,"publicationRun");g(this,"resourceType");g(this,"provider");g(this,"resourceId");g(this,"details",null);g(this,"name",null);g(this,"status","queued");this.publicationRun=u,this.resourceType=i,this.provider=a}setDetails(u){this.details=u}setStatus(u){this.status=u}setProvisionedBy(u){this.provisionedBy=u}}class vw extends mw{constructor(i,a,l,p){super(i,l,p);g(this,"resourceType");g(this,"owners",new Map);g(this,"details",null);g(this,"status","queued");a.forEach(e=>{this.owners.set(e.id,e)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,a;return this.resourceType===Jr.HttpApi?this.resourceId=J6(this.publicationRun.project.id):this.resourceType===Jr.RelationalDatabase&&(this.resourceId=Z6((a=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:a.id)),this.resourceId}}class Ew extends mw{constructor(i,a,l){super(i,a,l);g(this,"resourceType");g(this,"details",null);g(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceType===Jr.CompiledLocalCodebase?this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`:this.resourceType===Jr.CloudHostedCodebase&&(this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`),this.resourceId}}class lIe{constructor(u,i){g(this,"id");g(this,"projectAutoIncrementPublicationCount");g(this,"projectPublishedSemanticVersion");g(this,"projectVersion");g(this,"projectId");g(this,"cloudProvider");g(this,"triggeredBy");g(this,"createdAt");g(this,"updatedAt");g(this,"status");g(this,"steps",[]);g(this,"editor");g(this,"explicitResources",new Map);g(this,"implicitGlobalResources",new Map);g(this,"finalGlobalEvent",null);g(this,"finalStatus",null);this.id=u.id,this.projectAutoIncrementPublicationCount=u.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=u.projectPublishedSemanticVersion,this.projectVersion=u.projectVersion,this.projectId=u.projectId,this.cloudProvider=u.cloudProvider,this.triggeredBy=u.triggeredBy,this.createdAt=u.createdAt,this.updatedAt=u.updatedAt,this.status=u.status,this.editor=i}get project(){return this.editor.project}getInfraTypes(u){return this.steps.filter(i=>u.includes(i.resourceType))}getStepsTypes(u){return this.steps.filter(i=>u.includes(i.stepType))}toIds(u){return u.map(i=>i.id)}getResourceForEntity(u){const i=Array.from(this.explicitResources.values()).find(a=>a.owners.has(u.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(Jr.CompiledLocalCodebase,new Ew(this,Jr.CompiledLocalCodebase,Hp.Amazon)),this.implicitGlobalResources.set(Jr.CloudHostedCodebase,new Ew(this,Jr.CloudHostedCodebase,Hp.Amazon));const u=this.project.entities.filter(a=>vs(a,Be.HTTP_ENDPOINT)),i=this.project.entities.filter(a=>vs(a,Be.RELATIONAL_DATABASE));if(i.length&&i.forEach(a=>{const l=new vw(this,[a],Jr.RelationalDatabase,Hp.Amazon);this.explicitResources.set(l.resourceId,l)}),u.length){const a=new vw(this,u,Jr.HttpApi,Hp.Amazon);this.explicitResources.set(a.resourceId,a)}}setSteps(u,i){u.forEach(a=>{this.addStep(a,i)}),this.editor.events.emit(ht.ProjectPublishRequestAcknowledged,{})}addStep(u,i){const a=u.dependency||[];if(a.length){const p=a.filter(e=>!this.steps.find(y=>y.id===e));if(p.length)throw new Error(`Missing dependencies: ${p.join(", ")}`)}if(!u.resource)throw new Error(`Resource not found for step ${u.stepType} (${u.id})`);if(!this.steps.find(p=>p.id===u.id)){const p=this.implicitGlobalResources.get(u.resourceType)||this.explicitResources.get(u.resource.resourceId),e=new H6(u.stepType,u.id,u.resourceType,u.status,a,u.index,i,this,p);this.steps.push(e)}}onUpdate(u){var i;if(ke.log("onUpdate",u),(i=u.payload)!=null&&i.stepType){const a=this.steps.find(l=>{var p;return l.id===((p=u.payload)==null?void 0:p.id)});a&&L(u.emittedAt).isAfter(L(a.lasEventTimestamp))&&a.update(u.payload)}this.editor.events.emit("publication-updated",{}),u.type===hw.Error?(this.finalStatus=yw.Failed,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-error",u)):u.type===hw.Complete&&(this.finalStatus=yw.Success,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-completed",u))}}function dIe(d){switch(d){case An.CodeCompilation:return"Code generation";case An.RelationalDatabaseDeployment:return"Database creation";case An.HttpApiDeployment:return"HTTP gateway creation";case An.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case An.BundleCodebase:return"Bundle code";case An.MigrateRelationalDatabase:return"Database structure migration";case An.BusinessLogicCodebaseDeployment:return"Update servers with new code";case An.CodebaseCleanup:return"Code cleanup";case An.HttpApiDeletion:return"HTTP gateway deletion";case An.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function uIe(d){switch(d){case ht.DeploymentCompleted:return"Successfully published";case ht.DeploymentStarted:return"Publication started";case ht.DeploymentFailed:return"Publication failed";case ht.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case ht.RequestPayloadValidationFailed:return"Request payload validation failed";case ht.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case ht.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case ht.RelationalDatabaseDeploymentStarted:return"Database creation started";case ht.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case ht.RelationalDatabaseDeploymentFailed:return"Database creation failed";case ht.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case ht.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case ht.RelationalDatabaseAlreadyExists:return"Database already exists";case ht.HttpApiDeploymentStarted:return"HTTP gateway creation started";case ht.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case ht.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case ht.CreatingNewHttpApi:return"Creating new HTTP gateway";case ht.HttpApiAlreadyExists:return"HTTP gateway already exists";case ht.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case ht.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case ht.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case ht.BundlingCodebaseForDownload:return"Bundling code for download";case ht.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case ht.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case ht.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case ht.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case ht.CodeCompilationStarted:return"Code generation started";case ht.CodeCompilationCompleted:return"Code generation completed";case ht.CodeCompilationFailed:return"Code generation failed";case ht.BundleCodebaseStarted:return"Code bundling started";case ht.BundleCodebaseCompleted:return"Code bundling completed";case ht.BundleCodebaseFailed:return"Code bundling failed";case ht.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case ht.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case ht.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case ht.MigrateRelationalDatabaseStarted:return"Database structure migration started";case ht.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case ht.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case ht.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case ht.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case ht.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case ht.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case ht.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case ht.ProjectNotFound:return"Project not found";case ht.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case ht.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case ht.HttpApiDeletionStarted:return"HTTP gateway deletion started";case ht.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case ht.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case ht.RelationalDatabaseDeletionStarted:return"Database deletion started";case ht.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case ht.RelationalDatabaseDeletionFailed:return"Database deletion failed";case ht.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var Y6=(d=>(d.NO_LOGIC="NO_LOGIC",d.NO_NAME="NO_NAME",d.NO_CHANGES="NO_CHANGES",d.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",d))(Y6||{});function cIe(d){switch(d){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function pIe(d){switch(d){case Jr.RelationalDatabase:return"Relational database";case Jr.HttpEndpoint:case Jr.HttpApi:return"HTTP endpoints";case Jr.ServerlessFunction:case Jr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function fIe(d){switch(d){case wl.Running:return"In progress";case wl.Failed:return"Failed";case wl.Success:return"Succeeded";case wl.Skipped:return"Skipped";case wl.Queued:default:return"Queued"}}function hIe(d,u){let i=null;const a=[];if(!d.id)i={...d,id:N.UUID.uuid()};else if(!DS(d.id)){const y=N.UUID.uuid();i={...d,id:y},a.push(new ee({id:`${d.id}--${k.InvalidUUIDStringFormat}`,message:`Entity with id "${d.id}" has an invalid UUID string format. The 'id' property must be a valid UUID string.
|
|
199
|
+
`+p):a.stack=p}catch{}}throw a}}_request(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=bl(this.defaults,i);const{transitional:a,paramsSerializer:l,headers:p}=i;a!==void 0&&rm.assertOptions(a,{silentJSONParsing:Wn.transitional(Wn.boolean),forcedJSONParsing:Wn.transitional(Wn.boolean),clarifyTimeoutError:Wn.transitional(Wn.boolean)},!1),l!=null&&(Ae.isFunction(l)?i.paramsSerializer={serialize:l}:rm.assertOptions(l,{encode:Wn.function,serialize:Wn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),rm.assertOptions(i,{baseUrl:Wn.spelling("baseURL"),withXsrfToken:Wn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=p&&Ae.merge(p.common,p[i.method]);p&&Ae.forEach(["delete","get","head","post","put","patch","common"],U=>{delete p[U]}),i.headers=In.concat(e,p);const y=[];let v=!0;this.interceptors.request.forEach(function(G){typeof G.runWhen=="function"&&G.runWhen(i)===!1||(v=v&&G.synchronous,y.unshift(G.fulfilled,G.rejected))});const T=[];this.interceptors.response.forEach(function(G){T.push(G.fulfilled,G.rejected)});let w,A=0,P;if(!v){const U=[P6.bind(this),void 0];for(U.unshift.apply(U,y),U.push.apply(U,T),P=U.length,w=Promise.resolve(i);A<P;)w=w.then(U[A++],U[A++]);return w}P=y.length;let V=i;for(A=0;A<P;){const U=y[A++],G=y[A++];try{V=U(V)}catch(K){G.call(this,K);break}}try{w=P6.call(this,V)}catch(U){return Promise.reject(U)}for(A=0,P=T.length;A<P;)w=w.then(T[A++],T[A++]);return w}getUri(u){u=bl(this.defaults,u);const i=b6(u.baseURL,u.url,u.allowAbsoluteUrls);return f6(i,u.params,u.paramsSerializer)}}Ae.forEach(["delete","get","head","options"],function(u){im.prototype[u]=function(i,a){return this.request(bl(a||{},{method:u,url:i,data:(a||{}).data}))}}),Ae.forEach(["post","put","patch"],function(u){function i(a){return function(p,e,y){return this.request(bl(y||{},{method:u,headers:a?{"Content-Type":"multipart/form-data"}:{},url:p,data:e}))}}im.prototype[u]=i(),im.prototype[u+"Form"]=i(!0)});const sm=im;class XA{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(p){i=p});const a=this;this.promise.then(l=>{if(!a._listeners)return;let p=a._listeners.length;for(;p-- >0;)a._listeners[p](l);a._listeners=null}),this.promise.then=l=>{let p;const e=new Promise(y=>{a.subscribe(y),p=y}).then(l);return e.cancel=function(){a.unsubscribe(p)},e},u(function(p,e,y){a.reason||(a.reason=new Wd(p,e,y),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=a=>{u.abort(a)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new XA(function(l){u=l}),cancel:u}}}const FTe=XA;function GTe(d){return function(i){return d.apply(null,i)}}function STe(d){return Ae.isObject(d)&&d.isAxiosError===!0}const QA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(QA).forEach(([d,u])=>{QA[u]=d});const KTe=QA;function L6(d){const u=new sm(d),i=XG(sm.prototype.request,u);return Ae.extend(i,sm.prototype,u,{allOwnKeys:!0}),Ae.extend(i,u,null,{allOwnKeys:!0}),i.create=function(l){return L6(bl(d,l))},i}const fi=L6(JA);fi.Axios=sm,fi.CanceledError=Wd,fi.CancelToken=FTe,fi.isCancel=E6,fi.VERSION=N6,fi.toFormData=Wy,fi.AxiosError=Ot,fi.Cancel=fi.CanceledError,fi.all=function(u){return Promise.all(u)},fi.spread=GTe,fi.isAxiosError=STe,fi.mergeConfig=bl,fi.AxiosHeaders=In,fi.formToJSON=d=>m6(Ae.isHTMLForm(d)?new FormData(d):d),fi.getAdapter=$6.getAdapter,fi.HttpStatusCode=KTe,fi.default=fi;const kTe=fi;class eb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Addition);l&&(l.autoexecutable=!0,l.implementation=eb.prototype.module.main)}},main:async(...i)=>{try{const l=i.reduce((p,e)=>p+e,0);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class tb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Subtraction);l&&(l.autoexecutable=!0,l.implementation=tb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i,p=a-l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class rb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Multiplication);l&&(l.autoexecutable=!0,l.implementation=rb.prototype.module.main)}},main:async(...i)=>{try{const l=i.reduce((p,e)=>p*e,1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ib extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Division);l&&(l.autoexecutable=!0,l.implementation=ib.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i;if(l===0)throw new Error("Division by zero is not allowed");const p=a/l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class sb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Remainder);l&&(l.autoexecutable=!0,l.implementation=sb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i;if(l===0)throw new Error("Division by zero is not allowed");const p=a%l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class nb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Jt.Exponentiation);l&&(l.autoexecutable=!0,l.implementation=nb.prototype.module.main)}},main:async(...i)=>{try{const[a,l]=i,p=Math.pow(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ab extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomInteger);l&&(l.autoexecutable=!0,l.implementation=ab.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=pEe(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ob extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomFloat);l&&(l.autoexecutable=!0,l.implementation=ob.prototype.module.main)}},main:async(...i)=>{try{const a=HG();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class lb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomHexadecimal);l&&(l.autoexecutable=!0,l.implementation=lb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=WG(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class db extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomBase62);l&&(l.autoexecutable=!0,l.implementation=db.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=YG(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ub extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomBase64);l&&(l.autoexecutable=!0,l.implementation=ub.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=hEe(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class cb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomAlphanumeric);l&&(l.autoexecutable=!0,l.implementation=cb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=yEe(a);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class pb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateIdentifier);l&&(l.autoexecutable=!0,l.implementation=pb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=zG(a,l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class fb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateRandomUUIDv4);l&&(l.autoexecutable=!0,l.implementation=fb.prototype.module.main)}},main:async(...i)=>{try{const a=mEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class hb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateShortIdentifier);l&&(l.autoexecutable=!0,l.implementation=hb.prototype.module.main)}},main:async(...i)=>{try{const a=vEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class yb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Oe.GenerateHexadecimalToken);l&&(l.autoexecutable=!0,l.implementation=yb.prototype.module.main)}},main:async(...i)=>{try{const a=EEe();return{value:se.Success,error:null,results:[a]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class mb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Join);l&&(l.autoexecutable=!0,l.implementation=mb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],p=i.slice(1).join(a);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class vb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT,version:"1.0.0",description:"String split operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Split);l&&(l.autoexecutable=!0,l.implementation=vb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=a.split(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Eb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST,version:"1.0.0",description:"String delete last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteLast);l&&(l.autoexecutable=!0,l.implementation=Eb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.slice(0,-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Tb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST,version:"1.0.0",description:"String delete first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteFirst);l&&(l.autoexecutable=!0,l.implementation=Tb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.slice(1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ib extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Reverse);l&&(l.autoexecutable=!0,l.implementation=Ib.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.split("").reverse().join("");return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ab extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ToLowerCase);l&&(l.autoexecutable=!0,l.implementation=Ab.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.toLowerCase();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class bb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ToUpperCase);l&&(l.autoexecutable=!0,l.implementation=bb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.toUpperCase();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class wb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.DeleteIndex);l&&(l.autoexecutable=!0,l.implementation=wb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const p=a.slice(0,l)+a.slice(l+1);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Rb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.AddIndex);l&&(l.autoexecutable=!0,l.implementation=Rb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=a.slice(0,l)+p+a.slice(l);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class _b extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceFirst);l&&(l.autoexecutable=!0,l.implementation=_b.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.replace(l,p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class gb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceLast);l&&(l.autoexecutable=!0,l.implementation=gb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.lastIndexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=a.slice(0,e)+a.slice(e).replace(l,p);return{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Db extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceIndex);l&&(l.autoexecutable=!0,l.implementation=Db.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=a.slice(0,l)+p+a.slice(l+1);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ob extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_SINGLE_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceSingleMatch);l&&(l.autoexecutable=!0,l.implementation=Ob.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.replace(l,p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Cb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.ReplaceAllMatches);l&&(l.autoexecutable=!0,l.implementation=Cb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const e=a.split(l).join(p);return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class $b extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetIndexItem);l&&(l.autoexecutable=!0,l.implementation=$b.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.charAt(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Pb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST,version:"1.0.0",description:"String get first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetFirst);l&&(l.autoexecutable=!0,l.implementation=Pb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.charAt(0);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Nb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST,version:"1.0.0",description:"String get last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetLast);l&&(l.autoexecutable=!0,l.implementation=Nb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const l=a.charAt(a.length-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Vb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.GetIndexOf);l&&(l.autoexecutable=!0,l.implementation=Vb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.indexOf(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Lb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Append);l&&(l.autoexecutable=!0,l.implementation=Lb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a+l;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Mb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ge.Prepend);l&&(l.autoexecutable=!0,l.implementation=Mb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=l+a;return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Bb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Join);l&&(l.autoexecutable=!0,l.implementation=Bb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=a.join(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Ub extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Split);l&&(l.autoexecutable=!0,l.implementation=Ub.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No string provided or string is empty",results:[]};const p=a.split(l);return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class jb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Reverse);l&&(l.autoexecutable=!0,l.implementation=jb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice().reverse();return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class xb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.DeleteLast);l&&(l.autoexecutable=!0,l.implementation=xb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice(0,-1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Fb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.DeleteFirst);l&&(l.autoexecutable=!0,l.implementation=Fb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a.slice(1);return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Gb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.AddIndex);l&&(l.autoexecutable=!0,l.implementation=Gb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=[...a.slice(0,l),p,...a.slice(l)];return{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Sb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceIndex);l&&(l.autoexecutable=!0,l.implementation=Sb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const e=[...a];return e[l]=p,{value:se.Success,error:null,results:[e]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Kb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceFirst);l&&(l.autoexecutable=!0,l.implementation=Kb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const e=a.indexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=[...a];return y[e]=p,{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class kb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.ReplaceLast);l&&(l.autoexecutable=!0,l.implementation=kb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1],p=i[2];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const e=a.lastIndexOf(l);if(e===-1)return{value:se.Success,error:null,results:[a]};const y=[...a];return y[e]=p,{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class qb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetIndexItem);l&&(l.autoexecutable=!0,l.implementation=qb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};if(l<0||l>=a.length)return{value:se.Error,error:"Index out of bounds",results:[]};const p=a[l];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Jb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetFirst);l&&(l.autoexecutable=!0,l.implementation=Jb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a[0];return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Zb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.GetLast);l&&(l.autoexecutable=!0,l.implementation=Zb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const l=a[a.length-1];return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Hb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Append);l&&(l.autoexecutable=!0,l.implementation=Hb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=[...a,l];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Wb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(Ze.Prepend);l&&(l.autoexecutable=!0,l.implementation=Wb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0],l=i[1];if(!a||a.length===0)return{value:se.Error,error:"No list provided or list is empty",results:[]};const p=[l,...a];return{value:se.Success,error:null,results:[p]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Yb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_PARALLEL,version:"1.0.0",description:"Execution parallel operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Parallel);l&&(l.implementation=Yb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(a))return{value:se.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const p=this.registry.requestContexts(this,[ue.Editor])[0],y=a.map(T=>{const w=new Ws(p.logic,[T],T,null,this.registry);return w.inheritValuesFromContext(p),w}).map(T=>T.execute()),v=await Promise.all(y);return{value:se.Success,error:null,results:[v]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class zb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SEQUENTIAL,version:"1.0.0",description:"Execution sequential operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Sequential);l&&(l.implementation=zb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(a))return{value:se.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const l=[];for(let p=0;p<a.length;p++){const e=a[p],v=this.registry.requestContexts(this,[ue.Editor])[0],T=new Ws(v.logic,[e],e,null,this.registry);T.inheritValuesFromContext(v);const w=await T.execute();l.push(w)}return{value:se.Success,error:null,results:[l]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Xb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(sr.Wait);l&&(l.implementation=Xb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];return typeof a!="number"||a<0?{value:se.Error,error:"Invalid wait time provided",results:[]}:(await new Promise(l=>setTimeout(l,a)),{value:se.Success,error:null,results:[]})}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class Qb extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CREATE_NEW_INSTANCE,version:"1.0.0",description:"Entity create new instance operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(cr.CreateNewInstance);l&&(l.implementation=Qb.prototype.module.main)}},main:async(...i)=>{try{const a=i[0];if(!a)return{value:se.Error,error:"No entity template provided",results:[]};if(!(a instanceof Qn))return{value:se.Error,error:"Invalid entity template value provided",results:[]};const l=i[1]||{},e=Pi(a).map(v=>v.name);let y=l;if(e.includes(Be.PERSISTED_ENTITY)){const v=a.properties.find(w=>{var A;return((A=w.implements)==null?void 0:A.id)===Te["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id});if(!v)return{value:se.Error,error:"No database property found in entity",results:[]};if(!v.getDefaultValue())return{value:se.Error,error:"Database property has no database as entity as default value",results:[]}}return{value:se.Success,error:null,results:[y]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class ew extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(cr.Validate);l&&(l.autoexecutable=!0,l.implementation=ew.prototype.module.main)}},main:async(...i)=>{try{const l=rT(i[0]).safeParse(i[1]);return l.success?{value:se.Success,error:null,results:[i[1]]}:{value:se.Error,error:l.error.errors,results:[]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}class tw extends st{constructor(){super(...arguments);g(this,"manifest",{id:it.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Xe.High,permissions:[rt.All],contexts:[ue.Editor,ue.Logic]});g(this,"module",{init:i=>{const a=i.find(l=>l.contextType===ue.Logic);if(a){const l=a.get(yi.HttpRequest);l&&(l.implementation=tw.prototype.module.main)}},main:async(...i)=>{try{const a=i[3]||{},l={method:i[0],url:i[1],params:i[2],headers:a,data:i[4]};console.log("Axios request config: ",l);const p=await kTe(l);return{value:se.Success,error:null,results:[p.status,p.headers,p.data]}}catch(a){return{value:se.Error,error:a,results:[]}}}})}}function qTe(d){d.register(new ZG(d)),d.register(new JG(d)),d.register(new KG(d)),d.register(new qG(d)),d.register(new kG(d)),d.register(new eb(d)),d.register(new tb(d)),d.register(new rb(d)),d.register(new sb(d)),d.register(new ib(d)),d.register(new nb(d)),d.register(new ab(d)),d.register(new ob(d)),d.register(new lb(d)),d.register(new db(d)),d.register(new ub(d)),d.register(new cb(d)),d.register(new pb(d)),d.register(new fb(d)),d.register(new hb(d)),d.register(new yb(d)),d.register(new mb(d)),d.register(new vb(d)),d.register(new Eb(d)),d.register(new Tb(d)),d.register(new Ib(d)),d.register(new Ab(d)),d.register(new bb(d)),d.register(new wb(d)),d.register(new Rb(d)),d.register(new _b(d)),d.register(new gb(d)),d.register(new Db(d)),d.register(new Ob(d)),d.register(new Cb(d)),d.register(new $b(d)),d.register(new Pb(d)),d.register(new Nb(d)),d.register(new Vb(d)),d.register(new Lb(d)),d.register(new Mb(d)),d.register(new Bb(d)),d.register(new Ub(d)),d.register(new jb(d)),d.register(new xb(d)),d.register(new Fb(d)),d.register(new Gb(d)),d.register(new Sb(d)),d.register(new Kb(d)),d.register(new kb(d)),d.register(new qb(d)),d.register(new Jb(d)),d.register(new Zb(d)),d.register(new Hb(d)),d.register(new Wb(d)),d.register(new Yb(d)),d.register(new zb(d)),d.register(new Xb(d)),d.register(new Qb(d)),d.register(new ew(d)),d.register(new tw(d))}class M6{constructor(u=new Sp){g(this,"extensions",new Map);g(this,"onResolveEditorContextCallback",()=>null);g(this,"onResolveProjectLogicContextCallback",()=>null);g(this,"onResolveGUIContextCallback",()=>null);g(this,"onResolveCompileContextCallback",()=>null);this.events=u}onResolveEditorContext(u){this.onResolveEditorContextCallback=u}onResolveProjectLogicContext(u){this.onResolveProjectLogicContextCallback=u}onResolveGUIContext(u){this.onResolveGUIContextCallback=u}onResolveCompileContext(u){this.onResolveCompileContextCallback=u}get extensionInOrder(){return Array.from(this.extensions.values()).sort((u,i)=>(u.manifest.initPriority||Xe.Normal)-(i.manifest.initPriority||Xe.Normal))}async setup(){qTe(this),await this.initAll()}requestContext(u){switch(u){case ue.Editor:return this.onResolveEditorContextCallback();case ue.Logic:return this.onResolveProjectLogicContextCallback();case ue.GUI:return this.onResolveGUIContextCallback();case ue.Compile:return this.onResolveCompileContextCallback();default:throw new Error(`Unknown context type: ${u}`)}}requestContexts(u,i=[]){const a=[];i.length===0&&(i=u.manifest.contexts);for(const l of i){const p=this.requestContext(l);p&&a.push(p)}return a}requestModule(u){const i=this.extensions.get(u);if(i){if(i.module)return i.module;throw new Error(`Module ${u} is not registered properly.`)}throw new Error(`Unknown module: ${u}`)}register(u){this.extensions.set(u.manifest.id,u)}async initAll(){var u,i;for(const a of this.extensionInOrder)if(a.module.init){const l=a.manifest.contexts.map(p=>this.requestContext(p)).filter(p=>p!==null);l.length&&await((i=(u=a.module).init)==null?void 0:i.call(u,l))}}async destroyAll(){for(const u of[...this.extensionInOrder].reverse())u.module.destroy&&await u.module.destroy();this.events.destroy()}on(u,i){this.events.on(u,i)}emit(u,...i){this.events.emit(u,...i)}off(u,i){this.events.off(u,i)}}let nm=null;const rw={requestModule:d=>(nm||(nm=new M6,nm.setup()),nm.requestModule(d))},ho={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var iw=(d=>(d.FinishedSuccess="finished-success",d.FinishedError="finished-error",d.Running="running",d.Paused="paused",d.Stopped="stopped",d.NotStarted="not-started",d))(iw||{});const B6={...rw};class Ws extends Sp{constructor(i,a,l,p=null,e=B6){super();g(this,"project");g(this,"entryPoint");g(this,"state","not-started");g(this,"events",new Sp);g(this,"entities",[]);g(this,"parentExecution",null);g(this,"executing",[]);g(this,"executed",[]);g(this,"skipped",[]);g(this,"scheduled",[]);g(this,"localTestValues");g(this,"resolvedValues");g(this,"persistedExecutionResults");g(this,"lastExecutionResults");g(this,"onAddToSkippedListCallback",null);g(this,"onRemoveFromSkippedListCallback",null);g(this,"onAddEntityCallback",null);g(this,"onRemoveEntityCallback",null);this.parentContext=e,this.entities=a,this.entryPoint=l,this.project=i,this.parentExecution=p,this.localTestValues=new Mp(N.UUID.uuid(),this.project),this.resolvedValues=new Mp(N.UUID.uuid(),this.project),this.persistedExecutionResults=new Mp(N.UUID.uuid(),this.project),this.lastExecutionResults=new Mp(N.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults}}skip(i){this.hasEntity(i)&&(this.skipped.includes(i)||(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),Ss.includes(i.type)&&[...i.successCalls||[],...i.errorCalls||[],...i.calls||[]].forEach(a=>this.skip(a))))}async schedule(i,a,l){if(this.hasExecuted(i))return null;if(pr.includes(i.type))return this.executeBranch(i,l,a);if(Gs.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,l,a);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,a){const l=[];return[...mr,...pr].includes(a.type)?l.push(...a.inputs):Ar.includes(a.type)&&l.push(...a.outputs),l.map(e=>{var v;let y=i.find(T=>T.valueOwner.id===e.id);if(y)return y;if(!y&&pr.includes(a.type)&&(y=i.find(T=>{var w;return((w=T.valueOwner.declaration)==null?void 0:w.id)===e.id})),y){const T=(v=y.value)==null?void 0:v.clone(null);return T==null||T.setStandaloneParent(e),{...y,valueOwner:e,value:T||null,inheritanceLink:{sources:[y],target:e}}}return Vn.includes(e.type)?Ky(e,this.valueResolutionContext):vl(e,this.valueResolutionContext)}).reduce((e,y)=>{const v=En(y==null?void 0:y.valueOwner,this.project),T=y?[y]:[];return v.forEach(w=>{var V,U,G;if(w.id===(y==null?void 0:y.valueOwner.id))return;const A=dt(w.getDataType(null),w,this.project);A==null||A.metaSync({value:(V=y==null?void 0:y.value)==null?void 0:V.value},null),A==null||A.setValueAsTypeList(((U=y==null?void 0:y.value)==null?void 0:U.valueAsTypeList)||null),A==null||A.setValueAsTypeSingle(((G=y==null?void 0:y.value)==null?void 0:G.valueAsTypeSingle)||null);const P={...y,valueOwner:w,value:A};T.push(P)}),[...e,...T]},[]).sort((e,y)=>e.valueOwner.index-y.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};if(a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),Object.values(ki).includes(i.declaration.id)){const w=this.parentContext.requestModule(Kp+i.declaration.id).main;w?T=await w(i,a):ke.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{T=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,l,e);const w=i.outputs.map(P=>{var J,ie,X,ce;const V=[...P.declaration.getCounterparts(),P.declaration],U=T.results.find(re=>V.some(Y=>re.valueOwner.id===Y.id)),G=P==null?void 0:P.getDataType(null),K=dt(G,P,l);return G!=null&&G.asType?Array.isArray((J=U==null?void 0:U.value)==null?void 0:J.valueAsType)?K==null||K.setValueAsTypeList((ie=U==null?void 0:U.value)==null?void 0:ie.valueAsTypeList):K==null||K.setValueAsTypeSingle(((X=U==null?void 0:U.value)==null?void 0:X.valueAsType)||null):K==null||K.metaSync({value:(ce=U==null?void 0:U.value)==null?void 0:ce.value},null),{valueOwner:P,type:be.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(T.error){ke.warn("Raw error executing entity: ",T.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,l);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(T.error):V==null||V.metaSync({value:T.error},null),A={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:V}}return{value:T.value,entity:i,error:A,results:w}}return{...T,entity:i}}catch(T){ke.warn("Operation execution error: ",T);let w=null;if(i.error){const A=(v=i.error)==null?void 0:v.getDataType(null),P=dt(A,i.error,l);A!=null&&A.asType?P==null||P.setValueAsTypeSingle(T):P==null||P.metaSync({value:T},null),w={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:P}}return{value:se.Error,entity:i,error:w,results:[]}}}static async executeOperation(i,a,l){var p,e;try{let y={value:se.Success,error:null,results:[]};a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(y=await i.declaration.implementation(i,a));const v=i.outputs.map((w,A)=>{const P=w==null?void 0:w.getDataType(null),V=dt(P,w,l);return P!=null&&P.asType?V==null||V.setValueAsTypeSingle(y.results[A]):V==null||V.metaSync({value:y.results[A]},null),{valueOwner:w,type:be.ExecutionResult,inheritanceLink:null,value:V}});let T=null;if(y.error&&i.error){ke.warn("Raw error executing entity: ",y.error);const w=((p=i.error)==null?void 0:p.getDataType(null))||null,A=dt(w,i.error,l);w!=null&&w.asType?A==null||A.setValueAsTypeSingle(y.error):A==null||A.metaSync({value:y.error},null),T={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A}}return{value:y.value,entity:i,error:T,results:v}}catch(y){ke.warn("Operation execution error: ",y);let v=null;if(i.error){const T=(e=i.error)==null?void 0:e.getDataType(null),w=dt(T,i.error,l);T!=null&&T.asType?w==null||w.setValueAsTypeSingle(y):w==null||w.metaSync({value:y},null),v={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:w}}return{value:se.Error,entity:i,error:v,results:[]}}}async executeSearch(i,a,l){var p;try{let e={value:se.Success,error:null,results:[]};const y=i.outputs[0];if(!y)return{value:se.Success,entity:i,error:null,results:[]};let v={value:null,valueOwner:y,type:be.ExecutionResult,inheritanceLink:null};const T=await this.parentContext.requestModule(it.SEARCH_NODE_IMPLEMENTATION).main(i,a),w=y==null?void 0:y.getDataType(null),A=dt(w,y,l);return A==null||A.metaSync({value:T.data},null),v.value=A,{value:e.value,entity:i,error:null,results:[v]}}catch(e){if(ke.warn(`Search node execution error: ${e}`),!i.error)return{value:se.Error,entity:i,error:null,results:[]};const y=(p=i.error)==null?void 0:p.getDataType(null),v=dt(y,i.error,l);return v==null||v.metaSync({value:e},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:v},results:[]}}}async executeLoop(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};const w=a.map(K=>{var J,ie;return((J=K==null?void 0:K.value)==null?void 0:J.valueAsType)||((ie=K==null?void 0:K.value)==null?void 0:ie.value)});let A={};i.getUniqueReturnDeclarations().forEach(K=>{const J=i.body.inputs.find(re=>ne(re,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(K)),ie=K==null?void 0:K.getDataType(null),X=dt(ie,J,l);ie!=null&&ie.asType?X==null||X.setValueAsTypeList([]):X==null||X.metaSync({value:[]},null),this.lastExecutionResults.writeValue(J,X);const ce={value:X,valueOwner:J,type:be.ExecutionResult,inheritanceLink:null};A[J.id]=ce});let V={value:se.Success,entity:i.body,error:null,results:[]};switch(i.declaration.id){case Te.loop["counted-loop"].id:{const K=w[0];let J=1;for(;J<=K&&J<=50;){const ie=i.body.inputs.map(ce=>{if(ce===i.currentIterationNumberArgumentDeclaration){const re=i.currentIterationNumberArgumentDeclaration.getDataType(null),he=ml(re),Y=this.lastExecutionResults.readValue(ce.id);if(Y){Y.metaSync({value:J},null),this.lastExecutionResults.writeValue(ce,Y);const oe={value:Y,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null};return A[ce.id]=oe,oe}const H={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:J,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:he,standaloneParent:ce.toReference()},pe=or(H,l);this.lastExecutionResults.writeValue(ce,pe);const z={value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null};return A[ce.id]=z,z}else return A[ce.id]}).filter(ce=>!!ce),X=await this.executeFullFunctionDeclarationLogic(i.body,ie,e);if(V=X,V.results.forEach(ce=>{var H,pe,z,oe;if(ce.valueOwner.type!==f.ReturnDeclaration)return;const re=i.body.inputs.find(we=>ne(we,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(ce.valueOwner)),Y=[...((pe=(H=A==null?void 0:A[re.id])==null?void 0:H.value)==null?void 0:pe.value)||[],((z=ce==null?void 0:ce.value)==null?void 0:z.value)||null];(oe=A[re.id].value)==null||oe.metaSync({value:Y},null),this.lastExecutionResults.writeValue(re,A[re.id].value)}),[se.Error,se.Break,se.Return].includes(X.value))break;J++}break}case Te.loop["manual-flow-loop"].id:{let K=1;for(;K<=50;){const J=i.body.inputs.map(X=>{if(X===i.currentIterationNumberArgumentDeclaration){const ce=this.lastExecutionResults.readValue(X.id);if(ce){ce.metaSync({value:K},null),this.lastExecutionResults.writeValue(X,ce);const H={value:ce,valueOwner:X,type:be.ExecutionResult,inheritanceLink:null};return A[X.id]=H,H}const re=i.currentIterationNumberArgumentDeclaration.getDataType(null),he=dt(re,X,l);return he==null||he.metaSync({value:K},null),this.lastExecutionResults.writeValue(X,he),{value:he,valueOwner:X,type:be.ExecutionResult,inheritanceLink:null}}else return A[X.id]}).filter(X=>!!X),ie=await this.executeFullFunctionDeclarationLogic(i.body,J,e);if(V=ie,V.results.forEach(X=>{var Y,H,pe;if(X.valueOwner.type!==f.ReturnDeclaration)return;const ce=i.body.inputs.find(z=>ne(z,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(X.valueOwner)),he=[...(Y=A[ce.id].value)==null?void 0:Y.value,((H=X.value)==null?void 0:H.value)||null];(pe=A[ce.id].value)==null||pe.metaSync({value:he},null),this.lastExecutionResults.writeValue(ce,A[ce.id].value)}),[se.Error,se.Break,se.Return].includes(ie.value))break;K++}break}case Te.loop["list-loop"].id:{const K=w[0];let J=1;const ie=K;for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["object-keys-loop"].id:{const K=w[0];let J=1;const ie=K?Object.keys(K):[];for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["object-values-loop"].id:{const K=w[0];let J=1;const ie=K?Object.values(K):[];for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}case Te.loop["string-loop"].id:{const K=w[0];let J=1;const ie=K.split("");for(let X=0;X<ie.length;X++){const ce=ie[X],re=i.body.inputs.map(Y=>{if(Y===i.currentIterationNumberArgumentDeclaration){const H=this.lastExecutionResults.readValue(Y.id);if(H)return H.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,H),{value:H,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),z=dt(pe,Y,l);return z==null||z.metaSync({value:J},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else if(Y===i.currentValueArgumentDeclaration){const H=i.currentValueArgumentDeclaration.getDataType(null),pe=ml(H),z=this.lastExecutionResults.readValue(Y.id);if(z)return z.metaSync({value:ce},null),this.lastExecutionResults.writeValue(Y,z),{value:z,valueOwner:Y,type:be.ExecutionResult,inheritanceLink:null};const oe={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:ce,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:Y.toReference()},we=or(oe,l);return this.lastExecutionResults.writeValue(Y,we),{value:we,valueOwner:i.currentValueArgumentDeclaration,type:be.ExecutionResult,inheritanceLink:null}}else return A[Y.id]}).filter(Y=>!!Y),he=await this.executeFullFunctionDeclarationLogic(i.body,re,e);if(V=he,V.results.forEach(Y=>{var oe,we,je;if(Y.valueOwner.type!==f.ReturnDeclaration)return;const H=i.body.inputs.find(Ne=>ne(Ne,l)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(Y.valueOwner)),z=[...(oe=A[H.id].value)==null?void 0:oe.value,((we=Y.value)==null?void 0:we.value)||null];(je=A[H.id].value)==null||je.metaSync({value:z},null),this.lastExecutionResults.writeValue(H,A[H.id].value)}),[se.Error,se.Break,se.Return].includes(he.value))break;J++}break}}let U=[];i.body.inputs.forEach(K=>{var ie;const J=A[K.id];if(J){const X=(ie=J.value)==null?void 0:ie.clone(null),ce=i.outputs.find(re=>re.declaration&&ji.fromLoopOutputDeclarationToBodyArgumentDeclarationName(re.declaration)===ne(K,l));if(!ce)return;U.push({valueOwner:ce,type:be.ExecutionResult,inheritanceLink:null,value:X})}}),T={value:[se.Error,se.Return].includes(V.value)?V.value:se.Success,error:null,results:U};let G=null;if(T.error&&i.error){ke.warn("Raw error executing entity: ",T.error);const K=(y=i.error)==null?void 0:y.getDataType(null),J=dt(K||null,i.error,l);K!=null&&K.asType?J==null||J.setValueAsTypeSingle(T.error):J==null||J.metaSync({value:T.error},null),G={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:J}}return{value:T.value,entity:i,error:G,results:T.results}}catch(T){if(ke.warn("Error executing loop: ",T),i.error){const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,l);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(T):A==null||A.metaSync({value:T},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A},results:[]}}else return{value:se.Error,entity:i,error:null,results:[]}}}async executeFunctionCall(i,a,l,p={}){var y,v;const e={...ho,...p};try{let T={value:se.Success,error:null,results:[]};T=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,l,e);const w=i.outputs.map(P=>{var J,ie,X,ce;const V=[...P.declaration.getCounterparts(),P.declaration],U=T.results.find(re=>V.some(Y=>re.valueOwner.id===Y.id)),G=P==null?void 0:P.getDataType(null),K=dt(G,P,l);return G!=null&&G.asType?Array.isArray((J=U==null?void 0:U.value)==null?void 0:J.valueAsType)?K==null||K.setValueAsTypeList((ie=U==null?void 0:U.value)==null?void 0:ie.valueAsTypeList):K==null||K.setValueAsTypeSingle(((X=U==null?void 0:U.value)==null?void 0:X.valueAsType)||null):K==null||K.metaSync({value:(ce=U==null?void 0:U.value)==null?void 0:ce.value},null),{valueOwner:P,type:be.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(T.error&&i.error){ke.warn("Raw error executing entity: ",T.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,l);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(T.error):V==null||V.metaSync({value:T.error},null),A={valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:V}}return{value:T.value,entity:i,error:A,results:w}}catch(T){if(!i.error)return{value:se.Error,entity:i,error:null,results:[]};const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,l);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(T):A==null||A.metaSync({value:T},null),{value:se.Error,entity:i,error:{valueOwner:i.error,type:be.ExecutionResult,inheritanceLink:null,value:A},results:[]}}}static async executeCondition(i,a){var p,e,y,v,T,w,A,P,V,U,G,K,J,ie,X,ce,re,he,Y,H,pe,z,oe,we,je,Ne,$e,Pe,Je,xe,lt,Rt,dr,br,xr,ei;let l=!1;switch(i.declaration.id){case zr.Empty:{l=!((e=(p=a[0])==null?void 0:p.value)!=null&&e.value);break}case zr.NotEmpty:{l=!!((v=(y=a[0])==null?void 0:y.value)!=null&&v.value);break}case _r.Equal:{if([Q.String,Q.Number,Q.Boolean,Q.Null,Q.Enum,Q.Date,Q.UUID].includes((w=(T=a[0])==null?void 0:T.value)==null?void 0:w.name)){l=((P=(A=a[0])==null?void 0:A.value)==null?void 0:P.value)===((U=(V=a[1])==null?void 0:V.value)==null?void 0:U.value);break}if(((K=(G=a[0])==null?void 0:G.value)==null?void 0:K.name)===Q.KeyValue||((ie=(J=a[0])==null?void 0:J.value)==null?void 0:ie.name)===Q.Untyped){const ai=(ce=(X=a[0])==null?void 0:X.value)==null?void 0:ce.value,es=(he=(re=a[1])==null?void 0:re.value)==null?void 0:he.value;l=JSON.stringify(ai)===JSON.stringify(es);break}break}case _r.NotEqual:{if([Q.String,Q.Number,Q.Boolean,Q.Null,Q.Enum,Q.Date,Q.UUID].includes((H=(Y=a[0])==null?void 0:Y.value)==null?void 0:H.name)){l=((z=(pe=a[0])==null?void 0:pe.value)==null?void 0:z.value)!==((we=(oe=a[1])==null?void 0:oe.value)==null?void 0:we.value);break}if(((Ne=(je=a[0])==null?void 0:je.value)==null?void 0:Ne.name)===Q.Untyped||((Pe=($e=a[0])==null?void 0:$e.value)==null?void 0:Pe.name)===Q.KeyValue){const ai=(xe=(Je=a[0])==null?void 0:Je.value)==null?void 0:xe.value,es=(Rt=(lt=a[1])==null?void 0:lt.value)==null?void 0:Rt.value;l=JSON.stringify(ai)!==JSON.stringify(es);break}break}case _r.MoreThanOrEqual:{l=((br=(dr=a[0])==null?void 0:dr.value)==null?void 0:br.value)>=((ei=(xr=a[1])==null?void 0:xr.value)==null?void 0:ei.value);break}}return{value:l?se.Success:se.Error,entity:i,error:null,results:[]}}async executeDetachedFullFunctionDeclarationLogic(i,a,l,p={}){const e={...ho,...p,onBeforeEntityExecution:(T,w,A)=>{var P;return((P=p==null?void 0:p.onBeforeEntityExecution)==null?void 0:P.call(p,T,w,{...A,detached:!0}))||Promise.resolve()},onEntityExecuted:(T,w,A)=>{var P;return((P=p==null?void 0:p.onEntityExecuted)==null?void 0:P.call(p,T,w,{...A,detached:!0}))||Promise.resolve()}},y=new Ws(l,[i,...Om(i)],i,this,this.parentContext);return y.inheritValuesFromContext(this),await y.execute(e,a)}async executeFullFunctionDeclarationLogic(i,a,l={}){const p={...ho,...l},e=Om(i);e.forEach(A=>{this.addEntity(A)}),e.reduce((A,P)=>Ar.includes(P.type)?[...A,...P.outputs]:mr.includes(P.type)&&P.type!==f.Condition?[...A,...P.outputs,...P.inputs]:P.type===f.Condition?[...A,...P.inputs]:A,[]).forEach(A=>{this.lastExecutionResults.removeValue(A.id)});const v=await this.executeBranch(i,p,a),w=i.getUniqueReturnDeclarations().reduce((A,P)=>{const V=v==null?void 0:v.results.find(U=>U.valueOwner.id===P.id);return V?[...A,V]:A},[]);return{...v||{},value:(v==null?void 0:v.value)||se.Success,entity:i,error:(v==null?void 0:v.error)||null,results:w}}static async executeEntryPointEntity(i,a){return{value:se.Success,entity:i,error:null,results:a}}static async executeVariable(i,a){return{value:se.Success,entity:i,error:null,results:[a]}}static async executeReturnStatement(i,a){return{value:i.throws?se.Error:se.Return,entity:i,error:null,results:a}}static async executeContinueStatement(i,a){return{value:se.Continue,entity:i,error:null,results:a}}static async executeBreakStatement(i,a){return{value:se.Break,entity:i,error:null,results:a}}mergeValues(i,a){const l=[];for(let p=0;p<a.length;p++)i!=null&&i[p]?l.push(i[p]):l.push(a[p]);return l}async executeEntity(i,a=[],l={}){var y,v,T,w,A,P,V,U,G,K,J,ie,X,ce,re,he,Y;const p={...ho,...l},e={detached:!1};switch(i.type){case f.Condition:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((y=p.onBeforeEntityExecution)==null?void 0:y.call(p,i,H,e)),Ws.executeCondition(i,H)}case f.InternalCall:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((v=p.onBeforeEntityExecution)==null?void 0:v.call(p,i,H,e)),this.executeInternalCall(i,H,this.project)}case f.Operation:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((T=p.onBeforeEntityExecution)==null?void 0:T.call(p,i,H,e)),Ws.executeOperation(i,H,this.project)}case f.VariableInstance:case f.VariableDeclaration:{let H=Ky(i,this.valueResolutionContext);const pe=Ci(i),z=pe.getDataType(null);if(z!=null&&z.isObject()){let je={};if(((w=z==null?void 0:z.entity)==null?void 0:w.type)===f.DefinitionEntity&&(je={...je,...z.entity.getActiveRawDefaultValue()}),H!=null&&H.value)Tr((A=H==null?void 0:H.value)==null?void 0:A.value)&&(je={...je,...(P=H==null?void 0:H.value)==null?void 0:P.value}),H==null||H.value.metaSync({value:je},null);else{const Ne=dt(z,i,this.project);Ne==null||Ne.metaSync({value:je},null),H={valueOwner:pe,type:be.ExecutionResult,inheritanceLink:null,value:Ne}}this.lastExecutionResults.writeValue(pe,H.value),pe.inputs.forEach(Ne=>{var $e;if((($e=Ne.declaration)==null?void 0:$e.type)===f.Property&&Ne.declaration.static){const Pe=this.lastExecutionResults.readValue(Ne.declaration.id),Je=ne(Ne,this.project),xe=jr(Je);if(Pe)Pe.metaSync({value:je[xe]},null),this.lastExecutionResults.writeValue(Ne.declaration,Pe);else{const lt=dt(Ne.getDataType(null),Ne,this.project);lt==null||lt.metaSync({value:je[xe]},null),this.lastExecutionResults.writeValue(Ne.declaration,lt)}}})}else this.lastExecutionResults.writeValue(pe,H==null?void 0:H.value);const oe=[],we=(V=H==null?void 0:H.value)!=null&&V.value&&Tr((U=H.value)==null?void 0:U.value)?((G=H.value)==null?void 0:G.value)||{}:{};return i.outputs.map(je=>{const Ne=jr(ne(je,this.project)),$e=we[Ne],Pe=dt(je.getDataType(null),je,this.project);Pe==null||Pe.metaSync({value:$e},null);const Je={value:Pe,valueOwner:je,type:be.ExecutionResult,inheritanceLink:H?{sources:[H],target:i}:null};oe.push(Je)}),H.type=be.ExecutionResult,{value:se.Success,entity:i,error:null,results:[H,...oe]}}case f.FunctionCall:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((K=p.onBeforeEntityExecution)==null?void 0:K.call(p,i,H,e)),this.executeFunctionCall(i,H,this.project)}case f.FunctionDeclaration:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((J=p.onBeforeEntityExecution)==null?void 0:J.call(p,i,H,e)),Ws.executeEntryPointEntity(i,H)}case f.Search:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((ie=p.onBeforeEntityExecution)==null?void 0:ie.call(p,i,H,e)),this.executeSearch(i,H,this.project)}case f.Loop:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((X=p.onBeforeEntityExecution)==null?void 0:X.call(p,i,H,e)),this.executeLoop(i,H,this.project,p)}case f.ReturnStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((ce=p.onBeforeEntityExecution)==null?void 0:ce.call(p,i,H,e)),Ws.executeReturnStatement(i,H)}case f.ContinueStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((re=p.onBeforeEntityExecution)==null?void 0:re.call(p,i,H,e)),Ws.executeContinueStatement(i,H)}case f.BreakStatement:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((he=p.onBeforeEntityExecution)==null?void 0:he.call(p,i,H,e)),Ws.executeBreakStatement(i,H)}case f.GlobalEvent:{const H=this.mergeExernalValuesWithInternalInputs(a,i);return await((Y=p.onBeforeEntityExecution)==null?void 0:Y.call(p,i,H,e)),Ws.executeEntryPointEntity(i,H)}default:return{value:se.Error,entity:i,error:null,results:[]}}}storeLastExecutionValues(i){i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),i.results.forEach(a=>{const l=En(a.valueOwner,this.project);a.value?l.forEach(p=>{this.lastExecutionResults.writeValue(p,a.value)}):l.forEach(p=>{this.lastExecutionResults.removeValue(p.id)})})}async executeBranch(i,a={},l=[]){var T;const p={...ho,...a},e={detached:!1};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const v=await this.executeEntity(i,l,p);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(v),await((T=p.onEntityExecuted)==null?void 0:T.call(p,i,v,e)),v.value===se.Success){const w=(i.successCalls||i.calls||[]).filter(G=>this.hasEntity(G));(i.errorCalls||[]).forEach(G=>{this.skip(G)});let P=[];const V=(await Promise.all(w.map(G=>this.schedule(G,v.results,p)))).filter(G=>!!G),U=V.filter(G=>!!G).find(G=>G.value===se.Error||G.value===se.Return||G.value===se.Break||G.value===se.Continue);return U||(P=[...P,...V],v)}else if(v.value===se.Error){const w=(i.errorCalls||[]).filter(G=>this.hasEntity(G));(i.successCalls||i.calls||[]).forEach(G=>{this.skip(G)});let P=[];const V=(await Promise.all(w.map(G=>this.schedule(G,v.results,p)))).filter(G=>!!G),U=V.filter(G=>!!G).find(G=>G.value===se.Error||G.value===se.Return||G.value===se.Break||G.value===se.Continue);return U||(P=[...P,...V],v)}else{if(v.value===se.Return)return v;if(v.value===se.Break)return v;if(v.value===se.Continue)return v}return v}async execute(i={},a=[]){const l={...ho,...i};this.state="running";const p=await this.executeBranch(this.entryPoint,l,a);return this.state="finished-success",p}addEntity(i){var a;this.entities.includes(i)||(this.entities.push(i),(a=this.onAddEntityCallback)==null||a.call(this,i))}addEntities(i){i.forEach(a=>this.addEntity(a))}removeEntity(i){var a;if(i!==this.entryPoint){const l=this.entities.indexOf(i);l>-1&&(this.entities.splice(l,1),(a=this.onRemoveEntityCallback)==null||a.call(this,i))}}hasEntity(i){var p,e,y;if(this.entities.includes(i))return!0;if(((p=i.parent)==null?void 0:p.type)===f.FunctionDeclaration&&((y=(e=i.parent)==null?void 0:e.parent)==null?void 0:y.type)===f.DefinitionEntity)return this.entities.includes(i.parent);const a=Er(i);if(!a)return!1;const l=a.type===f.Loop&&i.parent===a.body?a.body:null;return l?this.entities.includes(l)||this.entities.includes(a):this.entities.includes(a)}removeScheduled(i){const a=this.scheduled.indexOf(i);a>-1&&this.scheduled.splice(a,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const a=this.project.get(i);return a?this.hasEntity(a):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}removeFromExecutingList(i){const a=this.executing.indexOf(i);a>-1&&this.executing.splice(a,1)}removeFromAlreadyExecutedList(i){const a=this.executed.indexOf(i);a>-1&&this.executed.splice(a,1)}removeFromSkippedList(i){var l;const a=this.skipped.indexOf(i);a>-1&&(this.skipped.splice(a,1),(l=this.onRemoveFromSkippedListCallback)==null||l.call(this,i))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var a;this.skipped.includes(i)||(this.skipped.push(i),(a=this.onAddToSkippedListCallback)==null||a.call(this,i))}}function JTe(d){var u,i;if(d.isList)return"list";if(((u=d.entity)==null?void 0:u.type)===f.DefinitionEntity)return"definition-entity";switch((i=d.entity)==null?void 0:i.name){case Q.Number:return"number";case Q.String:return"text";case Q.Boolean:return"boolean";case Q.UUID:return"uuid";case Q.Date:return"date-time";default:return"definition-entity"}}const sw={[f.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[f.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[f.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[f.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[f.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[f.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[f.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[f.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[f.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[f.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[f.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[f.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[f.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[f.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[f.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[f.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[f.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[f.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[f.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[f.ReturnDeclaration]:{singular:"Output definition",plural:"Output definitions",shortSingular:"Output",shortPlural:"Outputs"},[f.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"}};function nw(d){const u=Cm(d);if(!u){const a=tu(d);if(a.includes(Be.HTTP_ENDPOINT))return"HTTP endpoint";if(a.includes(Be.PERSISTED_ENTITY))return"Persisted entity";if(a.includes(Be.CRON_JOB))return"Scheduled execution";if(a.includes(Be.RELATIONAL_DATABASE))return"Relational database"}if(u){let a="Extension of "+ne(u,u.project)+" entity",l=_d(a);const p=tu(d);return p.includes(Be.HTTP_ENDPOINT)?"HTTP endpoint"+(l?", "+l:""):p.includes(Be.PERSISTED_ENTITY)?"Persisted entity"+(l?", "+l:""):p.includes(Be.CRON_JOB)?"Scheduled execution"+(l?", "+l:""):p.includes(Be.RELATIONAL_DATABASE)?"Relational database"+(l?", "+l:""):a}let i="";return d.abstract&&(i="Template "),d.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function U6(d){return d.parent.type===f.DefinitionEntity||d.parent.type===f.InstalledProject?"Internal action of "+ne(d.parent,d.project):d.parent.type===f.Loop?"Action repeated on every iteration":"Internal action of entity"}function aw(d){return Gw(d)?U6(d):"Custom trigger"}function ZTe(d){var u;switch(d.type){case f.DefinitionEntity:return nw(d);case f.FunctionDeclaration:return aw(d)}return(u=sw[d.type])==null?void 0:u.singular}function HTe(d){var u;switch(d.type){case f.DefinitionEntity:return nw(d);case f.FunctionDeclaration:return aw(d)}return(u=sw[d.type])==null?void 0:u.singular}const ow=4e4,j6=280,WTe=300,lw=65,Yd=32,am=39,x6=26,F6=49,om=44,YTe=35,lm=52,dw=10,Ma=dw*2,dm=38,um=90,uw=270,G6=ow/2+120,S6=ow/2+180;function K6(d){let i=Yd+om+dm+dw;const a=[...d.inputs];return a.length&&(i+=Ma,a.forEach(()=>{i+=x6})),{height:i,width:280}}function k6(d){let i=lw;const a=[];if([f.DefinitionEntity].includes(d.type)){const v=[...d.suggestedProperties||[],...d.properties||[]];v.length&&(i+=Ma,v.forEach(T=>{i+=T.static?F6:am}))}if([f.DefinitionEntity,f.InstalledProject,f.Loop].includes(d.type)){const v=[...(d==null?void 0:d.suggestedMethods)||[],...d.methods||[],...d.functions||[],...d.body?[d.body]:[]];v.length&&(i+=Ma,v.forEach(T=>{const w=K6(T);i+=w.height}))}mr.includes(d.type)?(mt.includes(d.type)?a.push(...(d.usedInputs||[]).flatMap(v=>[v])||[]):a.push(...(d.inputs||[]).flatMap(v=>[v])||[]),d.error&&(i+=lm)):[f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)?(a.push(...d.outputs||[]),d.throws&&(i+=lm)):d.type===f.Condition&&(a.push(d.inputs[0]),d.inputs[1]&&a.push(d.inputs[1]));const l=a.length;l&&(i+=l*am,i+=Ma);const p=[];if(d.type===f.FunctionDeclaration||d.type===f.GlobalEvent?p.push(...d.inputs||[]):mr.includes(d.type)&&(mt.includes(d.type)?p.push(...d.usedOutputs||[]):p.push(...d.outputs||[])),mt.includes(d.type)){d.readsValue&&(i+=Ma,i+=om),d.writesValues.length&&(i+=Ma,i+=om),d.internalCalls.length&&d.usedInternalCalls.forEach(()=>i+=lm+Ma);const v=d.getDataType(null);(!v||v.inferred)&&(i+=dm)}const e=p.length;return e&&(i+=e*am,i+=Ma),[f.DefinitionEntity,f.FunctionDeclaration,f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)&&(i+=dm),{height:i,width:280}}function Zp(d){return`${d.split("-").map((a,l)=>l===0?a.charAt(0).toUpperCase()+a.slice(1):a.toLowerCase()).join(" ")}.`}function zTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case le.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case le.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case le.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case le.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case le.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case le.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case ae.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case ae.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case le.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case le.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case ae.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case le.NoProperties:return"This entity has no properties, so it doesn't do anything";case le.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case le.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case le.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case le.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case le.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case le.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case le.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case le.PropertyImplementsNonAbstact:return"This property implements a non-template property";case le.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case le.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case le.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case le.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case le.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case ae.InternalCallDeclarationIsNotFunctionDeclaration:return"This internal call is not an action";case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case ae.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case ae.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case ae.UnreachableEntity:return"This entity is unreachable";case le.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";default:return Zp(d.code)}}function XTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case le.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case le.IncorrectEntityImplementation:return"Incorrect implementation";case le.IncorrectMethodImplementation:return"Incorrect action implementation";case le.IncorrectPropertyImplementation:return"Incorrect property implementation";case le.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case le.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case ae.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case ae.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case le.MissingMethodImplementation:return"Missing action";case le.MissingPropertyImplementation:return"Missing property";case ae.NameNotUniqueInScope:return"Duplicate name";case le.NoProperties:return"No properties";case le.NonStaticPropertyInStaticEntity:return"Non-static property";case le.StaticEntityWithNonStaticProperties:return"Non-static properties";case le.ReadingFromIncompatibleType:return"Read from different type";case le.WritingToIncompatibleType:return"Write to different type";case le.ScopeWithoutLogic:return"No logic";case le.NonStaticPropertyImplementsStatic:return"Invalid static property";case le.PropertyImplementsIncompatibleType:return"Incompatible data type";case le.PropertyImplementsNonAbstact:return"Non-template property";case le.StaticPropertyImplementsNonStatic:return"Non-static property";case le.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case le.VariableHasInputsAndInternalCall:return"Bad internal call";case le.VariableHasOutputsAndInternalCall:return"Bad internal call";case le.VariableIsCalledAndHasInternalCall:return"Bad internal call";case ae.InternalCallDeclarationIsNotFunctionDeclaration:return"Declaration not an action";case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case ae.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case ae.InternalCallParentMissingDataType:return"Parent has no data type";case ae.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case ae.UnreachableEntity:return"Unreachable entity";case le.DisconnectedCallableEntity:return"Disconnected entity";default:return Zp(d.code)}}function QTe(d){switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return`${ne(d.entity,d.entity.project)} has non-template actions`;case le.AbstractEntityWithNonAbstractProperties:return`${ne(d.entity,d.entity.project)} has non-template properties`;case le.IncorrectEntityImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements template`;case le.IncorrectMethodImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template`;case le.IncorrectPropertyImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template`;case le.AbstractMethodInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} can't be a template`;case le.AbstractPropertyInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} can't be a template`;case ae.MethodOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites action`;case ae.PropertyOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites property`;case le.MissingMethodImplementation:return`${ne(d.entity,d.entity.project)} is missing action`;case le.MissingPropertyImplementation:return`${ne(d.entity,d.entity.project)} is missing property`;case ae.NameNotUniqueInScope:return`${ne(d.entity,d.entity.project)} name is not unique`;case le.NoProperties:return`${ne(d.entity,d.entity.project)} has no properties`;case le.NonStaticPropertyInStaticEntity:return`${ne(d.entity,d.entity.project)} has non-static property`;case le.StaticEntityWithNonStaticProperties:return`${ne(d.entity,d.entity.project)} has non-static properties`;case le.ReadingFromIncompatibleType:return`${ne(d.entity,d.entity.project)} reads from different type`;case le.WritingToIncompatibleType:return`${ne(d.entity,d.entity.project)} writes to different type`;case le.ScopeWithoutLogic:return`${ne(d.entity,d.entity.project)} has no logic`;case le.NonStaticPropertyImplementsStatic:return`${ne(d.entity,d.entity.project)} has invalid static property`;case le.PropertyImplementsIncompatibleType:return`${ne(d.entity,d.entity.project)} has incompatible data type`;case le.PropertyImplementsNonAbstact:return`${ne(d.entity,d.entity.project)} has non-template property`;case le.StaticPropertyImplementsNonStatic:return`${ne(d.entity,d.entity.project)} has non-static property`;case le.VariableCallsOthersAndHasInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableHasInputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableHasOutputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case le.VariableIsCalledAndHasInternalCall:return`${ne(d.entity,d.entity.project)} has bad internal call`;case ae.InternalCallDeclarationIsNotFunctionDeclaration:return`${ne(d.entity,d.entity.project)} has declaration that is not an action`;case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has declaration that is not found in parent`;case ae.InternalCallParentDeclarationEntityInvalidType:return`${ne(d.entity,d.entity.project)} has invalid parent declaration type`;case ae.InternalCallParentMissingDataType:return`${ne(d.entity,d.entity.project)}'s parent has no data type`;case ae.InternalCallDeclarationNotInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has declaration that is not in parent`;case ae.UnreachableEntity:return`${ne(d.entity,d.entity.project)} is unreachable`;case le.DisconnectedCallableEntity:return`${ne(d.entity,d.entity.project)} is not executed by any entity`;default:return`${ne(d.entity,d.entity.project)} Error: ${Zp(d.code)}`}}function eIe(d){var u,i,a,l;switch(d.code){case le.AbstractEntityWithNonAbstractMethods:return`${ne(d.entity,d.entity.project)} has non-template actions`;case le.AbstractEntityWithNonAbstractProperties:return`${ne(d.entity,d.entity.project)} has non-template properties`;case le.IncorrectEntityImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template entity`;case le.IncorrectMethodImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template action it's based on`;case le.IncorrectPropertyImplementation:return`${ne(d.entity,d.entity.project)} incorrectly implements the template property it's based on`;case le.AbstractMethodInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} is a template action in a non-template entity`;case le.AbstractPropertyInNonAbstractEntity:return`${ne(d.entity,d.entity.project)} is a template property in a non-template entity`;case ae.MethodOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites an action in the template entity`;case ae.PropertyOverwritesOtherSiblingWithSameName:return`${ne(d.entity,d.entity.project)} overwrites a property in the template entity`;case le.MissingMethodImplementation:return`${ne(d.entity,d.entity.project)} is missing an action implementation from the template entity`;case le.MissingPropertyImplementation:return`${ne(d.entity,d.entity.project)} is missing a property implementation from the template entity`;case ae.NameNotUniqueInScope:return`${ne(d.entity,d.entity.project)} has a duplicate name in the same scope`;case le.NoProperties:return`${ne(d.entity,d.entity.project)} has no properties, so it doesn't do anything`;case le.NonStaticPropertyInStaticEntity:return`${ne(d.entity,d.entity.project)} has a non-static property in a static entity`;case le.StaticEntityWithNonStaticProperties:return`${ne(d.entity,d.entity.project)} has non-static properties in a static entity`;case le.ReadingFromIncompatibleType:return`${ne(d.entity,d.entity.project)} reads data from a value of a different data type`;case le.WritingToIncompatibleType:return`${ne(d.entity,d.entity.project)} writes data to a value of a different data type`;case le.ScopeWithoutLogic:return`${ne(d.entity,d.entity.project)} has no logic`;case le.NonStaticPropertyImplementsStatic:return`${ne(d.entity,d.entity.project)} has a static property in a non-static entity`;case le.PropertyImplementsIncompatibleType:return`${ne(d.entity,d.entity.project)} implements a property of a different data type`;case le.PropertyImplementsNonAbstact:return`${ne(d.entity,d.entity.project)} implements a non-template property`;case le.StaticPropertyImplementsNonStatic:return`${ne(d.entity,d.entity.project)} has a static property in a non-static entity`;case le.VariableCallsOthersAndHasInternalCall:return`${ne(d.entity,d.entity.project)} calls other entities while being used to execute internal logic`;case le.VariableHasInputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has inputs while being used to execute internal logic`;case le.VariableHasOutputsAndInternalCall:return`${ne(d.entity,d.entity.project)} has outputs while being used to execute internal logic`;case le.VariableIsCalledAndHasInternalCall:return`${ne(d.entity,d.entity.project)} is called while being used to execute internal logic`;case ae.InternalCallDeclarationIsNotFunctionDeclaration:return`${ne(d.entity,d.entity.project)} has a declaration that is not an action`;case ae.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has a declaration that is not found in ${(u=d.entity.parent.getDataType(null))!=null&&u.entity?ne((i=d.entity.parent.getDataType(null))==null?void 0:i.entity,d.entity.project):"the variable's data-type entity"}`;case ae.InternalCallParentDeclarationEntityInvalidType:return`${ne(d.entity,d.entity.project)} is part of a variable whos data-type entity can't have actions`;case ae.InternalCallParentMissingDataType:return`${ne(d.entity,d.entity.project)} is part of a variable with no data-type entity`;case ae.InternalCallDeclarationNotInParentDatatypeEntity:return`${ne(d.entity,d.entity.project)} has a declaration doesn't belong to ${(a=d.entity.parent.getDataType(null))!=null&&a.entity?ne((l=d.entity.parent.getDataType(null))==null?void 0:l.entity,d.entity.project):"the variable's data-type entity"}`;case ae.UnreachableEntity:return`${ne(d.entity,d.entity.project)} is unreachable`;case le.DisconnectedCallableEntity:return`${ne(d.entity,d.entity.project)} is disconnected and won't be executed by anything after publishing`;default:return`${ne(d.entity,d.entity.project)} Error: ${Zp(d.code)}`}}var cw=(d=>(d.ValuesAlreadyConnected="values-already-connected",d.CannotReadMoreThanOneValue="cannot-read-more-than-one-value",d.CannotReadValueFromChildren="cannot-read-value-from-children",d.CannotWriteValueToChildren="cannot-write-value-to-children",d.CannotBeCalledByChildren="cannot-be-called-by-children",d.ExecutionsAlreadyConnected="executions-already-connected",d.DataTypesNotCompatible="data-types-not-compatible",d.CannotCallAncestor="cannot-call-ancestor",d.CannotConnectToItself="cannot-connect-to-itself",d.CannotWriteValueToAncestor="cannot-write-value-to-ancestor",d.NotInScope="not-in-scope",d.IsNotValueWrittingEntity="is-not-value-writting-entity",d.IsNotValueReadingEntity="is-not-value-reading-entity",d.ContinueOrBreakStatementCalledFromOutsideLoop="continue-or-break-statement-called-from-outside-loop",d.ElementInLoopBodyCallingOutsideLoop="element-in-loop-body-calling-outside-loop",d.CallerIsInHigherScope="caller-is-in-higher-scope",d.CallerIsInLowerScope="caller-is-in-lower-scope",d.CallIsInHigherScope="call-is-in-higher-scope",d.CallIsInLowerScope="call-is-in-lower-scope",d.OtherIncompatibleScopeReason="other-incompatible-scope-reason",d.SiblingInternalCallAlreadyUsedInParentVariable="sibling-internal-call-already-used-in-parent-variable",d))(cw||{});const tIe=Object.values(cw);var pw=(d=>(d.NotPartOfOngoingTest="not-part-of-ongoing-test",d.CannotBeAddedToTest="cannot-be-added-to-test",d))(pw||{});const rIe=Object.values(pw);var fw=(d=>(d.Suggestion="suggestion",d.CanvasGloballyDisabled="canvas-globally-disabled",d.CannotInteractWithInputInVariableWithInternalCalls="cannot-interact-with-input-in-variable-with-internal-calls",d.CannotInteractWithOutputInVariableWithInternalCalls="cannot-interact-with-output-in-variable-with-internal-calls",d))(fw||{});const iIe=Object.values(fw);function sIe(d,u){const i=[...d,...u];return Array.from(new Set(i))}function nIe(d,u){const i=[...d,...u],a=Array.from(new Set(i));return{hasChanged:a.length!==d.length,reasons:a}}function aIe(d,u){const i=d.filter(l=>!u.includes(l));return{hasChanged:i.length!==d.length,reasons:i}}function oIe(d,u){return d.find(i=>i.entity.id===u)||null}function q6(d){return d.filter((u,i)=>d.indexOf(u)===i)}class Ai{constructor(u,i,a=null,l){g(this,"ids",[]);g(this,"entity");g(this,"entityCardHeight");g(this,"entityCardWidth");g(this,"index");g(this,"childEntities",[]);g(this,"children",[]);g(this,"parents",[]);g(this,"calculationEntryPoint");g(this,"_onlyEntities",null);g(this,"_changeSet",null);if(this.index=i,this.entity=u,this.calculationEntryPoint=a||this,this===this.calculationEntryPoint&&!l)throw new Error("Change set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(u,i,a){const l=G6-uw-j6,p=S6-um-lw;u.metaSync({x:u.x||l,y:u.y||p},i);const e=new Ai(u,0,null,i);e._onlyEntities=a||[],e.ids=["0"];const y=[];e.next(T=>{y.push(...T)}),Ai.recursivelyAssembleChildrenAreas(y),e.resolveChildrenOverlaps();const v=e.flattenChildEntities();return e._onlyEntities?v.filter(T=>(e._onlyEntities||[]).includes(T)):v}static recursivelyAssembleChildrenAreas(u){const i=[];u.forEach(a=>{a.next(l=>{i.push(...l)})}),i.length>0&&Ai.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(u){this.calculationEntryPoint._changeSet=u}findAreaInChildrenFromEntity(u){if(this.entity===u)return this;const i=this.children.find(l=>l.entity===u);return i||this.children.reduce((l,p)=>l||p.findAreaInChildrenFromEntity(u),null)}findAreaFromEntity(u){if(this.entity===u)return this;const i=this.calculationEntryPoint.children,a=i.find(p=>p.entity===u);return a||i.reduce((p,e)=>p||e.findAreaInChildrenFromEntity(u),null)}addParent(u){if(!this.parents.includes(u)){const i=Ai.resolveIds(u,this.index);this.ids.push(...i),this.parents.push(u)}}static resolveIds(u,i){return u?u.ids.map(a=>`${a}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const u=bn(this.entity,!0);if(this.entity.type===f.Project){const i=[],a=[],l=[];u.forEach(e=>{if(f.DefinitionEntity===e.type){a.push(e);return}else if(pr.includes(e.type)){l.push(e);return}i.push(e)});const p=i.sort((e,y)=>{const v=!!Am(e,y).length,T=bn(e),w=bn(y);return v?0:T.length&&!w.length?-1:!T.length&&w.length?1:0}).filter(e=>!Io(e).length);this.childEntities=[...a,...l,...p]}else{const i=[],a=[],l=[],p=[],e=[];Ss.includes(this.entity.type)&&wm(this.entity).forEach(T=>{if(mt.includes(T.type)){l.push(T);return}const w=Er(T);i.push(w)}),Mr.includes(this.entity.type)&&a.push(...this.entity.detachedChildren);const y=u.filter(v=>{const T=i.includes(v);return T||l.includes(v)||a.includes(v)?!1:mt.includes(v.type)?(l.push(v),!1):Gs.includes(v.type)&&!T?(p.push(v),!1):v.type===f.DefinitionEntity?(e.push(v),!1):!0});i.sort((v,T)=>Rl(v,T)?-1:0),p.sort((v,T)=>Rl(v,T)?-1:0),l.sort((v,T)=>Vw(v,T)?1:Vw(T,v)?-1:0),this.childEntities=[...e,...i,...p,...y,...l,...a]}}calculateCardSize(){const u=k6(this.entity);this.entityCardWidth=u.width,this.entityCardHeight=u.height}static getBoundriesOfTwoAreas(u,i){return{top:Math.min(u.top,i.top),left:Math.min(u.left,i.left),bottom:Math.max(u.bottom,i.bottom),right:Math.max(u.right,i.right)}}static getBoundriedOfCombinedAreas(u,i){const a=u.filter(p=>!i.includes(p));return a.reduce((p,e)=>i.includes(e)?p:Ai.getBoundriesOfTwoAreas(p,e.fullBranchArea),a[0].fullBranchArea)}getFullAreaUntilAny(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!u.includes(e)).map(e=>e.getFullAreaUntilAny(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),i)}getFullAreaUntilAreaOrAnyChildren(u){const i=[u,...u.flattenChildren()],a=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),a)}getFullAreaUntil(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(p=>p!==u).map(p=>p.getFullAreaUntil(u)).reduce((p,e)=>Ai.getBoundriesOfTwoAreas(p,e),i)}get fullBranchArea(){const u=this.ownEntityPlusBufferArea;return this.children.map(l=>l.fullBranchArea).reduce((l,p)=>Ai.getBoundriesOfTwoAreas(l,p),u)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const u=this.ownEntityArea;return{top:u.top,left:u.left,bottom:u.bottom+um,right:u.right+uw}}static filterOutRepeatedAreas(u){return u.filter((i,a)=>u.indexOf(i)===a)}getEarliestId(u,i){const a=u.split("-"),l=i.split("-");return a.length<l.length?u:a.length>l.length?i:a.reduce((e,y,v)=>y<l[v]?u:i,u)}getEarliestLevel(){return this.ids.reduce((a,l)=>this.getEarliestId(a,l),this.ids[0]).split("-").length}countColumns(){let u=0;if(this!==this.calculationEntryPoint)u++;else return u;if(!this.parents.length)return u;const a=this.parents.reduce((l,p)=>p.getEarliestLevel()>l.getEarliestLevel()?p:l,this.parents[0]).countColumns();return u+=a,u}getLatestId(u,i){if(u===i)return u;const a=u.split("-"),l=i.split("-");return a.length<l.length?i:a.length>l.length?u:a.reduce((e,y,v)=>y>l[v]?u:i,u)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((a,l)=>this.getLatestId(a,l),this.ids[0]).split("-").length}smoothPosition(){const u=this.flattenSiblings();if(!u.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(a=>{a!==this.calculationEntryPoint&&a.shiftDownAlone(i)})}else if([...pr].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=u.filter(a=>!this.parents.includes(a));i.length?i.every(l=>{const p=this.countColumns(),e=l.countColumns();return p>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(u,i){if(u.includes(this))return u;this.move(this.entity,{y:this.entity.y+i});let a=[...u,this];return this.children.forEach(l=>{if(Ai.getEarliestParentInChain(l)!==this)return;const e=oIe(a,l.entity.id);a=Ai.filterOutRepeatedAreas([...a]),e||(a=a.filter(v=>v!==l));const y=l.shiftDownUntilAny(a,i);a.push(...y)}),a}shiftRightUntilAny(u,i){u.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(a=>{const l=Ai.filterOutRepeatedAreas([...this.flattenSiblings(),...u]);Ai.getEarliestParentInChain(a)===this&&a.shiftRightUntilAny(l,i)}))}shiftRight(u){this.move(this.entity,{x:this.entity.x+u}),this.children.forEach(i=>{const l=i.flattenSiblings().filter(p=>p!==i);i.shiftRightUntilAny(l,u)})}shiftDownAlone(u){this.move(this.entity,{y:this.entity.y+u})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const u=this.parents.reduce((l,p)=>{const e=p.ownEntityArea,y=e.top+Yd,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(l,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Yd;this.shiftDownAlone(a)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const u=this.children.reduce((l,p)=>{const e=p.ownEntityArea,y=e.top+Yd,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(l,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Yd;return this.shiftDownAlone(a),a}resolveChildrenOverlaps(){const u=this.flattenChildren();let i=[];u.forEach(a=>{const l=a.adjustVerticallyToAvoidOverlaps();i.push(...l)}),u.forEach(a=>{a.smoothPosition()})}static getEarliestParentInChain(u){let i=u.parents[0];return u.parents.length&&(i=u.parents.sort((a,l)=>{if(!a.ids.length)return-1;if(!l.ids.length)return 1;const p=a.ids.sort((y,v)=>y.length<v.length?-1:0),e=l.ids.sort((y,v)=>y.length<v.length?-1:0);return p[0].length-e[0].length})[0]),i}flattenEarlierSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,l)=>{if(u.has(l.entity.id))return a;u.add(l.entity.id);const e=l.children.slice(0,l.children.indexOf(this)).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,l)=>{if(u.has(l.entity.id))return a;u.add(l.entity.id);const e=l.children.filter(y=>y!==this).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenChildren(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a,...a.flattenChildren(u)]),[])}flattenParents(u=new Set){return this.parents.reduce((a,l)=>u.has(l.entity.id)?a:(u.add(l.entity.id),[...a,l,...l.flattenParents(u)]),[])}getAreaIfRendered(u){return this.calculationEntryPoint.flattenChildren().find(l=>l.entity.id===u.id)||null}getLowerSiblings(){const u=this.parents.reduce((i,a)=>{const l=a.children.indexOf(this),p=a.children.slice(l+1);return[...i,...p]},[]);return q6(u)}getLowerAreas(){const u=this.getLowerSiblings(),i=this.parents.reduce((a,l)=>[...a,...l.getLowerAreas()],[]);return q6([...u,...i])}adjustVerticallyToAvoidOverlaps(u=[]){const a=Ai.getEarliestParentInChain(this).children[this.index-1];if(!a)return u;const l=this.flattenEarlierSiblings(),p=this.flattenParents(),e=[...l,...p,a],T=R(e.flatMap(V=>Am(this.entity,V.entity))).filter(V=>V.id!==this.entity.id).map(V=>this.findAreaFromEntity(V)).filter(V=>!!V),w=this.getFullAreaUntilAny(T),A=a.getFullAreaUntilAny(T),P=e.reduce((V,U)=>U===this||U.fullBranchArea.left!==w.left?V:Math.max(V,U.fullBranchArea.bottom),A.bottom);if(w.top<P){const V=P-w.top+um;return this.shiftDownUntilAny(u,V)}return u}move(u,i){(this.onlyEntities||[]).includes(u)&&u.metaSync(i,this.changeSet)}addChild(u){const i=this.childEntities[u];let a=null;i.x&&i.y?a=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),a||(a=new Ai(i,u,this.calculationEntryPoint));const l=this.ownEntityPlusBufferArea;this.children.includes(a)||(this.children.push(a),a.addParent(this));const p=a.fullBranchArea;if(p.left<l.right){const e=l.right-p.left;a.shiftRight(e)}return a}flattenChildEntities(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a.entity,...a.flattenChildEntities(u)]),[])}next(u){const i=[];this.childEntities.forEach((a,l)=>{const p=this.addChild(l);p&&i.push(p)}),u(i)}}var Hp=(d=>(d.Amazon="amazon",d.Google="google",d.Microsoft="microsoft",d))(Hp||{}),Jr=(d=>(d.RelationalDatabase="relational-database",d.CompiledLocalCodebase="compiled-local-codebase",d.CloudHostedCodebase="cloud-hosted-codebase",d.HttpApi="http-api",d.HttpEndpoint="http-endpoint",d.ServerlessFunction="serverless-function",d))(Jr||{}),hw=(d=>(d.Post="post",d.Get="get",d.Acknowledgement="acknowledgment",d.Progress="progress",d.Error="error",d.Complete="complete",d))(hw||{}),wl=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.Skipped="skipped",d.AbortedByUser="aborted-by-user",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(wl||{}),yw=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(yw||{}),ht=(d=>(d.ProjectNotFound="project-not-found",d.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",d.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",d.DeploymentCompleted="deployment-completed",d.DeploymentStarted="deployment-started",d.DeploymentFailed="deployment-failed",d.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",d.RequestPayloadValidationFailed="request-payload-validation-failed",d.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",d.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",d.ProjectAlreadyBeingPublished="project-already-being-published",d.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",d.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",d.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",d.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",d.CreatingNewRelationalDatabase="creating-new-relational-database",d.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",d.RelationalDatabaseAlreadyExists="relational-database-already-exists",d.RelationalDatabaseDeletionStarted="relational-database-deletion-started",d.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",d.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",d.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",d.HttpApiDeploymentStarted="http-api-deployment-started",d.HttpApiDeploymentCompleted="http-api-deployment-completed",d.HttpApiDeploymentFailed="http-api-deployment-failed",d.CreatingNewHttpApi="creating-new-http-api",d.HttpApiAlreadyExists="http-api-already-exists",d.HttpApiDeletionStarted="http-api-deletion-started",d.HttpApiDeletionCompleted="http-api-deletion-completed",d.HttpApiDeletionFailed="http-api-deletion-failed",d.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",d.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",d.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",d.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",d.BundlingCodebaseForDownload="bundling-codebase-for-download",d.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",d.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",d.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",d.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",d.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",d.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",d.CodeCompilationStarted="code-compilation-started",d.CodeCompilationCompleted="code-compilation-completed",d.CodeCompilationFailed="code-compilation-failed",d.BundleCodebaseStarted="bundle-codebase-started",d.BundleCodebaseCompleted="bundle-codebase-completed",d.BundleCodebaseFailed="bundle-codebase-failed",d.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",d.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",d.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",d.MigrateRelationalDatabaseStarted="migrate-relational-database-started",d.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",d.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",d))(ht||{}),An=(d=>(d.CodeCompilation="code-compilation",d.RelationalDatabaseDeployment="relational-database-deployment",d.RelationalDatabaseDeletion="relational-database-deletion",d.HttpApiDeployment="http-api-deployment",d.HttpApiDeletion="http-api-deletion",d.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",d.BundleCodebase="bundle-codebase",d.MigrateRelationalDatabase="migrate-relational-database",d.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",d.CodebaseCleanup="codebase-cleanup",d))(An||{});Jr.CloudHostedCodebase,Jr.HttpApi,Jr.RelationalDatabase,Jr.CloudHostedCodebase,Jr.CloudHostedCodebase,Jr.RelationalDatabase,Jr.CloudHostedCodebase,Jr.CloudHostedCodebase;function J6(d){return`project-${d}-http-api`}function Z6(d){return`entity-${d}-database`}class H6{constructor(u,i,a,l,p,e,y,v,T){g(this,"stepType");g(this,"id");g(this,"resourceType");g(this,"index");g(this,"dependency",[]);g(this,"lastEvent",null);g(this,"lasEventTimestamp",null);g(this,"status",wl.Queued);g(this,"publicationRun");g(this,"resource");this.stepType=u,this.id=i,this.resourceType=a,this.status=l,this.dependency=p,this.index=e,this.lasEventTimestamp=y,this.publicationRun=v,this.resource=T}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(u){var i,a;this.status=u.status,this.dependency=u.dependency,this.index=u.index,this.stepType=u.stepType,this.resourceType=u.resourceType,this.lastEvent=u.lastEvent,this.id=u.id,(a=this.resource)==null||a.setDetails((i=u.resource)==null?void 0:i.details)}}var W6=(d=>(d.Ready="ready",d.Provisioning="provisioning",d.Queued="queued",d.ProvisioningFailed="provisioning-failed",d.Deleting="deleting",d.DeletingFailed="deleting-failed",d.Deleted="deleted",d))(W6||{});class mw{constructor(u,i,a){g(this,"provisionedBy");g(this,"publicationRun");g(this,"resourceType");g(this,"provider");g(this,"resourceId");g(this,"details",null);g(this,"name",null);g(this,"status","queued");this.publicationRun=u,this.resourceType=i,this.provider=a}setDetails(u){this.details=u}setStatus(u){this.status=u}setProvisionedBy(u){this.provisionedBy=u}}class vw extends mw{constructor(i,a,l,p){super(i,l,p);g(this,"resourceType");g(this,"owners",new Map);g(this,"details",null);g(this,"status","queued");a.forEach(e=>{this.owners.set(e.id,e)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,a;return this.resourceType===Jr.HttpApi?this.resourceId=J6(this.publicationRun.project.id):this.resourceType===Jr.RelationalDatabase&&(this.resourceId=Z6((a=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:a.id)),this.resourceId}}class Ew extends mw{constructor(i,a,l){super(i,a,l);g(this,"resourceType");g(this,"details",null);g(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceType===Jr.CompiledLocalCodebase?this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`:this.resourceType===Jr.CloudHostedCodebase&&(this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`),this.resourceId}}class lIe{constructor(u,i){g(this,"id");g(this,"projectAutoIncrementPublicationCount");g(this,"projectPublishedSemanticVersion");g(this,"projectVersion");g(this,"projectId");g(this,"cloudProvider");g(this,"triggeredBy");g(this,"createdAt");g(this,"updatedAt");g(this,"status");g(this,"steps",[]);g(this,"editor");g(this,"explicitResources",new Map);g(this,"implicitGlobalResources",new Map);g(this,"finalGlobalEvent",null);g(this,"finalStatus",null);this.id=u.id,this.projectAutoIncrementPublicationCount=u.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=u.projectPublishedSemanticVersion,this.projectVersion=u.projectVersion,this.projectId=u.projectId,this.cloudProvider=u.cloudProvider,this.triggeredBy=u.triggeredBy,this.createdAt=u.createdAt,this.updatedAt=u.updatedAt,this.status=u.status,this.editor=i}get project(){return this.editor.project}getInfraTypes(u){return this.steps.filter(i=>u.includes(i.resourceType))}getStepsTypes(u){return this.steps.filter(i=>u.includes(i.stepType))}toIds(u){return u.map(i=>i.id)}getResourceForEntity(u){const i=Array.from(this.explicitResources.values()).find(a=>a.owners.has(u.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(Jr.CompiledLocalCodebase,new Ew(this,Jr.CompiledLocalCodebase,Hp.Amazon)),this.implicitGlobalResources.set(Jr.CloudHostedCodebase,new Ew(this,Jr.CloudHostedCodebase,Hp.Amazon));const u=this.project.entities.filter(a=>vs(a,Be.HTTP_ENDPOINT)),i=this.project.entities.filter(a=>vs(a,Be.RELATIONAL_DATABASE));if(i.length&&i.forEach(a=>{const l=new vw(this,[a],Jr.RelationalDatabase,Hp.Amazon);this.explicitResources.set(l.resourceId,l)}),u.length){const a=new vw(this,u,Jr.HttpApi,Hp.Amazon);this.explicitResources.set(a.resourceId,a)}}setSteps(u,i){u.forEach(a=>{this.addStep(a,i)}),this.editor.events.emit(ht.ProjectPublishRequestAcknowledged,{})}addStep(u,i){const a=u.dependency||[];if(a.length){const p=a.filter(e=>!this.steps.find(y=>y.id===e));if(p.length)throw new Error(`Missing dependencies: ${p.join(", ")}`)}if(!u.resource)throw new Error(`Resource not found for step ${u.stepType} (${u.id})`);if(!this.steps.find(p=>p.id===u.id)){const p=this.implicitGlobalResources.get(u.resourceType)||this.explicitResources.get(u.resource.resourceId),e=new H6(u.stepType,u.id,u.resourceType,u.status,a,u.index,i,this,p);this.steps.push(e)}}onUpdate(u){var i;if(ke.log("onUpdate",u),(i=u.payload)!=null&&i.stepType){const a=this.steps.find(l=>{var p;return l.id===((p=u.payload)==null?void 0:p.id)});a&&L(u.emittedAt).isAfter(L(a.lasEventTimestamp))&&a.update(u.payload)}this.editor.events.emit("publication-updated",{}),u.type===hw.Error?(this.finalStatus=yw.Failed,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-error",u)):u.type===hw.Complete&&(this.finalStatus=yw.Success,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-completed",u))}}function dIe(d){switch(d){case An.CodeCompilation:return"Code generation";case An.RelationalDatabaseDeployment:return"Database creation";case An.HttpApiDeployment:return"HTTP gateway creation";case An.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case An.BundleCodebase:return"Bundle code";case An.MigrateRelationalDatabase:return"Database structure migration";case An.BusinessLogicCodebaseDeployment:return"Update servers with new code";case An.CodebaseCleanup:return"Code cleanup";case An.HttpApiDeletion:return"HTTP gateway deletion";case An.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function uIe(d){switch(d){case ht.DeploymentCompleted:return"Successfully published";case ht.DeploymentStarted:return"Publication started";case ht.DeploymentFailed:return"Publication failed";case ht.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case ht.RequestPayloadValidationFailed:return"Request payload validation failed";case ht.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case ht.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case ht.RelationalDatabaseDeploymentStarted:return"Database creation started";case ht.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case ht.RelationalDatabaseDeploymentFailed:return"Database creation failed";case ht.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case ht.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case ht.RelationalDatabaseAlreadyExists:return"Database already exists";case ht.HttpApiDeploymentStarted:return"HTTP gateway creation started";case ht.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case ht.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case ht.CreatingNewHttpApi:return"Creating new HTTP gateway";case ht.HttpApiAlreadyExists:return"HTTP gateway already exists";case ht.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case ht.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case ht.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case ht.BundlingCodebaseForDownload:return"Bundling code for download";case ht.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case ht.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case ht.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case ht.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case ht.CodeCompilationStarted:return"Code generation started";case ht.CodeCompilationCompleted:return"Code generation completed";case ht.CodeCompilationFailed:return"Code generation failed";case ht.BundleCodebaseStarted:return"Code bundling started";case ht.BundleCodebaseCompleted:return"Code bundling completed";case ht.BundleCodebaseFailed:return"Code bundling failed";case ht.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case ht.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case ht.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case ht.MigrateRelationalDatabaseStarted:return"Database structure migration started";case ht.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case ht.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case ht.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case ht.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case ht.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case ht.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case ht.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case ht.ProjectNotFound:return"Project not found";case ht.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case ht.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case ht.HttpApiDeletionStarted:return"HTTP gateway deletion started";case ht.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case ht.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case ht.RelationalDatabaseDeletionStarted:return"Database deletion started";case ht.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case ht.RelationalDatabaseDeletionFailed:return"Database deletion failed";case ht.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var Y6=(d=>(d.NO_LOGIC="NO_LOGIC",d.NO_NAME="NO_NAME",d.NO_CHANGES="NO_CHANGES",d.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",d))(Y6||{});function cIe(d){switch(d){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function pIe(d){switch(d){case Jr.RelationalDatabase:return"Relational database";case Jr.HttpEndpoint:case Jr.HttpApi:return"HTTP endpoints";case Jr.ServerlessFunction:case Jr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function fIe(d){switch(d){case wl.Running:return"In progress";case wl.Failed:return"Failed";case wl.Success:return"Succeeded";case wl.Skipped:return"Skipped";case wl.Queued:default:return"Queued"}}function hIe(d,u){let i=null;const a=[];if(!d.id)i={...d,id:N.UUID.uuid()};else if(!DS(d.id)){const y=N.UUID.uuid();i={...d,id:y},a.push(new ee({id:`${d.id}--${k.InvalidUUIDStringFormat}`,message:`Entity with id "${d.id}" has an invalid UUID string format. The 'id' property must be a valid UUID string.
|
|
200
200
|
The 'id' has been changed to "${y}".`,severity:q.Warning,code:k.InvalidUUIDStringFormat,issue:null}))}if(i={...d,id:(i==null?void 0:i.id)||d.id||""},!d.type)return{errors:[...a,new ee({id:`${i.id}--${k.MissingTypeProperty}`,message:`Entity with id "${i.id}" is missing a 'type' property.`,severity:q.Error,code:k.MissingTypeProperty,issue:null})],modifiedData:i};if(d.type===f.GenericReference)return{errors:[...a,new ee({id:`${i.id}--${k.RootReference}`,message:`Generic reference entity with id "${i.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:q.Error,code:k.RootReference,issue:null})],modifiedData:i};const l=i,p=u.instances[l.id],e=u.builtInInstances[l.id];if(p&&!e&&l.type!==f.GenericReference){let y=`A previously generated entity with id "${l.id}" already exists in the project state.
|
|
201
201
|
Are you trying to update that entity?
|
|
202
202
|
If so, you should use the 'update' action for core mutable metadata properties, or 'delete' and then 'post' again to replace it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6393",
|
|
4
4
|
"author": "Sergio Herrero",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",
|