{"version":3,"sources":["mod.ts"],"sourcesContent":["/**\n * Import this module to get access to the Datex namespace.\n * The Datex runtime is not automatically initialized.\n * It needs to be initialized by calling init() and setting assigning the Blockchain\n * module to Datex.Runtime.Blockchain:\n * \n * ```ts\n * import {Datex, init} from \"datex-core-legacy/mod.ts\";\n * import { Blockchain } from \"datex-core-legacy/network/blockchain_adapter.ts\"\n * Datex.Runtime.Blockchain = Blockchain;\n * await init()\n * ```\n * \n * Loading Datex this way is required when bundling, otherwise the\n * imports cannot be resolved correctly.\n * If the source code is not bundled, \"datex-core-legacy/datex.ts\" can be imported.\n */\nimport * as Datex from \"./datex_all.ts\";\n\nexport {Datex};\nexport * from \"./js_adapter/decorators.ts\";\nexport * from \"./datex_short.ts\";\n\nexport {init} from \"./init.ts\";\n\n\n/**\n * Polyfills\n */\nObject.defineProperty(globalThis.Promise, \"withResolvers\", {value: function withResolvers() {\n\tif (!this) throw new TypeError(\"Promise.withResolvers called on non-object\")\n\tconst out: any = {}\n\tout.promise = new this((resolve_:any, reject_:any) => {\n\t\tout.resolve = resolve_\n\t\tout.reject = reject_\n\t})\n\treturn out\n}})\n\ndeclare global {\n\tinterface PromiseConstructor {\n\t\twithResolvers<T>(): {\n\t\t\tpromise: Promise<T>,\n\t\t\tresolve: (r:T) => void,\n\t\t\treject: (e:unknown) => void\n\t\t};\n\t}\n}\n\nif ((globalThis as any).Datex) throw new Error(`The datex-core-js-legacy library was imported more than once from different sources`);// (v${Datex.Runtime?.VERSION??'X'} from ${Datex.libURL??'unknown'} and v${globalThis.Datex?.Runtime?.VERSION??'X'} from ${globalThis.Datex?.libURL??'unknown'}). Check your imports!`)\n(globalThis as any).Datex = Datex;"],"names":["Datex","init","Object","defineProperty","globalThis","Promise","value","withResolvers","TypeError","out","promise","resolve_","reject_","resolve","reject","Error"],"mappings":"AAiBA,YAAYA,WAAW,iBAAiB;AAGxC,cAAc,6BAA6B;AAC3C,cAAc,mBAAmB;AAEjC,SAAQC,IAAI,QAAO,YAAY;AA0B/B,IApBAC,OAAOC,cAAc,CAACC,WAAWC,OAAO,EAAE,iBAAiB;IAACC,OAAO,SAASC;QAC3E,IAAI,CAAC,IAAI,EAAE,MAAM,AAAIC,UAAU;QAC/B,IAAMC,MAAW,CAAC;QAKlB,OAJAA,IAAIC,OAAO,GAAG,IAAI,IAAI,CAAC,CAACC,UAAcC;YACrCH,IAAII,OAAO,GAAGF,UACdF,IAAIK,MAAM,GAAGF;QACd,IACOH;IACR;AAAC,IAYG,AAACL,WAAmBJ,KAAK,EAAE,MAAM,AAAIe,MAAM;AAC9CX,WAAmBJ,KAAK,GAAGA;SA/BpBA,KAAK","sourceRoot":"/lib/datex-core-js-legacy-0.3.15/","file":"mod.ts"}