@elyx-code/project-logic-tree 0.0.6978 → 0.0.6979

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.cjs CHANGED
@@ -51,7 +51,7 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
51
51
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(p){return p instanceof this?p:new this(p)}static concat(p,...i){const r=new this(p);return i.forEach(a=>r.set(a)),r}static accessor(p){const r=(this[nU]=this[nU]={accessors:{}}).accessors,a=this.prototype;function c(e){const f=Z0(e);r[f]||(i1i(a,e),r[f]=!0)}return He.isArray(p)?p.forEach(c):c(p),this}}V1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);He.reduceDescriptors(V1.prototype,({value:s},p)=>{let i=p[0].toUpperCase()+p.slice(1);return{get:()=>s,set(r){this[i]=r}}});He.freezeMethods(V1);const so=V1;function l_(s,p){const i=this||m$,r=p||i,a=so.from(r.headers);let c=r.data;return He.forEach(s,function(f){c=f.call(i,c,a.normalize(),p?p.status:void 0)}),a.normalize(),c}function e2e(s){return!!(s&&s.__CANCEL__)}class r1i extends ar{constructor(p,i,r){super(p??"canceled",ar.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}}const VE=r1i;function t2e(s,p,i){const r=i.config.validateStatus;!i.status||!r||r(i.status)?s(i):p(new ar("Request failed with status code "+i.status,[ar.ERR_BAD_REQUEST,ar.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function n1i(s){const p=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return p&&p[1]||""}function a1i(s,p){s=s||10;const i=new Array(s),r=new Array(s);let a=0,c=0,e;return p=p!==void 0?p:1e3,function(h){const m=Date.now(),E=r[c];e||(e=m),i[a]=h,r[a]=m;let b=c,A=0;for(;b!==a;)A+=i[b++],b=b%s;if(a=(a+1)%s,a===c&&(c=(c+1)%s),m-e<p)return;const _=E&&m-E;return _?Math.round(A*1e3/_):void 0}}function s1i(s,p){let i=0,r=1e3/p,a,c;const e=(m,E=Date.now())=>{i=E,a=null,c&&(clearTimeout(c),c=null),s(...m)};return[(...m)=>{const E=Date.now(),b=E-i;b>=r?e(m,E):(a=m,c||(c=setTimeout(()=>{c=null,e(a)},r-b)))},()=>a&&e(a)]}const jg=(s,p,i=3)=>{let r=0;const a=a1i(50,250);return s1i(c=>{const e=c.loaded,f=c.lengthComputable?c.total:void 0,h=e-r,m=a(h),E=e<=f;r=e;const b={loaded:e,total:f,progress:f?e/f:void 0,bytes:h,rate:m||void 0,estimated:m&&f&&E?(f-e)/m:void 0,event:c,lengthComputable:f!=null,[p?"download":"upload"]:!0};s(b)},i)},aU=(s,p)=>{const i=s!=null;return[r=>p[0]({lengthComputable:i,total:s,loaded:r}),p[1]]},sU=s=>(...p)=>He.asap(()=>s(...p)),l1i=Da.hasStandardBrowserEnv?((s,p)=>i=>(i=new URL(i,Da.origin),s.protocol===i.protocol&&s.host===i.host&&(p||s.port===i.port)))(new URL(Da.origin),Da.navigator&&/(msie|trident)/i.test(Da.navigator.userAgent)):()=>!0,o1i=Da.hasStandardBrowserEnv?{write(s,p,i,r,a,c,e){if(typeof document>"u")return;const f=[`${s}=${encodeURIComponent(p)}`];He.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),He.isString(r)&&f.push(`path=${r}`),He.isString(a)&&f.push(`domain=${a}`),c===!0&&f.push("secure"),He.isString(e)&&f.push(`SameSite=${e}`),document.cookie=f.join("; ")},read(s){if(typeof document>"u")return null;const p=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return p?decodeURIComponent(p[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function d1i(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function u1i(s,p){return p?s.replace(/\/?\/$/,"")+"/"+p.replace(/^\/+/,""):s}function i2e(s,p,i){let r=!d1i(p);return s&&(r||i==!1)?u1i(s,p):p}const lU=s=>s instanceof so?{...s}:s;function Of(s,p){p=p||{};const i={};function r(m,E,b,A){return He.isPlainObject(m)&&He.isPlainObject(E)?He.merge.call({caseless:A},m,E):He.isPlainObject(E)?He.merge({},E):He.isArray(E)?E.slice():E}function a(m,E,b,A){if(He.isUndefined(E)){if(!He.isUndefined(m))return r(void 0,m,b,A)}else return r(m,E,b,A)}function c(m,E){if(!He.isUndefined(E))return r(void 0,E)}function e(m,E){if(He.isUndefined(E)){if(!He.isUndefined(m))return r(void 0,m)}else return r(void 0,E)}function f(m,E,b){if(b in p)return r(m,E);if(b in s)return r(void 0,m)}const h={url:c,method:c,data:c,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:f,headers:(m,E,b)=>a(lU(m),lU(E),b,!0)};return He.forEach(Object.keys({...s,...p}),function(E){if(E==="__proto__"||E==="constructor"||E==="prototype")return;const b=He.hasOwnProp(h,E)?h[E]:a,A=b(s[E],p[E],E);He.isUndefined(A)&&b!==f||(i[E]=A)}),i}const r2e=s=>{const p=Of({},s);let{data:i,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:c,headers:e,auth:f}=p;if(p.headers=e=so.from(e),p.url=QBe(i2e(p.baseURL,p.url,p.allowAbsoluteUrls),s.params,s.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),He.isFormData(i)){if(Da.hasStandardBrowserEnv||Da.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(He.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([E,b])=>{m.includes(E.toLowerCase())&&e.set(E,b)})}}if(Da.hasStandardBrowserEnv&&(r&&He.isFunction(r)&&(r=r(p)),r||r!==!1&&l1i(p.url))){const h=a&&c&&o1i.read(c);h&&e.set(a,h)}return p},p1i=typeof XMLHttpRequest<"u",c1i=p1i&&function(s){return new Promise(function(i,r){const a=r2e(s);let c=a.data;const e=so.from(a.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=a,E,b,A,_,P;function V(){_&&_(),P&&P(),a.cancelToken&&a.cancelToken.unsubscribe(E),a.signal&&a.signal.removeEventListener("abort",E)}let M=new XMLHttpRequest;M.open(a.method.toUpperCase(),a.url,!0),M.timeout=a.timeout;function G(){if(!M)return;const K=so.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),ne={data:!f||f==="text"||f==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:K,config:s,request:M};t2e(function(J){i(J),V()},function(J){r(J),V()},ne),M=null}"onloadend"in M?M.onloadend=G:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(G)},M.onabort=function(){M&&(r(new ar("Request aborted",ar.ECONNABORTED,s,M)),M=null)},M.onerror=function(le){const ne=le&&le.message?le.message:"Network Error",de=new ar(ne,ar.ERR_NETWORK,s,M);de.event=le||null,r(de),M=null},M.ontimeout=function(){let le=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const ne=a.transitional||f$;a.timeoutErrorMessage&&(le=a.timeoutErrorMessage),r(new ar(le,ne.clarifyTimeoutError?ar.ETIMEDOUT:ar.ECONNABORTED,s,M)),M=null},c===void 0&&e.setContentType(null),"setRequestHeader"in M&&He.forEach(e.toJSON(),function(le,ne){M.setRequestHeader(ne,le)}),He.isUndefined(a.withCredentials)||(M.withCredentials=!!a.withCredentials),f&&f!=="json"&&(M.responseType=a.responseType),m&&([A,P]=jg(m,!0),M.addEventListener("progress",A)),h&&M.upload&&([b,_]=jg(h),M.upload.addEventListener("progress",b),M.upload.addEventListener("loadend",_)),(a.cancelToken||a.signal)&&(E=K=>{M&&(r(!K||K.type?new VE(null,s,M):K),M.abort(),M=null)},a.cancelToken&&a.cancelToken.subscribe(E),a.signal&&(a.signal.aborted?E():a.signal.addEventListener("abort",E)));const k=n1i(a.url);if(k&&Da.protocols.indexOf(k)===-1){r(new ar("Unsupported protocol "+k+":",ar.ERR_BAD_REQUEST,s));return}M.send(c||null)})},f1i=(s,p)=>{const{length:i}=s=s?s.filter(Boolean):[];if(p||i){let r=new AbortController,a;const c=function(m){if(!a){a=!0,f();const E=m instanceof Error?m:this.reason;r.abort(E instanceof ar?E:new VE(E instanceof Error?E.message:E))}};let e=p&&setTimeout(()=>{e=null,c(new ar(`timeout of ${p}ms exceeded`,ar.ETIMEDOUT))},p);const f=()=>{s&&(e&&clearTimeout(e),e=null,s.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),s=null)};s.forEach(m=>m.addEventListener("abort",c));const{signal:h}=r;return h.unsubscribe=()=>He.asap(f),h}},y1i=f1i,h1i=function*(s,p){let i=s.byteLength;if(!p||i<p){yield s;return}let r=0,a;for(;r<i;)a=r+p,yield s.slice(r,a),r=a},m1i=async function*(s,p){for await(const i of T1i(s))yield*h1i(i,p)},T1i=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const p=s.getReader();try{for(;;){const{done:i,value:r}=await p.read();if(i)break;yield r}}finally{await p.cancel()}},oU=(s,p,i,r)=>{const a=m1i(s,p);let c=0,e,f=h=>{e||(e=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:E}=await a.next();if(m){f(),h.close();return}let b=E.byteLength;if(i){let A=c+=b;i(A)}h.enqueue(new Uint8Array(E))}catch(m){throw f(m),m}},cancel(h){return f(h),a.return()}},{highWaterMark:2})},dU=64*1024,{isFunction:lg}=He,v1i=(({Request:s,Response:p})=>({Request:s,Response:p}))(He.global),{ReadableStream:uU,TextEncoder:pU}=He.global,cU=(s,...p)=>{try{return!!s(...p)}catch{return!1}},E1i=s=>{s=He.merge.call({skipUndefined:!0},v1i,s);const{fetch:p,Request:i,Response:r}=s,a=p?lg(p):typeof fetch=="function",c=lg(i),e=lg(r);if(!a)return!1;const f=a&&lg(uU),h=a&&(typeof pU=="function"?(P=>V=>P.encode(V))(new pU):async P=>new Uint8Array(await new i(P).arrayBuffer())),m=c&&f&&cU(()=>{let P=!1;const V=new i(Da.origin,{body:new uU,method:"POST",get duplex(){return P=!0,"half"}}).headers.has("Content-Type");return P&&!V}),E=e&&f&&cU(()=>He.isReadableStream(new r("").body)),b={stream:E&&(P=>P.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(P=>{!b[P]&&(b[P]=(V,M)=>{let G=V&&V[P];if(G)return G.call(V);throw new ar(`Response type '${P}' is not supported`,ar.ERR_NOT_SUPPORT,M)})});const A=async P=>{if(P==null)return 0;if(He.isBlob(P))return P.size;if(He.isSpecCompliantForm(P))return(await new i(Da.origin,{method:"POST",body:P}).arrayBuffer()).byteLength;if(He.isArrayBufferView(P)||He.isArrayBuffer(P))return P.byteLength;if(He.isURLSearchParams(P)&&(P=P+""),He.isString(P))return(await h(P)).byteLength},_=async(P,V)=>{const M=He.toFiniteNumber(P.getContentLength());return M??A(V)};return async P=>{let{url:V,method:M,data:G,signal:k,cancelToken:K,timeout:le,onDownloadProgress:ne,onUploadProgress:de,responseType:J,headers:te,withCredentials:oe="same-origin",fetchOptions:X}=r2e(P),z=p||fetch;J=J?(J+"").toLowerCase():"text";let se=y1i([k,K&&K.toAbortSignal()],le),ye=null;const ce=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let he;try{if(de&&m&&M!=="get"&&M!=="head"&&(he=await _(te,G))!==0){let Se=new i(V,{method:"POST",body:G,duplex:"half"}),Ke;if(He.isFormData(G)&&(Ke=Se.headers.get("content-type"))&&te.setContentType(Ke),Se.body){const[Xe,mt]=aU(he,jg(sU(de)));G=oU(Se.body,dU,Xe,mt)}}He.isString(oe)||(oe=oe?"include":"omit");const Ae=c&&"credentials"in i.prototype,Re={...X,signal:se,method:M.toUpperCase(),headers:te.normalize().toJSON(),body:G,duplex:"half",credentials:Ae?oe:void 0};ye=c&&new i(V,Re);let Oe=await(c?z(ye,X):z(V,Re));const Be=E&&(J==="stream"||J==="response");if(E&&(ne||Be&&ce)){const Se={};["status","statusText","headers"].forEach(pt=>{Se[pt]=Oe[pt]});const Ke=He.toFiniteNumber(Oe.headers.get("content-length")),[Xe,mt]=ne&&aU(Ke,jg(sU(ne),!0))||[];Oe=new r(oU(Oe.body,dU,Xe,()=>{mt&&mt(),ce&&ce()}),Se)}J=J||"text";let Ge=await b[He.findKey(b,J)||"text"](Oe,P);return!Be&&ce&&ce(),await new Promise((Se,Ke)=>{t2e(Se,Ke,{data:Ge,headers:so.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:P,request:ye})})}catch(Ae){throw ce&&ce(),Ae&&Ae.name==="TypeError"&&/Load failed|fetch/i.test(Ae.message)?Object.assign(new ar("Network Error",ar.ERR_NETWORK,P,ye,Ae&&Ae.response),{cause:Ae.cause||Ae}):ar.from(Ae,Ae&&Ae.code,P,ye,Ae&&Ae.response)}}},b1i=new Map,n2e=s=>{let p=s&&s.env||{};const{fetch:i,Request:r,Response:a}=p,c=[r,a,i];let e=c.length,f=e,h,m,E=b1i;for(;f--;)h=c[f],m=E.get(h),m===void 0&&E.set(h,m=f?new Map:E1i(p)),E=m;return m};n2e();const T$={http:$Ri,xhr:c1i,fetch:{get:n2e}};He.forEach(T$,(s,p)=>{if(s){try{Object.defineProperty(s,"name",{value:p})}catch{}Object.defineProperty(s,"adapterName",{value:p})}});const fU=s=>`- ${s}`,A1i=s=>He.isFunction(s)||s===null||s===!1;function g1i(s,p){s=He.isArray(s)?s:[s];const{length:i}=s;let r,a;const c={};for(let e=0;e<i;e++){r=s[e];let f;if(a=r,!A1i(r)&&(a=T$[(f=String(r)).toLowerCase()],a===void 0))throw new ar(`Unknown adapter '${f}'`);if(a&&(He.isFunction(a)||(a=a.get(p))))break;c[f||"#"+e]=a}if(!a){const e=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let f=i?e.length>1?`since :
52
52
  `+e.map(fU).join(`
53
53
  `):" "+fU(e[0]):"as no adapter specified";throw new ar("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return a}const a2e={getAdapter:g1i,adapters:T$};function o_(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new VE(null,s)}function yU(s){return o_(s),s.headers=so.from(s.headers),s.data=l_.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),a2e.getAdapter(s.adapter||m$.adapter,s)(s).then(function(r){return o_(s),r.data=l_.call(s,s.transformResponse,r),r.headers=so.from(r.headers),r},function(r){return e2e(r)||(o_(s),r&&r.response&&(r.response.data=l_.call(s,s.transformResponse,r.response),r.response.headers=so.from(r.response.headers))),Promise.reject(r)})}const s2e="1.13.6",P1={};["object","boolean","number","function","string","symbol"].forEach((s,p)=>{P1[s]=function(r){return typeof r===s||"a"+(p<1?"n ":" ")+s}});const hU={};P1.transitional=function(p,i,r){function a(c,e){return"[Axios v"+s2e+"] Transitional option '"+c+"'"+e+(r?". "+r:"")}return(c,e,f)=>{if(p===!1)throw new ar(a(e," has been removed"+(i?" in "+i:"")),ar.ERR_DEPRECATED);return i&&!hU[e]&&(hU[e]=!0,console.warn(a(e," has been deprecated since v"+i+" and will be removed in the near future"))),p?p(c,e,f):!0}};P1.spelling=function(p){return(i,r)=>(console.warn(`${r} is likely a misspelling of ${p}`),!0)};function I1i(s,p,i){if(typeof s!="object")throw new ar("options must be an object",ar.ERR_BAD_OPTION_VALUE);const r=Object.keys(s);let a=r.length;for(;a-- >0;){const c=r[a],e=p[c];if(e){const f=s[c],h=f===void 0||e(f,c,s);if(h!==!0)throw new ar("option "+c+" must be "+h,ar.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new ar("Unknown option "+c,ar.ERR_BAD_OPTION)}}const vg={assertOptions:I1i,validators:P1},ml=vg.validators;class Ug{constructor(p){this.defaults=p||{},this.interceptors={request:new rU,response:new rU}}async request(p,i){try{return await this._request(p,i)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const c=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?c&&!String(r.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(r.stack+=`
54
- `+c):r.stack=c}catch{}}throw r}}_request(p,i){typeof p=="string"?(i=i||{},i.url=p):i=p||{},i=Of(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&vg.assertOptions(r,{silentJSONParsing:ml.transitional(ml.boolean),forcedJSONParsing:ml.transitional(ml.boolean),clarifyTimeoutError:ml.transitional(ml.boolean),legacyInterceptorReqResOrdering:ml.transitional(ml.boolean)},!1),a!=null&&(He.isFunction(a)?i.paramsSerializer={serialize:a}:vg.assertOptions(a,{encode:ml.function,serialize:ml.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),vg.assertOptions(i,{baseUrl:ml.spelling("baseURL"),withXsrfToken:ml.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&He.merge(c.common,c[i.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],P=>{delete c[P]}),i.headers=so.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(V){if(typeof V.runWhen=="function"&&V.runWhen(i)===!1)return;h=h&&V.synchronous;const M=i.transitional||f$;M&&M.legacyInterceptorReqResOrdering?f.unshift(V.fulfilled,V.rejected):f.push(V.fulfilled,V.rejected)});const m=[];this.interceptors.response.forEach(function(V){m.push(V.fulfilled,V.rejected)});let E,b=0,A;if(!h){const P=[yU.bind(this),void 0];for(P.unshift(...f),P.push(...m),A=P.length,E=Promise.resolve(i);b<A;)E=E.then(P[b++],P[b++]);return E}A=f.length;let _=i;for(;b<A;){const P=f[b++],V=f[b++];try{_=P(_)}catch(M){V.call(this,M);break}}try{E=yU.call(this,_)}catch(P){return Promise.reject(P)}for(b=0,A=m.length;b<A;)E=E.then(m[b++],m[b++]);return E}getUri(p){p=Of(this.defaults,p);const i=i2e(p.baseURL,p.url,p.allowAbsoluteUrls);return QBe(i,p.params,p.paramsSerializer)}}He.forEach(["delete","get","head","options"],function(p){Ug.prototype[p]=function(i,r){return this.request(Of(r||{},{method:p,url:i,data:(r||{}).data}))}});He.forEach(["post","put","patch"],function(p){function i(r){return function(c,e,f){return this.request(Of(f||{},{method:p,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}Ug.prototype[p]=i(),Ug.prototype[p+"Form"]=i(!0)});const Eg=Ug;class v${constructor(p){if(typeof p!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=c});const r=this;this.promise.then(a=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](a);r._listeners=null}),this.promise.then=a=>{let c;const e=new Promise(f=>{r.subscribe(f),c=f}).then(a);return e.cancel=function(){r.unsubscribe(c)},e},p(function(c,e,f){r.reason||(r.reason=new VE(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(p){if(this.reason){p(this.reason);return}this._listeners?this._listeners.push(p):this._listeners=[p]}unsubscribe(p){if(!this._listeners)return;const i=this._listeners.indexOf(p);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const p=new AbortController,i=r=>{p.abort(r)};return this.subscribe(i),p.signal.unsubscribe=()=>this.unsubscribe(i),p.signal}static source(){let p;return{token:new v$(function(a){p=a}),cancel:p}}}const R1i=v$;function D1i(s){return function(i){return s.apply(null,i)}}function w1i(s){return He.isObject(s)&&s.isAxiosError===!0}const z_={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(z_).forEach(([s,p])=>{z_[p]=s});const C1i=z_;function l2e(s){const p=new Eg(s),i=FBe(Eg.prototype.request,p);return He.extend(i,Eg.prototype,p,{allOwnKeys:!0}),He.extend(i,p,null,{allOwnKeys:!0}),i.create=function(a){return l2e(Of(s,a))},i}const Kn=l2e(m$);Kn.Axios=Eg;Kn.CanceledError=VE;Kn.CancelToken=R1i;Kn.isCancel=e2e;Kn.VERSION=s2e;Kn.toFormData=_1;Kn.AxiosError=ar;Kn.Cancel=Kn.CanceledError;Kn.all=function(p){return Promise.all(p)};Kn.spread=D1i;Kn.isAxiosError=w1i;Kn.mergeConfig=Of;Kn.AxiosHeaders=so;Kn.formToJSON=s=>XBe(He.isHTMLForm(s)?new FormData(s):s);Kn.getAdapter=a2e.getAdapter;Kn.HttpStatusCode=C1i;Kn.default=Kn;const o2e=Kn;class d2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(En.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.method.id}),E=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",_=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.query.id}),P=((e=_==null?void 0:_.value)==null?void 0:e.value)||"",V=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.body.id}),M=((f=V==null?void 0:V.value)==null?void 0:f.value)||"",G=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.headers.id}),k=((h=G==null?void 0:G.value)==null?void 0:h.value)||"",K={method:E,url:A,params:P,headers:k,data:M};Y.Logger.log("Axios request config: ",K);const le=await o2e(K);return{value:U.Success,error:null,result:{status:le.status,headers:le.headers,data:le.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:m,result:null}}}})}}class u2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(ao.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.query.id}),E=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[ae.Editor])[0],A=await o2e.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:E},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:U.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:f,result:null}}}})}}class p2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.Validate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)});Y.Logger.log("Inputs for entity validation: ",a);const e=gD(a[1]).safeParse(a[0]);return e.success?{value:U.Success,error:null,result:{data:a[0]}}:{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e.error.errors,result:null}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}const Xa=s=>s.map(p=>{var i,r;return((i=p.value)==null?void 0:i.valueAsType)??((r=p.value)==null?void 0:r.value)});class c2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=GVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class f2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=kVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=jVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class h2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=UVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class m2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY,version:"1.0.0",description:"Entity write-nested-key operation implementation module (immutable, no auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=FVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class T2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY,version:"1.0.0",description:"Entity write-safe-nested-key-recursively operation implementation module (immutable, auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=KVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class v2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=qVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class E2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=SVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class b2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=ZVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class A2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=HVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class g2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=WVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class I2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,E,b,A,_;try{const P=((c=(a=r[0])==null?void 0:a.value)==null?void 0:c.parent)||((f=(e=r[0])==null?void 0:e.value)==null?void 0:f.standaloneParent),V=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,M=(b=(E=r[1])==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle;if(!V)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!M)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!P)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if(M.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const G=P.getDataType(null);if(((A=G==null?void 0:G.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let k=!1;return((_=G==null?void 0:G.entity)==null?void 0:_.id)!==(M==null?void 0:M.id)?k=!1:gD(G==null?void 0:G.entity).safeParse(V).success?k=!0:k=!1,{value:U.Success,error:null,result:k}}catch(P){return{value:U.UnhandledError,error:P,result:null}}}})}}class R2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=Xa(r),c=zVe(...a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class D2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=YVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class w2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=JVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class C2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=QVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}let Us=null;try{Us=require("crypto")}catch{}const WT=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Us&&Us.webcrypto?Us.webcrypto:null,Rp=WT?WT.subtle:null;function sv(s){const p=new ArrayBuffer(s.byteLength);return new Uint8Array(p).set(s),p}function yn(s,p="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(p==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(p==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(p==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(p==="base64url"){const r=i.replace(/-/g,"+").replace(/_/g,"/").replace(/=+$/,"");if(typeof Buffer<"u")return new Uint8Array(Buffer.from(r,"base64"));const a=typeof atob=="function"?atob(r):"",c=new Uint8Array(a.length);for(let e=0;e<a.length;e++)c[e]=a.charCodeAt(e);return c}throw new Error(`Unsupported environment/encoding combo for toBytes(${p})`)}function jo(s,p="utf8"){if(p==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(p==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(p==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(p==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${p})`)}const O2e=s=>yn(s,"base64"),_2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64")},Vh=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64url")},_f=s=>yn(s,"base64url"),V2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"hex")},P2e=s=>yn(s,"hex");function E$(s){if(WT&&WT.getRandomValues){const p=new Uint8Array(s);return WT.getRandomValues(p),p}if(Us&&Us.randomBytes)return new Uint8Array(Us.randomBytes(s));throw new Error("Secure random not available")}function N1(s,p){if(!(s instanceof Uint8Array)||!(p instanceof Uint8Array)||s.length!==p.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^p[r];return i===0}function N2e(s,p,i,r){if((typeof s!="string"||typeof p!="string")&&typeof s!="string"&&typeof p!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=yn(s??"",a),f=yn(p??"",c);return N1(e,f)}async function x2e(s,p){if(Rp){const i=await Rp.digest({name:s},sv(p));return new Uint8Array(i)}if(Us){const i=s.replace("SHA-","sha"),r=Us.createHash(i);return r.update(Buffer.from(p)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function $2e(s,p,i,r){if(typeof p!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=yn(p??"",c),h=await x2e(a,f);return jo(h,e)}async function x1(s,p,i){if(Rp){const r=await Rp.importKey("raw",sv(p),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await Rp.sign("HMAC",r,sv(i));return new Uint8Array(a)}if(Us){const r=`sha${s.split("-")[1]}`,a=Us.createHmac(r,Buffer.from(p));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function L2e(s,p,i,r,a,c){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for key or data; expected strings");const e=String(i??"SHA-256"),f=r??"utf8",h=a??"utf8",m=c??"base64url",E=yn(s??"",f),b=yn(p??"",h),A=await x1(e,E,b);return jo(A,m)}async function $1(s,p,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(Rp){const c=await Rp.importKey("raw",sv(s),"PBKDF2",!1,["deriveBits"]),e=await Rp.deriveBits({name:"PBKDF2",salt:sv(p),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Us){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Us.pbkdf2(Buffer.from(s),Buffer.from(p),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function B2e(s,p,i,r,a,c,e,f){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",E=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),_=a??"SHA-256",P=yn(s??"",h),V=yn(p??"",m),M=await $1(P,V,{iterations:b,length:A,hashAlg:_});return jo(M,E)}async function M2e(s,p=E$(16),i=21e4,r=32,a="SHA-256"){const c=yn(s,"utf8"),e=await $1(c,p,{iterations:i,length:r,hashAlg:a}),f=Vh(p),h=Vh(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function G2e(s,p){const i=String(p).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=_f(i[3]),e=_f(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await $1(yn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return N1(h,e)}async function k2e(s,p,i,r,a,c){const e=p!=null?Math.max(1,Number(p)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",E=a!=null?yn(a,m):void 0;return await M2e(String(s??""),E,e,f,h)}function mU(s){return Vh(yn(JSON.stringify(s),"utf8"))}function Fg(s){try{return JSON.parse(jo(_f(s),"utf8"))}catch{return null}}async function j2e(s,p,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:E={}}={}){const b={alg:i,typ:"JWT",...E},A=Math.floor(Date.now()/1e3),_={...s||{}};r&&(_.iat=A),typeof a=="number"&&(_.exp=A+a),typeof c=="number"&&(_.nbf=A+c),e&&(_.iss=e),f&&(_.sub=f),h&&(_.aud=h),m&&(_.jti=m);const P=mU(b),V=mU(_),M=yn(`${P}.${V}`,"utf8"),k=await x1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,M),K=Vh(k);return`${P}.${V}.${K}`}async function U2e(s,p,i,r,a,c,e,f,h,m,E,b){if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(s!=null&&typeof s!="object")throw new Error("Invalid input type for payload; expected object");if(E!=null&&typeof E!="object")throw new Error("Invalid input type for header; expected object");if(m!=null&&typeof m!="string")throw new Error("Invalid input type for jwtid; expected string");if(e!=null&&typeof e!="string")throw new Error("Invalid input type for issuer; expected string");if(f!=null&&typeof f!="string")throw new Error("Invalid input type for subject; expected string");if(h!=null&&typeof h!="string"&&!Array.isArray(h))throw new Error("Invalid input type for audience; expected string or string[]");const _=yn(p??"",b??"utf8");return await j2e(s??{},_,{alg:i??"HS256",includeIat:r==null?!0:!!r,expiresInSeconds:a!=null?Number(a):void 0,notBeforeSeconds:c!=null?Number(c):void 0,issuer:e??void 0,subject:f??void 0,audience:h??void 0,jwtid:m??void 0,header:E??void 0})}async function F2e(s,p,{alg:i="HS256",issuer:r,audience:a,maxAgeSeconds:c,clockSkewSeconds:e=60}={}){try{const[f,h,m]=String(s).split(".");if(!f||!h||!m)return{valid:!1,header:null,payload:null,reason:"Malformed"};const E=Fg(f),b=Fg(h);if(!E||!b)return{valid:!1,header:E,payload:b,reason:"Bad base64/json"};if(E.alg!==i)return{valid:!1,header:E,payload:b,reason:"Alg mismatch"};const A=yn(`${f}.${h}`,"utf8"),P=await x1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,A),V=_f(m);if(!N1(P,V))return{valid:!1,header:E,payload:b,reason:"Bad signature"};const M=Math.floor(Date.now()/1e3),G=Math.max(0,Number(e)||0);if(b.nbf!=null&&M+G<Number(b.nbf))return{valid:!1,header:E,payload:b,reason:"Not before"};if(b.exp!=null&&M-G>=Number(b.exp))return{valid:!1,header:E,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:E,payload:b,reason:"Issuer mismatch"};if(a){const k=b.aud;if(!(Array.isArray(k)?k.includes(a):k===a))return{valid:!1,header:E,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&M-Number(b.iat)>Number(c)+G?{valid:!1,header:E,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:E,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function K2e(s,p,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(typeof r!="string")throw new Error("Invalid input type for issuer; expected string");if(a!=null&&typeof a!="string")throw new Error("Invalid input type for audience; expected string");const m=yn(p??"",f??"utf8");return await F2e(String(s??""),m,{alg:i??"HS256",issuer:r??void 0,audience:a??void 0,maxAgeSeconds:c!=null?Number(c):void 0,clockSkewSeconds:e!=null?Number(e):void 0})}function q2e(s){const[p,i,r]=String(s).split(".");return{header:p?Fg(p):null,payload:i?Fg(i):null,signature:r?_f(r):new Uint8Array}}function S2e(s,p){if(!s)throw new Error("Token is required for decoding");if(typeof s!="string")throw new Error("Invalid input type for token; expected string");const i=p??"base64url",{header:r,payload:a,signature:c}=q2e(String(s??"")),e=jo(c,i);return{header:r,payload:a,signature:e}}class Z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(tt.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)}),e=Math.max(0,Number(a)||0),f=c??"base64url",h=E$(e),m=jo(h,f);return{value:U.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class H2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=bVe(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class W2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=E1();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Wx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=zx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class J2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=gVe(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Q2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Yx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class X2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=Jx(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class eMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=Ip();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class tMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{Y.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===ae.Logic);if(r){Y.Logger.log("Project state found, setting up operation");const a=r.get(tt.GenerateShortIdentifier);a?(Y.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):Y.Logger.warn("Operation generate-short-identifier not found in project state")}else Y.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=IVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class iMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=RVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}function O1i(s){let p;if(s===null?p="null":Array.isArray(s)?p="array":p=typeof s,!["string","number","boolean","null","object","array"].includes(p))throw new TypeError("GetTypeOf cannot determine type of the given value.");return p}class rMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(Qe.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)||((h=e.value)==null?void 0:h.value)})[0];return{value:U.Success,error:null,result:O1i(c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class nMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class aMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=Number(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class sMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=yn(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class lMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=jo(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class oMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:_2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class dMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=O2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class uMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=Vh(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class pMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=_f(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class cMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=V2e(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class fMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=P2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class yMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:$2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class hMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:L2e(c,e,a,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class mMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:N2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class TMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:B2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class vMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(bn.Parse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a;try{const c=(a=r[0].value)==null?void 0:a.value;if(typeof c!="string")throw new Error(`Invalid input type for JSON.parse operation: expected string, got ${typeof c}`);const e=JSON.parse(c);return{value:U.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:c,result:null}}}})}}class EMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(bn.Stringify);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=(a=r[0].value)==null?void 0:a.value,f=(c=r[1].value)==null?void 0:c.value;if(!e||typeof e!="object"&&!Array.isArray(e))throw new Error(`Invalid input type for JSON.stringify operation: expected object or array, got ${typeof e}`);if(!f&&f!==0){const m=JSON.stringify(e);return{value:U.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:U.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e,result:null}}}})}}class bMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b,A,_,P,V]=r.map(M=>{var G,k;return((G=M.value)==null?void 0:G.valueAsType)??((k=M.value)==null?void 0:k.value)});return{value:U.Success,error:null,result:await U2e(a,c,e,f,h,m,E,b,A,_,P,V)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class AMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:await K2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class gMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:S2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class IMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(An.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:await k2e(a,c,e,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class RMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(An.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=await G2e(String(a??""),String(c??""));return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y_ extends D1{constructor(p,i,r=i.projectId){super(p,ae.Editor),this._editor=i,this.id=r}get ready(){return this._editor.ready}get env(){return this._editor.env}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get lastPublishedProjectState(){return this._editor.lastPublishedProjectState}get branchHead(){return this._editor.branchHead}get branchHeadPromise(){return this._editor.branchHeadPromise}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get livePublishedVersions(){return this._editor.livePublishedVersions}get publications(){return this._editor.publications}get liveResources(){return this._editor.liveResources}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(p){this._editor.undoableStackValueIndex=p}get activeWorkspace(){return this._editor.activeWorkspace}get branches(){return this._editor.branches}get roles(){return this._editor.roles}get READ_ONLY(){return this._editor.READ_ONLY}get isViewingNonHead(){return this._editor.isViewingNonHead}get canEdit(){return this._editor.canEdit}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}getRefreshToken(){return this._editor.getRefreshToken()}removeValueByOwnerId(p){return this._editor.removeValueByOwnerId(p)}removeValue(p){return this._editor.removeValue(p)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(p,i){return this._editor.initTest(p,i)}removeTest(p){return this._editor.removeTest(p)}async copyEntities(p,i={}){return this._editor.copyEntities(p,i)}resolveInitialChildrenPositions(p,i,r){return this._editor.resolveInitialChildrenPositions(p,i,r)}publish(){return this._editor.publish()}loadGivenPublication(p){return this._editor.loadGivenPublication(p)}validateProjectState(p){return this._editor.validateProjectState(p)}requestActiveDynamicValue(p,i=!1){return this._editor.requestActiveDynamicValue(p,i)}getValueTypePreference(p){return this._editor.getValueTypePreference(p)}setValueTypePreference(p,i){return this._editor.setValueTypePreference(p,i)}implementFeature(p){return this._editor.implementFeature(p)}getProjectRoles(){return this._editor.getProjectRoles()}getLastPublishedVersionLogic(p){return this._editor.getLastPublishedVersionLogic(p)}initialLoads(p){return this._editor.initialLoads(p)}moveBranchHeadToVersion(p,i,r){return this._editor.moveBranchHeadToVersion(p,i,r)}loadInitialBranchHead(){return this._editor.loadInitialBranchHead()}}function _1i(s,p){return p instanceof Y_?p:new Y_(s,p)}class J_ extends D1{constructor(p,i){super(p,ae.PublicationRun),this._publicationRun=i}get id(){return this._publicationRun.id}get projectAutoIncrementPublicationCount(){return this._publicationRun.projectAutoIncrementPublicationCount}get projectPublishedSemanticVersion(){return this._publicationRun.projectPublishedSemanticVersion}get envIdentifier(){return this._publicationRun.envIdentifier}get projectVersion(){return this._publicationRun.projectVersion}get projectBranchId(){return this._publicationRun.projectBranchId}get projectId(){return this._publicationRun.projectId}get triggeredBy(){return this._publicationRun.triggeredBy}get createdAt(){return this._publicationRun.createdAt}get updatedAt(){return this._publicationRun.updatedAt}get status(){return this._publicationRun.status}get steps(){return this._publicationRun.steps}get editor(){return this._publicationRun.editor}get explicitResources(){return this._publicationRun.explicitResources}get implicitGlobalResources(){return this._publicationRun.implicitGlobalResources}get finalGlobalEvent(){return this._publicationRun.finalGlobalEvent}get finalStatus(){return this._publicationRun.finalStatus}}function V1i(s,p){return p instanceof J_?p:new J_(s,p)}function P1i(s){s.register(new bPe(s)),s.register(new EPe(s)),s.register(new hPe(s)),s.register(new TPe(s)),s.register(new vPe(s)),s.register(new mPe(s)),s.register(new tBe(s)),s.register(new iBe(s)),s.register(new rBe(s)),s.register(new aBe(s)),s.register(new nBe(s)),s.register(new sBe(s)),s.register(new H2e(s)),s.register(new W2e(s)),s.register(new z2e(s)),s.register(new Y2e(s)),s.register(new J2e(s)),s.register(new Q2e(s)),s.register(new X2e(s)),s.register(new eMe(s)),s.register(new tMe(s)),s.register(new iMe(s)),s.register(new eLe(s)),s.register(new tLe(s)),s.register(new iLe(s)),s.register(new rLe(s)),s.register(new nLe(s)),s.register(new aLe(s)),s.register(new sLe(s)),s.register(new lLe(s)),s.register(new oLe(s)),s.register(new dLe(s)),s.register(new uLe(s)),s.register(new pLe(s)),s.register(new cLe(s)),s.register(new fLe(s)),s.register(new yLe(s)),s.register(new hLe(s)),s.register(new mLe(s)),s.register(new TLe(s)),s.register(new vLe(s)),s.register(new ALe(s)),s.register(new gLe(s)),s.register(new ILe(s)),s.register(new b$e(s)),s.register(new A$e(s)),s.register(new g$e(s)),s.register(new I$e(s)),s.register(new R$e(s)),s.register(new D$e(s)),s.register(new w$e(s)),s.register(new C$e(s)),s.register(new O$e(s)),s.register(new V$e(s)),s.register(new P$e(s)),s.register(new N$e(s)),s.register(new x$e(s)),s.register(new $$e(s)),s.register(new kxe(s)),s.register(new p2e(s)),s.register(new d2e(s)),s.register(new u2e(s)),s.register(new GNe(s)),s.register(new kNe(s)),s.register(new jNe(s)),s.register(new UNe(s)),s.register(new FNe(s)),s.register(new KNe(s)),s.register(new qNe(s)),s.register(new SNe(s)),s.register(new ZNe(s)),s.register(new axe(s)),s.register(new Bxe(s)),s.register(new Mxe(s)),s.register(new Gxe(s)),s.register(new HNe(s)),s.register(new WNe(s)),s.register(new zNe(s)),s.register(new YNe(s)),s.register(new JNe(s)),s.register(new QNe(s)),s.register(new XNe(s)),s.register(new exe(s)),s.register(new txe(s)),s.register(new ixe(s)),s.register(new rxe(s)),s.register(new nxe(s)),s.register(new sxe(s)),s.register(new lxe(s)),s.register(new oxe(s)),s.register(new dxe(s)),s.register(new uxe(s)),s.register(new pxe(s)),s.register(new cxe(s)),s.register(new fxe(s)),s.register(new yxe(s)),s.register(new hxe(s)),s.register(new mxe(s)),s.register(new Txe(s)),s.register(new wxe(s)),s.register(new Cxe(s)),s.register(new Oxe(s)),s.register(new vxe(s)),s.register(new Exe(s)),s.register(new bxe(s)),s.register(new Axe(s)),s.register(new gxe(s)),s.register(new Ixe(s)),s.register(new Rxe(s)),s.register(new Dxe(s)),s.register(new h2e(s)),s.register(new m2e(s)),s.register(new T2e(s)),s.register(new v2e(s)),s.register(new c2e(s)),s.register(new f2e(s)),s.register(new y2e(s)),s.register(new E2e(s)),s.register(new A2e(s)),s.register(new I2e(s)),s.register(new b2e(s)),s.register(new g2e(s)),s.register(new R2e(s)),s.register(new C2e(s)),s.register(new D2e(s)),s.register(new w2e(s)),s.register(new L$e(s)),s.register(new k$e(s)),s.register(new j$e(s)),s.register(new K$e(s)),s.register(new q$e(s)),s.register(new S$e(s)),s.register(new Z$e(s)),s.register(new H$e(s)),s.register(new W$e(s)),s.register(new z$e(s)),s.register(new Y$e(s)),s.register(new U$e(s)),s.register(new F$e(s)),s.register(new M$e(s)),s.register(new G$e(s)),s.register(new B$e(s)),s.register(new _$e(s)),s.register(new Q$e(s)),s.register(new X$e(s)),s.register(new J$e(s)),s.register(new oBe(s)),s.register(new NBe(s)),s.register(new PBe(s)),s.register(new xBe(s)),s.register(new $Be(s)),s.register(new pBe(s)),s.register(new cBe(s)),s.register(new vBe(s)),s.register(new mBe(s)),s.register(new _Be(s)),s.register(new IBe(s)),s.register(new DBe(s)),s.register(new CBe(s)),s.register(new wBe(s)),s.register(new TBe(s)),s.register(new bBe(s)),s.register(new ABe(s)),s.register(new EBe(s)),s.register(new lBe(s)),s.register(new fBe(s)),s.register(new RBe(s)),s.register(new MBe(s)),s.register(new S_(s)),s.register(new uBe(s)),s.register(new yBe(s)),s.register(new dBe(s)),s.register(new OBe(s)),s.register(new hBe(s)),s.register(new gBe(s)),s.register(new VBe(s)),s.register(new BBe(s)),s.register(new LBe(s)),s.register(new GBe(s)),s.register(new S_(s)),s.register(new jBe(s)),s.register(new kBe(s)),s.register(new UBe(s)),s.register(new GLe(s)),s.register(new kLe(s)),s.register(new jLe(s)),s.register(new DLe(s)),s.register(new bLe(s)),s.register(new _Le(s)),s.register(new xLe(s)),s.register(new ELe(s)),s.register(new $Le(s)),s.register(new MLe(s)),s.register(new PLe(s)),s.register(new VLe(s)),s.register(new kg(s)),s.register(new ULe(s)),s.register(new FLe(s)),s.register(new NLe(s)),s.register(new BLe(s)),s.register(new LLe(s)),s.register(new OLe(s)),s.register(new CLe(s)),s.register(new wLe(s)),s.register(new RLe(s)),s.register(new SLe(s)),s.register(new qLe(s)),s.register(new ZLe(s)),s.register(new KLe(s)),s.register(new Nxe(s)),s.register(new _xe(s)),s.register(new Pxe(s)),s.register(new xxe(s)),s.register(new $xe(s)),s.register(new Vxe(s)),s.register(new Lxe(s)),s.register(new rMe(s)),s.register(new dMe(s)),s.register(new pMe(s)),s.register(new fMe(s)),s.register(new oMe(s)),s.register(new uMe(s)),s.register(new cMe(s)),s.register(new lMe(s)),s.register(new sMe(s)),s.register(new aMe(s)),s.register(new nMe(s)),s.register(new vMe(s)),s.register(new EMe(s)),s.register(new mMe(s)),s.register(new TMe(s)),s.register(new Z2e(s)),s.register(new yMe(s)),s.register(new hMe(s)),s.register(new AMe(s)),s.register(new bMe(s)),s.register(new gMe(s)),s.register(new IMe(s)),s.register(new RMe(s)),s.register(new gPe(s)),s.register(new IPe(s)),s.register(new Mg(s)),s.register(new Gg(s))}class b${constructor(p=new Y.Events("extensions-registry-fallback-events")){R(this,"extensionsRegistry",new Map);R(this,"initialized",new Set);R(this,"initializedContexts",new Set);R(this,"onResolveEditorContextCallback",()=>null);R(this,"onResolveProjectLogicContextCallback",()=>null);R(this,"onResolveEditorGUIContextCallback",()=>null);R(this,"onResolveGUIContextCallback",()=>null);R(this,"onResolveCompileContextCallback",()=>null);R(this,"onResolvePublicationRunContextCallback",()=>null);this.events=p,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(p){this.onResolveEditorContextCallback=p}onResolveProjectLogicContext(p){this.onResolveProjectLogicContextCallback=p}onResolveGUIContext(p){this.onResolveGUIContextCallback=p}onResolveEditorGUIContext(p){this.onResolveEditorGUIContextCallback=p}onResolveCompileContext(p){this.onResolveCompileContextCallback=p}onResolvePublicationRunContext(p){this.onResolvePublicationRunContextCallback=p}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((p,i)=>(p.manifest.initPriority||_e.Normal)-(i.manifest.initPriority||_e.Normal))}async setup(){P1i(this),Y.Logger.log("Initializing extensions without context..."),this.initForReady()}requestContext(p){switch(p){case ae.Editor:return this.onResolveEditorContextCallback();case ae.Logic:return this.onResolveProjectLogicContextCallback();case ae.EditorGUI:return this.onResolveEditorGUIContextCallback();case ae.Compile:return this.onResolveCompileContextCallback();case ae.PublicationRun:return this.onResolvePublicationRunContextCallback();case ae.GUI:return this.onResolveGUIContextCallback();case ae.EditorGUI:return this.onResolveEditorGUIContextCallback();default:throw new Error(`Unknown context type: ${p}`)}}requestContexts(p,i=[]){const r=[];i.length===0&&(i=p.manifest.contexts);for(const a of i){const c=this.requestContext(a);c&&r.push(c)}return r}requestExtension(p){const i=this.extensionsRegistry.get(p);if(i)return i;throw new Error(`Unknown extension: ${p}`)}register(p){this.extensionsRegistry.set(p.manifest.id,p)}async initAll(){var p,i;for(const r of this.extensionInOrder)if(r.module.init&&!this.initialized.has(r.manifest.id)){const a=r.manifest.contexts.map(c=>this.requestContext(c)).filter(c=>c!==null);a.length&&(await((i=(p=r.module).init)==null?void 0:i.call(p,a)),this.initialized.add(r.manifest.id))}else!r.module.init&&!this.initialized.has(r.manifest.id)&&this.initialized.add(r.manifest.id)}async initForReady(){Y.Logger.log("Initializing extensions for ready contexts...");for(const p of this.extensionInOrder)if(p.module.init&&!this.initialized.has(p.manifest.id)){Y.Logger.log("Initializing "+p.manifest.id+" extension...");const i=this.requestContexts(p);p.manifest.contexts.every(a=>!!i.find(c=>c.contextType===a))?(await p.module.init(i),this.initialized.add(p.manifest.id)):Y.Logger.warn(`Skipping initialization of ${p.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${p.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(a=>a.contextType).join(", ")}`)}else!p.module.init&&!this.initialized.has(p.manifest.id)?(Y.Logger.log("Set "+p.manifest.id+" extension as initialized by default..."),this.initialized.add(p.manifest.id)):Y.Logger.log(`Skipping initialization of ${p.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const p of[...this.extensionInOrder].reverse())p.module.destroy&&await p.module.destroy();this.events.destroy()}on(p,i){this.events.on(p,i)}emit(p,...i){this.events.emit(p,...i)}off(p,i){this.events.off(p,i)}emitAsync(p,...i){return this.events.emitAsync(p,...i)}emitAsyncAll(p,...i){return this.events.emitAsyncAll(p,...i)}emitAsyncAllSettled(p,...i){return this.events.emitAsyncAllSettled(p,...i)}emitAsyncSequentially(p,...i){return this.events.emitAsyncSequentially(p,...i)}emitAsyncSequentiallyAll(p,...i){return this.events.emitAsyncSequentiallyAll(p,...i)}emitAsyncSequentiallyAllSettled(p,...i){return this.events.emitAsyncSequentiallyAllSettled(p,...i)}async contextAvailable(p){if(this.initializedContexts.has(p)){Y.Logger.warn(`Context ${p} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(p),p){case ae.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case ae.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Y.Logger.log(`Context ${p} is now available. Initializing extensions for this context...`),await this.initForReady()}getValueTypePreference(p){return window.localStorage.getItem("dynamic-value-type-preference--"+p)||null}setValueTypePreference(p,i){window.localStorage.setItem("dynamic-value-type-preference--"+p,(i==null?void 0:i.toString())||""),this.emit(p,{})}}let og=null;const A$={requestExtension:s=>(og||(og=new b$,og.setup()),og.requestExtension(s))};function op(s){return!(s instanceof Error)&&typeof s=="object"&&s!==null?s:s instanceof Error?{name:s.name,message:s.message,stack:s.stack,...s}:s}function TU(s){var p,i,r;if(s&&typeof s=="object"&&"value"in s){const a=s;return{single:((p=a.value)==null?void 0:p.valueAsTypeSingle)??((i=a.value)==null?void 0:i.value),list:((r=a.value)==null?void 0:r.valueAsTypeList)??null}}return{single:s,list:Array.isArray(s)?s:null}}const dp={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};class Q_ extends Error{constructor(){super("Execution was stopped"),this.name="ExecutionStoppedError"}}var g$=(s=>(s.FinishedSuccess="finished-success",s.FinishedError="finished-error",s.Running="running",s.Paused="paused",s.Stopped="stopped",s.NotStarted="not-started",s))(g$||{});const DMe={...A$,getValueTypePreference:()=>null,setValueTypePreference:()=>{}};class yh extends Y.Events{constructor(i,r,a,c=null,e=DMe){super();R(this,"project");R(this,"entryPoint");R(this,"state","not-started");R(this,"events",new Y.Events("fe-exec-inst-events"));R(this,"entities",[]);R(this,"parentExecution",null);R(this,"executing",[]);R(this,"executed",[]);R(this,"skipped",[]);R(this,"scheduled",[]);R(this,"localTestValues");R(this,"resolvedValues");R(this,"persistedExecutionResults");R(this,"lastExecutionResults");R(this,"onAddToSkippedListCallback",null);R(this,"onRemoveFromSkippedListCallback",null);R(this,"onAddEntityCallback",null);R(this,"onRemoveEntityCallback",null);R(this,"onAbortExecutionCallback",null);this.parentContext=e,this.entities=r,this.entryPoint=a,this.project=i,this.parentExecution=c,this.localTestValues=new BT(x.UUID.uuid(),this.project),this.resolvedValues=new BT(x.UUID.uuid(),this.project),this.persistedExecutionResults=new BT(x.UUID.uuid(),this.project),this.lastExecutionResults=new BT(x.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults,getValueTypePreference:this.parentContext.getValueTypePreference,setValueTypePreference:this.parentContext.setValueTypePreference}}get rootExecution(){let i=this;for(;i.parentExecution;)i=i.parentExecution;return i}get rootState(){return this.rootExecution.state}isStopped(){return this.state==="stopped"||this.rootExecution.state==="stopped"}isPaused(){return this.state==="paused"||this.rootExecution.state==="paused"}async checkStateAndPause(){if(this.isStopped())throw new Q_;for(;this.isPaused();){if(this.isStopped())throw new Q_;await new Promise(i=>setTimeout(i,100))}}skip(i){this.hasEntity(i)&&(this.removeFromScheduledList(i),!this.skipped.includes(i)&&(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),tr.includes(i.type)&&ft(i).forEach(r=>this.skip(r))))}async schedule(i,r,a){if(this.hasExecuted(i))return null;if(Ft.includes(i.type))return this.executeBranch(i,a,r);if(sr.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,a,r);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,r){const a=[];return[..._t,...Ft].includes(r.type)?a.push(...r.inputs):Dt.includes(r.type)&&a.push(...r.outputs),a.map(e=>{var h;let f=i.find(m=>m.valueOwner.id===e.id);if(f)return f;if(!f&&Ft.includes(r.type)&&(f=i.find(m=>{var E;return((E=m.valueOwner.declaration)==null?void 0:E.id)===e.id})),f){const m=(h=f.value)==null?void 0:h.clone(null);return m==null||m.setStandaloneParent(e,null),{...f,valueOwner:e,value:m||null,inheritanceLink:{sources:[f],target:e}}}return Qr.includes(e.type)?to(e,this.valueResolutionContext):iu(e,this.valueResolutionContext)}).reduce((e,f)=>{const h=ud(f==null?void 0:f.valueOwner,this.project),m=f?[f]:[];return h.forEach(E=>{var _,P,V;if(E.id===(f==null?void 0:f.valueOwner.id))return;const b=Ht(E.getDataType(null),E,this.project);b==null||b.metaSync({value:(_=f==null?void 0:f.value)==null?void 0:_.value},null),b==null||b.setValueAsTypeList(((P=f==null?void 0:f.value)==null?void 0:P.valueAsTypeList)||null),b==null||b.setValueAsTypeSingle(((V=f==null?void 0:f.value)==null?void 0:V.valueAsTypeSingle)||null);const A={...f,valueOwner:E,value:b};m.push(A)}),[...e,...m]},[]).sort((e,f)=>e.valueOwner.index-f.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,r,a,c={}){var f,h;this.logBeforeExecution("executeInternalCall",i,r);const e={...dp,...c};try{let m={value:U.Success,error:null,result:null};if(r.sort((V,M)=>V.valueOwner.index-M.valueOwner.index),Object.values(Gr).includes(i.declaration.id)){const V=this.parentContext.requestExtension(fh+i.declaration.id).module.main;V?m=await V(i,r,this):Y.Logger.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{const V=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);m={value:V.value,error:V.error,result:V.result}}let E=null;if(m.error&&i.error){Y.Logger.warn("Raw error executing entity: ",m.error);const{single:V,list:M}=TU(m.error),G=op(V),k=(f=i.error)==null?void 0:f.getDataType(null),K=Ht(k||null,i.error,a);if(k!=null&&k.asType)M!==null?K==null||K.setValueAsTypeList(M):K==null||K.setValueAsTypeSingle(V);else{const le=vr(G)?JSON.stringify(G,null,2):G;K==null||K.metaSync({value:le},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:K}}const b=i==null?void 0:i.getDataType(null),A=Ht(b,i,a),{single:_,list:P}=TU(m.result);return b!=null&&b.asType?P!==null?A==null||A.setValueAsTypeList(P):A==null||A.setValueAsTypeSingle(_):A==null||A.metaSync({value:_},null),{value:m.value,entity:i,error:E,result:{value:A||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(m){if(m&&(m.name==="ExecutionStoppedError"||m.message==="Execution was stopped"))throw m;Y.Logger.warn("Internal call execution error: ",m);let E=null;if(i.error){const b=op(m),A=(h=i.error)==null?void 0:h.getDataType(null),_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(m);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:E,result:null}}}static async executeOperation(i,r,a,c){var e,f;c?c.logBeforeExecution("executeOperation",i,r):console.log(`executeOperation (${i.type}) -> [${pe(i,a)}] Inputs:${r.length?`
54
+ `+c):r.stack=c}catch{}}throw r}}_request(p,i){typeof p=="string"?(i=i||{},i.url=p):i=p||{},i=Of(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&vg.assertOptions(r,{silentJSONParsing:ml.transitional(ml.boolean),forcedJSONParsing:ml.transitional(ml.boolean),clarifyTimeoutError:ml.transitional(ml.boolean),legacyInterceptorReqResOrdering:ml.transitional(ml.boolean)},!1),a!=null&&(He.isFunction(a)?i.paramsSerializer={serialize:a}:vg.assertOptions(a,{encode:ml.function,serialize:ml.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),vg.assertOptions(i,{baseUrl:ml.spelling("baseURL"),withXsrfToken:ml.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&He.merge(c.common,c[i.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],P=>{delete c[P]}),i.headers=so.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(V){if(typeof V.runWhen=="function"&&V.runWhen(i)===!1)return;h=h&&V.synchronous;const M=i.transitional||f$;M&&M.legacyInterceptorReqResOrdering?f.unshift(V.fulfilled,V.rejected):f.push(V.fulfilled,V.rejected)});const m=[];this.interceptors.response.forEach(function(V){m.push(V.fulfilled,V.rejected)});let E,b=0,A;if(!h){const P=[yU.bind(this),void 0];for(P.unshift(...f),P.push(...m),A=P.length,E=Promise.resolve(i);b<A;)E=E.then(P[b++],P[b++]);return E}A=f.length;let _=i;for(;b<A;){const P=f[b++],V=f[b++];try{_=P(_)}catch(M){V.call(this,M);break}}try{E=yU.call(this,_)}catch(P){return Promise.reject(P)}for(b=0,A=m.length;b<A;)E=E.then(m[b++],m[b++]);return E}getUri(p){p=Of(this.defaults,p);const i=i2e(p.baseURL,p.url,p.allowAbsoluteUrls);return QBe(i,p.params,p.paramsSerializer)}}He.forEach(["delete","get","head","options"],function(p){Ug.prototype[p]=function(i,r){return this.request(Of(r||{},{method:p,url:i,data:(r||{}).data}))}});He.forEach(["post","put","patch"],function(p){function i(r){return function(c,e,f){return this.request(Of(f||{},{method:p,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}Ug.prototype[p]=i(),Ug.prototype[p+"Form"]=i(!0)});const Eg=Ug;class v${constructor(p){if(typeof p!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=c});const r=this;this.promise.then(a=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](a);r._listeners=null}),this.promise.then=a=>{let c;const e=new Promise(f=>{r.subscribe(f),c=f}).then(a);return e.cancel=function(){r.unsubscribe(c)},e},p(function(c,e,f){r.reason||(r.reason=new VE(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(p){if(this.reason){p(this.reason);return}this._listeners?this._listeners.push(p):this._listeners=[p]}unsubscribe(p){if(!this._listeners)return;const i=this._listeners.indexOf(p);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const p=new AbortController,i=r=>{p.abort(r)};return this.subscribe(i),p.signal.unsubscribe=()=>this.unsubscribe(i),p.signal}static source(){let p;return{token:new v$(function(a){p=a}),cancel:p}}}const R1i=v$;function D1i(s){return function(i){return s.apply(null,i)}}function w1i(s){return He.isObject(s)&&s.isAxiosError===!0}const z_={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(z_).forEach(([s,p])=>{z_[p]=s});const C1i=z_;function l2e(s){const p=new Eg(s),i=FBe(Eg.prototype.request,p);return He.extend(i,Eg.prototype,p,{allOwnKeys:!0}),He.extend(i,p,null,{allOwnKeys:!0}),i.create=function(a){return l2e(Of(s,a))},i}const Kn=l2e(m$);Kn.Axios=Eg;Kn.CanceledError=VE;Kn.CancelToken=R1i;Kn.isCancel=e2e;Kn.VERSION=s2e;Kn.toFormData=_1;Kn.AxiosError=ar;Kn.Cancel=Kn.CanceledError;Kn.all=function(p){return Promise.all(p)};Kn.spread=D1i;Kn.isAxiosError=w1i;Kn.mergeConfig=Of;Kn.AxiosHeaders=so;Kn.formToJSON=s=>XBe(He.isHTMLForm(s)?new FormData(s):s);Kn.getAdapter=a2e.getAdapter;Kn.HttpStatusCode=C1i;Kn.default=Kn;const o2e=Kn;class d2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(En.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.method.id}),E=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",_=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.query.id}),P=(e=_==null?void 0:_.value)==null?void 0:e.value,V=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.body.id}),M=(f=V==null?void 0:V.value)==null?void 0:f.value,G=r.find(ne=>{var de,J;return((J=(de=ne.valueOwner)==null?void 0:de.declaration)==null?void 0:J.id)===re.operation[En.HttpRequest].inputs.headers.id}),k=(h=G==null?void 0:G.value)==null?void 0:h.value,K={method:E,url:A};P!==void 0&&P!==""&&(K.params=P),k!==void 0&&k!==""&&(K.headers=k),M!==void 0&&M!==""&&(K.data=M),Y.Logger.log("Axios request config: ",K);const le=await o2e(K);return{value:U.Success,error:null,result:{status:le.status,headers:le.headers,data:le.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:m,result:null}}}})}}class u2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(ao.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.query.id}),E=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[ae.Editor])[0],A=await o2e.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:E},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:U.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:f,result:null}}}})}}class p2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.Validate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)});Y.Logger.log("Inputs for entity validation: ",a);const e=gD(a[1]).safeParse(a[0]);return e.success?{value:U.Success,error:null,result:{data:a[0]}}:{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e.error.errors,result:null}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}const Xa=s=>s.map(p=>{var i,r;return((i=p.value)==null?void 0:i.valueAsType)??((r=p.value)==null?void 0:r.value)});class c2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=GVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class f2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=kVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=jVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class h2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=UVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class m2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY,version:"1.0.0",description:"Entity write-nested-key operation implementation module (immutable, no auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=FVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class T2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY,version:"1.0.0",description:"Entity write-safe-nested-key-recursively operation implementation module (immutable, auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=KVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class v2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(xe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=qVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class E2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=SVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class b2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=ZVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class A2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=HVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class g2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=WVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class I2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(xe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,E,b,A,_;try{const P=((c=(a=r[0])==null?void 0:a.value)==null?void 0:c.parent)||((f=(e=r[0])==null?void 0:e.value)==null?void 0:f.standaloneParent),V=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,M=(b=(E=r[1])==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle;if(!V)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!M)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!P)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if(M.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const G=P.getDataType(null);if(((A=G==null?void 0:G.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let k=!1;return((_=G==null?void 0:G.entity)==null?void 0:_.id)!==(M==null?void 0:M.id)?k=!1:gD(G==null?void 0:G.entity).safeParse(V).success?k=!0:k=!1,{value:U.Success,error:null,result:k}}catch(P){return{value:U.UnhandledError,error:P,result:null}}}})}}class R2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=Xa(r),c=zVe(...a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class D2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=YVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class w2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=JVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class C2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic);if(!r)return;const a=r.get(xe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=QVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}let Us=null;try{Us=require("crypto")}catch{}const WT=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Us&&Us.webcrypto?Us.webcrypto:null,Rp=WT?WT.subtle:null;function sv(s){const p=new ArrayBuffer(s.byteLength);return new Uint8Array(p).set(s),p}function yn(s,p="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(p==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(p==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(p==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(p==="base64url"){const r=i.replace(/-/g,"+").replace(/_/g,"/").replace(/=+$/,"");if(typeof Buffer<"u")return new Uint8Array(Buffer.from(r,"base64"));const a=typeof atob=="function"?atob(r):"",c=new Uint8Array(a.length);for(let e=0;e<a.length;e++)c[e]=a.charCodeAt(e);return c}throw new Error(`Unsupported environment/encoding combo for toBytes(${p})`)}function jo(s,p="utf8"){if(p==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(p==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(p==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(p==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${p})`)}const O2e=s=>yn(s,"base64"),_2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64")},Vh=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64url")},_f=s=>yn(s,"base64url"),V2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"hex")},P2e=s=>yn(s,"hex");function E$(s){if(WT&&WT.getRandomValues){const p=new Uint8Array(s);return WT.getRandomValues(p),p}if(Us&&Us.randomBytes)return new Uint8Array(Us.randomBytes(s));throw new Error("Secure random not available")}function N1(s,p){if(!(s instanceof Uint8Array)||!(p instanceof Uint8Array)||s.length!==p.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^p[r];return i===0}function N2e(s,p,i,r){if((typeof s!="string"||typeof p!="string")&&typeof s!="string"&&typeof p!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=yn(s??"",a),f=yn(p??"",c);return N1(e,f)}async function x2e(s,p){if(Rp){const i=await Rp.digest({name:s},sv(p));return new Uint8Array(i)}if(Us){const i=s.replace("SHA-","sha"),r=Us.createHash(i);return r.update(Buffer.from(p)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function $2e(s,p,i,r){if(typeof p!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=yn(p??"",c),h=await x2e(a,f);return jo(h,e)}async function x1(s,p,i){if(Rp){const r=await Rp.importKey("raw",sv(p),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await Rp.sign("HMAC",r,sv(i));return new Uint8Array(a)}if(Us){const r=`sha${s.split("-")[1]}`,a=Us.createHmac(r,Buffer.from(p));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function L2e(s,p,i,r,a,c){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for key or data; expected strings");const e=String(i??"SHA-256"),f=r??"utf8",h=a??"utf8",m=c??"base64url",E=yn(s??"",f),b=yn(p??"",h),A=await x1(e,E,b);return jo(A,m)}async function $1(s,p,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(Rp){const c=await Rp.importKey("raw",sv(s),"PBKDF2",!1,["deriveBits"]),e=await Rp.deriveBits({name:"PBKDF2",salt:sv(p),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Us){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Us.pbkdf2(Buffer.from(s),Buffer.from(p),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function B2e(s,p,i,r,a,c,e,f){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",E=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),_=a??"SHA-256",P=yn(s??"",h),V=yn(p??"",m),M=await $1(P,V,{iterations:b,length:A,hashAlg:_});return jo(M,E)}async function M2e(s,p=E$(16),i=21e4,r=32,a="SHA-256"){const c=yn(s,"utf8"),e=await $1(c,p,{iterations:i,length:r,hashAlg:a}),f=Vh(p),h=Vh(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function G2e(s,p){const i=String(p).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=_f(i[3]),e=_f(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await $1(yn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return N1(h,e)}async function k2e(s,p,i,r,a,c){const e=p!=null?Math.max(1,Number(p)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",E=a!=null?yn(a,m):void 0;return await M2e(String(s??""),E,e,f,h)}function mU(s){return Vh(yn(JSON.stringify(s),"utf8"))}function Fg(s){try{return JSON.parse(jo(_f(s),"utf8"))}catch{return null}}async function j2e(s,p,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:E={}}={}){const b={alg:i,typ:"JWT",...E},A=Math.floor(Date.now()/1e3),_={...s||{}};r&&(_.iat=A),typeof a=="number"&&(_.exp=A+a),typeof c=="number"&&(_.nbf=A+c),e&&(_.iss=e),f&&(_.sub=f),h&&(_.aud=h),m&&(_.jti=m);const P=mU(b),V=mU(_),M=yn(`${P}.${V}`,"utf8"),k=await x1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,M),K=Vh(k);return`${P}.${V}.${K}`}async function U2e(s,p,i,r,a,c,e,f,h,m,E,b){if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(s!=null&&typeof s!="object")throw new Error("Invalid input type for payload; expected object");if(E!=null&&typeof E!="object")throw new Error("Invalid input type for header; expected object");if(m!=null&&typeof m!="string")throw new Error("Invalid input type for jwtid; expected string");if(e!=null&&typeof e!="string")throw new Error("Invalid input type for issuer; expected string");if(f!=null&&typeof f!="string")throw new Error("Invalid input type for subject; expected string");if(h!=null&&typeof h!="string"&&!Array.isArray(h))throw new Error("Invalid input type for audience; expected string or string[]");const _=yn(p??"",b??"utf8");return await j2e(s??{},_,{alg:i??"HS256",includeIat:r==null?!0:!!r,expiresInSeconds:a!=null?Number(a):void 0,notBeforeSeconds:c!=null?Number(c):void 0,issuer:e??void 0,subject:f??void 0,audience:h??void 0,jwtid:m??void 0,header:E??void 0})}async function F2e(s,p,{alg:i="HS256",issuer:r,audience:a,maxAgeSeconds:c,clockSkewSeconds:e=60}={}){try{const[f,h,m]=String(s).split(".");if(!f||!h||!m)return{valid:!1,header:null,payload:null,reason:"Malformed"};const E=Fg(f),b=Fg(h);if(!E||!b)return{valid:!1,header:E,payload:b,reason:"Bad base64/json"};if(E.alg!==i)return{valid:!1,header:E,payload:b,reason:"Alg mismatch"};const A=yn(`${f}.${h}`,"utf8"),P=await x1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,A),V=_f(m);if(!N1(P,V))return{valid:!1,header:E,payload:b,reason:"Bad signature"};const M=Math.floor(Date.now()/1e3),G=Math.max(0,Number(e)||0);if(b.nbf!=null&&M+G<Number(b.nbf))return{valid:!1,header:E,payload:b,reason:"Not before"};if(b.exp!=null&&M-G>=Number(b.exp))return{valid:!1,header:E,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:E,payload:b,reason:"Issuer mismatch"};if(a){const k=b.aud;if(!(Array.isArray(k)?k.includes(a):k===a))return{valid:!1,header:E,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&M-Number(b.iat)>Number(c)+G?{valid:!1,header:E,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:E,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function K2e(s,p,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(typeof r!="string")throw new Error("Invalid input type for issuer; expected string");if(a!=null&&typeof a!="string")throw new Error("Invalid input type for audience; expected string");const m=yn(p??"",f??"utf8");return await F2e(String(s??""),m,{alg:i??"HS256",issuer:r??void 0,audience:a??void 0,maxAgeSeconds:c!=null?Number(c):void 0,clockSkewSeconds:e!=null?Number(e):void 0})}function q2e(s){const[p,i,r]=String(s).split(".");return{header:p?Fg(p):null,payload:i?Fg(i):null,signature:r?_f(r):new Uint8Array}}function S2e(s,p){if(!s)throw new Error("Token is required for decoding");if(typeof s!="string")throw new Error("Invalid input type for token; expected string");const i=p??"base64url",{header:r,payload:a,signature:c}=q2e(String(s??"")),e=jo(c,i);return{header:r,payload:a,signature:e}}class Z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(tt.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)}),e=Math.max(0,Number(a)||0),f=c??"base64url",h=E$(e),m=jo(h,f);return{value:U.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class H2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=bVe(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class W2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=E1();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Wx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=zx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class J2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=gVe(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Q2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Yx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class X2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=Jx(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class eMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=Ip();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class tMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{Y.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===ae.Logic);if(r){Y.Logger.log("Project state found, setting up operation");const a=r.get(tt.GenerateShortIdentifier);a?(Y.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):Y.Logger.warn("Operation generate-short-identifier not found in project state")}else Y.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=IVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class iMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(tt.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=RVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}function O1i(s){let p;if(s===null?p="null":Array.isArray(s)?p="array":p=typeof s,!["string","number","boolean","null","object","array"].includes(p))throw new TypeError("GetTypeOf cannot determine type of the given value.");return p}class rMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(Qe.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)||((h=e.value)==null?void 0:h.value)})[0];return{value:U.Success,error:null,result:O1i(c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class nMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class aMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=Number(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class sMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=yn(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class lMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=jo(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class oMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:_2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class dMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=O2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class uMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=Vh(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class pMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=_f(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class cMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=V2e(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class fMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Qe.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=P2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class yMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:$2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class hMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:L2e(c,e,a,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class mMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:N2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class TMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(Li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:B2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class vMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(bn.Parse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a;try{const c=(a=r[0].value)==null?void 0:a.value;if(typeof c!="string")throw new Error(`Invalid input type for JSON.parse operation: expected string, got ${typeof c}`);const e=JSON.parse(c);return{value:U.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:c,result:null}}}})}}class EMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===ae.Logic);if(r){const a=r.get(bn.Stringify);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=(a=r[0].value)==null?void 0:a.value,f=(c=r[1].value)==null?void 0:c.value;if(!e||typeof e!="object"&&!Array.isArray(e))throw new Error(`Invalid input type for JSON.stringify operation: expected object or array, got ${typeof e}`);if(!f&&f!==0){const m=JSON.stringify(e);return{value:U.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:U.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e,result:null}}}})}}class bMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b,A,_,P,V]=r.map(M=>{var G,k;return((G=M.value)==null?void 0:G.valueAsType)??((k=M.value)==null?void 0:k.value)});return{value:U.Success,error:null,result:await U2e(a,c,e,f,h,m,E,b,A,_,P,V)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class AMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:await K2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class gMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(hr.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:S2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class IMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(An.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:await k2e(a,c,e,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class RMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:_e.High,permissions:[Ve.All],contexts:[ae.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===ae.Logic),a=r==null?void 0:r.get(An.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=await G2e(String(a??""),String(c??""));return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y_ extends D1{constructor(p,i,r=i.projectId){super(p,ae.Editor),this._editor=i,this.id=r}get ready(){return this._editor.ready}get env(){return this._editor.env}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get lastPublishedProjectState(){return this._editor.lastPublishedProjectState}get branchHead(){return this._editor.branchHead}get branchHeadPromise(){return this._editor.branchHeadPromise}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get livePublishedVersions(){return this._editor.livePublishedVersions}get publications(){return this._editor.publications}get liveResources(){return this._editor.liveResources}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(p){this._editor.undoableStackValueIndex=p}get activeWorkspace(){return this._editor.activeWorkspace}get branches(){return this._editor.branches}get roles(){return this._editor.roles}get READ_ONLY(){return this._editor.READ_ONLY}get isViewingNonHead(){return this._editor.isViewingNonHead}get canEdit(){return this._editor.canEdit}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}getRefreshToken(){return this._editor.getRefreshToken()}removeValueByOwnerId(p){return this._editor.removeValueByOwnerId(p)}removeValue(p){return this._editor.removeValue(p)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(p,i){return this._editor.initTest(p,i)}removeTest(p){return this._editor.removeTest(p)}async copyEntities(p,i={}){return this._editor.copyEntities(p,i)}resolveInitialChildrenPositions(p,i,r){return this._editor.resolveInitialChildrenPositions(p,i,r)}publish(){return this._editor.publish()}loadGivenPublication(p){return this._editor.loadGivenPublication(p)}validateProjectState(p){return this._editor.validateProjectState(p)}requestActiveDynamicValue(p,i=!1){return this._editor.requestActiveDynamicValue(p,i)}getValueTypePreference(p){return this._editor.getValueTypePreference(p)}setValueTypePreference(p,i){return this._editor.setValueTypePreference(p,i)}implementFeature(p){return this._editor.implementFeature(p)}getProjectRoles(){return this._editor.getProjectRoles()}getLastPublishedVersionLogic(p){return this._editor.getLastPublishedVersionLogic(p)}initialLoads(p){return this._editor.initialLoads(p)}moveBranchHeadToVersion(p,i,r){return this._editor.moveBranchHeadToVersion(p,i,r)}loadInitialBranchHead(){return this._editor.loadInitialBranchHead()}}function _1i(s,p){return p instanceof Y_?p:new Y_(s,p)}class J_ extends D1{constructor(p,i){super(p,ae.PublicationRun),this._publicationRun=i}get id(){return this._publicationRun.id}get projectAutoIncrementPublicationCount(){return this._publicationRun.projectAutoIncrementPublicationCount}get projectPublishedSemanticVersion(){return this._publicationRun.projectPublishedSemanticVersion}get envIdentifier(){return this._publicationRun.envIdentifier}get projectVersion(){return this._publicationRun.projectVersion}get projectBranchId(){return this._publicationRun.projectBranchId}get projectId(){return this._publicationRun.projectId}get triggeredBy(){return this._publicationRun.triggeredBy}get createdAt(){return this._publicationRun.createdAt}get updatedAt(){return this._publicationRun.updatedAt}get status(){return this._publicationRun.status}get steps(){return this._publicationRun.steps}get editor(){return this._publicationRun.editor}get explicitResources(){return this._publicationRun.explicitResources}get implicitGlobalResources(){return this._publicationRun.implicitGlobalResources}get finalGlobalEvent(){return this._publicationRun.finalGlobalEvent}get finalStatus(){return this._publicationRun.finalStatus}}function V1i(s,p){return p instanceof J_?p:new J_(s,p)}function P1i(s){s.register(new bPe(s)),s.register(new EPe(s)),s.register(new hPe(s)),s.register(new TPe(s)),s.register(new vPe(s)),s.register(new mPe(s)),s.register(new tBe(s)),s.register(new iBe(s)),s.register(new rBe(s)),s.register(new aBe(s)),s.register(new nBe(s)),s.register(new sBe(s)),s.register(new H2e(s)),s.register(new W2e(s)),s.register(new z2e(s)),s.register(new Y2e(s)),s.register(new J2e(s)),s.register(new Q2e(s)),s.register(new X2e(s)),s.register(new eMe(s)),s.register(new tMe(s)),s.register(new iMe(s)),s.register(new eLe(s)),s.register(new tLe(s)),s.register(new iLe(s)),s.register(new rLe(s)),s.register(new nLe(s)),s.register(new aLe(s)),s.register(new sLe(s)),s.register(new lLe(s)),s.register(new oLe(s)),s.register(new dLe(s)),s.register(new uLe(s)),s.register(new pLe(s)),s.register(new cLe(s)),s.register(new fLe(s)),s.register(new yLe(s)),s.register(new hLe(s)),s.register(new mLe(s)),s.register(new TLe(s)),s.register(new vLe(s)),s.register(new ALe(s)),s.register(new gLe(s)),s.register(new ILe(s)),s.register(new b$e(s)),s.register(new A$e(s)),s.register(new g$e(s)),s.register(new I$e(s)),s.register(new R$e(s)),s.register(new D$e(s)),s.register(new w$e(s)),s.register(new C$e(s)),s.register(new O$e(s)),s.register(new V$e(s)),s.register(new P$e(s)),s.register(new N$e(s)),s.register(new x$e(s)),s.register(new $$e(s)),s.register(new kxe(s)),s.register(new p2e(s)),s.register(new d2e(s)),s.register(new u2e(s)),s.register(new GNe(s)),s.register(new kNe(s)),s.register(new jNe(s)),s.register(new UNe(s)),s.register(new FNe(s)),s.register(new KNe(s)),s.register(new qNe(s)),s.register(new SNe(s)),s.register(new ZNe(s)),s.register(new axe(s)),s.register(new Bxe(s)),s.register(new Mxe(s)),s.register(new Gxe(s)),s.register(new HNe(s)),s.register(new WNe(s)),s.register(new zNe(s)),s.register(new YNe(s)),s.register(new JNe(s)),s.register(new QNe(s)),s.register(new XNe(s)),s.register(new exe(s)),s.register(new txe(s)),s.register(new ixe(s)),s.register(new rxe(s)),s.register(new nxe(s)),s.register(new sxe(s)),s.register(new lxe(s)),s.register(new oxe(s)),s.register(new dxe(s)),s.register(new uxe(s)),s.register(new pxe(s)),s.register(new cxe(s)),s.register(new fxe(s)),s.register(new yxe(s)),s.register(new hxe(s)),s.register(new mxe(s)),s.register(new Txe(s)),s.register(new wxe(s)),s.register(new Cxe(s)),s.register(new Oxe(s)),s.register(new vxe(s)),s.register(new Exe(s)),s.register(new bxe(s)),s.register(new Axe(s)),s.register(new gxe(s)),s.register(new Ixe(s)),s.register(new Rxe(s)),s.register(new Dxe(s)),s.register(new h2e(s)),s.register(new m2e(s)),s.register(new T2e(s)),s.register(new v2e(s)),s.register(new c2e(s)),s.register(new f2e(s)),s.register(new y2e(s)),s.register(new E2e(s)),s.register(new A2e(s)),s.register(new I2e(s)),s.register(new b2e(s)),s.register(new g2e(s)),s.register(new R2e(s)),s.register(new C2e(s)),s.register(new D2e(s)),s.register(new w2e(s)),s.register(new L$e(s)),s.register(new k$e(s)),s.register(new j$e(s)),s.register(new K$e(s)),s.register(new q$e(s)),s.register(new S$e(s)),s.register(new Z$e(s)),s.register(new H$e(s)),s.register(new W$e(s)),s.register(new z$e(s)),s.register(new Y$e(s)),s.register(new U$e(s)),s.register(new F$e(s)),s.register(new M$e(s)),s.register(new G$e(s)),s.register(new B$e(s)),s.register(new _$e(s)),s.register(new Q$e(s)),s.register(new X$e(s)),s.register(new J$e(s)),s.register(new oBe(s)),s.register(new NBe(s)),s.register(new PBe(s)),s.register(new xBe(s)),s.register(new $Be(s)),s.register(new pBe(s)),s.register(new cBe(s)),s.register(new vBe(s)),s.register(new mBe(s)),s.register(new _Be(s)),s.register(new IBe(s)),s.register(new DBe(s)),s.register(new CBe(s)),s.register(new wBe(s)),s.register(new TBe(s)),s.register(new bBe(s)),s.register(new ABe(s)),s.register(new EBe(s)),s.register(new lBe(s)),s.register(new fBe(s)),s.register(new RBe(s)),s.register(new MBe(s)),s.register(new S_(s)),s.register(new uBe(s)),s.register(new yBe(s)),s.register(new dBe(s)),s.register(new OBe(s)),s.register(new hBe(s)),s.register(new gBe(s)),s.register(new VBe(s)),s.register(new BBe(s)),s.register(new LBe(s)),s.register(new GBe(s)),s.register(new S_(s)),s.register(new jBe(s)),s.register(new kBe(s)),s.register(new UBe(s)),s.register(new GLe(s)),s.register(new kLe(s)),s.register(new jLe(s)),s.register(new DLe(s)),s.register(new bLe(s)),s.register(new _Le(s)),s.register(new xLe(s)),s.register(new ELe(s)),s.register(new $Le(s)),s.register(new MLe(s)),s.register(new PLe(s)),s.register(new VLe(s)),s.register(new kg(s)),s.register(new ULe(s)),s.register(new FLe(s)),s.register(new NLe(s)),s.register(new BLe(s)),s.register(new LLe(s)),s.register(new OLe(s)),s.register(new CLe(s)),s.register(new wLe(s)),s.register(new RLe(s)),s.register(new SLe(s)),s.register(new qLe(s)),s.register(new ZLe(s)),s.register(new KLe(s)),s.register(new Nxe(s)),s.register(new _xe(s)),s.register(new Pxe(s)),s.register(new xxe(s)),s.register(new $xe(s)),s.register(new Vxe(s)),s.register(new Lxe(s)),s.register(new rMe(s)),s.register(new dMe(s)),s.register(new pMe(s)),s.register(new fMe(s)),s.register(new oMe(s)),s.register(new uMe(s)),s.register(new cMe(s)),s.register(new lMe(s)),s.register(new sMe(s)),s.register(new aMe(s)),s.register(new nMe(s)),s.register(new vMe(s)),s.register(new EMe(s)),s.register(new mMe(s)),s.register(new TMe(s)),s.register(new Z2e(s)),s.register(new yMe(s)),s.register(new hMe(s)),s.register(new AMe(s)),s.register(new bMe(s)),s.register(new gMe(s)),s.register(new IMe(s)),s.register(new RMe(s)),s.register(new gPe(s)),s.register(new IPe(s)),s.register(new Mg(s)),s.register(new Gg(s))}class b${constructor(p=new Y.Events("extensions-registry-fallback-events")){R(this,"extensionsRegistry",new Map);R(this,"initialized",new Set);R(this,"initializedContexts",new Set);R(this,"onResolveEditorContextCallback",()=>null);R(this,"onResolveProjectLogicContextCallback",()=>null);R(this,"onResolveEditorGUIContextCallback",()=>null);R(this,"onResolveGUIContextCallback",()=>null);R(this,"onResolveCompileContextCallback",()=>null);R(this,"onResolvePublicationRunContextCallback",()=>null);this.events=p,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(p){this.onResolveEditorContextCallback=p}onResolveProjectLogicContext(p){this.onResolveProjectLogicContextCallback=p}onResolveGUIContext(p){this.onResolveGUIContextCallback=p}onResolveEditorGUIContext(p){this.onResolveEditorGUIContextCallback=p}onResolveCompileContext(p){this.onResolveCompileContextCallback=p}onResolvePublicationRunContext(p){this.onResolvePublicationRunContextCallback=p}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((p,i)=>(p.manifest.initPriority||_e.Normal)-(i.manifest.initPriority||_e.Normal))}async setup(){P1i(this),Y.Logger.log("Initializing extensions without context..."),this.initForReady()}requestContext(p){switch(p){case ae.Editor:return this.onResolveEditorContextCallback();case ae.Logic:return this.onResolveProjectLogicContextCallback();case ae.EditorGUI:return this.onResolveEditorGUIContextCallback();case ae.Compile:return this.onResolveCompileContextCallback();case ae.PublicationRun:return this.onResolvePublicationRunContextCallback();case ae.GUI:return this.onResolveGUIContextCallback();case ae.EditorGUI:return this.onResolveEditorGUIContextCallback();default:throw new Error(`Unknown context type: ${p}`)}}requestContexts(p,i=[]){const r=[];i.length===0&&(i=p.manifest.contexts);for(const a of i){const c=this.requestContext(a);c&&r.push(c)}return r}requestExtension(p){const i=this.extensionsRegistry.get(p);if(i)return i;throw new Error(`Unknown extension: ${p}`)}register(p){this.extensionsRegistry.set(p.manifest.id,p)}async initAll(){var p,i;for(const r of this.extensionInOrder)if(r.module.init&&!this.initialized.has(r.manifest.id)){const a=r.manifest.contexts.map(c=>this.requestContext(c)).filter(c=>c!==null);a.length&&(await((i=(p=r.module).init)==null?void 0:i.call(p,a)),this.initialized.add(r.manifest.id))}else!r.module.init&&!this.initialized.has(r.manifest.id)&&this.initialized.add(r.manifest.id)}async initForReady(){Y.Logger.log("Initializing extensions for ready contexts...");for(const p of this.extensionInOrder)if(p.module.init&&!this.initialized.has(p.manifest.id)){Y.Logger.log("Initializing "+p.manifest.id+" extension...");const i=this.requestContexts(p);p.manifest.contexts.every(a=>!!i.find(c=>c.contextType===a))?(await p.module.init(i),this.initialized.add(p.manifest.id)):Y.Logger.warn(`Skipping initialization of ${p.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${p.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(a=>a.contextType).join(", ")}`)}else!p.module.init&&!this.initialized.has(p.manifest.id)?(Y.Logger.log("Set "+p.manifest.id+" extension as initialized by default..."),this.initialized.add(p.manifest.id)):Y.Logger.log(`Skipping initialization of ${p.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const p of[...this.extensionInOrder].reverse())p.module.destroy&&await p.module.destroy();this.events.destroy()}on(p,i){this.events.on(p,i)}emit(p,...i){this.events.emit(p,...i)}off(p,i){this.events.off(p,i)}emitAsync(p,...i){return this.events.emitAsync(p,...i)}emitAsyncAll(p,...i){return this.events.emitAsyncAll(p,...i)}emitAsyncAllSettled(p,...i){return this.events.emitAsyncAllSettled(p,...i)}emitAsyncSequentially(p,...i){return this.events.emitAsyncSequentially(p,...i)}emitAsyncSequentiallyAll(p,...i){return this.events.emitAsyncSequentiallyAll(p,...i)}emitAsyncSequentiallyAllSettled(p,...i){return this.events.emitAsyncSequentiallyAllSettled(p,...i)}async contextAvailable(p){if(this.initializedContexts.has(p)){Y.Logger.warn(`Context ${p} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(p),p){case ae.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case ae.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Y.Logger.log(`Context ${p} is now available. Initializing extensions for this context...`),await this.initForReady()}getValueTypePreference(p){return window.localStorage.getItem("dynamic-value-type-preference--"+p)||null}setValueTypePreference(p,i){window.localStorage.setItem("dynamic-value-type-preference--"+p,(i==null?void 0:i.toString())||""),this.emit(p,{})}}let og=null;const A$={requestExtension:s=>(og||(og=new b$,og.setup()),og.requestExtension(s))};function op(s){return!(s instanceof Error)&&typeof s=="object"&&s!==null?s:s instanceof Error?{name:s.name,message:s.message,stack:s.stack,...s}:s}function TU(s){var p,i,r;if(s&&typeof s=="object"&&"value"in s){const a=s;return{single:((p=a.value)==null?void 0:p.valueAsTypeSingle)??((i=a.value)==null?void 0:i.value),list:((r=a.value)==null?void 0:r.valueAsTypeList)??null}}return{single:s,list:Array.isArray(s)?s:null}}const dp={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};class Q_ extends Error{constructor(){super("Execution was stopped"),this.name="ExecutionStoppedError"}}var g$=(s=>(s.FinishedSuccess="finished-success",s.FinishedError="finished-error",s.Running="running",s.Paused="paused",s.Stopped="stopped",s.NotStarted="not-started",s))(g$||{});const DMe={...A$,getValueTypePreference:()=>null,setValueTypePreference:()=>{}};class yh extends Y.Events{constructor(i,r,a,c=null,e=DMe){super();R(this,"project");R(this,"entryPoint");R(this,"state","not-started");R(this,"events",new Y.Events("fe-exec-inst-events"));R(this,"entities",[]);R(this,"parentExecution",null);R(this,"executing",[]);R(this,"executed",[]);R(this,"skipped",[]);R(this,"scheduled",[]);R(this,"localTestValues");R(this,"resolvedValues");R(this,"persistedExecutionResults");R(this,"lastExecutionResults");R(this,"onAddToSkippedListCallback",null);R(this,"onRemoveFromSkippedListCallback",null);R(this,"onAddEntityCallback",null);R(this,"onRemoveEntityCallback",null);R(this,"onAbortExecutionCallback",null);this.parentContext=e,this.entities=r,this.entryPoint=a,this.project=i,this.parentExecution=c,this.localTestValues=new BT(x.UUID.uuid(),this.project),this.resolvedValues=new BT(x.UUID.uuid(),this.project),this.persistedExecutionResults=new BT(x.UUID.uuid(),this.project),this.lastExecutionResults=new BT(x.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults,getValueTypePreference:this.parentContext.getValueTypePreference,setValueTypePreference:this.parentContext.setValueTypePreference}}get rootExecution(){let i=this;for(;i.parentExecution;)i=i.parentExecution;return i}get rootState(){return this.rootExecution.state}isStopped(){return this.state==="stopped"||this.rootExecution.state==="stopped"}isPaused(){return this.state==="paused"||this.rootExecution.state==="paused"}async checkStateAndPause(){if(this.isStopped())throw new Q_;for(;this.isPaused();){if(this.isStopped())throw new Q_;await new Promise(i=>setTimeout(i,100))}}skip(i){this.hasEntity(i)&&(this.removeFromScheduledList(i),!this.skipped.includes(i)&&(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),tr.includes(i.type)&&ft(i).forEach(r=>this.skip(r))))}async schedule(i,r,a){if(this.hasExecuted(i))return null;if(Ft.includes(i.type))return this.executeBranch(i,a,r);if(sr.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,a,r);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,r){const a=[];return[..._t,...Ft].includes(r.type)?a.push(...r.inputs):Dt.includes(r.type)&&a.push(...r.outputs),a.map(e=>{var h;let f=i.find(m=>m.valueOwner.id===e.id);if(f)return f;if(!f&&Ft.includes(r.type)&&(f=i.find(m=>{var E;return((E=m.valueOwner.declaration)==null?void 0:E.id)===e.id})),f){const m=(h=f.value)==null?void 0:h.clone(null);return m==null||m.setStandaloneParent(e,null),{...f,valueOwner:e,value:m||null,inheritanceLink:{sources:[f],target:e}}}return Qr.includes(e.type)?to(e,this.valueResolutionContext):iu(e,this.valueResolutionContext)}).reduce((e,f)=>{const h=ud(f==null?void 0:f.valueOwner,this.project),m=f?[f]:[];return h.forEach(E=>{var _,P,V;if(E.id===(f==null?void 0:f.valueOwner.id))return;const b=Ht(E.getDataType(null),E,this.project);b==null||b.metaSync({value:(_=f==null?void 0:f.value)==null?void 0:_.value},null),b==null||b.setValueAsTypeList(((P=f==null?void 0:f.value)==null?void 0:P.valueAsTypeList)||null),b==null||b.setValueAsTypeSingle(((V=f==null?void 0:f.value)==null?void 0:V.valueAsTypeSingle)||null);const A={...f,valueOwner:E,value:b};m.push(A)}),[...e,...m]},[]).sort((e,f)=>e.valueOwner.index-f.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,r,a,c={}){var f,h;this.logBeforeExecution("executeInternalCall",i,r);const e={...dp,...c};try{let m={value:U.Success,error:null,result:null};if(r.sort((V,M)=>V.valueOwner.index-M.valueOwner.index),Object.values(Gr).includes(i.declaration.id)){const V=this.parentContext.requestExtension(fh+i.declaration.id).module.main;V?m=await V(i,r,this):Y.Logger.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{const V=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);m={value:V.value,error:V.error,result:V.result}}let E=null;if(m.error&&i.error){Y.Logger.warn("Raw error executing entity: ",m.error);const{single:V,list:M}=TU(m.error),G=op(V),k=(f=i.error)==null?void 0:f.getDataType(null),K=Ht(k||null,i.error,a);if(k!=null&&k.asType)M!==null?K==null||K.setValueAsTypeList(M):K==null||K.setValueAsTypeSingle(V);else{const le=vr(G)?JSON.stringify(G,null,2):G;K==null||K.metaSync({value:le},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:K}}const b=i==null?void 0:i.getDataType(null),A=Ht(b,i,a),{single:_,list:P}=TU(m.result);return b!=null&&b.asType?P!==null?A==null||A.setValueAsTypeList(P):A==null||A.setValueAsTypeSingle(_):A==null||A.metaSync({value:_},null),{value:m.value,entity:i,error:E,result:{value:A||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(m){if(m&&(m.name==="ExecutionStoppedError"||m.message==="Execution was stopped"))throw m;Y.Logger.warn("Internal call execution error: ",m);let E=null;if(i.error){const b=op(m),A=(h=i.error)==null?void 0:h.getDataType(null),_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(m);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:E,result:null}}}static async executeOperation(i,r,a,c){var e,f;c?c.logBeforeExecution("executeOperation",i,r):console.log(`executeOperation (${i.type}) -> [${pe(i,a)}] Inputs:${r.length?`
55
55
  `:""}${r.map(h=>{var m,E,b;return`${(m=h.valueOwner)==null?void 0:m.type} (${(E=h.valueOwner)==null?void 0:E.id}) "${pe(h.valueOwner,a)}": ${JSON.stringify((b=h.value)==null?void 0:b.value,null,2)}`}).join(`
56
56
  `)}
57
57
  `);try{let h={value:U.Success,error:null,result:null};r.sort((A,_)=>A.valueOwner.index-_.valueOwner.index),i.declaration.implementation&&(h=await i.declaration.implementation(i,r.sort((A,_)=>A.valueOwner.index-_.valueOwner.index)));let m=null;if(h.error&&i.error){const A=op(h.error),_=((e=i.error)==null?void 0:e.getDataType(null))||null,P=Ht(_,i.error,a);if(_!=null&&_.asType)P==null||P.setValueAsTypeSingle(h.error);else{const V=vr(A)?JSON.stringify(A,null,2):A;P==null||P.metaSync({value:V},null)}m={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:P}}const E=i==null?void 0:i.getDataType(null),b=Ht(E,i,a);return E!=null&&E.asType?b==null||b.setValueAsTypeSingle(h.result):b==null||b.metaSync({value:h.result},null),{value:h.value,entity:i,error:m,result:{value:b||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(h){if(h&&(h.name==="ExecutionStoppedError"||h.message==="Execution was stopped"))throw h;console.warn("Operation execution error: ",h);let m=null;if(i.error){const E=op(h),b=(f=i.error)==null?void 0:f.getDataType(null),A=Ht(b,i.error,a);if(b!=null&&b.asType)A==null||A.setValueAsTypeSingle(h);else{const _=vr(E)?JSON.stringify(E,null,2):E;A==null||A.metaSync({value:_},null)}m={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:A}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:m,result:null}}}async executeSearch(i,r,a){var c;this.logBeforeExecution("executeSearch",i,r);try{let e={value:U.Success,error:null,result:null};const f=await(await this.parentContext.requestExtension(Pe.SEARCH_NODE_IMPLEMENTATION)).module.main(i,r),h=i==null?void 0:i.getDataType(null),m=Ht(h,i,a);return m==null||m.metaSync({value:f},null),f.error?{value:U.UnhandledError,entity:i,error:{valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}:{value:e.value,entity:i,error:null,result:{value:m,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(e){if(e&&(e.name==="ExecutionStoppedError"||e.message==="Execution was stopped"))throw e;if(Y.Logger.warn(`Search node execution error: ${e}`),!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const f=op(e),h=(c=i.error)==null?void 0:c.getDataType(null),m=Ht(h,i.error,a),E=vr(f)?JSON.stringify(f,null,2):f;return m==null||m.metaSync({value:E},null),{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}}}async executeLoop(i,r,a,c={}){var f,h,m,E,b,A;this.logBeforeExecution("executeLoop",i,r);const e={...dp,...c};try{let _={value:U.Success,error:null,result:null};const P=r.map(ne=>{var de,J;return((de=ne==null?void 0:ne.value)==null?void 0:de.valueAsType)||((J=ne==null?void 0:ne.value)==null?void 0:J.value)});let V={};i.getUniqueInputMaps().forEach(ne=>{const de=i.body.inputs.find(X=>pe(X,a)===pe(ne,a)),J=ne==null?void 0:ne.getDataType(null),te=Ht(J,de,a);J!=null&&J.asType?te==null||te.setValueAsTypeList([]):te==null||te.metaSync({value:[]},null),this.lastExecutionResults.writeValue(de,te);const oe={value:te,valueOwner:de,type:ke.ExecutionResult,inheritanceLink:null};V[de.id]=oe});let G={value:U.Success,entity:i.body,error:null,result:null};switch(i.declaration.id){case re.loop["counted-loop"].id:{const ne=P[0];let de=1;for(;de<=ne&&de<=50;){await this.checkStateAndPause();const J=i.body.inputs.map(te=>{if(te===i.currentIterationNumberArgumentDeclaration){const oe=i.currentIterationNumberArgumentDeclaration.getDataType(null),X=Jd(oe),z=this.lastExecutionResults.readValue(te.id);if(z){z.metaSync({value:de},null),this.lastExecutionResults.writeValue(te,z);const he={value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[te.id]=he,he}const se={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:X,standaloneParent:te.toReference()},ye=lr(se,a);this.lastExecutionResults.writeValue(te,ye);const ce={value:ye,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[te.id]=ce,ce}else return V[te.id]}).filter(te=>!!te);if(G=await this.executeFullFunctionDeclarationLogic(i.body,J,e),(G.results||[]).forEach(te=>{var se,ye,ce,he;if(te.valueOwner.type!==d.InputMap||Dt.includes(te.valueOwner.parent.type))return;const oe=i.body.inputs.find(Ae=>pe(Ae,a)===pe(te.valueOwner,a)),z=[...((ye=(se=V==null?void 0:V[oe.id])==null?void 0:se.value)==null?void 0:ye.value)||[],((ce=te==null?void 0:te.value)==null?void 0:ce.value)||null];(he=V[oe.id].value)==null||he.metaSync({value:z},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;de++}break}case re.loop["manual-flow-loop"].id:{let ne=1;for(;ne<=50;){await this.checkStateAndPause();const de=i.body.inputs.map(J=>{if(J===i.currentIterationNumberArgumentDeclaration){const te=this.lastExecutionResults.readValue(J.id);if(te){te.metaSync({value:ne},null),this.lastExecutionResults.writeValue(J,te);const se={value:te,valueOwner:J,type:ke.ExecutionResult,inheritanceLink:null};return V[J.id]=se,se}const oe=i.currentIterationNumberArgumentDeclaration.getDataType(null),X=Ht(oe,J,a);return X==null||X.metaSync({value:ne},null),this.lastExecutionResults.writeValue(J,X),{value:X,valueOwner:J,type:ke.ExecutionResult,inheritanceLink:null}}else return V[J.id]}).filter(J=>!!J);if(G=await this.executeFullFunctionDeclarationLogic(i.body,de,e),(G.results||[]).forEach(J=>{var z,se,ye;if(J.valueOwner.type!==d.InputMap||Dt.includes(J.valueOwner.parent.type))return;const te=i.body.inputs.find(ce=>pe(ce,a)===pe(J.valueOwner,a)),X=[...(z=V[te.id].value)==null?void 0:z.value,((se=J.value)==null?void 0:se.value)||null];(ye=V[te.id].value)==null||ye.metaSync({value:X},null),this.lastExecutionResults.writeValue(te,V[te.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ne++}break}case re.loop["list-loop"].id:{const ne=P[0];let de=1;const J=ne;for(let te=0;te<J.length;te++){await this.checkStateAndPause();const oe=J[te],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const se=this.lastExecutionResults.readValue(z.id);if(se)return se.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,se),{value:se,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=Ht(ye,z,a);return ce==null||ce.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const se=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(se),ce=this.lastExecutionResults.readValue(z.id);if(ce)return ce.metaSync({value:oe},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:oe,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,X,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const se=i.body.inputs.find(Oe=>pe(Oe,a)===pe(z.valueOwner,a)),ce=[...(he=V[se.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[se.id].value)==null||Re.metaSync({value:ce},null),this.lastExecutionResults.writeValue(se,V[se.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;de++}break}case re.loop["object-keys-loop"].id:{const ne=P[0];let de=1;const J=ne?Object.keys(ne):[];for(let te=0;te<J.length;te++){await this.checkStateAndPause();const oe=J[te],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const se=this.lastExecutionResults.readValue(z.id);if(se)return se.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,se),{value:se,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=Ht(ye,z,a);return ce==null||ce.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const se=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(se),ce=this.lastExecutionResults.readValue(z.id);if(ce)return ce.metaSync({value:oe},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:oe,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,X,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const se=i.body.inputs.find(Oe=>pe(Oe,a)===pe(z.valueOwner,a)),ce=[...(he=V[se.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[se.id].value)==null||Re.metaSync({value:ce},null),this.lastExecutionResults.writeValue(se,V[se.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;de++}break}case re.loop["object-values-loop"].id:{const ne=P[0];let de=1;const J=ne?Object.values(ne):[];for(let te=0;te<J.length;te++){await this.checkStateAndPause();const oe=J[te],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const se=this.lastExecutionResults.readValue(z.id);if(se)return se.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,se),{value:se,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=Ht(ye,z,a);return ce==null||ce.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const se=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(se),ce=this.lastExecutionResults.readValue(z.id);if(ce)return ce.metaSync({value:oe},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:oe,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,X,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const se=i.body.inputs.find(Oe=>pe(Oe,a)===pe(z.valueOwner,a)),ce=[...(he=V[se.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[se.id].value)==null||Re.metaSync({value:ce},null),this.lastExecutionResults.writeValue(se,V[se.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;de++}break}case re.loop["string-loop"].id:{const ne=P[0];let de=1;const J=ne.split("");for(let te=0;te<J.length;te++){await this.checkStateAndPause();const oe=J[te],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const se=this.lastExecutionResults.readValue(z.id);if(se)return se.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,se),{value:se,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=Ht(ye,z,a);return ce==null||ce.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const se=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(se),ce=this.lastExecutionResults.readValue(z.id);if(ce)return ce.metaSync({value:oe},null),this.lastExecutionResults.writeValue(z,ce),{value:ce,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:oe,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,X,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const se=i.body.inputs.find(Oe=>pe(Oe,a)===pe(z.valueOwner,a)),ce=[...(he=V[se.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[se.id].value)==null||Re.metaSync({value:ce},null),this.lastExecutionResults.writeValue(se,V[se.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;de++}break}}let k=U.Success;if(G.value===U.UnhandledError?i.catchesError||i.errorCalls.length?k=U.CaughtError:k=U.UnhandledError:[U.CaughtError,U.Return].includes(G.value)&&(k=G.value),_={value:k,error:((h=(f=G.error)==null?void 0:f.value)==null?void 0:h.value)||null,result:((E=(m=G==null?void 0:G.result)==null?void 0:m.value)==null?void 0:E.value)||null},_.value===U.UnhandledError||_.value===U.CaughtError){let ne=null;if(i.error){const de=op(_.error),J=(b=i.error)==null?void 0:b.getDataType(null),te=Ht(J||null,i.error,a);if(J!=null&&J.asType)te==null||te.setValueAsTypeSingle(_.error);else{const oe=vr(de)?JSON.stringify(de,null,2):de;te==null||te.metaSync({value:oe},null)}ne={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:te}}return{value:_.value,entity:i,error:ne,result:null}}const K=i==null?void 0:i.getDataType(null),le=Ht(K,i,a);return K!=null&&K.asType?le==null||le.setValueAsTypeSingle(_.result):le==null||le.metaSync({value:_.result},null),{value:_.value,entity:i,error:null,result:{value:le||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(_){if(_&&(_.name==="ExecutionStoppedError"||_.message==="Execution was stopped"))throw _;if(Y.Logger.warn("Error executing loop: ",_),i.error){const P=op(_),V=(A=i.error)==null?void 0:A.getDataType(null),M=Ht(V,i.error,a);if(V!=null&&V.asType)M==null||M.setValueAsTypeSingle(_);else{const G=vr(P)?JSON.stringify(P,null,2):P;M==null||M.metaSync({value:G},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:M},result:null}}else return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null}}}async executeFunctionCall(i,r,a,c={}){var f,h,m,E,b,A,_,P,V,M,G,k,K,le,ne,de,J,te,oe,X,z,se,ye,ce,he,Ae;const e={...dp,...c};try{this.logBeforeExecution("executeFunctionCall",i,r);const Re=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);let Oe=null;if(Re.error&&i.error){Y.Logger.warn("Raw error executing entity: ",Re.error);const Ke=(f=i.error)==null?void 0:f.getDataType(null),Xe=Ht(Ke||null,i.error,a);Ke!=null&&Ke.asType?(m=(h=Re.error)==null?void 0:h.value)!=null&&m.valueAsTypeSingle?Xe==null||Xe.setValueAsTypeSingle((b=(E=Re.error)==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle):(_=(A=Re.error)==null?void 0:A.value)!=null&&_.valueAsTypeList&&Array.isArray((V=(P=Re.error)==null?void 0:P.value)==null?void 0:V.valueAsTypeList)&&(Xe==null||Xe.setValueAsTypeList((G=(M=Re.error)==null?void 0:M.value)==null?void 0:G.valueAsTypeList)):Xe==null||Xe.metaSync({value:(K=(k=Re.error)==null?void 0:k.value)==null?void 0:K.value},null),Oe={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Xe}}let Be=U.Success;Re.value===U.UnhandledError&&(i.catchesError||i.errorCalls.length?Be=U.CaughtError:Be=U.UnhandledError);const Ge=i==null?void 0:i.getDataType(null),Se=Ht(Ge,i,a);return Ge!=null&&Ge.asType?(ne=(le=Re.result)==null?void 0:le.value)!=null&&ne.valueAsTypeSingle?Se==null||Se.setValueAsTypeSingle((J=(de=Re.result)==null?void 0:de.value)==null?void 0:J.valueAsTypeSingle):(oe=(te=Re.result)==null?void 0:te.value)!=null&&oe.valueAsTypeList&&Array.isArray((z=(X=Re.result)==null?void 0:X.value)==null?void 0:z.valueAsTypeList)&&(Se==null||Se.setValueAsTypeList((ye=(se=Re.result)==null?void 0:se.value)==null?void 0:ye.valueAsTypeList)):Se==null||Se.metaSync({value:((he=(ce=Re.result)==null?void 0:ce.value)==null?void 0:he.value)||null},null),{value:Be,entity:i,error:Oe,result:{value:Se||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(Re){if(Re&&(Re.name==="ExecutionStoppedError"||Re.message==="Execution was stopped"))throw Re;if(!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const Oe=op(Re),Be=(Ae=i.error)==null?void 0:Ae.getDataType(null),Ge=Ht(Be,i.error,a);if(Be!=null&&Be.asType)Ge==null||Ge.setValueAsTypeSingle(Re);else{const Se=vr(Oe)?JSON.stringify(Oe,null,2):Oe;Ge==null||Ge.metaSync({value:Se},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Ge},result:null}}}async executeCondition(i,r){var c,e,f,h;this.logBeforeExecution("executeCondition",i,r);let a=!1;switch(i.declaration.id){case gn.BooleanIsTrue:{const m=(e=(c=r[0])==null?void 0:c.value)==null?void 0:e.value;if(typeof m!="boolean")throw new TypeError("BooleanIsTrue expects a boolean input.");a=m===!0;break}case gn.BooleanIsFalse:{const m=(h=(f=r[0])==null?void 0:f.value)==null?void 0:h.value;if(typeof m!="boolean")throw new TypeError("BooleanIsFalse expects a boolean input.");a=m===!1;break}case Vr.And:{a=(await Promise.all(i.andChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).every(E=>E);break}case Vr.Or:{a=(await Promise.all(i.orChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).some(E=>E);break}default:throw new Error(`Condition declaration ${i.declaration.name} does not have an implementation.`)}return{value:a?U.Success:U.ConditionNotMet,entity:i,error:null,result:null}}async executeDetachedFullFunctionDeclarationLogic(i,r,a,c={}){this.logBeforeExecution("executeDetachedFullFunctionDeclarationLogic",i,r);const e={...dp,...c,onBeforeEntityExecution:(m,E,b)=>{var A;return((A=c==null?void 0:c.onBeforeEntityExecution)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()},onEntityExecuted:(m,E,b)=>{var A;return((A=c==null?void 0:c.onEntityExecuted)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()}},f=new yh(a,[i,...aI(i)],i,this,this.parentContext);return f.inheritValuesFromContext(this),await f.execute(e,r)}async executeFullFunctionDeclarationLogic(i,r,a={}){this.logBeforeExecution("executeFullFunctionDeclarationLogic",i,r);const c={...dp,...a},e=aI(i),f=[];e.forEach(E=>{if(E.type===d.VariableDeclaration||E.type===d.VariableInstance){const b=E;b.internalCalls&&f.push(...b.internalCalls)}}),e.push(...f),console.log(`[executeFullFunctionDeclarationLogic] Reseting children for: ${pe(i,this.project)}
package/dist/index.js CHANGED
@@ -120689,24 +120689,21 @@ class qvi extends Pe {
120689
120689
  var oe, J;
120690
120690
  return ((J = (oe = re.valueOwner) == null ? void 0 : oe.declaration) == null ? void 0 : J.id) === ie.operation[wn.HttpRequest].inputs.query.id;
120691
120691
  }
120692
- ), N = ((e = _ == null ? void 0 : _.value) == null ? void 0 : e.value) || "", V = r.find(
120692
+ ), N = (e = _ == null ? void 0 : _.value) == null ? void 0 : e.value, V = r.find(
120693
120693
  (re) => {
120694
120694
  var oe, J;
120695
120695
  return ((J = (oe = re.valueOwner) == null ? void 0 : oe.declaration) == null ? void 0 : J.id) === ie.operation[wn.HttpRequest].inputs.body.id;
120696
120696
  }
120697
- ), B = ((f = V == null ? void 0 : V.value) == null ? void 0 : f.value) || "", M = r.find(
120697
+ ), B = (f = V == null ? void 0 : V.value) == null ? void 0 : f.value, M = r.find(
120698
120698
  (re) => {
120699
120699
  var oe, J;
120700
120700
  return ((J = (oe = re.valueOwner) == null ? void 0 : oe.declaration) == null ? void 0 : J.id) === ie.operation[wn.HttpRequest].inputs.headers.id;
120701
120701
  }
120702
- ), U = ((h = M == null ? void 0 : M.value) == null ? void 0 : h.value) || "", K = {
120702
+ ), U = (h = M == null ? void 0 : M.value) == null ? void 0 : h.value, K = {
120703
120703
  method: b,
120704
- url: A,
120705
- params: N,
120706
- headers: U,
120707
- data: B
120704
+ url: A
120708
120705
  };
120709
- ce.log("Axios request config: ", K);
120706
+ N !== void 0 && N !== "" && (K.params = N), U !== void 0 && U !== "" && (K.headers = U), B !== void 0 && B !== "" && (K.data = B), ce.log("Axios request config: ", K);
120710
120707
  const se = await E3(K);
120711
120708
  return {
120712
120709
  value: j.Success,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6978",
3
+ "version": "0.0.6979",
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",