{"version":3,"sources":["datex_short.ts"],"sourcesContent":["\n// shortcut functions\n// import { Datex } from \"./datex.ts\";\nimport { baseURL, Runtime, PrecompiledDXB, Type, Pointer, ReactiveValue, PointerProperty, primitive, Target, IdEndpoint, Markdown, MinimalJSRef, RefOrValue, datex_meta, ObjectWithDatexValues, Compiler, endpoint_by_endpoint_name, endpoint_name, Storage, compiler_scope, datex_scope, DatexResponse, target_clause, ValueError, Class, getDefaultLocalMeta, Endpoint, INSERT_MARK, SmartTransformFunction, activePlugins, PointerPropertyParent, RefLike, CollapsedValue } from \"./datex_all.ts\";\n\n/** make decorators global */\nimport { assert as _assert, timeout as _timeout, entrypoint as _entrypoint, ref as _ref, entrypointProperty as _entrypointProperty, property as _property, struct as _struct, endpoint as _endpoint, sync as _sync, allow as _allow} from \"./datex_all.ts\";\nimport { effect as _effect, always as _always, reactiveFn as _reactiveFn, asyncAlways as _asyncAlways, toggle as _toggle, filter as _filter, map as _map, equals as _equals, selectProperty as _selectProperty, not as _not } from \"./functions.ts\";\nexport * from \"./functions.ts\";\nimport { NOT_EXISTING, DX_SLOTS, SLOT_GET, SLOT_SET } from \"./runtime/constants.ts\";\nimport { AssertionError } from \"./types/errors.ts\";\nimport { getCallerFile, getCallerInfo, getMeta } from \"./utils/caller_metadata.ts\";\nimport { eternals, getLazyEternal, waitingEternals, waitingLazyEternals } from \"./utils/eternals.ts\";\n\nimport {instance} from \"./js_adapter/js_class_adapter.ts\";\nimport { communicationHub } from \"./network/communication-hub.ts\";\nimport { MessageLogger } from \"./utils/message_logger.ts\";\nexport {instance} from \"./js_adapter/js_class_adapter.ts\";\n\ndeclare global {\n\tconst property: typeof _property;\n    const ref: typeof _ref;\n    const assert: typeof _assert;\n    const allow: typeof _allow;\n\n\n\tconst struct: typeof _struct;\n\tconst endpoint: typeof _endpoint;\n    const entrypoint: typeof _entrypoint;\n    const entrypointProperty: typeof _entrypointProperty;\n    const timeout: typeof _timeout;\n    const always: typeof _always;\n    \n    const sync: typeof _sync;\n    const asyncAlways: typeof _asyncAlways;\n    const reactiveFn: typeof _reactiveFn;\n    const toggle: typeof _toggle;\n    const map: typeof _map;\n    const filter: typeof _filter;\n    const equals: typeof _equals;\n    const selectProperty: typeof _selectProperty;\n    const not: typeof _not;\n    const effect: typeof _effect;\n    const observe: typeof ReactiveValue.observe\n    const observeAndInit: typeof ReactiveValue.observeAndInit\n    const unobserve: typeof ReactiveValue.unobserve\n    /**\n     * Prevents any values accessed within the callback function from\n     * being captured by a transform function (e.g. always)\n     */\n    const isolate: typeof ReactiveValue.disableCapturing\n\n    /**\n     * The local endpoint of the current runtime (alias for Datex.Runtime.endpoint)\n     */\n    const localEndpoint: Endpoint\n\n    // conflict with UIX.template (confusing)\n\t// const template: typeof _template; \n}\n\n// @ts-ignore global\nglobalThis.property = _property;\n// @ts-ignore global\nglobalThis.ref = _ref;\n// @ts-ignore global\nglobalThis.assert = _assert;\n// @ts-ignore global\nglobalThis.allow = _allow;\n\n// @ts-ignore global\nglobalThis.struct = _struct;\n// @ts-ignore global\nglobalThis.endpoint = _endpoint;\n// @ts-ignore global\nglobalThis.entrypoint = _entrypoint;\n// @ts-ignore global\nglobalThis.entrypointProperty = _entrypointProperty;\n// @ts-ignore global\nglobalThis.timeout = _timeout;\n// @ts-ignore global\nglobalThis.sync = _sync;\n\n\n// can be used instead of import(), calls a DATEX get instruction, works for urls, endpoint, ...\nexport async function get<T=unknown>(dx:string|URL|Endpoint, assert_type?:Type<T> | Class<T> | string, context_location?:URL|string, plugins?:string[]):Promise<T> {\n    // auto retrieve location from stack\n    context_location ??= getCallerFile();\n    // TODO:just a workaournd, how to do this better\n    //  if context location is index.html (no 'x.y' file extension) -> set to root url\n    if (!context_location.toString().match(/\\/[^\\/]*\\.[^\\/]*$/) && (context_location.toString().startsWith(\"http://\") || context_location.toString().startsWith(\"https://\"))) context_location = new URL(context_location).origin + \"/\"\n    // workaround -> convert absolute path to url/relative (TODO: handle in DATEX?)\n    if (typeof dx == \"string\" && dx.startsWith(\"/\")) {\n        if (globalThis.location?.origin) dx = globalThis.location.origin + dx;\n        else dx = \".\" + dx;\n    }\n\n    // TODO: activePlugins only workaround\n    if (plugins) {\n        activePlugins.push(...plugins);\n        // TODO: only workaround, delete url cache for dx file, make sure content is fetched again with active plugins (only works if dx is an url)\n        Runtime.deleteURLCache(dx.toString())\n    }\n\n    // escape relative paths\n    if (typeof dx == \"string\" && (dx.startsWith('./') || dx.startsWith('../'))) {\n        dx = new URL(dx, context_location).toString();\n    }\n\n    // escape urls\n    if (dx.toString().startsWith('http://') || dx.toString().startsWith('https://') || dx.toString().startsWith('file://') || dx.toString().startsWith('blob:http://') || dx.toString().startsWith('blob:https://')) dx = `url \"${dx}\"`;\n\n    const res = <T> await _datex('get (' + dx + ' )', undefined, undefined, undefined, undefined, context_location, plugins);\n    if (plugins) activePlugins.splice(0, activePlugins.length);\n\n    if (typeof assert_type == \"string\") assert_type = Type.get(assert_type);\n\n    if (assert_type instanceof Type) {\n        if (!assert_type.matches(res)) throw new AssertionError(\"Invalid type in datex.get: Expected \"+assert_type+\", found \"+Type.ofValue(res)+\"\")\n    }\n    else if (assert_type) {\n        if (!(res instanceof assert_type)) throw new AssertionError(\"Invalid type in datex.get: Expected instance of \"+assert_type.name+\", found \"+Type.ofValue(res)+\"\")\n    }\n\n    return res;\n}\n\n\n/***** execute DATEX */\n// default endpoint: DatexRuntime.endpoint\n// sign per default if not local endpoint\n// do not encrypt per default\nfunction _datex<T=unknown>(dx:TemplateStringsArray, ...args:any[]):Promise<T>\nfunction _datex<T=unknown>(dx:string|PrecompiledDXB, data?:unknown[], to?:Target|target_clause|endpoint_name, sign?:boolean, encrypt?:boolean, context_location?:URL|string, plugins?:string[], timeout?: number):Promise<T>\nfunction _datex(dx:string|TemplateStringsArray|PrecompiledDXB, data?:unknown[], to?:Target|target_clause|endpoint_name, sign?:boolean, encrypt?:boolean, context_location?:URL|string, plugins?:string[], timeout?: number) {\n\n    // auto retrieve location from stack\n    if (!context_location) {\n        context_location = getCallerFile();\n    }\n\n    // template string (datex `...`)\n    if (dx instanceof Array && !(dx instanceof PrecompiledDXB)) {\n        dx = dx.raw.join(INSERT_MARK);\n        data = Array.from(arguments);\n        data.splice(0,1);\n        // arguments have no meaning when using template string, set to default\n        to = Runtime.endpoint;\n        sign = false;\n        encrypt = false;\n        context_location = undefined;\n    }\n\n    else {\n        // default arg values\n        data ??= [];\n        to ??= Runtime.endpoint;\n        sign ??= to!=Runtime.endpoint;\n        encrypt ??= false;\n    }\n\n    // local execution\n    if (to === Runtime.endpoint) return Runtime.executeDatexLocally(dx, data, {plugins, sign, encrypt}, context_location ? new URL(context_location.toString()) : undefined); \n    // remote execution\n    else return Runtime.datexOut([dx, data, {plugins, sign, encrypt, context_location: context_location ? new URL(context_location.toString()) : undefined}], typeof to == \"string\" ? f(<endpoint_name>to) : to, undefined, undefined, undefined, undefined, undefined, timeout);\n    \n}\n\n// add datex.meta\nObject.defineProperty(_datex, 'meta', {get:()=>getMeta()??getDefaultLocalMeta(), set:()=>{}, configurable:false})\n// add datex.get\nObject.defineProperty(_datex, 'get', {value:(res:string, type?:Class|Type, location?:URL, plugins?:string[])=>get(res,type,location ?? getCallerFile(),plugins), configurable:false})\n\n// add globalThis.meta\n// Object.defineProperty(globalThis, 'meta', {get:()=>getMeta(), set:()=>{}, configurable:false})\n\nexport const datex = <typeof _datex & {\n    /**\n     * metadata associated with the current function call\n     */\n    meta:datex_meta,\n    /**\n     * get a resource via datex\n     */\n    get:typeof get\n}><unknown>_datex;\n// @ts-ignore global datex\nglobalThis.datex = datex;\n// global access to datex and meta\ntype d = typeof datex;\ndeclare global {\n    const datex: d;\n}\n\nexport const 〱 = _datex;\n\n\n// create raw dxb from script or file (used to return in functions)\nexport function raw<T=unknown>(dx:TemplateStringsArray, ...args:unknown[]):DatexResponse<T>\nexport function raw<T=unknown>(dx:string):DatexResponse<T>\nexport function raw<T=unknown>(script_url:URL):DatexResponse<T>\nexport function raw<T=unknown>(dx_or_url:string|URL|TemplateStringsArray):DatexResponse<T> {\n    let data: unknown[] = [];\n    // template string (raw `...`)\n    if (dx_or_url instanceof Array) {\n        dx_or_url = dx_or_url.raw.join(\"?\");\n        data = Array.from(arguments);\n        data.splice(0,1);\n    }\n    return new DatexResponse(dx_or_url, data)\n}\n\n\n\n// execute DATEX as continuos scope with current context location\n// similar to the 'compile' command in Compiler\n\nconst context_compiler_scopes = new Map<string, compiler_scope>();\nconst context_runtime_scopes = new Map<string, datex_scope>();\n\n// TODO:\nexport async function script(dx:TemplateStringsArray, ...args:any[]):Promise<any>\nexport async function script(dx:string|PrecompiledDXB, data?:any[], to?:Target|target_clause|endpoint_name, sign?:boolean, encrypt?:boolean):Promise<any>\nexport async function script(dx:string|TemplateStringsArray|PrecompiledDXB, data:any[]=[], to:Target|target_clause|endpoint_name = Runtime.endpoint, sign=to!=Runtime.endpoint, encrypt=false) {\n    // template string (script `...`)\n    if (dx instanceof Array && !(dx instanceof PrecompiledDXB)) {\n        dx = dx.raw.join(\"?\");\n        data = Array.from(arguments);\n        data.splice(0,1);\n    }\n\n    const context_location = baseURL;\n    const context_string = context_location.toString();\n\n    let compiler_scope:compiler_scope|undefined = context_compiler_scopes.get(context_string)\n    let runtime_scope:datex_scope|undefined = context_runtime_scopes.get(context_string);\n\n\n    // COMPILE:\n\n    // create compiler scope first time\n    if (!compiler_scope) {\n        context_compiler_scopes.set(context_string, compiler_scope = Compiler.createCompilerScope(<string>dx, data, {}, false, false, false, undefined, Infinity))\n    }\n    // reset scope for next DATEX script snippet\n    else {\n        Compiler.resetScope(compiler_scope, <string>dx);\n    }\n    // compile snippet in compiler scope\n    const compiled = <ArrayBuffer> await Compiler.compileLoop(compiler_scope);\n\n\n    // RUN:\n\n    // create datex scope to run\n    if (!runtime_scope) {\n        context_runtime_scopes.set(context_string, runtime_scope = Runtime.createNewInitialScope(undefined, undefined, undefined, undefined, context_location));\n    }\n    // set dxb as scope buffer\n    Runtime.updateScope(runtime_scope, compiled, {sender:Runtime.endpoint, executable:true})\n    \n    // execute scope -> get script from path\n    const value = await Runtime.simpleScopeExecution(runtime_scope)\n\n    return value;\n}\n\n\n// generate a pointer for an object and returns the proxified object or the primitive pointer\n/**\n * Returns a pointer property (live ref that points to the property of a Map or Object)\n * @param parentValue Map or Object\n * @param property property name\n */\nexport function pointer<Key, Parent extends PointerPropertyParent<Key,unknown>>(parentValue:RefLike<Parent>, property:Key): PointerProperty<Parent extends Map<unknown, infer MV> ? MV : Parent[Key&keyof Parent]> // defined 2x with Ref<Parent> and Parent for correct type inference\nexport function pointer<Key, Parent extends PointerPropertyParent<Key,unknown>>(parentValue:Parent, property:Key): PointerProperty<Parent extends Map<unknown, infer MV> ? MV : Parent[Key&keyof Parent]>\n/**\n * Creates a new pointer from a value\n * @param value \n */\nexport function pointer<T>(value:RefLike<T>): MinimalJSRef<T> // defined 2x with Ref<T> and T for correct type inference\nexport function pointer<T>(value:T): MinimalJSRef<T>\nexport function pointer<T>(value:RefOrValue<T>, property?:unknown, callStackIndex = 0): unknown {\n\n    // pointer property\n    if (property !== undefined) {\n        return PointerProperty.get(value as PointerPropertyParent<any, any>, property);\n    }\n\n    // pointer\n    else {\n        const pointer = <any> Pointer.createOrGet(value).js_value;\n        // store as eternal?\n        if (waitingEternals.size) {\n            const info = getCallerInfo()?.[callStackIndex];\n            if (!info) throw new Error(\"eternal values are not supported in this runtime environment\");\n            const unique = `${info.file}:${info.row}`;\n            if (waitingEternals.has(unique)) {\n                eternals.set(waitingEternals.get(unique)!, pointer);\n                waitingEternals.delete(unique);\n            }\n        }\n        if (waitingLazyEternals.size) {\n            const info = getCallerInfo()?.[callStackIndex];\n            if (!info) throw new Error(\"eternal values are not supported in this runtime environment\");\n            const unique = `${info.file}:${info.row}`;\n            if (waitingLazyEternals.has(unique)) {\n                Storage.setItem(waitingLazyEternals.get(unique)!, pointer);\n                waitingLazyEternals.delete(unique);\n            }\n        }\n        return pointer\n    }\n    \n}\n\n\n/**\n * Returns a reactive pointer property if the parent is bound to a pointer, otherwise the plain property value\n * @param parent a Map or Object, optionally bound to a pointer\n * @param propertyKey \n */\nexport function prop<T extends Map<unknown, unknown>>(parent:RefOrValue<T>, propertyKey: T extends Map<infer K, infer V> ? K : unknown): PointerProperty<T extends Map<infer K, infer V> ? V : unknown>|(T extends Map<infer K, infer V> ? V : unknown)\nexport function prop<T extends Record<PropertyKey, unknown>, K extends keyof T>(parent:RefOrValue<T>, propertyKey: K): PointerProperty<T[K]>|T[K]\nexport function prop(parent:Map<unknown, unknown>|Record<PropertyKey, unknown>, propertyKey: unknown): any {\n    // try to get pointer property\n    if (ReactiveValue.isRef(parent)) {\n        if (parent instanceof ReactiveValue) {\n            // If parent is ReactiveValue and propertyKey is \"val\", just directly return pointer to keep reactivity\n            if (propertyKey == \"val\") return parent;\n            // If any other property key, assume we want to get a reactive property of the underlying value\n            // This is useful in JUSIX expressions when having nested properties after a .val access, e.g.\n            // <div>{myString.val.length}</div>\n            // Which gets transformed by JUSIX to\n            // prop(prop(myString, \"val\"), \"length\")\n            // prop(myString, \"val\") is transformed to the Pointer myString,\n            // so prop(myString, \"length\") should return a reactive reference to the actual\n            // length property of the underlying pointer value\n            // We can guarantee this with an always, which is less performant than a pointer property,\n            // but supports more cases (e.g. internal properties like \"length\")\n            // With this workaround, it is no longer possible for a user to directly access any other\n            // internal Pointer/ReactiveProperty properties besides \".val\", but this is not a common/recommended use case\n            else {\n                return _always(()=>parent.val[propertyKey])\n            }\n        }\n        // if strongBoundPointerProperty, return pointer instead of pointer property\n        const parentPtr = Pointer.getByValue(parent)!;\n        if (parentPtr.strongBoundPointerProperties.has(propertyKey)) {\n            return parentPtr.$[propertyKey]\n        }\n        else {\n            const prop = PointerProperty.getIfExists(parent, propertyKey, true);\n            if (prop !== NOT_EXISTING) return prop;\n        }\n    }\n    \n    const value = parent instanceof Map ? \n        parent.get(propertyKey) : \n        parent[propertyKey as keyof typeof parent];\n    if (value instanceof ReactiveValue) return value;\n    else return pointer(value);\n}\n\n\n/**\n * Add endpoint to allowed_access list\n * @param endpoint\n */\nexport function grantAccess(value: any, endpoint: string|Endpoint) {\n    const pointer = Pointer.pointerifyValue(value);\n    if (pointer instanceof Pointer) pointer.grantAccessTo(typeof endpoint == \"string\" ? f(endpoint as \"@\") : endpoint)\n    else throw new Error(\"Cannot set read permissions for non-pointer value\")\n}\n\n/**\n * Grant public access for pointer\n * @param endpoint\n */\nexport function grantPublicAccess(value: any) {\n    const pointer = Pointer.pointerifyValue(value);\n    if (pointer instanceof Pointer) pointer.grantPublicAccess()\n    else throw new Error(\"Cannot set read permissions for non-pointer value\")\n}\n\n/**\n * Remove endpoint from allowed_access list\n * @param endpoint\n */\nexport function revokeAccess(value: any, endpoint: string|Endpoint) {\n    const pointer = Pointer.pointerifyValue(value);\n    if (pointer instanceof Pointer) pointer.revokeAccessFor(typeof endpoint == \"string\" ? f(endpoint as \"@\") : endpoint)\n    else throw new Error(\"Cannot set read permissions for non-pointer value\")\n}\n\nexport const $$ = pointer;\n\n\ntype $type = (Record<string, Pointer<unknown>|Promise<Pointer<unknown>>>) & {\n    <T>(value:T): MinimalJSRef<T>\n};\n\n/**\n * Compiled reactivity syntax ($()) - throws an error when called directly and not compiled to $$() or always()\n * Also used as shortcut for debugging, returns a Pointer or Promise<Pointer>\n * for a given id:\n * ```ts\n * const ptr: Pointer = $.AFEFEF3282389FEFAxE2;\n * ```\n * \n */\nexport const $ = new Proxy(function(){} as unknown as $type, {\n    get(_target,p,_receiver) {\n        if (typeof p == \"string\") {\n            const ptr = Pointer.get(p);\n            if (ptr) return ptr;\n            else return Pointer.load(p)\n        }\n    },\n\n    apply(_target, _thisArg, args) {\n        return pointer(args[0], args[1], 1 /* callStackIndex */);\n    },\n})\n\n\n/**\n * val shortcut function, collapses all ref value (pointers, pointer properties)\n * @param val \n * @returns \n */\nexport function val<T>(val: T): CollapsedValue<T>  { // TODO: return inferred type instead of T (ts resolution error, too deep)\n    return ReactiveValue.collapseValue(val, true, true)\n}\n\n\n// generate primitive pointers\nexport function decimal(value:RefOrValue<number|bigint|string> = 0): Pointer<number> {\n    if (value instanceof ReactiveValue) value = value.val; // collapse\n    return Pointer.create(undefined, Number(value)) // adds pointer or returns existing pointer\n}\nexport function integer(value:RefOrValue<bigint|number|string> = 0n): Pointer<bigint> {\n    if (value instanceof ReactiveValue) value = value.val; // collapse\n    return Pointer.create(undefined, BigInt(Math.floor(Number(value)))) // adds pointer or returns existing pointer\n}\nexport function text(string:TemplateStringsArray, ...vars:any[]):Promise<Pointer<string>>\nexport function text(value?:RefOrValue<any>): Pointer<string>\nexport function text(value:RefOrValue<string>|TemplateStringsArray = \"\", ...vars:any[]): Pointer<string>|Promise<Pointer<string>> {\n    if (value instanceof ReactiveValue) value = value.val; // collapse\n    // template transform\n    if (value instanceof Array) {\n        return <Promise<Pointer<string>>>_datex(`always '${value.raw.map(s=>s.replace(/\\(/g, '\\\\(').replace(/\\'/g, \"\\\\'\")).join(INSERT_MARK)}'`, vars)\n    }\n    else return Pointer.create(undefined, String(value)) // adds pointer or returns existing pointer\n}\nexport function boolean(value:RefOrValue<boolean> = false): Pointer<boolean> {\n    if (value instanceof ReactiveValue) value = value.val; // collapse\n    return Pointer.create(undefined, Boolean(value)) // adds pointer or returns existing pointer\n}\n\n\n// Markdown\nexport function md(string:TemplateStringsArray, ...vars:any[]):Promise<Markdown>\nexport function md(value?:RefOrValue<string>): Markdown\nexport function md(value:RefOrValue<string>|TemplateStringsArray = \"\", ...vars:any[]): Markdown|Promise<Markdown> {\n    // transform string reference\n    if (value instanceof ReactiveValue) return <Promise<Markdown>> _datex `always <text/markdown> ${value}`\n    // template transform\n    else if (value instanceof Array) return <Promise<Markdown>>_datex(`always <text/markdown>'${value.raw.map(s=>s.replace(/\\(/g, '\\\\(').replace(/\\'/g, \"\\\\'\")).join(INSERT_MARK)}'`, vars)\n    // pointer from string\n    else return Pointer.create(undefined, new Markdown(value)).val // adds pointer or returns existing pointer\n}\n\n// TODO: use this?\n// Object.defineProperty(String.prototype, \"$\", {get(){return text(this)}})\n// Object.defineProperty(Number.prototype, \"$\", {get(){return decimal(this)}})\n// Object.defineProperty(BigInt.prototype, \"$\", {get(){return integer(this)}})\n\n\n// get string transform matching the current Runtime.ENV language\nexport function localtext(local_map: { [lang: string]: string; }) {\n    return Runtime.getLocalString(local_map)\n}\n\n/**\n * @deprecated use localtext\n */\nexport const local_text = localtext\n\n// map boolean to two values\n/**\n * @deprecated use functions from unyt_core/function.ts\n */\nexport function map<K extends string|number, V>(value:RefOrValue<K>, map:Record<K, V>):MinimalJSRef<V> {\n    return <MinimalJSRef<V>> transform([value], (v)=><any>map[<K>v]);\n}\n\n// map boolean to two values\n/**\n * @deprecated use functions from unyt_core/function.ts\n */\nexport function select<T extends primitive>(value:RefOrValue<boolean>, if_true:T, if_false:T):MinimalJSRef<T>\nexport function select<T>(value:RefOrValue<boolean>, if_true:T, if_false:T):MinimalJSRef<T>\nexport function select<T>(value:RefOrValue<boolean>, if_true:T, if_false:T) {\n    return transform([value], v=>v?<any>if_true:<any>if_false, `\n    always (\n        if (${Runtime.valueToDatexString(value)}) (${Runtime.valueToDatexString(if_true)}) \n        else (${Runtime.valueToDatexString(if_false)})\n    )`);\n}\n\n\n\n// generate a static pointer for an object\nexport function static_pointer<T>(value:RefOrValue<T>, endpoint:IdEndpoint, unique_id:number, label?:string|number) {\n    const static_id = Pointer.getStaticPointerId(endpoint, unique_id);\n    const pointer = Pointer.create(static_id, value)\n    if (label) pointer.addLabel(typeof label == \"string\" ? label.replace(/^\\$/, '') : label);\n    return ReactiveValue.collapseValue(pointer);\n}\n\n// similar to pointer(), but also adds a label\nexport function label<T>(label:string|number, value:RefOrValue<T>): T {\n    const pointer = Pointer.createOrGet(value);\n    if (pointer instanceof Pointer) pointer.addLabel(typeof label == \"string\" ? label.replace(/^\\$/, '') : label);\n    else throw new ValueError(\"Cannot add label to value, value is not a pointer\");\n    return pointer.val;\n}\n\n\n\n// call once and return stored value\nexport function once<T>(init:()=>Promise<T>|T):Promise<T>\nexport function once<T>(identifier:string, init:()=>Promise<T>|T):Promise<T>\n\nexport async function once<T>(id_or_init:string|(()=>Promise<T>|T), _init?:()=>Promise<T>|T) {\n    const identifier = typeof id_or_init == \"string\" ? id_or_init : undefined;\n    const init = typeof id_or_init == \"function\" ? id_or_init : _init!;\n    const info = getCallerInfo();\n    if (!info?.[0]) throw new Error(\"once() initializer is not supported in this runtime environment\");\n    const existing = await getLazyEternal(info, identifier, true)\n    if (existing === NOT_EXISTING) {\n        const unique = `${info[0].file}:${info[0].row}`;\n        if (waitingLazyEternals.has(unique)) {\n            const value = await init();\n            Storage.setItem(waitingLazyEternals.get(unique)!, value);\n            waitingLazyEternals.delete(unique);\n            return value;\n        }\n        else throw new Error(\"could not handle once() initializer\");\n    }\n    else return existing;\n}\n\n\nconst _once = once;\ntype val = typeof val;\ntype grantAccess = typeof grantAccess\ntype grantPublicAccess = typeof grantPublicAccess\ntype revokeAccess = typeof revokeAccess\n\ndeclare global {\n    const eternal: undefined\n    const lazyEternal: undefined    \n    /**\n     * @deprecated use $()\n     */\n    const $$: typeof pointer\n    const $: $type\n\n    const val: val\n\n    const eternalVar: (customIdentifier:string)=>undefined\n    const lazyEternalVar: (customIdentifier:string)=>undefined\n    const once: typeof _once;\n\n    const grantAccess: grantAccess;\n    const grantPublicAccess: grantPublicAccess;\n    const revokeAccess: revokeAccess;\n}\n\n\n// TODO: '123456'.$$, [1,2,3].$$ ?\n// declare global {\n\n//     interface Object {\n// \t\t$$<T>(this:T): MinimalJSRef<T>\n// \t}\n\n//     interface String {\n// \t\t$$: MinimalJSRef<string>\n// \t}\n// }\n\n\n// load all eternal values from storage\n\n\n// create any filter Target from a string\nexport function f<T extends endpoint_name>(name:[T]|T):endpoint_by_endpoint_name<T> {\n    return <any>Target.get((typeof name == \"string\" ? name : name[0]));\n}\n\nexport function printTrace(endpoint: string|Endpoint) {\n    endpoint = typeof endpoint == \"string\" ? Target.get(endpoint) as Endpoint : endpoint;\n    return endpoint.printTrace()\n}\ntype printTraceT = typeof printTrace;\n\nexport function printComStatus() {\n    return communicationHub.printStatus()\n}\ntype printComStatusT = typeof printComStatus;\n\nexport function enableMessageLogger(showRedirectMessages?: boolean) {\n    return MessageLogger.enable(showRedirectMessages)\n}\ntype enableMessageLoggerT = typeof enableMessageLogger;\n\nexport function disableMessageLogger() {\n    return MessageLogger.disable()\n}\ntype disableMessageLoggerT = typeof disableMessageLogger;\n\ndeclare global {\n    const printTrace: printTraceT;\n    const printComStatus: printComStatusT;\n    const printSnapshot: typeof Storage.printSnapshot\n    const enableMessageLogger: enableMessageLoggerT;\n    const disableMessageLogger: disableMessageLoggerT;    \n}\n\n\nexport function syncedValue(parent:any|Pointer, key?:any):PointerProperty {\n    return PointerProperty.get(parent, key); \n}\n\n// usage: props(someObjectWithPointer).someProperty  -> DatexPointerProperty<typeof someProperty>\n// creates an object from a pointer with all properties as DatexSynced values\n// if strong_parent_bounding is on, the child properties are always DatexPointerPropertys, otherwise a Pointer or other DatexValue might be returned if the property is already a DatexValue\nexport function props<T extends object = object>(parent:RefOrValue<T>, strong_parent_bounding = true): ObjectWithDatexValues<T> {\n    let pointer:Pointer<T>;\n    parent = Pointer.pointerifyValue(parent);\n    if (parent instanceof PointerProperty) parent = parent.val; // collapse pointer property\n\n    if (parent instanceof Pointer) pointer = <Pointer> parent;\n    //else if (parent instanceof Value) pointer = parent.value;\n    else throw new Error(\"Cannot get pointer properties of non-pointer value\");\n    //pointer = <Pointer<T>>Pointer.createOrGet(parent, undefined, undefined, undefined, true);\n\n    return <ObjectWithDatexValues<T>> new Proxy({}, {\n        get: (_, key) => {\n            // other DatexValues can also be returned -> check if property already a DatexValue\n            if (!strong_parent_bounding) {\n                const property = pointer.getProperty(key);\n                if (property instanceof ReactiveValue) return property;\n            }\n            // create a DatexPointerProperty\n            return PointerProperty.get(pointer, <keyof Pointer<T>>key);\n        },\n        set: (_, key, value) => {\n            PointerProperty.get(pointer, <keyof Pointer<T>>key).val = value;\n            return true;\n        }\n    })\n}\n\nexport function translocate<V extends unknown, T extends Record<string,V>>(value:T): {[K in keyof T]:Promise<T[K]>}\nexport function translocate<T extends Map<unknown,unknown>|Set<unknown>|Array<unknown>|Record<string,unknown>>(value:T):T {\n    value = $$(value);\n    const ptr = Pointer.getByValue(value)!;\n    const id = ptr.idString();\n\n    if (!value) throw new Error(\"cannot translocate empty value\");\n    if (!(DX_SLOTS in value)) value[DX_SLOTS] = new Map();\n\n\n    const getter = (key:unknown)=>{\n        const storage_key = id + \".\" + key;\n        console.log(\"#get\",key, storage_key)\n        return Storage.getItem(storage_key)\n    }\n    const setter = async (key:unknown, value:unknown)=>{\n        const storage_key = id + \".\" + key;\n        console.log(\"#set\",key, value, storage_key)\n        await Storage.setItem(storage_key, value)\n        return true;\n    }\n\n    value[DX_SLOTS]!.set(SLOT_GET, getter)\n    value[DX_SLOTS]!.set(SLOT_SET, setter)\n\n    // link custom getters/setters to proxy\n    ptr.setPropertyGetter(getter)\n    ptr.setPropertySetter(setter)\n\n    // if (value instanceof Map) return translocateMapJS(value);\n    console.log(value);\n    return value;\n}\n\n// add js binding to read/write translocated properties\n// export function translocateObjectJS(value:Record<string,unknown>){\n\n// }\n\n// export function translocateMapJS(value:Map<unknown,unknown>){\n//     console.log(\"trans\",value);\n//     value.\n// }\n\nexport function _$method(value: any, method: string, ...args: unknown[]) {\n    if (ReactiveValue.isRef(value) && typeof value['$'][method] == 'function') {\n        return value['$'][method](...args);\n    }\n    else return value[method](...args);\n}\n\n\nObject.defineProperty(globalThis, 'once', {value:once, configurable:false})\nObject.defineProperty(globalThis, 'always', {value:_always, configurable:false})\nObject.defineProperty(globalThis, 'asyncAlways', {value:_asyncAlways, configurable:false})\n// used internally for reactive $ syntax\nObject.defineProperty(globalThis, '_$', {value: (cb:SmartTransformFunction<unknown>) => _always(cb, {allowStatic: true, _allowAsync: true, _collapseStatic: true, _rebindStaticToPointers: true, _returnWrapper: true, _allowAnyType: true}), configurable:false})\nObject.defineProperty(globalThis, '_$method', {value: _$method, configurable:false})\nObject.defineProperty(globalThis, 'reactiveFn', {value:_reactiveFn, configurable:false})\nObject.defineProperty(globalThis, 'toggle', {value:_toggle, configurable:false})\nObject.defineProperty(globalThis, 'map', {value:_map, configurable:false})\nObject.defineProperty(globalThis, 'filter', {value:_filter, configurable:false})\nObject.defineProperty(globalThis, 'equals', {value:_equals, configurable:false})\nObject.defineProperty(globalThis, 'selectProperty', {value:_selectProperty, configurable:false})\nObject.defineProperty(globalThis, 'not', {value:_not, configurable:false})\nObject.defineProperty(globalThis, 'effect', {value:_effect, configurable:false})\nObject.defineProperty(globalThis, 'observe', {value:ReactiveValue.observe.bind(ReactiveValue), configurable:false})\nObject.defineProperty(globalThis, 'observeAndInit', {value:ReactiveValue.observeAndInit.bind(ReactiveValue), configurable:false})\nObject.defineProperty(globalThis, 'unobserve', {value:ReactiveValue.unobserve.bind(ReactiveValue), configurable:false})\nObject.defineProperty(globalThis, 'isolate', {value:ReactiveValue.disableCapturing.bind(ReactiveValue), configurable:false})\n\nObject.defineProperty(globalThis, 'grantAccess', {value:grantAccess, configurable:false})\nObject.defineProperty(globalThis, 'grantPublicAccess', {value:grantPublicAccess, configurable:false})\nObject.defineProperty(globalThis, 'revokeAccess', {value:revokeAccess, configurable:false})\n\nObject.defineProperty(globalThis, 'localEndpoint', {get: ()=>Runtime.endpoint, configurable:false})\n\nObject.defineProperty(globalThis, 'prop', {value:prop, configurable:false})\n\n// @ts-ignore\nglobalThis.get = get\n// @ts-ignore\nglobalThis.script = script\n// @ts-ignore\nglobalThis.instance = instance;\n// @ts-ignore\nglobalThis.md = md;\n// @ts-ignore\nglobalThis.localtext = localtext;\n// @ts-ignore\nglobalThis.local_text = local_text;\n// @ts-ignore\nglobalThis.label = label;\n// @ts-ignore\nglobalThis.$$ = $$;\n// @ts-ignore\nglobalThis.$ = $;\n// @ts-ignore\nglobalThis.val = val;\n// @ts-ignore\nglobalThis.static_pointer = static_pointer;\n// @ts-ignore\nglobalThis.f = f;\n// @ts-ignore\nglobalThis.printTrace = printTrace;\n// @ts-ignore\nglobalThis.printComStatus = printComStatus;\n// @ts-ignore\nglobalThis.printSnapshot = Storage.printSnapshot.bind(Storage);\n// @ts-ignore\nglobalThis.enableMessageLogger = enableMessageLogger;\n// @ts-ignore\nglobalThis.disableMessageLogger = disableMessageLogger;\n// @ts-ignore\nglobalThis.props = props;"],"names":["baseURL","Runtime","PrecompiledDXB","Type","Pointer","ReactiveValue","PointerProperty","Target","Markdown","Compiler","Storage","DatexResponse","ValueError","getDefaultLocalMeta","INSERT_MARK","activePlugins","assert","_assert","timeout","_timeout","entrypoint","_entrypoint","ref","_ref","entrypointProperty","_entrypointProperty","property","_property","struct","_struct","endpoint","_endpoint","sync","_sync","allow","_allow","effect","_effect","always","_always","reactiveFn","_reactiveFn","asyncAlways","_asyncAlways","toggle","_toggle","filter","_filter","map","_map","equals","_equals","selectProperty","_selectProperty","not","_not","NOT_EXISTING","DX_SLOTS","SLOT_GET","SLOT_SET","AssertionError","getCallerFile","getCallerInfo","getMeta","eternals","getLazyEternal","waitingEternals","waitingLazyEternals","instance","communicationHub","MessageLogger","globalThis","get","dx","assert_type","context_location","plugins","toString","match","startsWith","URL","origin","location","push","deleteURLCache","res","_datex","undefined","splice","length","matches","ofValue","name","data","to","sign","encrypt","Array","raw","join","from","arguments","executeDatexLocally","datexOut","f","Object","defineProperty","set","configurable","value","type","datex","〱","dx_or_url","context_compiler_scopes","Map","context_runtime_scopes","script","context_string","compiler_scope","runtime_scope","resetScope","createCompilerScope","Infinity","compiled","compileLoop","createNewInitialScope","updateScope","sender","executable","simpleScopeExecution","pointer","callStackIndex","createOrGet","js_value","size","info","Error","unique","file","row","has","delete","setItem","prop","parent","propertyKey","isRef","val","parentPtr","getByValue","strongBoundPointerProperties","$","getIfExists","grantAccess","pointerifyValue","grantAccessTo","grantPublicAccess","revokeAccess","revokeAccessFor","$$","Proxy","_target","p","_receiver","load","apply","_thisArg","args","collapseValue","decimal","create","Number","integer","BigInt","Math","floor","text","vars","s","replace","String","boolean","Boolean","md","localtext","local_map","getLocalString","local_text","transform","v","select","if_true","if_false","valueToDatexString","static_pointer","unique_id","label","static_id","getStaticPointerId","addLabel","once","id_or_init","_init","init","existing","printTrace","printComStatus","printStatus","enableMessageLogger","showRedirectMessages","enable","disableMessageLogger","disable","syncedValue","key","props","strong_parent_bounding","_","getProperty","translocate","ptr","id","idString","getter","storage_key","console","log","getItem","setter","setPropertyGetter","setPropertySetter","_$method","method","cb","allowStatic","_allowAsync","_collapseStatic","_rebindStaticToPointers","_returnWrapper","_allowAnyType","observe","bind","observeAndInit","unobserve","disableCapturing","printSnapshot"],"mappings":"AAGA,SAASA,OAAO,EAAEC,OAAO,EAAEC,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAEC,aAAa,EAAEC,eAAe,EAAaC,MAAM,EAAcC,QAAQ,EAA+DC,QAAQ,EAA4CC,OAAO,EAA+BC,aAAa,EAAiBC,UAAU,EAASC,mBAAmB,EAAYC,WAAW,EAA0BC,aAAa,QAAwD,iBAAiB;AAGre,SAASC,UAAUC,OAAO,EAAEC,WAAWC,QAAQ,EAAEC,cAAcC,WAAW,EAAEC,OAAOC,IAAI,EAAEC,sBAAsBC,mBAAmB,EAAEC,YAAYC,SAAS,EAAEC,UAAUC,OAAO,EAAEC,YAAYC,SAAS,EAAEC,QAAQC,KAAK,EAAEC,SAASC,MAAM,QAAO,iBAAiB;AAC3P,SAASC,UAAUC,OAAO,EAAEC,UAAUC,OAAO,EAAEC,cAAcC,WAAW,EAAEC,eAAeC,YAAY,EAAEC,UAAUC,OAAO,EAAEC,UAAUC,OAAO,EAAEC,OAAOC,IAAI,EAAEC,UAAUC,OAAO,EAAEC,kBAAkBC,eAAe,EAAEC,OAAOC,IAAI,QAAQ,iBAAiB;AACpP,cAAc,iBAAiB;AAC/B,SAASC,YAAY,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,yBAAyB;AACpF,SAASC,cAAc,QA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