{"version":3,"file":"hive.DRIi5jzw.mjs","sources":["../../../@hive/sdk/dist/namespace.mjs"],"sourcesContent":["import { ResourceNotInitializedError, Selector } from \"./_chunks/errors-CNH_pZDT.mjs\";\n\n//#region src/namespace.ts\nvar Namespace = class extends Selector {\n\t/**\n\t* `Storage` instance to use for persisting the Namespace.\n\t*\n\t* If not set, the Namespace must be initialized by passing it to either\n\t* `hive.create()` or `hive.get()`.\n\t*/\n\tstorage = null;\n\tconstructor(config) {\n\t\tsuper({\n\t\t\ttype: \"namespace\",\n\t\t\tid: config?.id ?? crypto.randomUUID(),\n\t\t\tparent: config?.parent ?? null\n\t\t});\n\t\tthis.storage = config?.storage ?? null;\n\t}\n\t/**\n\t* Get the metadata stored for the Namespace.\n\t*\n\t* @param opts Options for getting the metadata stored for the Namespace.\n\t*\n\t* @returns Promise resolving with the metadata stored for the Namespace.\n\t*\n\t* @throws `ResourceNotFoundError` if the Namespace was not found.\n\t* @throws `ResourceNotInitializedError` if the Namespace is not initialized.\n\t* To initialize the Namespace, pass it to either `hive.create()` or `hive.get()`.\n\t*/\n\tgetMetadata = (opts) => {\n\t\tif (!this.storage) throw new ResourceNotInitializedError(this);\n\t\treturn this.storage.getMetadata(this, { trace: opts?.trace });\n\t};\n};\n\n//#endregion\nexport { Namespace };"],"names":[],"mappings":";;AAGA,IAAI,SAAA,GAAY,cAAc,QAAA,CAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOtC,OAAA,GAAU,IAAA;AAAA,EACV,YAAY,MAAA,EAAQ;AACnB,IAAA,KAAA,CAAM;AAAA,MACL,IAAA,EAAM,WAAA;AAAA,MACN,EAAA,EAAI,MAAA,EAAQ,EAAA,IAAM,MAAA,CAAO,UAAA,EAAW;AAAA,MACpC,MAAA,EAAQ,QAAQ,MAAA,IAAU;AAAA,KAC1B,CAAA;AACD,IAAA,IAAA,CAAK,OAAA,GAAU,QAAQ,OAAA,IAAW,IAAA;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,WAAA,GAAc,CAAC,IAAA,KAAS;AACvB,IAAA,IAAI,CAAC,IAAA,CAAK,OAAA,EAAS,MAAM,IAAI,4BAA4B,IAAI,CAAA;AAC7D,IAAA,OAAO,IAAA,CAAK,QAAQ,WAAA,CAAY,IAAA,EAAM,EAAE,KAAA,EAAO,IAAA,EAAM,OAAO,CAAA;AAAA,EAC7D,CAAA;AACD;;;;"}