@platforma-open/milaboratories.repertoire-diversity-2 3.0.0 → 3.1.0
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/block-pack/CHANGELOG.md +331 -0
- package/block-pack/block-logo.png +0 -0
- package/block-pack/description.md +5 -0
- package/block-pack/main.plj.gz +0 -0
- package/block-pack/manifest.json +1 -0
- package/block-pack/model.json +1 -0
- package/block-pack/organization-logo.png +0 -0
- package/block-pack/published.json +8 -0
- package/block-pack/ui.tgz +0 -0
- package/dist/AGENTS.d.ts +14041 -0
- package/dist/AGENTS.d.ts.map +1 -0
- package/dist/AGENTS.js +0 -0
- package/dist/index.d.ts +14054 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12568 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -15
- package/index.d.ts +0 -2
- package/index.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultErrorMap","defaultErrorMap","regex","defaultErrorMap","z.object","z.literal","z.string","z.object","z.number","z.object","z.string","z.unknown","z.enum","z.array","z.number","z.boolean","z.record","matchDomain","isNil","isTypedArray","z.string","z.object","z.literal","z.string","isNil$1","#constructing","#perf","#starts","#ttls","#autopurgeTimers","#sizes","#keyMap","#keyList","#valList","#next","#prev","#head","#tail","#free","#isBackgroundFetch","#backgroundFetch","#moveToTail","#indexes","#rindexes","#isStale","#max","#maxSize","#calculatedSize","#size","#fetchMethod","#memoMethod","#dispose","#onInsert","#disposeAfter","#hasFetchMethod","#disposed","#hasDispose","#hasOnInsert","#hasDisposeAfter","#initializeSizeTracking","#initializeTTLTracking","#setItemTTL","#delete","#updateItemAge","#statusTTL","#removeItemSize","#requireSize","#addItemSize","#evict","#isValidIndex","#connect","#clear","isNil","isNil","z.object","z.literal","z.string","z.lazy","z.union","platforma"],"sources":["../../model/dist/converters.js","../../model/dist/label.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/plugin_handle.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/block_storage.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/block_migrations.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/internal.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/block_storage_facade.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/config/actions.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/future.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js","../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/bmodel/code.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/util.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/errors.js","../../node_modules/.pnpm/canonicalize@2.1.0/node_modules/canonicalize/lib/canonicalize.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/json.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js","../../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/utils.js","../../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/objects.js","../../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/error.js","../../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/uniqId.js","../../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/hash.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/function/identity.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isFunction.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isLength.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isNil.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isString.mjs","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/plid.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/ref.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/resource_types.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/services/service_capabilities.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js","../../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.2/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/accessor.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/internal.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/labels/linked_column_postfix.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/util/label.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/services/block_services.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/services/service_bridge.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/services/get_services.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/render/api.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/package.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/version.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/bconfig/types.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/plugin_model.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/block_model.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js","../../node_modules/.pnpm/lru-cache@11.2.4/node_modules/lru-cache/dist/esm/index.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_lazy.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/column.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/columns_collection.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/columns/utils.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/filters/traverse.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs","../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/filters/distill.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/labels.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/columnResolver.js","../../node_modules/.pnpm/@platforma-sdk+model@1.80.8/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.js","../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js","../../node_modules/.pnpm/@milaboratories+pl-error-like@1.12.10/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js","../../model/dist/dataModel.js","../../node_modules/.pnpm/@milaboratories+strings@0.1.2/node_modules/@milaboratories/strings/strings.json","../../model/dist/index.js","../src/index.ts"],"sourcesContent":["//#region src/converters.ts\nconst convertMetricsUiToArgs = (metrics) => {\n\treturn metrics.map((metric) => {\n\t\treturn {\n\t\t\ttype: metric.type,\n\t\t\tdownsampling: metric.downsampling\n\t\t};\n\t});\n};\n//#endregion\nexport { convertMetricsUiToArgs };\n\n//# sourceMappingURL=converters.js.map","//#region src/label.ts\nfunction getDefaultBlockLabel(data) {\n\tif (data.abundanceLabel) return data.abundanceLabel;\n\treturn \"Select Abundance and Metrics\";\n}\n//#endregion\nexport { getDefaultBlockLabel };\n\n//# sourceMappingURL=label.js.map","//#region src/plugin_handle.ts\nconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n/** Construct the output key for a plugin output in the block outputs map. */\nfunction pluginOutputKey(handle, outputKey) {\n\treturn `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n}\n/** Check whether an output key belongs to a plugin (vs block-level output). */\nfunction isPluginOutputKey(key) {\n\treturn key.startsWith(PLUGIN_OUTPUT_PREFIX);\n}\n/** Get the prefix used for all outputs of a specific plugin instance. */\nfunction pluginOutputPrefix(handle) {\n\treturn pluginOutputKey(handle, \"\");\n}\n//#endregion\nexport { isPluginOutputKey, pluginOutputKey, pluginOutputPrefix };\n\n//# sourceMappingURL=plugin_handle.js.map","import { isDataUnrecoverableError } from \"./block_migrations.js\";\n//#region src/block_storage.ts\n/**\n* Discriminator key for BlockStorage format detection.\n* This unique hash-based key identifies data as BlockStorage vs legacy formats.\n*/\nconst BLOCK_STORAGE_KEY = \"__pl_a7f3e2b9__\";\n/**\n* Default data version for new blocks without migrations.\n* Unique identifier ensures blocks are created via DataModel API.\n*/\nconst DATA_MODEL_LEGACY_VERSION = \"__pl_v1_d4e8f2a1__\";\n/**\n* Type guard to check if a value is a valid BlockStorage object.\n* Checks for the discriminator key and valid schema version.\n*/\nfunction isBlockStorage(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\treturn value[BLOCK_STORAGE_KEY] === \"v1\";\n}\n/**\n* Creates a BlockStorage with the given initial data\n*\n* @param initialData - The initial data value (defaults to empty object)\n* @param version - The initial data version key (defaults to DATA_MODEL_LEGACY_VERSION)\n* @returns A new BlockStorage instance with discriminator key\n*/\nfunction createBlockStorage(initialData = {}, version = DATA_MODEL_LEGACY_VERSION) {\n\treturn {\n\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t__dataVersion: version,\n\t\t__data: initialData,\n\t\t__pluginRegistry: {},\n\t\t__plugins: {}\n\t};\n}\n/**\n* Normalizes raw storage data to BlockStorage format.\n* If the input is already a BlockStorage, returns it as-is (with defaults for missing fields).\n* If the input is legacy format (raw state), wraps it in BlockStorage structure.\n*\n* @param raw - Raw storage data (may be legacy format or BlockStorage)\n* @returns Normalized BlockStorage\n*/\nfunction normalizeBlockStorage(raw) {\n\tif (isBlockStorage(raw)) {\n\t\tconst storage = raw;\n\t\treturn {\n\t\t\t...storage,\n\t\t\t__dataVersion: typeof storage.__dataVersion === \"number\" ? DATA_MODEL_LEGACY_VERSION : storage.__dataVersion,\n\t\t\t__pluginRegistry: storage.__pluginRegistry ?? {},\n\t\t\t__plugins: storage.__plugins ?? {}\n\t\t};\n\t}\n\treturn createBlockStorage(raw);\n}\n/**\n* Gets the data from BlockStorage\n*\n* @param storage - The BlockStorage instance\n* @returns The data value\n*/\nfunction getStorageData(storage) {\n\treturn storage.__data;\n}\n/**\n* Derives data from raw block storage.\n* This function is meant to be called from sdk/ui-vue to extract\n* user-facing data from the raw storage returned by the middle layer.\n*\n* The middle layer returns raw storage (opaque to it), and the UI\n* uses this function to derive the actual data value.\n*\n* @param rawStorage - Raw storage data from middle layer (may be any format)\n* @returns The extracted data value, or undefined if storage is undefined/null\n*/\nfunction deriveDataFromStorage(rawStorage) {\n\treturn getStorageData(normalizeBlockStorage(rawStorage));\n}\n/**\n* Updates the data in BlockStorage (immutable)\n*\n* @param storage - The current BlockStorage\n* @param payload - The update payload with operation and value\n* @returns A new BlockStorage with updated data\n*/\nfunction updateStorageData(storage, payload) {\n\tswitch (payload.operation) {\n\t\tcase \"update-block-data\": return {\n\t\t\t...storage,\n\t\t\t__data: payload.value\n\t\t};\n\t\tcase \"update-plugin-data\": {\n\t\t\tconst { pluginId, value } = payload;\n\t\t\tconst currentPlugins = storage.__plugins ?? {};\n\t\t\tconst version = currentPlugins[pluginId]?.__dataVersion ?? \"__pl_v1_d4e8f2a1__\";\n\t\t\treturn {\n\t\t\t\t...storage,\n\t\t\t\t__plugins: {\n\t\t\t\t\t...currentPlugins,\n\t\t\t\t\t[pluginId]: {\n\t\t\t\t\t\t__dataVersion: version,\n\t\t\t\t\t\t__data: value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tdefault: throw new Error(`Unknown storage operation: ${payload.operation}`);\n\t}\n}\n/**\n* Performs atomic migration of block storage including block data and all plugins.\n*\n* Migration is atomic: either everything succeeds and a new storage is returned,\n* or an error is returned and the original storage is completely untouched.\n*\n* Migration steps:\n* 1. Migrate block data\n* 2. For each plugin in newPluginRegistry:\n* - If plugin exists with same name: migrate its data\n* - Otherwise (new or type changed): create with initial data\n* Plugins not in newPluginRegistry are dropped.\n*\n* If any step throws, migration fails and original storage is preserved.\n* User can then choose to:\n* - Abort: keep original storage, don't update block\n* - Reset: call createBlockStorage() to start fresh\n*\n* @param storage - The original storage (will not be modified)\n* @param config - Migration configuration\n* @returns Migration result - either success with new storage, or failure with error info\n*\n* @example\n* const result = migrateBlockStorage(storage, {\n* migrateBlockData: (versioned) => blockDataModel.migrate(versioned),\n* migratePluginData: (pluginId, versioned) => getPluginModel(pluginId).migrate(versioned),\n* newPluginRegistry: { table1: 'dataTable' as PluginName },\n* createPluginData: (pluginId) => getPluginModel(pluginId).getDefaultData(),\n* });\n*\n* if (result.success) {\n* commitStorage(result.storage);\n* } else {\n* const userChoice = await askUser(`Migration failed: ${result.error}. Reset data?`);\n* if (userChoice === 'reset') {\n* commitStorage(createBlockStorage(initialData, currentVersion));\n* }\n* // else: abort, keep original\n* }\n*/\nfunction migrateBlockStorage(storage, config) {\n\tconst { migrateBlockData, migratePluginData, newPluginRegistry, createPluginData } = config;\n\tlet migratedData;\n\tlet newVersion;\n\tlet transfers;\n\ttry {\n\t\tconst result = migrateBlockData({\n\t\t\tversion: storage.__dataVersion,\n\t\t\tdata: storage.__data\n\t\t});\n\t\tmigratedData = result.data;\n\t\tnewVersion = result.version;\n\t\ttransfers = result.transfers;\n\t} catch (error) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\tfailedAt: \"block\"\n\t\t};\n\t}\n\tconst oldPlugins = storage.__plugins ?? {};\n\tconst oldRegistry = storage.__pluginRegistry ?? {};\n\tconst newPlugins = {};\n\tfor (const [key, pluginName] of Object.entries(newPluginRegistry)) {\n\t\tconst handle = key;\n\t\tconst existingEntry = oldPlugins[handle];\n\t\tconst existingName = oldRegistry[handle];\n\t\ttry {\n\t\t\tif (existingEntry && existingName === pluginName) {\n\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\tversion: existingEntry.__dataVersion,\n\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t});\n\t\t\t\tif (migrated) newPlugins[handle] = {\n\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t__data: migrated.data\n\t\t\t\t};\n\t\t\t} else if (existingEntry) {\n\t\t\t\tlet recovered = false;\n\t\t\t\ttry {\n\t\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\t\tversion: DATA_MODEL_LEGACY_VERSION,\n\t\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t\t});\n\t\t\t\t\tif (migrated) {\n\t\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t\t\t__data: migrated.data\n\t\t\t\t\t\t};\n\t\t\t\t\t\trecovered = true;\n\t\t\t\t\t}\n\t\t\t\t} catch (recoverError) {\n\t\t\t\t\tif (!isDataUnrecoverableError(recoverError)) throw recoverError;\n\t\t\t\t}\n\t\t\t\tif (!recovered) {\n\t\t\t\t\tconst transfer = transfers[handle];\n\t\t\t\t\tconst initial = createPluginData(handle, transfer);\n\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t\t\t__data: initial.data\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst transfer = transfers[handle];\n\t\t\t\tconst initial = createPluginData(handle, transfer);\n\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t\t__data: initial.data\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\tfailedAt: handle\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tsuccess: true,\n\t\tstorage: {\n\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t__dataVersion: newVersion,\n\t\t\t__data: migratedData,\n\t\t\t__pluginRegistry: newPluginRegistry,\n\t\t\t__plugins: newPlugins\n\t\t}\n\t};\n}\n/**\n* Gets plugin-specific data from block storage.\n* Accepts raw storage (any format) and normalizes internally.\n*\n* When called with a typed PluginHandle<F>, the return type is automatically\n* inferred from the factory's phantom `__types.data` field.\n*\n* @param rawStorage - Raw block storage (may be legacy format or BlockStorage)\n* @param handle - The plugin handle (branded plugin instance id)\n* @returns The plugin data, typed via factory inference\n* @throws If plugin is not found in storage\n*/\nfunction getPluginData(rawStorage, handle) {\n\tconst pluginEntry = normalizeBlockStorage(rawStorage).__plugins?.[handle];\n\tif (!pluginEntry) throw new Error(`Plugin '${handle}' not found in block storage`);\n\treturn pluginEntry.__data;\n}\n//#endregion\nexport { BLOCK_STORAGE_KEY, DATA_MODEL_LEGACY_VERSION, createBlockStorage, deriveDataFromStorage, getPluginData, getStorageData, isBlockStorage, migrateBlockStorage, normalizeBlockStorage, updateStorageData };\n\n//# sourceMappingURL=block_storage.js.map","import { DATA_MODEL_LEGACY_VERSION } from \"./block_storage.js\";\n//#region src/block_migrations.ts\n/** Create a DataVersioned wrapper with correct shape */\nfunction makeVersionedData(version, data) {\n\treturn {\n\t\tversion,\n\t\tdata\n\t};\n}\n/** Thrown by recover() to signal unrecoverable data. */\nvar DataUnrecoverableError = class extends Error {\n\tname = \"DataUnrecoverableError\";\n\tconstructor(dataVersion) {\n\t\tsuper(`Unknown version '${dataVersion}'`);\n\t}\n};\nfunction isDataUnrecoverableError(error) {\n\treturn error instanceof Error && error.name === \"DataUnrecoverableError\";\n}\n/**\n* Default recover function for unknown versions.\n* Use as fallback at the end of custom recover functions.\n*\n* @example\n* .recover((version, data) => {\n* if (version === 'legacy') {\n* return transformLegacyData(data);\n* }\n* return defaultRecover(version, data);\n* })\n*/\nconst defaultRecover = (version, _data) => {\n\tthrow new DataUnrecoverableError(version);\n};\n/** Symbol for internal builder creation method */\nconst FROM_BUILDER = Symbol(\"fromBuilder\");\n/**\n* Abstract base for both migration chain types.\n* Holds shared state, buildStep() helper, and init().\n* migrate() cannot be shared due to a TypeScript limitation: when the base class\n* migrate() return type is abstract, subclasses cannot narrow it without losing type safety.\n* Each subclass therefore owns its migrate() with the correct concrete return type.\n*\n* @internal\n*/\nvar MigrationChainBase = class {\n\tversionChain;\n\tmigrationSteps;\n\ttransferSteps;\n\tconstructor(state) {\n\t\tthis.versionChain = state.versionChain;\n\t\tthis.migrationSteps = state.steps;\n\t\tthis.transferSteps = state.transferSteps ?? [];\n\t}\n\t/** Appends a migration step and returns the new versionChain and steps arrays. */\n\tbuildStep(nextVersion, fn) {\n\t\tif (this.versionChain.includes(nextVersion)) throw new Error(`Duplicate version '${nextVersion}' in migration chain`);\n\t\tconst step = {\n\t\t\tfromVersion: this.versionChain[this.versionChain.length - 1],\n\t\t\ttoVersion: nextVersion,\n\t\t\tmigrate: fn\n\t\t};\n\t\treturn {\n\t\t\tversionChain: [...this.versionChain, nextVersion],\n\t\t\tsteps: [...this.migrationSteps, step]\n\t\t};\n\t}\n\t/** Validates uniqueness and records a TransferStep. */\n\tbuildTransfer(target, extract) {\n\t\tif (this.transferSteps.some((t) => t.pluginId === target.id)) throw new Error(`Duplicate transfer for plugin '${target.id}'`);\n\t\tconst entry = {\n\t\t\tpluginId: target.id,\n\t\t\tbeforeStepIndex: this.migrationSteps.length,\n\t\t\textract,\n\t\t\ttargetVersion: target.transferVersion\n\t\t};\n\t\treturn { transferSteps: [...this.transferSteps, entry] };\n\t}\n\t/** Returns recover-specific fields for DataModel construction. Overridden by WithRecover. */\n\trecoverState() {\n\t\treturn {};\n\t}\n\t/**\n\t* Finalize the DataModel with initial data factory.\n\t*\n\t* @param initialData - Factory function returning the initial state\n\t* @returns Finalized DataModel instance\n\t*/\n\tinit(initialData) {\n\t\treturn DataModel[FROM_BUILDER]({\n\t\t\tversionChain: this.versionChain,\n\t\t\tsteps: this.migrationSteps,\n\t\t\ttransferSteps: this.transferSteps,\n\t\t\tinitialDataFn: initialData,\n\t\t\t...this.recoverState()\n\t\t});\n\t}\n};\n/**\n* Migration chain after recover() or upgradeLegacy() has been called.\n* Further migrate() and transfer() calls are allowed; recover() and upgradeLegacy() are not\n* (enforced by type — no such methods on this class).\n*\n* @typeParam Current - Data type at the current point in the chain\n* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n* @internal\n*/\nvar DataModelMigrationChainWithRecover = class DataModelMigrationChainWithRecover extends MigrationChainBase {\n\trecoverFn;\n\trecoverFromIndex;\n\t/** @internal */\n\tconstructor(state) {\n\t\tsuper(state);\n\t\tthis.recoverFn = state.recoverFn;\n\t\tthis.recoverFromIndex = state.recoverFromIndex;\n\t}\n\trecoverState() {\n\t\treturn {\n\t\t\trecoverFn: this.recoverFn,\n\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t};\n\t}\n\t/**\n\t* Add a migration step. Same semantics as on the base chain.\n\t* recover() and upgradeLegacy() are not available — one has already been called.\n\t*/\n\tmigrate(nextVersion, fn) {\n\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\tversionChain,\n\t\t\tsteps,\n\t\t\ttransferSteps: this.transferSteps,\n\t\t\trecoverFn: this.recoverFn,\n\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t});\n\t}\n\t/**\n\t* Extract data at the current chain position for seeding a new plugin.\n\t* The extract function's return type must match the plugin's transfer data type.\n\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t*/\n\ttransfer(target, extract) {\n\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\tversionChain: this.versionChain,\n\t\t\tsteps: this.migrationSteps,\n\t\t\ttransferSteps,\n\t\t\trecoverFn: this.recoverFn,\n\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t});\n\t}\n};\n/**\n* Migration chain builder.\n* Each migrate() call advances the current data type. recover() can be called once\n* at any point — it removes itself from the returned chain so it cannot be called again.\n* Duplicate version keys throw at runtime.\n*\n* @typeParam Current - Data type at the current point in the migration chain\n* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n* @internal\n*/\nvar DataModelMigrationChain = class DataModelMigrationChain extends MigrationChainBase {\n\t/** @internal */\n\tconstructor({ versionChain, steps = [], transferSteps = [] }) {\n\t\tsuper({\n\t\t\tversionChain,\n\t\t\tsteps,\n\t\t\ttransferSteps\n\t\t});\n\t}\n\t/**\n\t* Add a migration step transforming data from the current version to the next.\n\t*\n\t* @typeParam Next - Data type of the next version\n\t* @param nextVersion - Version key to migrate to (must be unique in the chain)\n\t* @param fn - Migration function\n\t* @returns Builder with the next version as current\n\t*\n\t* @example\n\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n\t*/\n\tmigrate(nextVersion, fn) {\n\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\treturn new DataModelMigrationChain({\n\t\t\tversionChain,\n\t\t\tsteps,\n\t\t\ttransferSteps: this.transferSteps\n\t\t});\n\t}\n\t/**\n\t* Extract data at the current chain position for seeding a new plugin.\n\t* The extract function's return type must match the plugin's transfer data type.\n\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t*\n\t* Calling .transfer() on DataModelInitialChain returns DataModelMigrationChain,\n\t* which removes .upgradeLegacy() from the chain (preventing a problematic combination).\n\t*\n\t* @example\n\t* .from<V1>(\"v1\")\n\t* .transfer(tablePlugin, (v1) => ({ state: v1.tableState }))\n\t* .migrate<V2>(\"v2\", ({ tableState: _, ...rest }) => rest)\n\t*/\n\ttransfer(target, extract) {\n\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\treturn new DataModelMigrationChain({\n\t\t\tversionChain: this.versionChain,\n\t\t\tsteps: this.migrationSteps,\n\t\t\ttransferSteps\n\t\t});\n\t}\n\t/**\n\t* Set a recovery handler for unknown or legacy versions.\n\t*\n\t* The recover function is called when data has a version not in the migration chain.\n\t* It must return data of the type at this point in the chain (Current). Any migrate()\n\t* steps added after recover() will then run on the recovered data.\n\t*\n\t* Can only be called once — the returned chain has no recover() method.\n\t*\n\t* @param fn - Recovery function returning Current (the type at this chain position)\n\t* @returns Builder with migrate() and init() but without recover()\n\t*\n\t* @example\n\t* // Recover between migrations — recovered data goes through v3 migration\n\t* new DataModelBuilder<V1>(\"v1\")\n\t* .migrate<V2>(\"v2\", (v1) => ({ ...v1, label: \"\" }))\n\t* .recover((version, data) => {\n\t* if (version === 'legacy') return transformLegacy(data); // returns V2\n\t* return defaultRecover(version, data);\n\t* })\n\t* .migrate<V3>(\"v3\", (v2) => ({ ...v2, description: \"\" }))\n\t* .init(() => ({ count: 0, label: \"\", description: \"\" }));\n\t*/\n\trecover(fn) {\n\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\tversionChain: this.versionChain,\n\t\t\tsteps: this.migrationSteps,\n\t\t\ttransferSteps: this.transferSteps,\n\t\t\trecoverFn: fn,\n\t\t\trecoverFromIndex: this.migrationSteps.length\n\t\t});\n\t}\n};\n/**\n* Initial migration chain returned by `.from()`.\n* Extends DataModelMigrationChain with `upgradeLegacy()` — available only before\n* any `.migrate()` calls, since legacy data always arrives at the initial version.\n*\n* @typeParam Current - Data type at the initial version\n* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n* @internal\n*/\nvar DataModelInitialChain = class extends DataModelMigrationChain {\n\t/**\n\t* Handle legacy V1 model state ({ args, uiState }) when upgrading a block from\n\t* BlockModel V1 to BlockModelV3.\n\t*\n\t* When a V1 block is upgraded, its stored state `{ args, uiState }` is normalized\n\t* to the internal default version. This method inserts a migration step from that\n\t* internal version to the version specified in `.from()`, using the provided typed\n\t* callback to transform the legacy shape. Non-legacy data passes through unchanged.\n\t*\n\t* Must be called right after `.from()` — not available after `.migrate()` calls.\n\t* Any `.migrate()` steps added after `upgradeLegacy()` will run on the transformed result.\n\t*\n\t* Can only be called once — the returned chain has no upgradeLegacy() method.\n\t* Mutually exclusive with recover().\n\t*\n\t* @typeParam Args - Type of the legacy block args\n\t* @typeParam UiState - Type of the legacy block uiState\n\t* @param fn - Typed transform from { args, uiState } to Current\n\t* @returns Builder with migrate() and init() but without recover() or upgradeLegacy()\n\t*\n\t* @example\n\t* type OldArgs = { inputFile: string; threshold: number };\n\t* type OldUiState = { selectedTab: string };\n\t* type BlockData = { inputFile: string; threshold: number; selectedTab: string };\n\t*\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockData>(\"v1\")\n\t* .upgradeLegacy<OldArgs, OldUiState>(({ args, uiState }) => ({\n\t* inputFile: args.inputFile,\n\t* threshold: args.threshold,\n\t* selectedTab: uiState.selectedTab,\n\t* }))\n\t* .init(() => ({ inputFile: '', threshold: 0, selectedTab: 'main' }));\n\t*/\n\tupgradeLegacy(fn) {\n\t\tconst wrappedFn = (data) => {\n\t\t\tif (data !== null && typeof data === \"object\" && \"args\" in data) return fn(data);\n\t\t\treturn data;\n\t\t};\n\t\tconst step = {\n\t\t\tfromVersion: DATA_MODEL_LEGACY_VERSION,\n\t\t\ttoVersion: this.versionChain[0],\n\t\t\tmigrate: wrappedFn\n\t\t};\n\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\tversionChain: [DATA_MODEL_LEGACY_VERSION, ...this.versionChain],\n\t\t\tsteps: [step, ...this.migrationSteps],\n\t\t\ttransferSteps: this.transferSteps.map((t) => ({\n\t\t\t\t...t,\n\t\t\t\tbeforeStepIndex: t.beforeStepIndex + 1\n\t\t\t}))\n\t\t});\n\t}\n};\n/**\n* Builder entry point for creating DataModel with type-safe migrations.\n*\n* @example\n* // Simple (no migrations):\n* const dataModel = new DataModelBuilder()\n* .from<BlockData>(\"v1\")\n* .init(() => ({ numbers: [] }));\n*\n* @example\n* // With migrations:\n* const dataModel = new DataModelBuilder()\n* .from<BlockDataV1>(\"v1\")\n* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n* .init(() => ({ numbers: [], labels: [], description: '' }));\n*\n* @example\n* // With recover() between migrations — recovered data goes through remaining migrations:\n* const dataModelChain = new DataModelBuilder()\n* .from<BlockDataV1>(\"v1\")\n* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }));\n*\n* // recover() placed before the v3 migration: recovered data goes through v3\n* const dataModel = dataModelChain\n* .recover((version, data) => {\n* if (version === 'legacy' && isLegacyData(data)) return transformLegacy(data); // returns V2\n* return defaultRecover(version, data);\n* })\n* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n* .init(() => ({ numbers: [], labels: [], description: '' }));\n*\n* @example\n* // With upgradeLegacy() — typed upgrade from BlockModel V1 state:\n* type OldArgs = { inputFile: string };\n* type OldUiState = { selectedTab: string };\n* type BlockData = { inputFile: string; selectedTab: string };\n*\n* const dataModel = new DataModelBuilder()\n* .from<BlockData>(\"v1\")\n* .upgradeLegacy<OldArgs, OldUiState>(({ args, uiState }) => ({\n* inputFile: args.inputFile,\n* selectedTab: uiState.selectedTab,\n* }))\n* .init(() => ({ inputFile: '', selectedTab: 'main' }));\n*/\nvar DataModelBuilder = class {\n\t/**\n\t* Start the migration chain with the given initial data type and version key.\n\t*\n\t* @typeParam T - Data type for the initial version\n\t* @param initialVersion - Version key string (e.g. \"v1\")\n\t* @returns Migration chain builder\n\t*/\n\tfrom(initialVersion) {\n\t\treturn new DataModelInitialChain({ versionChain: [initialVersion] });\n\t}\n};\n/**\n* DataModel defines the block's data structure, initial values, and migrations.\n* Used by BlockModelV3 to manage data state.\n*\n* Use `new DataModelBuilder()` to create a DataModel.\n*\n* @example\n* // With recover() between migrations:\n* // Recovered data (V2) goes through the v2→v3 migration automatically.\n* const dataModel = new DataModelBuilder()\n* .from<V1>(\"v1\")\n* .migrate<V2>(\"v2\", (v1) => ({ ...v1, label: \"\" }))\n* .recover((version, data) => {\n* if (version === \"legacy\") return transformLegacy(data); // returns V2\n* return defaultRecover(version, data);\n* })\n* .migrate<V3>(\"v3\", (v2) => ({ ...v2, description: \"\" }))\n* .init(() => ({ count: 0, label: \"\", description: \"\" }));\n*/\nvar DataModel = class DataModel {\n\t/** Latest version key — O(1) access for the common \"already current\" check. */\n\tlatestVersion;\n\t/** Maps each known version key to the index of the first step to run from it. O(1) lookup. */\n\tstepsByFromVersion;\n\tsteps;\n\ttransferSteps;\n\tinitialDataFn;\n\trecoverFn;\n\trecoverFromIndex;\n\tconstructor({ versionChain, steps, transferSteps = [], initialDataFn, recoverFn = defaultRecover, recoverFromIndex }) {\n\t\tif (versionChain.length === 0) throw new Error(\"DataModel requires at least one version key\");\n\t\tthis.latestVersion = versionChain[versionChain.length - 1];\n\t\tthis.stepsByFromVersion = new Map(versionChain.map((v, i) => [v, i]));\n\t\tthis.steps = steps;\n\t\tthis.transferSteps = transferSteps;\n\t\tthis.initialDataFn = initialDataFn;\n\t\tthis.recoverFn = recoverFn;\n\t\tthis.recoverFromIndex = recoverFromIndex ?? steps.length;\n\t}\n\t/**\n\t* Internal method for creating DataModel from builder.\n\t* Uses Symbol key to prevent external access.\n\t* @internal\n\t*/\n\tstatic [FROM_BUILDER](state) {\n\t\treturn new DataModel(state);\n\t}\n\t/**\n\t* The latest (current) version key in the migration chain.\n\t*/\n\tget version() {\n\t\treturn this.latestVersion;\n\t}\n\t/**\n\t* Get a fresh copy of the initial data.\n\t*/\n\tinitialData() {\n\t\treturn this.initialDataFn();\n\t}\n\t/**\n\t* Get initial data wrapped with current version.\n\t* Used when creating new blocks or resetting to defaults.\n\t*/\n\tgetDefaultData() {\n\t\treturn makeVersionedData(this.latestVersion, this.initialDataFn());\n\t}\n\trecoverFrom(data, version) {\n\t\tlet currentData = this.recoverFn(version, data);\n\t\tfor (let i = this.recoverFromIndex; i < this.steps.length; i++) currentData = this.steps[i].migrate(currentData);\n\t\treturn {\n\t\t\tversion: this.latestVersion,\n\t\t\tdata: currentData\n\t\t};\n\t}\n\t/**\n\t* Migrate versioned data from any version to the latest.\n\t* Collects transfer extractions at their designated chain positions.\n\t*\n\t* - If version is in chain, applies needed migrations (O(1) lookup)\n\t* - If version is unknown, attempts recovery; falls back to initial data\n\t* - If a migration step fails, throws so the caller can preserve original data\n\t*\n\t* Transfers only fire during normal step-by-step migration:\n\t* - Recovery path: returns empty transfers\n\t* - Fast-path (already at latest): returns empty transfers\n\t*\n\t* @param versioned - Data with version tag\n\t* @returns Migrated data at the latest version with transfer record\n\t* @throws If a migration step from a known version fails\n\t*/\n\tmigrate(versioned) {\n\t\tconst { version: fromVersion, data } = versioned;\n\t\tif (fromVersion === this.latestVersion) return {\n\t\t\tversion: this.latestVersion,\n\t\t\tdata,\n\t\t\ttransfers: {}\n\t\t};\n\t\tconst startIndex = this.stepsByFromVersion.get(fromVersion);\n\t\tif (startIndex === void 0) try {\n\t\t\treturn {\n\t\t\t\t...this.recoverFrom(data, fromVersion),\n\t\t\t\ttransfers: {}\n\t\t\t};\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\t...this.getDefaultData(),\n\t\t\t\ttransfers: {}\n\t\t\t};\n\t\t}\n\t\tlet currentData = data;\n\t\tconst transfers = {};\n\t\tfor (let i = startIndex; i < this.steps.length; i++) {\n\t\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex === i) transfers[t.pluginId] = {\n\t\t\t\tversion: t.targetVersion,\n\t\t\t\tdata: t.extract(currentData)\n\t\t\t};\n\t\t\tcurrentData = this.steps[i].migrate(currentData);\n\t\t}\n\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex >= this.steps.length && t.beforeStepIndex >= startIndex) transfers[t.pluginId] = {\n\t\t\tversion: t.targetVersion,\n\t\t\tdata: t.extract(currentData)\n\t\t};\n\t\treturn {\n\t\t\tversion: this.latestVersion,\n\t\t\tdata: currentData,\n\t\t\ttransfers\n\t\t};\n\t}\n};\n//#endregion\nexport { DataModel, DataModelBuilder, DataUnrecoverableError, defaultRecover, isDataUnrecoverableError, makeVersionedData };\n\n//# sourceMappingURL=block_migrations.js.map","//#region src/internal.ts\n/** Utility code helping to identify whether the code is running in actual UI environment */\nfunction isInUI() {\n\treturn typeof globalThis.getPlatforma !== \"undefined\" || typeof globalThis.platforma !== \"undefined\";\n}\n/** Utility code helping to retrieve a platforma instance form the environment */\nfunction getPlatformaInstance(config) {\n\tif (config && typeof globalThis.getPlatforma === \"function\") return globalThis.getPlatforma(config);\n\telse if (typeof globalThis.platforma !== \"undefined\") return globalThis.platforma;\n\telse throw new Error(\"Can't get platforma instance.\");\n}\nfunction tryGetCfgRenderCtx() {\n\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\telse return void 0;\n}\nfunction getCfgRenderCtx() {\n\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\telse throw new Error(\"Not in config rendering context\");\n}\nfunction tryRegisterCallback(key, callback) {\n\tconst ctx = tryGetCfgRenderCtx();\n\tif (ctx === void 0) return false;\n\tif (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n\tctx.callbackRegistry[key] = callback;\n\treturn true;\n}\n/**\n* Registers a callback, replacing any existing callback with the same key.\n* Use this for callbacks that have a default value but can be overridden.\n*\n* @param key - The callback registry key\n* @param callback - The callback function to register\n* @returns true if registered, false if not in render context\n*/\nfunction replaceCallback(key, callback) {\n\tconst ctx = tryGetCfgRenderCtx();\n\tif (ctx === void 0) return false;\n\tctx.callbackRegistry[key] = callback;\n\treturn true;\n}\n/** Creates a ConfigRenderLambda descriptor without registering a callback. */\nfunction createRenderLambda(opts) {\n\tconst { handle, ...flags } = opts;\n\treturn {\n\t\t__renderLambda: true,\n\t\thandle,\n\t\t...flags\n\t};\n}\n/** Registers a callback and returns a ConfigRenderLambda descriptor. */\nfunction createAndRegisterRenderLambda(opts, replace) {\n\tconst { handle, lambda, ...flags } = opts;\n\tif (replace) replaceCallback(handle, lambda);\n\telse tryRegisterCallback(handle, lambda);\n\treturn createRenderLambda({\n\t\thandle,\n\t\t...flags\n\t});\n}\nconst futureResolves = /* @__PURE__ */ new Map();\nfunction registerFutureAwait(handle, onResolve) {\n\tif (!(handle in getCfgRenderCtx().callbackRegistry)) {\n\t\tgetCfgRenderCtx().callbackRegistry[handle] = (value) => {\n\t\t\tfor (const res of futureResolves.get(handle)) res(value);\n\t\t};\n\t\tfutureResolves.set(handle, []);\n\t}\n\tfutureResolves.get(handle).push(onResolve);\n}\n//#endregion\nexport { createAndRegisterRenderLambda, createRenderLambda, getCfgRenderCtx, getPlatformaInstance, isInUI, registerFutureAwait, replaceCallback, tryGetCfgRenderCtx, tryRegisterCallback };\n\n//# sourceMappingURL=internal.js.map","import { createRenderLambda, tryRegisterCallback } from \"./internal.js\";\n//#region src/block_storage_facade.ts\n/**\n* The current facade version. This value is used for `requiresModelAPIVersion`\n* feature flag in BlockModelV3.\n*/\nconst BLOCK_STORAGE_FACADE_VERSION = 2;\n/**\n* All facade callback names as constants.\n* These are the source of truth - the interface is derived from these.\n*\n* IMPORTANT: When adding a new callback:\n* 1. Add the constant here\n* 2. Add the callback signature to FacadeCallbackTypes below\n* 3. The BlockStorageFacade type will automatically include it\n*/\nconst BlockStorageFacadeCallbacks = {\n\tStorageApplyUpdate: \"__pl_storage_applyUpdate\",\n\tStorageDebugView: \"__pl_storage_debugView\",\n\tStorageMigrate: \"__pl_storage_migrate\",\n\tArgsDerive: \"__pl_args_derive\",\n\tPrerunArgsDerive: \"__pl_prerunArgs_derive\",\n\tStorageInitial: \"__pl_storage_initial\"\n};\n/**\n* Creates a map of lambda handles from a callbacks constant object.\n* Keys are the callback string values (e.g., '__pl_storage_applyUpdate').\n*/\nfunction createFacadeHandles(callbacks) {\n\treturn Object.fromEntries(Object.values(callbacks).map((handle) => [handle, createRenderLambda({ handle })]));\n}\n/**\n* Lambda handles for facade callbacks.\n* Used by the middle layer to invoke callbacks via executeSingleLambda().\n*/\nconst BlockStorageFacadeHandles = createFacadeHandles(BlockStorageFacadeCallbacks);\n/** Register all facade callbacks at once. Ensures all required callbacks are provided. */\nfunction registerFacadeCallbacks(callbacks) {\n\tfor (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);\n}\n//#endregion\nexport { BLOCK_STORAGE_FACADE_VERSION, BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, registerFacadeCallbacks };\n\n//# sourceMappingURL=block_storage_facade.js.map","//#region src/config/actions.ts\nfunction primitiveToConfig(value) {\n\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || value === null) return getImmediate(value);\n\telse return value;\n}\nfunction getFromCfg(variable) {\n\treturn {\n\t\ttype: \"GetFromCtx\",\n\t\tvariable\n\t};\n}\nfunction isolate(cfg) {\n\treturn {\n\t\ttype: \"Isolate\",\n\t\tcfg\n\t};\n}\nconst Args = getFromCfg(\"$args\");\nconst It = getFromCfg(\"$it\");\nconst MainOutputs = getFromCfg(\"$prod\");\nconst StagingOutputs = getFromCfg(\"$staging\");\nconst UiState = getFromCfg(\"$ui\");\nfunction getImmediate(value) {\n\treturn {\n\t\ttype: \"Immediate\",\n\t\tvalue\n\t};\n}\nfunction makeObject(template) {\n\tconst normalizedTemplate = {};\n\tfor (const [k, cfg] of Object.entries(template)) normalizedTemplate[k] = primitiveToConfig(cfg);\n\treturn {\n\t\ttype: \"MakeObject\",\n\t\ttemplate: normalizedTemplate\n\t};\n}\nfunction makeArray(...template) {\n\tconst normalizedTemplate = [];\n\tfor (const cfg of template) normalizedTemplate.push(primitiveToConfig(cfg));\n\treturn {\n\t\ttype: \"MakeArray\",\n\t\ttemplate: normalizedTemplate\n\t};\n}\nfunction getJsonField(source, field) {\n\treturn {\n\t\ttype: \"GetJsonField\",\n\t\tsource: primitiveToConfig(source),\n\t\tfield: primitiveToConfig(field)\n\t};\n}\nfunction mapRecordValues(source, mapping, itVar = \"$it\") {\n\treturn {\n\t\ttype: \"MapRecordValues\",\n\t\tsource,\n\t\tmapping,\n\t\titVar\n\t};\n}\nfunction mapArrayValues(source, mapping, itVar = \"$it\") {\n\treturn {\n\t\ttype: \"MapArrayValues\",\n\t\tsource,\n\t\tmapping,\n\t\titVar\n\t};\n}\nfunction flatten(source) {\n\treturn {\n\t\ttype: \"Flatten\",\n\t\tsource\n\t};\n}\nfunction isEmpty(arg) {\n\treturn {\n\t\ttype: \"IsEmpty\",\n\t\targ\n\t};\n}\nfunction not(operand) {\n\treturn {\n\t\ttype: \"Not\",\n\t\toperand\n\t};\n}\nfunction and(operand1, operand2) {\n\treturn {\n\t\ttype: \"And\",\n\t\toperand1,\n\t\toperand2\n\t};\n}\nfunction or(operand1, operand2) {\n\treturn {\n\t\ttype: \"Or\",\n\t\toperand1,\n\t\toperand2\n\t};\n}\nfunction getResourceField(source, field) {\n\treturn {\n\t\ttype: \"GetResourceField\",\n\t\tsource: primitiveToConfig(source),\n\t\tfield: primitiveToConfig(field)\n\t};\n}\nfunction getResourceValueAsJson() {\n\treturn function(source) {\n\t\treturn {\n\t\t\ttype: \"GetResourceValueAsJson\",\n\t\t\tsource: primitiveToConfig(source)\n\t\t};\n\t};\n}\nfunction mapResourceFields(source, mapping, itVar = \"$it\") {\n\treturn {\n\t\ttype: \"MapResourceFields\",\n\t\tsource,\n\t\tmapping,\n\t\titVar\n\t};\n}\nfunction getBlobContent(source, range) {\n\treturn {\n\t\ttype: \"GetBlobContent\",\n\t\trange,\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction getBlobContentAsString(source, range) {\n\treturn {\n\t\ttype: \"GetBlobContentAsString\",\n\t\trange,\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction getBlobContentAsJson() {\n\treturn function(source, range) {\n\t\treturn {\n\t\t\ttype: \"GetBlobContentAsJson\",\n\t\t\trange,\n\t\t\tsource: primitiveToConfig(source)\n\t\t};\n\t};\n}\nfunction getDownloadedBlobContent(source) {\n\treturn {\n\t\ttype: \"GetDownloadedBlobContent\",\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction getOnDemandBlobContent(source) {\n\treturn {\n\t\ttype: \"GetOnDemandBlobContent\",\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction extractArchiveAndGetURL(source, format) {\n\treturn {\n\t\ttype: \"ExtractArchiveAndGetURL\",\n\t\tformat,\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction getImportProgress(source) {\n\treturn {\n\t\ttype: \"GetImportProgress\",\n\t\tsource: primitiveToConfig(source)\n\t};\n}\nfunction getLastLogs(source, lines) {\n\treturn {\n\t\ttype: \"GetLastLogs\",\n\t\tsource: primitiveToConfig(source),\n\t\tlines\n\t};\n}\nfunction getProgressLog(source, patternToSearch) {\n\treturn {\n\t\ttype: \"GetProgressLog\",\n\t\tsource: primitiveToConfig(source),\n\t\tpatternToSearch\n\t};\n}\nfunction getProgressLogWithInfo(source, patternToSearch) {\n\treturn {\n\t\ttype: \"GetProgressLogWithInfo\",\n\t\tsource: primitiveToConfig(source),\n\t\tpatternToSearch\n\t};\n}\nfunction getLogHandle(source) {\n\treturn {\n\t\ttype: \"GetLogHandle\",\n\t\tsource: primitiveToConfig(source)\n\t};\n}\n//#endregion\nexport { Args, It, MainOutputs, StagingOutputs, UiState, and, extractArchiveAndGetURL, flatten, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getDownloadedBlobContent, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getProgressLog, getProgressLogWithInfo, getResourceField, getResourceValueAsJson, isEmpty, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, not, or };\n\n//# sourceMappingURL=actions.js.map","import { registerFutureAwait } from \"../internal.js\";\n//#region src/render/future.ts\nvar FutureRef = class FutureRef {\n\thandle;\n\tpostProcess;\n\tisResolved = false;\n\tresolvedValue;\n\tconstructor(handle, postProcess = (v) => v) {\n\t\tthis.handle = handle;\n\t\tthis.postProcess = postProcess;\n\t\tregisterFutureAwait(handle, (value) => {\n\t\t\tthis.resolvedValue = postProcess(value);\n\t\t\tthis.isResolved = true;\n\t\t});\n\t}\n\tmap(mapping) {\n\t\treturn new FutureRef(this.handle, (v) => mapping(this.postProcess(v)));\n\t}\n\tmapDefined(mapping) {\n\t\treturn new FutureRef(this.handle, (v) => {\n\t\t\tconst vv = this.postProcess(v);\n\t\t\treturn vv ? mapping(vv) : void 0;\n\t\t});\n\t}\n\ttoJSON() {\n\t\treturn this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };\n\t}\n};\n//#endregion\nexport { FutureRef };\n\n//# sourceMappingURL=future.js.map","export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n","import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n","import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n","import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n","import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n","export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n","import { ZodError, ZodIssueCode, } from \"./ZodError.js\";\nimport { defaultErrorMap, getErrorMap } from \"./errors.js\";\nimport { errorUtil } from \"./helpers/errorUtil.js\";\nimport { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from \"./helpers/parseUtil.js\";\nimport { util, ZodParsedType, getParsedType } from \"./helpers/util.js\";\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nexport class ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\nconst ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nexport class ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport class ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nexport class ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nexport class ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nexport class ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nexport class ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nexport class ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nexport class ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nexport class ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nexport class ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nexport class ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nexport class ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nexport class ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nexport class ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexport class ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nexport class ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nexport class ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexport class ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nexport class ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nexport class ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nZodEnum.create = createZodEnum;\nexport class ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nexport class ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nexport class ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nexport { ZodEffects as ZodTransformer };\nexport class ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nexport class ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nexport class ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nexport class ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nexport class ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexport const BRAND = Symbol(\"zod_brand\");\nexport class ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexport class ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexport class ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nexport function custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexport { ZodType as Schema, ZodType as ZodSchema };\nexport const late = {\n object: ZodObject.lazycreate,\n};\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nexport const coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexport { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };\nexport const NEVER = INVALID;\n","import { z } from \"zod\";\n//#region src/bmodel/code.ts\nconst Code = z.object({\n\ttype: z.literal(\"plain\"),\n\tcontent: z.string()\n});\n//#endregion\nexport { Code };\n\n//# sourceMappingURL=code.js.map","import { z } from \"zod\";\n//#region src/drivers/blob.ts\n/** Range in bytes, from should be less than to. */\nconst RangeBytes = z.object({\n\t/** Included left border. */\n\tfrom: z.number().min(0),\n\t/** Excluded right border. */\n\tto: z.number().min(1)\n});\nfunction newRangeBytesOpt(from, to) {\n\tif (from == void 0 || to == void 0) return;\n\tconst range = {\n\t\tfrom,\n\t\tto\n\t};\n\tvalidateRangeBytes(range, \"newRangeBytesOpt\");\n\treturn range;\n}\nfunction validateRangeBytes(range, errMsg) {\n\tif (range.from < 0 || range.from >= range.to) throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n}\n//#endregion\nexport { RangeBytes, newRangeBytesOpt, validateRangeBytes };\n\n//# sourceMappingURL=blob.js.map","//#region src/util.ts\nfunction assertNever(x) {\n\tthrow new Error(\"Unexpected object: \" + x);\n}\n/**\n* Return unique entries of the array by the provided id\n* For each id, the last entry is kept\n*/\nfunction uniqueBy(array, makeId) {\n\treturn [...new Map(array.map((e) => [makeId(e), e])).values()];\n}\n//#endregion\nexport { assertNever, uniqueBy };\n\n//# sourceMappingURL=util.js.map","import { assertNever } from \"../../util.js\";\n//#region src/drivers/pframe/data_info.ts\n/**\n* Type guard function that checks if the given value is a valid DataInfo.\n*\n* @param value - The value to check\n* @returns True if the value is a valid DataInfo, false otherwise\n*/\nfunction isDataInfo(value) {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst data = value;\n\tif (!(\"type\" in data)) return false;\n\tswitch (data.type) {\n\t\tcase \"Json\": return typeof data.keyLength === \"number\" && data.data !== void 0 && typeof data.data === \"object\";\n\t\tcase \"JsonPartitioned\":\n\t\tcase \"BinaryPartitioned\":\n\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && data.parts !== void 0 && typeof data.parts === \"object\";\n\t\tdefault: return false;\n\t}\n}\nfunction mapDataInfo(dataInfo, mapFn) {\n\tif (dataInfo === void 0) return;\n\tswitch (dataInfo.type) {\n\t\tcase \"Json\": return dataInfo;\n\t\tcase \"JsonPartitioned\": {\n\t\t\tconst newParts = {};\n\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\treturn {\n\t\t\t\t...dataInfo,\n\t\t\t\tparts: newParts\n\t\t\t};\n\t\t}\n\t\tcase \"BinaryPartitioned\": {\n\t\t\tconst newParts = {};\n\t\t\tfor (const [key, chunk] of Object.entries(dataInfo.parts)) newParts[key] = {\n\t\t\t\tindex: mapFn(chunk.index),\n\t\t\t\tvalues: mapFn(chunk.values)\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...dataInfo,\n\t\t\t\tparts: newParts\n\t\t\t};\n\t\t}\n\t\tcase \"ParquetPartitioned\": {\n\t\t\tconst newParts = {};\n\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\treturn {\n\t\t\t\t...dataInfo,\n\t\t\t\tparts: newParts\n\t\t\t};\n\t\t}\n\t}\n}\n/**\n* @param dataInfo - The source DataInfo object\n* @param cb - Callback, function that have access to every blob to visit them all\n* @returns Nothing\n*/\nfunction visitDataInfo(dataInfo, cb) {\n\tswitch (dataInfo.type) {\n\t\tcase \"Json\": break;\n\t\tcase \"JsonPartitioned\":\n\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\tbreak;\n\t\tcase \"BinaryPartitioned\":\n\t\t\tObject.values(dataInfo.parts).forEach((chunk) => {\n\t\t\t\tcb(chunk.index);\n\t\t\t\tcb(chunk.values);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"ParquetPartitioned\":\n\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\tbreak;\n\t}\n}\n/**\n* Type guard function that checks if the given value is a valid DataInfoEntries.\n*\n* @param value - The value to check\n* @returns True if the value is a valid DataInfoEntries, false otherwise\n*/\nfunction isDataInfoEntries(value) {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst data = value;\n\tif (!(\"type\" in data)) return false;\n\tswitch (data.type) {\n\t\tcase \"Json\": return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n\t\tcase \"JsonPartitioned\":\n\t\tcase \"BinaryPartitioned\":\n\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n\t\tdefault: return false;\n\t}\n}\n/**\n* Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n*\n* @template Blob - Type parameter representing the storage reference type\n* @param value - The value to check\n* @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n*/\nfunction isPartitionedDataInfoEntries(value) {\n\tif (!isDataInfoEntries(value)) return false;\n\tswitch (value.type) {\n\t\tcase \"JsonPartitioned\":\n\t\tcase \"BinaryPartitioned\":\n\t\tcase \"ParquetPartitioned\": return true;\n\t\tdefault: return false;\n\t}\n}\n/**\n* Converts DataInfo to DataInfoEntries\n*\n* @param dataInfo - The record-based DataInfo object\n* @returns The equivalent entry-based DataInfoEntries object\n*/\nfunction dataInfoToEntries(dataInfo) {\n\tswitch (dataInfo.type) {\n\t\tcase \"Json\": return {\n\t\t\ttype: \"Json\",\n\t\t\tkeyLength: dataInfo.keyLength,\n\t\t\tdata: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\tvalue\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tcase \"JsonPartitioned\": return {\n\t\t\ttype: \"JsonPartitioned\",\n\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\tvalue: blob\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tcase \"BinaryPartitioned\": return {\n\t\t\ttype: \"BinaryPartitioned\",\n\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\tvalue: chunk\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tcase \"ParquetPartitioned\": return {\n\t\t\ttype: \"ParquetPartitioned\",\n\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\tvalue: blob\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tdefault: assertNever(dataInfo);\n\t}\n}\n/**\n* Converts DataInfoEntries to DataInfo\n*\n* @param dataInfoEntries - The entry-based DataInfoEntries object\n* @returns The equivalent record-based DataInfo object\n*/\nfunction entriesToDataInfo(dataInfoEntries) {\n\tswitch (dataInfoEntries.type) {\n\t\tcase \"Json\": return {\n\t\t\ttype: \"Json\",\n\t\t\tkeyLength: dataInfoEntries.keyLength,\n\t\t\tdata: Object.fromEntries(dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t};\n\t\tcase \"JsonPartitioned\": return {\n\t\t\ttype: \"JsonPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t};\n\t\tcase \"BinaryPartitioned\": return {\n\t\t\ttype: \"BinaryPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t};\n\t\tcase \"ParquetPartitioned\": return {\n\t\t\ttype: \"ParquetPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t};\n\t\tdefault: assertNever(dataInfoEntries);\n\t}\n}\nfunction mapDataInfoEntries(dataInfoEntries, mapFn) {\n\tif (dataInfoEntries === void 0) return;\n\tswitch (dataInfoEntries.type) {\n\t\tcase \"Json\": return dataInfoEntries;\n\t\tcase \"JsonPartitioned\": return {\n\t\t\t...dataInfoEntries,\n\t\t\tparts: dataInfoEntries.parts.map((entry) => ({\n\t\t\t\tkey: entry.key,\n\t\t\t\tvalue: mapFn(entry.value)\n\t\t\t}))\n\t\t};\n\t\tcase \"BinaryPartitioned\": return {\n\t\t\t...dataInfoEntries,\n\t\t\tparts: dataInfoEntries.parts.map((entry) => ({\n\t\t\t\tkey: entry.key,\n\t\t\t\tvalue: {\n\t\t\t\t\tindex: mapFn(entry.value.index),\n\t\t\t\t\tvalues: mapFn(entry.value.values)\n\t\t\t\t}\n\t\t\t}))\n\t\t};\n\t\tcase \"ParquetPartitioned\": return {\n\t\t\t...dataInfoEntries,\n\t\t\tparts: dataInfoEntries.parts.map((entry) => ({\n\t\t\t\tkey: entry.key,\n\t\t\t\tvalue: mapFn(entry.value)\n\t\t\t}))\n\t\t};\n\t}\n}\n//#endregion\nexport { dataInfoToEntries, entriesToDataInfo, isDataInfo, isDataInfoEntries, isPartitionedDataInfoEntries, mapDataInfo, mapDataInfoEntries, visitDataInfo };\n\n//# sourceMappingURL=data_info.js.map","//#region src/errors.ts\n/**\n* Just for convenience, usually it is an Error with name 'AbortError'\n*/\nvar AbortError = class extends Error {\n\tname = \"AbortError\";\n};\n/**\n* Throw this to show a message without stack trace in UI\n*/\nvar UiError = class extends Error {\n\tname = \"UiError\";\n};\nfunction isAbortError(error) {\n\treturn error instanceof Error && error.name === \"AbortError\";\n}\nfunction hasAbortError(error) {\n\tif (!(error instanceof Error)) return false;\n\treturn error.name === \"AbortError\" || hasAbortError(error.cause);\n}\nfunction isAggregateError(error) {\n\treturn error instanceof Error && error.name === \"AggregateError\";\n}\nvar ServiceError = class extends Error {\n\tname = \"ServiceError\";\n};\nfunction isServiceError(error) {\n\treturn error instanceof Error && (error.name === \"ServiceError\" || error.name.startsWith(\"ServiceError.\"));\n}\nvar ServiceInvalidIdError = class extends ServiceError {\n\tname = \"ServiceError.InvalidId\";\n};\nfunction isServiceInvalidIdError(error) {\n\treturn error instanceof Error && error.name === \"ServiceError.InvalidId\";\n}\nvar ServiceAlreadyRegisteredError = class extends ServiceError {\n\tname = \"ServiceError.AlreadyRegistered\";\n};\nfunction isServiceAlreadyRegisteredError(error) {\n\treturn error instanceof Error && error.name === \"ServiceError.AlreadyRegistered\";\n}\nvar ServiceInjectionError = class extends ServiceError {\n\tname = \"ServiceError.Injection\";\n};\nfunction isServiceInjectionError(error) {\n\treturn error instanceof Error && error.name === \"ServiceError.Injection\";\n}\nvar ServiceNotRegisteredError = class extends ServiceError {\n\tname = \"ServiceError.NotRegistered\";\n};\nfunction isServiceNotRegisteredError(error) {\n\treturn error instanceof Error && error.name === \"ServiceError.NotRegistered\";\n}\nvar ServiceMethodNotFoundError = class extends ServiceError {\n\tname = \"ServiceError.MethodNotFound\";\n};\nfunction isServiceMethodNotFoundError(error) {\n\treturn error instanceof Error && error.name === \"ServiceError.MethodNotFound\";\n}\nvar PFrameError = class extends Error {\n\tname = \"PFrameError\";\n};\nfunction isPFrameError(error) {\n\treturn error instanceof Error && error.name === \"PFrameError\";\n}\nvar PFrameDriverError = class extends PFrameError {\n\tname = \"PFrameError.Driver\";\n};\nfunction isPFrameDriverError(error) {\n\treturn error instanceof Error && error.name === \"PFrameError.Driver\";\n}\nvar PFrameSpecDriverError = class extends PFrameError {\n\tname = \"PFrameError.SpecDriver\";\n};\nfunction isPFrameSpecDriverError(error) {\n\treturn error instanceof Error && error.name === \"PFrameError.SpecDriver\";\n}\nfunction stringifyValue(value) {\n\tif (typeof value === \"string\") return `String value was thrown: ${value}`;\n\tif (value && typeof value === \"object\") try {\n\t\treturn `Plain object was thrown: ${JSON.stringify(value)}`;\n\t} catch (jsonError) {\n\t\treturn `Non-serializable object was thrown (JSON.stringify failed: ${jsonError instanceof Error ? jsonError.message : String(jsonError)}): ${String(value)}`;\n\t}\n\treturn String(`Non-Error value (${typeof value}) was thrown: ${value}`);\n}\nfunction ensureError(value) {\n\tif (value instanceof Error) return value;\n\treturn new Error(stringifyValue(value));\n}\nfunction deserializeError(obj) {\n\tconst cause = obj.cause ? deserializeError(obj.cause) : void 0;\n\tconst error = new Error(obj.message, cause !== void 0 ? { cause } : void 0);\n\terror.name = obj.name || \"Error\";\n\terror.stack = obj.stack;\n\treturn error;\n}\nfunction serializeError(e) {\n\tconst error = ensureError(e);\n\tconst cause = error.cause ? serializeError(error.cause) : void 0;\n\treturn {\n\t\tname: error.name,\n\t\tmessage: error.message,\n\t\tstack: error.stack,\n\t\t...error.cause !== void 0 && { cause }\n\t};\n}\nfunction unwrapResult(result) {\n\tif (result.error) throw result.error instanceof Error ? result.error : deserializeError(result.error);\n\treturn result.value;\n}\nfunction serializeResult(result) {\n\tif (result.error) return { error: serializeError(result.error) };\n\treturn { value: result.value };\n}\nfunction deserializeResult(result) {\n\tif (result.error) return { error: deserializeError(result.error) };\n\treturn { value: result.value };\n}\nfunction wrapCallback(callback) {\n\ttry {\n\t\treturn { value: callback() };\n\t} catch (error) {\n\t\treturn { error: ensureError(error) };\n\t}\n}\nasync function wrapAsyncCallback(callback) {\n\ttry {\n\t\treturn { value: await callback() };\n\t} catch (error) {\n\t\treturn { error: ensureError(error) };\n\t}\n}\nfunction wrapAndSerialize(callback) {\n\treturn serializeResult(wrapCallback(callback));\n}\nasync function wrapAndSerializeAsync(callback) {\n\treturn serializeResult(await wrapAsyncCallback(callback));\n}\n//#endregion\nexport { AbortError, PFrameDriverError, PFrameError, PFrameSpecDriverError, ServiceAlreadyRegisteredError, ServiceError, ServiceInjectionError, ServiceInvalidIdError, ServiceMethodNotFoundError, ServiceNotRegisteredError, UiError, deserializeError, deserializeResult, ensureError, hasAbortError, isAbortError, isAggregateError, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, serializeError, serializeResult, unwrapResult, wrapAndSerialize, wrapAndSerializeAsync, wrapAsyncCallback, wrapCallback };\n\n//# sourceMappingURL=errors.js.map","/* jshint esversion: 6 */\n/* jslint node: true */\n'use strict';\n\nmodule.exports = function serialize (object) {\n if (typeof object === 'number' && isNaN(object)) {\n throw new Error('NaN is not allowed');\n }\n\n if (typeof object === 'number' && !isFinite(object)) {\n throw new Error('Infinity is not allowed');\n }\n\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(object);\n }\n\n if (object.toJSON instanceof Function) {\n return serialize(object.toJSON());\n }\n\n if (Array.isArray(object)) {\n const values = object.reduce((t, cv, ci) => {\n const comma = ci === 0 ? '' : ',';\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return `${t}${comma}${serialize(value)}`;\n }, '');\n return `[${values}]`;\n }\n\n const values = Object.keys(object).sort().reduce((t, cv) => {\n if (object[cv] === undefined ||\n typeof object[cv] === 'symbol') {\n return t;\n }\n const comma = t.length === 0 ? '' : ',';\n return `${t}${comma}${serialize(cv)}:${serialize(object[cv])}`;\n }, '');\n return `{${values}}`;\n};\n","import canonicalize from \"canonicalize\";\n//#region src/json.ts\nfunction stringifyJson(value) {\n\treturn JSON.stringify(value);\n}\nfunction canonicalizeJson(value) {\n\treturn canonicalize(value);\n}\nfunction parseJson(value) {\n\treturn JSON.parse(value);\n}\nfunction parseJsonSafely(value, fallback) {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\nfunction bigintReplacer(_key, value) {\n\treturn typeof value === \"bigint\" ? value.toString() : value;\n}\n//#endregion\nexport { bigintReplacer, canonicalizeJson, parseJson, parseJsonSafely, stringifyJson };\n\n//# sourceMappingURL=json.js.map","import { ensureError } from \"../../../errors.js\";\nimport { canonicalizeJson } from \"../../../json.js\";\nimport { z } from \"zod\";\n//#region src/drivers/pframe/spec/spec.ts\nconst ValueType = {\n\tInt: \"Int\",\n\tLong: \"Long\",\n\tFloat: \"Float\",\n\tDouble: \"Double\",\n\tString: \"String\",\n\tBytes: \"Bytes\"\n};\nfunction readMetadata(metadata, key) {\n\treturn metadata?.[key];\n}\nfunction readMetadataJsonOrThrow(metadata, metadataJson, key, methodNameInError = \"readMetadataJsonOrThrow\") {\n\tconst json = readMetadata(metadata, key);\n\tif (json === void 0) return void 0;\n\tconst schema = metadataJson[key];\n\ttry {\n\t\tconst value = JSON.parse(json);\n\t\treturn schema.parse(value);\n\t} catch (error) {\n\t\tthrow new Error(`${methodNameInError} failed, key: ${String(key)}, value: ${json}, error: ${ensureError(error)}`);\n\t}\n}\nfunction readMetadataJson(metadata, metadataJson, key) {\n\ttry {\n\t\treturn readMetadataJsonOrThrow(metadata, metadataJson, key);\n\t} catch {\n\t\treturn;\n\t}\n}\nconst Domain = {\n\tAlphabet: \"pl7.app/alphabet\",\n\tBlockId: \"pl7.app/blockId\",\n\tVDJ: {\n\t\tClustering: { BlockId: \"pl7.app/vdj/clustering/blockId\" },\n\t\tScClonotypeChain: { Index: \"pl7.app/vdj/scClonotypeChain/index\" }\n\t}\n};\nconst DomainJson = {};\nfunction readDomain(spec, key) {\n\treturn readMetadata(spec?.domain, key);\n}\nfunction readDomainJsonOrThrow(spec, key) {\n\treturn readMetadataJsonOrThrow(spec?.domain, DomainJson, key, \"readDomainJsonOrThrow\");\n}\nfunction readDomainJson(spec, key) {\n\treturn readMetadataJson(spec?.domain, DomainJson, key);\n}\nconst Annotation = {\n\tAxisNature: \"pl7.app/axisNature\",\n\tAlphabet: \"pl7.app/alphabet\",\n\tDescription: \"pl7.app/description\",\n\tDataStatus: \"pl7.app/dataStatus\",\n\tDiscreteValues: \"pl7.app/discreteValues\",\n\tFormat: \"pl7.app/format\",\n\tGraph: {\n\t\tAxis: {\n\t\t\tHighCardinality: \"pl7.app/graph/axis/highCardinality\",\n\t\t\tLowerLimit: \"pl7.app/graph/axis/lowerLimit\",\n\t\t\tSymmetricRange: \"pl7.app/graph/axis/symmetricRange\",\n\t\t\tUpperLimit: \"pl7.app/graph/axis/upperLimit\"\n\t\t},\n\t\tIsDenseAxis: \"pl7.app/graph/isDenseAxis\",\n\t\tIsVirtual: \"pl7.app/graph/isVirtual\",\n\t\tPalette: \"pl7.app/graph/palette\",\n\t\tThresholds: \"pl7.app/graph/thresholds\",\n\t\tTreatAbsentValuesAs: \"pl7.app/graph/treatAbsentValuesAs\"\n\t},\n\tHideDataFromUi: \"pl7.app/hideDataFromUi\",\n\tHideDataFromGraphs: \"pl7.app/hideDataFromGraphs\",\n\tIsDiscreteFilter: \"pl7.app/isDiscreteFilter\",\n\tIsAnchor: \"pl7.app/isAnchor\",\n\tIsLinkerColumn: \"pl7.app/isLinkerColumn\",\n\tIsScore: \"pl7.app/isScore\",\n\tIsSubset: \"pl7.app/isSubset\",\n\tLabel: \"pl7.app/label\",\n\tLinkLabel: \"pl7.app/linkLabel\",\n\tMax: \"pl7.app/max\",\n\tMin: \"pl7.app/min\",\n\tMultipliesBy: \"pl7.app/multipliesBy\",\n\tParents: \"pl7.app/parents\",\n\tScore: {\n\t\tDefaultCutoff: \"pl7.app/score/defaultCutoff\",\n\t\tRankingOrder: \"pl7.app/score/rankingOrder\"\n\t},\n\tSequence: {\n\t\tAnnotation: { Mapping: \"pl7.app/sequence/annotation/mapping\" },\n\t\tIsAnnotation: \"pl7.app/sequence/isAnnotation\"\n\t},\n\tTable: {\n\t\tFontFamily: \"pl7.app/table/fontFamily\",\n\t\tOrderPriority: \"pl7.app/table/orderPriority\",\n\t\tVisibility: \"pl7.app/table/visibility\",\n\t\tInfo: \"pl7.app/table/info\"\n\t},\n\tTrace: \"pl7.app/trace\",\n\tVDJ: {\n\t\tIsAssemblingFeature: \"pl7.app/vdj/isAssemblingFeature\",\n\t\tIsMainSequence: \"pl7.app/vdj/isMainSequence\"\n\t}\n};\nconst TraceEntrySchema = z.object({\n\ttype: z.string(),\n\tlabel: z.string()\n}).catchall(z.unknown());\nconst ValueTypeSchema = z.enum([\n\t\"Int\",\n\t\"Long\",\n\t\"Float\",\n\t\"Double\",\n\t\"String\"\n]);\nconst AnnotationJson = {\n\t[Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),\n\t[Annotation.Graph.Axis.HighCardinality]: z.boolean(),\n\t[Annotation.Graph.Axis.LowerLimit]: z.number(),\n\t[Annotation.Graph.Axis.UpperLimit]: z.number(),\n\t[Annotation.Graph.Axis.SymmetricRange]: z.boolean(),\n\t[Annotation.Graph.IsDenseAxis]: z.boolean(),\n\t[Annotation.Graph.Palette]: z.object({\n\t\tmapping: z.record(z.number()),\n\t\tname: z.string()\n\t}),\n\t[Annotation.Graph.Thresholds]: z.array(z.object({\n\t\tcolumnId: z.object({\n\t\t\tvalueType: ValueTypeSchema,\n\t\t\tname: z.string()\n\t\t}),\n\t\tvalue: z.number()\n\t})),\n\t[Annotation.Graph.TreatAbsentValuesAs]: z.number(),\n\t[Annotation.Graph.IsVirtual]: z.boolean(),\n\t[Annotation.HideDataFromUi]: z.boolean(),\n\t[Annotation.HideDataFromGraphs]: z.boolean(),\n\t[Annotation.IsDiscreteFilter]: z.boolean(),\n\t[Annotation.IsLinkerColumn]: z.boolean(),\n\t[Annotation.IsSubset]: z.boolean(),\n\t[Annotation.Max]: z.number(),\n\t[Annotation.Min]: z.number(),\n\t[Annotation.MultipliesBy]: z.array(z.string()),\n\t[Annotation.Parents]: z.array(z.string()),\n\t[Annotation.Sequence.Annotation.Mapping]: z.record(z.string(), z.string()),\n\t[Annotation.Sequence.IsAnnotation]: z.boolean(),\n\t[Annotation.Table.OrderPriority]: z.number(),\n\t[Annotation.Trace]: z.array(TraceEntrySchema),\n\t[Annotation.VDJ.IsAssemblingFeature]: z.boolean()\n};\nfunction readAnnotation(spec, key) {\n\treturn readMetadata(spec?.annotations, key);\n}\nfunction readAnnotationJsonOrThrow(spec, key) {\n\treturn readMetadataJsonOrThrow(spec?.annotations, AnnotationJson, key, \"readAnnotationJsonOrThrow\");\n}\nfunction readAnnotationJson(spec, key) {\n\treturn readMetadataJson(spec?.annotations, AnnotationJson, key);\n}\nfunction isLinkerColumn(column) {\n\treturn !!readAnnotationJson(column, Annotation.IsLinkerColumn);\n}\nfunction makeAxisTree(axis) {\n\treturn {\n\t\taxis,\n\t\tchildren: []\n\t};\n}\n/** Build tree by axis parents annotations */\nfunction getAxesTree(rootAxis) {\n\tconst root = makeAxisTree(rootAxis);\n\tlet nodesQ = [root];\n\twhile (nodesQ.length) {\n\t\tconst nextNodes = [];\n\t\tfor (const node of nodesQ) {\n\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\tnextNodes.push(...node.children);\n\t\t}\n\t\tnodesQ = nextNodes;\n\t}\n\treturn root;\n}\n/** Get set of canonicalized axisIds from axisTree */\nfunction getSetFromAxisTree(tree) {\n\tconst set = /* @__PURE__ */ new Set([canonicalizeJson(getAxisId(tree.axis))]);\n\tlet nodesQ = [tree];\n\twhile (nodesQ.length) {\n\t\tconst nextNodes = [];\n\t\tfor (const node of nodesQ) for (const parent of node.children) {\n\t\t\tset.add(canonicalizeJson(getAxisId(parent.axis)));\n\t\t\tnextNodes.push(parent);\n\t\t}\n\t\tnodesQ = nextNodes;\n\t}\n\treturn set;\n}\n/** Get array of axisSpecs from axisTree */\nfunction getArrayFromAxisTree(tree) {\n\tconst res = [tree.axis];\n\tlet nodesQ = [tree];\n\twhile (nodesQ.length) {\n\t\tconst nextNodes = [];\n\t\tfor (const node of nodesQ) for (const parent of node.children) {\n\t\t\tres.push(parent.axis);\n\t\t\tnextNodes.push(parent);\n\t\t}\n\t\tnodesQ = nextNodes;\n\t}\n\treturn res;\n}\nfunction canonicalizeAxisWithParents(axis) {\n\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n}\nfunction normalizingAxesComparator(axis1, axis2) {\n\tif (axis1.name !== axis2.name) return axis1.name < axis2.name ? 1 : -1;\n\tif (axis1.type !== axis2.type) return axis1.type < axis2.type ? 1 : -1;\n\tconst domain1 = canonicalizeJson(axis1.domain ?? {});\n\tconst domain2 = canonicalizeJson(axis2.domain ?? {});\n\tif (domain1 !== domain2) return domain1 < domain2 ? 1 : -1;\n\tconst contextDomain1 = canonicalizeJson(axis1.contextDomain ?? {});\n\tconst contextDomain2 = canonicalizeJson(axis2.contextDomain ?? {});\n\tif (contextDomain1 !== contextDomain2) return contextDomain1 < contextDomain2 ? 1 : -1;\n\tconst parents1 = canonicalizeAxisWithParents(axis1);\n\tconst parents2 = canonicalizeAxisWithParents(axis2);\n\tif (parents1 !== parents2) return parents1 < parents2 ? 1 : -1;\n\tconst annotation1 = canonicalizeJson(axis1.annotations ?? {});\n\tconst annotation2 = canonicalizeJson(axis2.annotations ?? {});\n\tif (annotation1 !== annotation2) return annotation1 < annotation2 ? 1 : -1;\n\treturn 0;\n}\nfunction parseParentsFromAnnotations(axis) {\n\tconst parentsList = readAnnotationJson(axis, Annotation.Parents);\n\tif (parentsList === void 0) return [];\n\treturn parentsList;\n}\nfunction sortParentsDeep(axisSpec) {\n\taxisSpec.parentAxesSpec.forEach(sortParentsDeep);\n\taxisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n}\nfunction hasCycleOfParents(axisSpec) {\n\tlet nodesQ = [makeAxisTree(axisSpec)];\n\tconst ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n\twhile (nodesQ.length) {\n\t\tconst nextNodes = [];\n\t\tconst levelIds = /* @__PURE__ */ new Set();\n\t\tfor (const node of nodesQ) {\n\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\tfor (const child of node.children) {\n\t\t\t\tconst childId = canonicalizeJson(getAxisId(child.axis));\n\t\t\t\tif (!levelIds.has(childId)) {\n\t\t\t\t\tnextNodes.push(child);\n\t\t\t\t\tlevelIds.add(childId);\n\t\t\t\t\tif (ancestors.has(childId)) return true;\n\t\t\t\t\tancestors.add(childId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnodesQ = nextNodes;\n\t}\n\treturn false;\n}\n/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\nfunction getNormalizedAxesList(axes) {\n\tif (axes.length === 0) return [];\n\tconst modifiedAxes = axes.map((axis) => {\n\t\tconst { parentAxes: _, ...copiedRest } = axis;\n\t\treturn {\n\t\t\t...copiedRest,\n\t\t\tannotations: { ...copiedRest.annotations },\n\t\t\tparentAxesSpec: []\n\t\t};\n\t});\n\taxes.forEach((axis, idx) => {\n\t\tconst modifiedAxis = modifiedAxes[idx];\n\t\tif (axis.parentAxes) modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n\t\telse {\n\t\t\tconst parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n\t\t\tmodifiedAxis.parentAxesSpec = parents.some((p) => p === void 0) ? [] : parents;\n\t\t}\n\t});\n\tif (modifiedAxes.some(hasCycleOfParents)) modifiedAxes.forEach((axis) => {\n\t\taxis.parentAxesSpec = [];\n\t});\n\telse modifiedAxes.forEach((axis) => {\n\t\tsortParentsDeep(axis);\n\t});\n\treturn modifiedAxes;\n}\n/** Create list of regular axisSpec from normalized (parents are indexes, inside of current axes list) */\nfunction getDenormalizedAxesList(axesSpec) {\n\tconst idsList = axesSpec.map(canonicalizeAxisId);\n\treturn axesSpec.map((axisSpec) => {\n\t\tconst parentIdxs = axisSpec.parentAxesSpec.map(canonicalizeAxisId).map((id) => idsList.indexOf(id));\n\t\tconst { parentAxesSpec: _, ...copiedRest } = axisSpec;\n\t\tif (parentIdxs.length) return {\n\t\t\t...copiedRest,\n\t\t\tparentAxes: parentIdxs\n\t\t};\n\t\treturn copiedRest;\n\t});\n}\n/**\n* Resolve annotation-based parents (`pl7.app/parents`) to numeric `parentAxes`\n* on a column spec. Returns the spec unchanged if all axes already use numeric\n* indices or have no parent annotations.\n*/\nfunction resolveAnnotationParents(spec) {\n\tif (!spec.axesSpec.some((axis) => !!readAnnotationJson(axis, Annotation.Parents))) return spec;\n\tconst denormalized = getDenormalizedAxesList(getNormalizedAxesList(spec.axesSpec));\n\treturn {\n\t\t...spec,\n\t\taxesSpec: denormalized\n\t};\n}\nconst PColumnName = {\n\tLabel: \"pl7.app/label\",\n\tTable: { RowSelection: \"pl7.app/table/row-selection\" },\n\tVDJ: {\n\t\tLeadSelection: \"pl7.app/vdj/lead-selection\",\n\t\tRankingOrder: \"pl7.app/vdj/ranking-order\",\n\t\tSequence: \"pl7.app/vdj/sequence\"\n\t}\n};\nconst PAxisName = {\n\tSampleId: \"pl7.app/sampleId\",\n\tVDJ: {\n\t\tAssay: { SequenceId: \"pl7.app/vdj/assay/sequenceId\" },\n\t\tClusterId: \"pl7.app/vdj/clusterId\",\n\t\tClonotypeKey: \"pl7.app/vdj/clonotypeKey\",\n\t\tScClonotypeKey: \"pl7.app/vdj/scClonotypeKey\"\n\t}\n};\nfunction isLabelColumn(column) {\n\treturn column.axesSpec.length === 1 && column.name === PColumnName.Label;\n}\nfunction getPColumnSpecId(spec) {\n\treturn {\n\t\tkind: spec.kind,\n\t\tvalueType: spec.valueType,\n\t\tname: spec.name,\n\t\tdomain: spec.domain,\n\t\tcontextDomain: spec.contextDomain,\n\t\tparentAxes: spec.parentAxes,\n\t\taxesId: getAxesId(spec.axesSpec)\n\t};\n}\n/** Get column id and spec from a column */\nfunction getColumnIdAndSpec(column) {\n\treturn {\n\t\tcolumnId: column.id,\n\t\tspec: column.spec\n\t};\n}\n/** Extracts axis ids from axis spec */\nfunction getAxisId(spec) {\n\tconst { type, name, domain, contextDomain } = spec;\n\tconst result = {\n\t\ttype,\n\t\tname\n\t};\n\tif (domain && Object.entries(domain).length > 0) Object.assign(result, { domain });\n\tif (contextDomain && Object.entries(contextDomain).length > 0) Object.assign(result, { contextDomain });\n\treturn result;\n}\n/** Extracts axes ids from axes spec array from column spec */\nfunction getAxesId(spec) {\n\treturn spec.map(getAxisId);\n}\n/** Canonicalizes axis id */\nfunction canonicalizeAxisId(id) {\n\treturn canonicalizeJson(getAxisId(id));\n}\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query, target) {\n\tif (query === void 0) return target === void 0;\n\tif (target === void 0) return true;\n\tfor (const k in target) if (query[k] !== target[k]) return false;\n\treturn true;\n}\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nfunction matchAxisId(query, target) {\n\treturn query.name === target.name && matchDomain(query.domain, target.domain) && matchDomain(query.contextDomain, target.contextDomain);\n}\nfunction getTypeFromPColumnOrAxisSpec(spec) {\n\treturn \"valueType\" in spec ? spec.valueType : spec.type;\n}\nfunction isAxisId(id) {\n\treturn typeof id === \"object\" && id !== null && \"name\" in id && \"type\" in id;\n}\n//#endregion\nexport { Annotation, AnnotationJson, Domain, DomainJson, PAxisName, PColumnName, ValueType, canonicalizeAxisId, canonicalizeAxisWithParents, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getNormalizedAxesList, getPColumnSpecId, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, isAxisId, isLabelColumn, isLinkerColumn, matchAxisId, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, resolveAnnotationParents };\n\n//# sourceMappingURL=spec.js.map","import { assertNever } from \"../../../util.js\";\nimport { canonicalizeJson } from \"../../../json.js\";\n//#region src/drivers/pframe/query/utils.ts\nconst BOOLEAN_TYPES = /* @__PURE__ */ new Set([\n\t\"numericComparison\",\n\t\"stringEquals\",\n\t\"stringContains\",\n\t\"stringContainsFuzzy\",\n\t\"stringRegex\",\n\t\"isNull\",\n\t\"not\",\n\t\"and\",\n\t\"or\",\n\t\"isIn\"\n]);\nfunction isBooleanExpression(expr) {\n\treturn BOOLEAN_TYPES.has(expr.type);\n}\n/**\n* Recursively traverses a SpecQuery tree bottom-up, applying visitor callbacks.\n*\n* Traversal order:\n* 1. Recurse into child queries\n* 2. Apply `column` to transform column references in leaf nodes\n* 3. Apply `joinEntry` to each join entry (with inner query already traversed)\n* 4. Assemble node with transformed children\n* 5. Apply `node` to the assembled node\n*/\nfunction traverseQuerySpec(query, visitor) {\n\tconst traverseEntry = (entry) => {\n\t\tconst traversed = {\n\t\t\t...entry,\n\t\t\tentry: traverseQuerySpec(entry.entry, visitor)\n\t\t};\n\t\treturn visitor.joinEntry ? visitor.joinEntry(traversed) : traversed;\n\t};\n\tlet result;\n\tswitch (query.type) {\n\t\tcase \"column\":\n\t\t\tresult = {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"sparseToDenseColumn\":\n\t\t\tresult = {\n\t\t\t\t...query,\n\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"inlineColumn\":\n\t\t\tresult = query;\n\t\t\tbreak;\n\t\tcase \"innerJoin\":\n\t\tcase \"fullJoin\":\n\t\t\tresult = {\n\t\t\t\t...query,\n\t\t\t\tentries: query.entries.map(traverseEntry)\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"outerJoin\":\n\t\t\tresult = {\n\t\t\t\t...query,\n\t\t\t\tprimary: traverseEntry(query.primary),\n\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"linkerJoin\": {\n\t\t\tconst linker = \"type\" in query.linker ? query.linker : {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: query.linker.column\n\t\t\t};\n\t\t\tresult = {\n\t\t\t\t...query,\n\t\t\t\tlinker: traverseQuerySpec(linker, visitor),\n\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase \"filter\":\n\t\tcase \"sort\":\n\t\tcase \"sliceAxes\":\n\t\tcase \"transformColumns\":\n\t\tcase \"specOverride\":\n\t\t\tresult = {\n\t\t\t\t...query,\n\t\t\t\tinput: traverseQuerySpec(query.input, visitor)\n\t\t\t};\n\t\t\tbreak;\n\t\tdefault: assertNever(query);\n\t}\n\treturn visitor.node ? visitor.node(result) : result;\n}\n/** Recursively maps all column references in a SpecQuery tree. */\nfunction mapSpecQueryColumns(query, visitor) {\n\treturn traverseQuerySpec(query, visitor);\n}\n/** Collects all column references from a SpecQuery tree. */\nfunction collectSpecQueryColumns(query) {\n\tconst result = [];\n\ttraverseQuerySpec(query, { column: (c) => {\n\t\tresult.push(c);\n\t\treturn c;\n\t} });\n\treturn result;\n}\nfunction sortSpecQuery(query) {\n\treturn traverseQuerySpec(query, {\n\t\tcolumn: (c) => c,\n\t\tnode: (node) => {\n\t\t\tswitch (node.type) {\n\t\t\t\tcase \"sparseToDenseColumn\": return {\n\t\t\t\t\t...node,\n\t\t\t\t\taxes: node.axes.toSorted((a, b) => canonicalizeJson(a).localeCompare(canonicalizeJson(b)))\n\t\t\t\t};\n\t\t\t\tcase \"innerJoin\":\n\t\t\t\tcase \"fullJoin\": {\n\t\t\t\t\tconst sorted = [...node.entries].sort(cmpQueryJoinEntrySpec);\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\tentries: sorted\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"outerJoin\": {\n\t\t\t\t\tconst sorted = [...node.secondary].sort(cmpQueryJoinEntrySpec);\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\tsecondary: sorted\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"linkerJoin\": {\n\t\t\t\t\tconst sorted = [...node.secondary].sort(cmpQueryJoinEntrySpec);\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\tsecondary: sorted\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"sliceAxes\": return {\n\t\t\t\t\t...node,\n\t\t\t\t\taxisFilters: node.axisFilters.toSorted((a, b) => {\n\t\t\t\t\t\tconst ak = canonicalizeJson(a.axisSelector);\n\t\t\t\t\t\tconst bk = canonicalizeJson(b.axisSelector);\n\t\t\t\t\t\treturn ak < bk ? -1 : ak === bk ? 0 : 1;\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t\tdefault: return node;\n\t\t\t}\n\t\t},\n\t\tjoinEntry: (entry) => {\n\t\t\tif (entry.qualifications === void 0 || entry.qualifications.length === 0) return entry;\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\tqualifications: entry.qualifications.toSorted((a, b) => {\n\t\t\t\t\tconst ak = canonicalizeJson(a.axis);\n\t\t\t\t\tconst bk = canonicalizeJson(b.axis);\n\t\t\t\t\treturn ak < bk ? -1 : ak === bk ? 0 : 1;\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t});\n}\nfunction cmpQuerySpec(lhs, rhs) {\n\tif (lhs.type !== rhs.type) return lhs.type < rhs.type ? -1 : 1;\n\tswitch (lhs.type) {\n\t\tcase \"column\": return lhs.column < rhs.column ? -1 : lhs.column === rhs.column ? 0 : 1;\n\t\tcase \"inlineColumn\": return lhs.spec.columnId < rhs.spec.columnId ? -1 : lhs.spec.columnId === rhs.spec.columnId ? 0 : 1;\n\t\tcase \"sparseToDenseColumn\": return lhs.column < rhs.column ? -1 : lhs.column === rhs.column ? 0 : 1;\n\t\tcase \"innerJoin\":\n\t\tcase \"fullJoin\": {\n\t\t\tconst rhsJoin = rhs;\n\t\t\tif (lhs.entries.length !== rhsJoin.entries.length) return lhs.entries.length - rhsJoin.entries.length;\n\t\t\tfor (let i = 0; i < lhs.entries.length; i++) {\n\t\t\t\tconst cmp = cmpQueryJoinEntrySpec(lhs.entries[i], rhsJoin.entries[i]);\n\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tcase \"outerJoin\": {\n\t\t\tconst rhsOuter = rhs;\n\t\t\tconst cmp = cmpQueryJoinEntrySpec(lhs.primary, rhsOuter.primary);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t\tif (lhs.secondary.length !== rhsOuter.secondary.length) return lhs.secondary.length - rhsOuter.secondary.length;\n\t\t\tfor (let i = 0; i < lhs.secondary.length; i++) {\n\t\t\t\tconst cmp = cmpQueryJoinEntrySpec(lhs.secondary[i], rhsOuter.secondary[i]);\n\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tcase \"linkerJoin\": {\n\t\t\tconst rhsLinker = rhs;\n\t\t\tconst cmp = cmpQuerySpec(lhs.linker, rhsLinker.linker);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t\tif (lhs.secondary.length !== rhsLinker.secondary.length) return lhs.secondary.length - rhsLinker.secondary.length;\n\t\t\tfor (let i = 0; i < lhs.secondary.length; i++) {\n\t\t\t\tconst cmp = cmpQueryJoinEntrySpec(lhs.secondary[i], rhsLinker.secondary[i]);\n\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tcase \"sliceAxes\": return cmpQuerySpec(lhs.input, rhs.input);\n\t\tcase \"sort\": return cmpQuerySpec(lhs.input, rhs.input);\n\t\tcase \"filter\": return cmpQuerySpec(lhs.input, rhs.input);\n\t\tcase \"specOverride\": {\n\t\t\tconst rhsSo = rhs;\n\t\t\tconst cmp = cmpQuerySpec(lhs.input, rhsSo.input);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t\treturn canonicalizeJson(lhs.override).localeCompare(canonicalizeJson(rhsSo.override));\n\t\t}\n\t\tcase \"transformColumns\": {\n\t\t\tconst rhsTc = rhs;\n\t\t\tconst cmp = cmpQuerySpec(lhs.input, rhsTc.input);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t\tconst modeCmp = lhs.mode.localeCompare(rhsTc.mode);\n\t\t\tif (modeCmp !== 0) return modeCmp;\n\t\t\treturn canonicalizeJson(lhs.columns).localeCompare(canonicalizeJson(rhsTc.columns));\n\t\t}\n\t\tdefault: assertNever(lhs);\n\t}\n}\nfunction cmpQueryJoinEntrySpec(lhs, rhs) {\n\tconst cmp = cmpQuerySpec(lhs.entry, rhs.entry);\n\tif (cmp !== 0) return cmp;\n\tconst lhsQ = lhs.qualifications ?? [];\n\tconst rhsQ = rhs.qualifications ?? [];\n\tif (lhsQ.length !== rhsQ.length) return lhsQ.length - rhsQ.length;\n\tfor (let i = 0; i < lhsQ.length; i++) {\n\t\tconst l = canonicalizeJson(lhsQ[i]);\n\t\tconst r = canonicalizeJson(rhsQ[i]);\n\t\tif (l !== r) return l < r ? -1 : 1;\n\t}\n\treturn 0;\n}\n//#endregion\nexport { collectSpecQueryColumns, isBooleanExpression, mapSpecQueryColumns, sortSpecQuery, traverseQuerySpec };\n\n//# sourceMappingURL=utils.js.map","import { assertNever } from \"../../util.js\";\nimport { canonicalizeJson } from \"../../json.js\";\nimport { getAxisId } from \"./spec/spec.js\";\nimport { mapSpecQueryColumns } from \"./query/utils.js\";\nimport \"./query/index.js\";\n//#region src/drivers/pframe/table_calculate.ts\nfunction mapPTableDef(def, cb) {\n\treturn {\n\t\t...def,\n\t\tsrc: mapJoinEntry(def.src, cb)\n\t};\n}\nfunction sortPTableDef(def) {\n\tfunction sortFilters(filters) {\n\t\treturn filters.toSorted((lhs, rhs) => {\n\t\t\tif (lhs.column.type === \"axis\" && rhs.column.type === \"axis\") return canonicalizeJson(getAxisId(lhs.column.id)) < canonicalizeJson(getAxisId(rhs.column.id)) ? -1 : 1;\n\t\t\telse if (lhs.column.type === \"column\" && rhs.column.type === \"column\") return lhs.column.id < rhs.column.id ? -1 : 1;\n\t\t\telse return lhs.column.type === \"axis\" ? -1 : 1;\n\t\t});\n\t}\n\treturn {\n\t\tsrc: sortJoinEntry(def.src),\n\t\tpartitionFilters: sortFilters(def.partitionFilters),\n\t\tfilters: sortFilters(def.filters),\n\t\tsorting: def.sorting\n\t};\n}\nfunction mapPTableDefV2(def, visitor) {\n\treturn { query: mapSpecQueryColumns(def.query, visitor) };\n}\nfunction mapJoinEntry(entry, cb) {\n\tswitch (entry.type) {\n\t\tcase \"column\": return {\n\t\t\ttype: \"column\",\n\t\t\tcolumn: cb(entry.column)\n\t\t};\n\t\tcase \"slicedColumn\": return {\n\t\t\ttype: \"slicedColumn\",\n\t\t\tcolumn: cb(entry.column),\n\t\t\tnewId: entry.newId,\n\t\t\taxisFilters: entry.axisFilters\n\t\t};\n\t\tcase \"artificialColumn\": return {\n\t\t\ttype: \"artificialColumn\",\n\t\t\tcolumn: cb(entry.column),\n\t\t\tnewId: entry.newId,\n\t\t\taxesIndices: entry.axesIndices\n\t\t};\n\t\tcase \"inlineColumn\": return entry;\n\t\tcase \"inner\":\n\t\tcase \"full\": return {\n\t\t\ttype: entry.type,\n\t\t\tentries: entry.entries.map((col) => mapJoinEntry(col, cb))\n\t\t};\n\t\tcase \"outer\": return {\n\t\t\ttype: \"outer\",\n\t\t\tprimary: mapJoinEntry(entry.primary, cb),\n\t\t\tsecondary: entry.secondary.map((col) => mapJoinEntry(col, cb))\n\t\t};\n\t\tdefault: assertNever(entry);\n\t}\n}\nfunction cmpJoinEntries(lhs, rhs) {\n\tif (lhs.type !== rhs.type) return lhs.type < rhs.type ? -1 : 1;\n\tconst type = lhs.type;\n\tswitch (type) {\n\t\tcase \"column\": return lhs.column < rhs.column ? -1 : 1;\n\t\tcase \"slicedColumn\":\n\t\tcase \"artificialColumn\": return lhs.newId < rhs.newId ? -1 : 1;\n\t\tcase \"inlineColumn\": return lhs.column.id < rhs.column.id ? -1 : 1;\n\t\tcase \"inner\":\n\t\tcase \"full\": {\n\t\t\tconst rhsInner = rhs;\n\t\t\tif (lhs.entries.length !== rhsInner.entries.length) return lhs.entries.length - rhsInner.entries.length;\n\t\t\tfor (let i = 0; i < lhs.entries.length; i++) {\n\t\t\t\tconst cmp = cmpJoinEntries(lhs.entries[i], rhsInner.entries[i]);\n\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tcase \"outer\": {\n\t\t\tconst rhsOuter = rhs;\n\t\t\tconst cmp = cmpJoinEntries(lhs.primary, rhsOuter.primary);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t\tif (lhs.secondary.length !== rhsOuter.secondary.length) return lhs.secondary.length - rhsOuter.secondary.length;\n\t\t\tfor (let i = 0; i < lhs.secondary.length; i++) {\n\t\t\t\tconst cmp = cmpJoinEntries(lhs.secondary[i], rhsOuter.secondary[i]);\n\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tdefault: assertNever(type);\n\t}\n}\nfunction sortJoinEntry(entry) {\n\tswitch (entry.type) {\n\t\tcase \"column\":\n\t\tcase \"slicedColumn\":\n\t\tcase \"inlineColumn\": return entry;\n\t\tcase \"artificialColumn\": {\n\t\t\tconst sortedAxesIndices = entry.axesIndices.toSorted((lhs, rhs) => lhs - rhs);\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\taxesIndices: sortedAxesIndices\n\t\t\t};\n\t\t}\n\t\tcase \"inner\":\n\t\tcase \"full\": {\n\t\t\tconst sortedEntries = entry.entries.map(sortJoinEntry);\n\t\t\tsortedEntries.sort(cmpJoinEntries);\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\tentries: sortedEntries\n\t\t\t};\n\t\t}\n\t\tcase \"outer\": {\n\t\t\tconst sortedSecondary = entry.secondary.map(sortJoinEntry);\n\t\t\tsortedSecondary.sort(cmpJoinEntries);\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\tprimary: sortJoinEntry(entry.primary),\n\t\t\t\tsecondary: sortedSecondary\n\t\t\t};\n\t\t}\n\t\tdefault: assertNever(entry);\n\t}\n}\n//#endregion\nexport { mapJoinEntry, mapPTableDef, mapPTableDefV2, sortJoinEntry, sortPTableDef };\n\n//# sourceMappingURL=table_calculate.js.map","//#region src/drivers/pframe/table_common.ts\nfunction getPTableColumnId(spec) {\n\tswitch (spec.type) {\n\t\tcase \"axis\": return {\n\t\t\ttype: \"axis\",\n\t\t\tid: spec.id\n\t\t};\n\t\tcase \"column\": return {\n\t\t\ttype: \"column\",\n\t\t\tid: spec.id\n\t\t};\n\t}\n}\n//#endregion\nexport { getPTableColumnId };\n\n//# sourceMappingURL=table_common.js.map","import { canonicalizeJson, parseJsonSafely } from \"../../../json.js\";\n//#region src/drivers/pframe/spec/filtered_column.ts\n/**\n* Checks if a given value is a FilteredPColumn\n* @param id - The value to check\n* @returns True if the value is a FilteredPColumn, false otherwise\n* @deprecated use {@link isColumnFilteredKey} for the key form and `source` checks for the id form\n*/\nfunction isFilteredPColumn(id) {\n\treturn typeof id === \"object\" && id !== null && \"source\" in id && \"axisFilters\" in id;\n}\nfunction stringifyColumnFilteredId(key) {\n\treturn canonicalizeJson(createColumnFilteredKey(key));\n}\nfunction isColumnFilteredKey(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"__isFiltered\" in obj;\n}\nfunction isColumnFilteredId(id) {\n\tif (typeof id !== \"string\") return false;\n\treturn isColumnFilteredKey(parseJsonSafely(id));\n}\nfunction createColumnFilteredId(props) {\n\treturn stringifyColumnFilteredId(props);\n}\nfunction createColumnFilteredKey(props) {\n\tconst axisFilters = props.axisFilters.toSorted((a, b) => a[0] - b[0]);\n\treturn {\n\t\t__isFiltered: true,\n\t\tsource: props.source,\n\t\taxisFilters\n\t};\n}\n/**\n* Drop the axes pinned by `axisFilters` from a {@link PColumnSpec}'s\n* `axesSpec`. Indices are positional against `spec.axesSpec`. Returns `spec`\n* unchanged when there are no filters.\n*\n* Single source of the Filtered-layer spec math — shared by\n* `reconstructSpecFromId` (host, id-walking) and `ColumnFilteredRecipe.getSpec`\n* (sandbox, recipe-graph walking).\n*/\nfunction applyAxisFilters(spec, axisFilters) {\n\tif (axisFilters.length === 0) return spec;\n\tconst fixed = new Set(axisFilters.map(([i]) => i));\n\treturn {\n\t\t...spec,\n\t\taxesSpec: spec.axesSpec.filter((_, i) => !fixed.has(i))\n\t};\n}\n//#endregion\nexport { applyAxisFilters, createColumnFilteredId, createColumnFilteredKey, isColumnFilteredId, isColumnFilteredKey, isFilteredPColumn, stringifyColumnFilteredId };\n\n//# sourceMappingURL=filtered_column.js.map","import { assertNever } from \"../util.js\";\nimport { canonicalizeJson, parseJsonSafely } from \"../json.js\";\n//#region src/pool/spec.ts\nfunction isPObjectId(value) {\n\tif (typeof value !== \"string\") return false;\n\treturn isPObjectKey(parseJsonSafely(value));\n}\nfunction isPObjectKey(value) {\n\treturn isLocalPObjectKey(value) || isGlobalPObjectKey(value);\n}\nfunction createPObjectId(obj) {\n\tif (isLocalPObjectKey(obj)) return createLocalPObjectId(obj.resolvePath, obj.name);\n\tif (isGlobalPObjectKey(obj)) return createGlobalPObjectId(obj.blockId, obj.name);\n\tthrow new Error(`createPObjectId: unrecognized object key structure: ${JSON.stringify(obj)}`);\n}\nfunction createLocalPObjectId(resolvePath, name) {\n\treturn canonicalizeJson({\n\t\tresolvePath,\n\t\tname\n\t});\n}\nfunction isLocalPObjectId(value) {\n\tif (typeof value !== \"string\") return false;\n\treturn isLocalPObjectKey(parseJsonSafely(value));\n}\nfunction isLocalPObjectKey(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst v = value;\n\treturn Array.isArray(v.resolvePath) && typeof v.name === \"string\";\n}\nfunction createGlobalPObjectId(blockId, exportName) {\n\treturn canonicalizeJson({\n\t\t__isRef: true,\n\t\tblockId,\n\t\tname: exportName\n\t});\n}\nfunction isGlobalPObjectKey(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"__isRef\" in value && \"blockId\" in value && \"name\" in value;\n}\nfunction isGlobalPObjectId(value) {\n\tif (typeof value !== \"string\") return false;\n\treturn isGlobalPObjectKey(parseJsonSafely(value));\n}\nfunction isPObject(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"id\" in obj && \"spec\" in obj && \"data\" in obj;\n}\nfunction isPColumn(obj) {\n\treturn isPObject(obj) && isPColumnSpec(obj.spec);\n}\nfunction isPColumnSpec(spec) {\n\treturn spec.kind === \"PColumn\";\n}\nfunction ensurePColumn(obj) {\n\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\treturn obj;\n}\nfunction mapPObjectData(pObj, cb) {\n\treturn pObj === void 0 ? void 0 : {\n\t\t...pObj,\n\t\tdata: cb(pObj.data)\n\t};\n}\nfunction extractAllColumns(entry) {\n\tconst columns = /* @__PURE__ */ new Map();\n\tconst addAllColumns = (entry) => {\n\t\tswitch (entry.type) {\n\t\t\tcase \"column\":\n\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\treturn;\n\t\t\tcase \"slicedColumn\":\n\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\treturn;\n\t\t\tcase \"artificialColumn\":\n\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\treturn;\n\t\t\tcase \"inlineColumn\": return;\n\t\t\tcase \"full\":\n\t\t\tcase \"inner\":\n\t\t\t\tfor (const e of entry.entries) addAllColumns(e);\n\t\t\t\treturn;\n\t\t\tcase \"outer\":\n\t\t\t\taddAllColumns(entry.primary);\n\t\t\t\tfor (const e of entry.secondary) addAllColumns(e);\n\t\t\t\treturn;\n\t\t\tdefault: assertNever(entry);\n\t\t}\n\t};\n\taddAllColumns(entry);\n\treturn [...columns.values()];\n}\n//#endregion\nexport { createGlobalPObjectId, createLocalPObjectId, createPObjectId, ensurePColumn, extractAllColumns, isGlobalPObjectId, isGlobalPObjectKey, isLocalPObjectId, isLocalPObjectKey, isPColumn, isPColumnSpec, isPObject, isPObjectId, isPObjectKey, mapPObjectData };\n\n//# sourceMappingURL=spec.js.map","import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\n//#region src/utils.ts\nvar utils_exports = /* @__PURE__ */ __exportAll({\n\tDeferred: () => Deferred,\n\tFetcher: () => Fetcher,\n\tInterval: () => Interval,\n\talike: () => alike,\n\tarrayFrom: () => arrayFrom,\n\tasConst: () => asConst,\n\tasync: () => async,\n\tbetween: () => between,\n\tbool: () => bool,\n\tcall: () => call,\n\tcheckIfDefined: () => checkIfDefined,\n\tcheckIfNotEmpty: () => checkIfNotEmpty,\n\tclamp: () => clamp,\n\tdelay: () => delay,\n\terrorOptional: () => errorOptional,\n\texhaustive: () => exhaustive,\n\tflatValue: () => flatValue,\n\tidentity: () => identity,\n\tisNil: () => isNil,\n\tisPrimitive: () => isPrimitive,\n\tlistToOptions: () => listToOptions,\n\tmatch: () => match,\n\tnotEmpty: () => notEmpty,\n\tnotUndef: () => notUndef,\n\tokOptional: () => okOptional,\n\tperformanceTimer: () => performanceTimer,\n\trange: () => range,\n\tresolveAwaited: () => resolveAwaited,\n\ttap: () => tap,\n\ttapIf: () => tapIf,\n\ttear: () => tear,\n\ttimer: () => timer,\n\ttimes: () => times,\n\ttoList: () => toList,\n\tundef: () => undef,\n\tunionize: () => unionize,\n\tuniqueValues: () => uniqueValues,\n\tunwrap: () => unwrap\n});\nfunction isNil(v) {\n\treturn v === null || v === void 0;\n}\nfunction isPrimitive(v) {\n\treturn isNil(v) || typeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\" || typeof v === \"bigint\";\n}\nfunction notEmpty(v, message) {\n\tif (v === null || v === void 0) throw Error(message ?? \"Empty (null | undefined) value\");\n\treturn v;\n}\nfunction notUndef(v, message) {\n\tif (v === void 0) throw Error(message ?? \"Undefined value\");\n\treturn v;\n}\nfunction undef(v = void 0) {\n\treturn v;\n}\nfunction bool(v) {\n\treturn v;\n}\nfunction uniqueValues(items) {\n\treturn [...new Set(items)];\n}\nfunction checkIfNotEmpty(v, message) {\n\tif (v === void 0 || v === null) throw Error(message ?? \"Empty (null | undefined) value\");\n}\nfunction checkIfDefined(v, message) {\n\tif (v === void 0) throw Error(message ?? \"Undefined value\");\n}\nfunction between(n, a, b) {\n\treturn n >= Math.min(a, b) && n <= Math.max(a, b);\n}\nfunction listToOptions(list) {\n\treturn list.map((value) => ({\n\t\ttext: String(value),\n\t\tvalue\n\t}));\n}\nfunction async(gf) {\n\treturn function(...args) {\n\t\tconst generator = gf(...args);\n\t\tasync function handle(result) {\n\t\t\tif (result.done) return Promise.resolve(result.value);\n\t\t\treturn Promise.resolve(result.value).then((res) => {\n\t\t\t\treturn handle(generator.next(res));\n\t\t\t}).catch((err) => {\n\t\t\t\treturn handle(generator.throw(err));\n\t\t\t});\n\t\t}\n\t\ttry {\n\t\t\treturn handle(generator.next());\n\t\t} catch (ex) {\n\t\t\treturn Promise.reject(ex instanceof Error ? ex : Error(String(ex)));\n\t\t}\n\t};\n}\nvar Deferred = class {\n\tpromise;\n\tconstructor() {\n\t\tthis.promise = new Promise((res, rej) => {\n\t\t\tthis.resolve = res;\n\t\t\tthis.reject = rej;\n\t\t});\n\t}\n\tresolve = () => {};\n\treject = () => {};\n};\nfunction delay(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\nfunction tear() {\n\treturn new Promise((r) => queueMicrotask(r));\n}\nfunction timer() {\n\tconst t = (/* @__PURE__ */ new Date()).getTime();\n\treturn function() {\n\t\treturn (/* @__PURE__ */ new Date()).getTime() - t;\n\t};\n}\nfunction performanceTimer() {\n\tconst t = performance.now();\n\treturn function() {\n\t\treturn performance.now() - t;\n\t};\n}\nfunction call(f) {\n\treturn f();\n}\nfunction clamp(n, lo, up) {\n\treturn lo > n ? lo : n > up ? up : n;\n}\nfunction tap(v, cb) {\n\treturn cb(v);\n}\nfunction tapIf(v, cb) {\n\tif (v !== null && v !== void 0) return cb(v);\n}\nfunction* range(from, to, step = 1) {\n\tfor (let i = from; i < to; i += step) yield i;\n}\nfunction toList(iterable) {\n\tconst lst = [];\n\tfor (const it of iterable) lst.push(it);\n\treturn lst;\n}\nfunction times(n, cb) {\n\treturn toList(range(0, n)).map(cb);\n}\nvar Interval = class {\n\t_delay;\n\tconstructor(_delay) {\n\t\tthis._delay = _delay;\n\t}\n\tasync *generate() {\n\t\tlet i = 0;\n\t\twhile (true) {\n\t\t\tawait delay(this._delay);\n\t\t\tyield i++;\n\t\t}\n\t}\n\tasync *[Symbol.asyncIterator]() {\n\t\tlet i = 0;\n\t\twhile (true) {\n\t\t\tawait delay(this._delay);\n\t\t\tyield i++;\n\t\t}\n\t}\n};\nfunction arrayFrom(length, cb) {\n\treturn Array.from({ length }, (_, i) => cb(i));\n}\nfunction exhaustive(v, message) {\n\tthrow Error(message);\n}\nfunction match(matcher) {\n\treturn (key) => matcher[key]();\n}\nfunction okOptional(v) {\n\tif (!v) return;\n\tif (v.ok) return v.value;\n}\nfunction errorOptional(v) {\n\tif (!v) return;\n\tif (!v.ok) return v.error;\n}\nfunction unwrap(r) {\n\tif (r.ok) return r.value;\n\tthrow Error(r.error);\n}\nfunction flatValue(v) {\n\treturn Array.isArray(v) ? v : [v];\n}\nasync function resolveAwaited(obj) {\n\treturn Object.fromEntries(await Promise.all(Object.entries(obj).map(async ([k, v]) => [k, await v])));\n}\nfunction alike(obj, to) {\n\treturn Object.keys(to).every((bKey) => obj[bKey] === to[bKey]);\n}\nconst identity = (v) => v;\nfunction asConst(v) {\n\treturn v;\n}\nfunction unionize(obj) {\n\treturn Object.entries(obj).map(([key, value]) => ({\n\t\tkey,\n\t\tvalue\n\t}));\n}\nvar Fetcher = class {\n\tpromises = /* @__PURE__ */ new Map();\n\tfetch(key, callback) {\n\t\tif (this.promises.has(key)) return this.promises.get(key);\n\t\tconst promise = callback().finally(() => {\n\t\t\tthis.promises.delete(key);\n\t\t});\n\t\tthis.promises.set(key, promise);\n\t\treturn promise;\n\t}\n};\n//#endregion\nexport { Deferred, Fetcher, Interval, alike, arrayFrom, asConst, async, between, bool, call, checkIfDefined, checkIfNotEmpty, clamp, delay, errorOptional, exhaustive, flatValue, identity, isNil, isPrimitive, listToOptions, match, notEmpty, notUndef, okOptional, performanceTimer, range, resolveAwaited, tap, tapIf, tear, timer, times, toList, undef, unionize, uniqueValues, unwrap, utils_exports };\n\n//# sourceMappingURL=utils.js.map","import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { isNil } from \"./utils.js\";\n//#region src/objects.ts\nvar objects_exports = /* @__PURE__ */ __exportAll({\n\tbindMethods: () => bindMethods,\n\tdeepClone: () => deepClone,\n\tdeepEqual: () => deepEqual,\n\tdeepPatch: () => deepPatch,\n\tgetField: () => getField,\n\tgetProp: () => getProp,\n\tisArray: () => isArray,\n\tisJsonEqual: () => isJsonEqual,\n\tisNonPrimitive: () => isNonPrimitive,\n\tisObject: () => isObject,\n\tisPlainObject: () => isPlainObject,\n\tmap: () => map,\n\tomit: () => omit,\n\tpick: () => pick,\n\tpickValues: () => pickValues,\n\tsetProp: () => setProp,\n\tshallowClone: () => shallowClone,\n\tshallowDiff: () => shallowDiff,\n\tshiftProp: () => shiftProp\n});\n/**\n* Alias to Array.isArray\n*/\nconst isArray = Array.isArray;\nfunction isNonPrimitive(obj) {\n\treturn obj !== null && typeof obj === \"object\";\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Checks if the given value is a plain object.\n*\n* A plain object is defined as an object created by the `{}` literal,\n* an object created with `Object.create(null)`, or an object with a\n* prototype that resolves to `Object.prototype`.\n*\n* @param value - The value to check.\n* @returns `true` if the value is a plain object, otherwise `false`.\n*\n* @example\n* ```typescript\n* isPlainObject({}); // true\n* isPlainObject(Object.create(null)); // true\n* isPlainObject(new Date()); // false\n* isPlainObject(null); // false\n* isPlainObject([]); // false\n* ```\n*/\nfunction isPlainObject(value) {\n\tif (!isObject(value)) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;\n}\nfunction map(obj, callback) {\n\treturn Object.keys(obj).map((key) => {\n\t\treturn callback(obj[key], key);\n\t});\n}\nfunction definedKeysSize(obj) {\n\treturn Object.values(obj).reduce((length, v) => {\n\t\treturn v !== void 0 ? length + 1 : length;\n\t}, 0);\n}\n/**\n* Performs a deep equality check between two values, `a` and `b`, to determine if they are JSON-equivalent.\n*\n* JSON equivalence means that the two values are strictly equal in structure and content, including arrays and plain objects.\n* Non-primitive values that are neither arrays nor plain objects will throw an error.\n*\n* @param a - The first value to compare.\n* @param b - The second value to compare.\n* @returns `true` if the values are JSON-equivalent, otherwise `false`.\n*\n* @throws If the values are non-primitive and not arrays or plain objects.\n*\n* @example\n* ```typescript\n* isJsonEqual(1, 1); // true\n* isJsonEqual({ a: 1 }, { a: 1 }); // true\n* isJsonEqual([1, 2], [1, 2]); // true\n* isJsonEqual({ a: 1 }, { a: 2 }); // false\n* isJsonEqual([1, 2], [2, 1]); // false\n* isJsonEqual(new Date(), new Date()); // Error\n* ```\n*/\nfunction isJsonEqual(a, b) {\n\tif (!(isNonPrimitive(a) && isNonPrimitive(b))) return a === b;\n\tif (isArray(a) && isArray(b)) if (a.length !== b.length) return false;\n\telse return [...a.keys()].every((k) => isJsonEqual(a[k], b[k]));\n\tif (isPlainObject(a) && isPlainObject(b)) {\n\t\tif (definedKeysSize(a) !== definedKeysSize(b)) return false;\n\t\treturn Object.keys(a).every((k) => isJsonEqual(a[k], b[k]));\n\t}\n\tthrow Error(`Cannot compare a ${String(a)} and b ${String(b)}`);\n}\n/**\n* Alias to isJsonEqual function\n* @deprecated change to isJsonEqual\n*/\nconst deepEqual = isJsonEqual;\nfunction deepClone(obj) {\n\tif (Array.isArray(obj)) {\n\t\tconst copy = [];\n\t\tfor (let i = 0; i < obj.length; i++) copy[i] = deepClone(obj[i]);\n\t\treturn copy;\n\t} else if (isPlainObject(obj)) {\n\t\tconst copy = {};\n\t\tObject.keys(obj).forEach((k) => {\n\t\t\tcopy[k] = deepClone(obj[k]);\n\t\t});\n\t\treturn copy;\n\t} else return obj;\n}\nfunction shallowClone(obj) {\n\tif (isNil(obj)) return obj;\n\tif (Array.isArray(obj)) return obj.slice();\n\tif (isPlainObject(obj)) return Object.assign({}, obj);\n\tif (obj instanceof Map) return new Map(obj);\n\tif (obj instanceof Set) return new Set(obj);\n\tthrow Error(`Not implemented clone strategy for ${JSON.stringify(obj)}`);\n}\nfunction shallowDiff(to, from) {\n\tconst diff = {};\n\tfor (const key in from) if (from[key] !== to[key]) diff[key] = to[key];\n\treturn diff;\n}\nfunction bindMethods(obj) {\n\tObject.entries(obj).forEach(([key, m]) => {\n\t\tif (m instanceof Function) obj[key] = m.bind(obj);\n\t});\n\treturn obj;\n}\nfunction setProp(obj, key, value) {\n\tobj[key] = value;\n\treturn obj;\n}\nfunction getProp(obj, key) {\n\treturn obj[key];\n}\nfunction shiftProp(obj, key) {\n\tobj = { ...obj };\n\tconst val = obj[key];\n\tdelete obj[key];\n\treturn [val, obj];\n}\nfunction pick(obj, ...keys) {\n\treturn Object.assign({}, ...keys.map((k) => ({ [k]: obj[k] })));\n}\nfunction pickValues(obj, ...keys) {\n\treturn keys.map((k) => obj[k]);\n}\nfunction omit(obj, ...keys) {\n\tconst o = Object.assign({}, obj);\n\tkeys.forEach((k) => delete o[k]);\n\treturn o;\n}\n/**\n* Performs a deep patch of the target object or array using the source object or array.\n*\n* This function recursively merges properties of the source into the target:\n* - If a property in both target and source is a plain object, they are recursively merged.\n* - If a property in both target and source is an array of the same length, the arrays are recursively patched element by element.\n* - Otherwise, the property value in the target is replaced by the corresponding value from the source.\n*\n* The patch is applied in-place to the target object or array, which is also returned for convenience.\n*\n* @typeParam T - The type of the target and source, which must be either a plain object or an array.\n* @param target - The target object or array to be patched. This object/array is modified in-place.\n* @param source - The source object or array providing the new values for the patch.\n* @returns The modified target object or array.\n*\n* @example\n* ```typescript\n* const target = { a: { b: 1 }, c: [1, 2] };\n* const source = { a: { b: 2 }, c: [3, 4], d: 5 };\n* const result = deepPatch(target, source);\n* // target is now: { a: { b: 2 }, c: [3, 4], d: 5 }\n* // result is the same reference as target.\n*\n* const targetArray = [{ a: 1 }, { b: 2 }];\n* const sourceArray = [{ a: 2 }, { b: 3 }];\n* const resultArray = deepPatch(targetArray, sourceArray);\n* // targetArray is now: [{ a: 2 }, { b: 3 }]\n* ```\n*/\nfunction deepPatch(target, source) {\n\t(/* @__PURE__ */ new Set([...Object.keys(target), ...Object.keys(source)])).forEach((key) => {\n\t\tconst t = target[key];\n\t\tconst s = source[key];\n\t\tif (isPlainObject(t) && isPlainObject(s)) deepPatch(t, s);\n\t\telse if (isArray(t) && isArray(s) && t.length === s.length) deepPatch(t, s);\n\t\telse target[key] = s;\n\t});\n\treturn target;\n}\n/**\n* Reads a property from a union-typed object where the key may exist only on some members of the union.\n*\n* `K` is constrained to keys of the union's intersection, so any key present on at least one union\n* member is accepted. The return type resolves to `T[K]` when `K` is a key of `T`, otherwise `undefined`\n* — matching the runtime behavior of reading a missing property.\n*\n* @param obj - source object (may be a union of shapes)\n* @param prop - property name, must be a key of at least one union member\n* @returns the property value if present, otherwise `undefined`\n*/\nfunction getField(obj, prop) {\n\treturn obj[prop];\n}\n//#endregion\nexport { bindMethods, deepClone, deepEqual, deepPatch, getField, getProp, isArray, isJsonEqual, isNonPrimitive, isObject, isPlainObject, map, objects_exports, omit, pick, pickValues, setProp, shallowClone, shallowDiff, shiftProp };\n\n//# sourceMappingURL=objects.js.map","import { isObject } from \"./objects.js\";\n//#region src/error.ts\nfunction isErrorLike(error) {\n\tif (error instanceof Error) return true;\n\treturn isObject(error) && \"message\" in error && typeof error.message === \"string\";\n}\nfunction throwError(v) {\n\tif (typeof v === \"string\") throw new Error(v);\n\telse throw v;\n}\n//#endregion\nexport { isErrorLike, throwError };\n\n//# sourceMappingURL=error.js.map","//#region src/uniqId.ts\nfunction createGetIncrementalId() {\n\tlet idx = 0n;\n\treturn () => idx++;\n}\n//#endregion\nexport { createGetIncrementalId };\n\n//# sourceMappingURL=uniqId.js.map","import { isPrimitive } from \"./utils.js\";\nimport { createGetIncrementalId } from \"./uniqId.js\";\n//#region src/hash.ts\nfunction hashString(str, seed = 0) {\n\tlet h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;\n\tfor (let i = 0, ch; i < str.length; i++) {\n\t\tch = str.charCodeAt(i);\n\t\th1 = Math.imul(h1 ^ ch, 2654435761);\n\t\th2 = Math.imul(h2 ^ ch, 1597334677);\n\t}\n\th1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);\n\th2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);\n\treturn 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\nfunction shallowHash(...values) {\n\tlet str = \"\";\n\tfor (let i = 0; i < values.length; i += 1) {\n\t\tconst value = values[i];\n\t\tif (isPrimitive(value)) str += \"/\" + String(value);\n\t\telse str += \"/\" + getIdForPointer(value);\n\t}\n\treturn hashString(str);\n}\nconst mapPointerToMap = /* @__PURE__ */ new WeakMap();\nconst getIncrementalId = createGetIncrementalId();\nfunction getIdForPointer(obj) {\n\tif (!mapPointerToMap.has(obj)) mapPointerToMap.set(obj, getIncrementalId().toString());\n\treturn mapPointerToMap.get(obj);\n}\n//#endregion\nexport { hashString, shallowHash };\n\n//# sourceMappingURL=hash.js.map","import { canonicalizeJson, parseJsonSafely } from \"../../../json.js\";\nimport { throwError } from \"@milaboratories/helpers\";\n//#region src/drivers/pframe/spec/discovered_column.ts\nfunction isColumnDiscoveredKey(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"__isDiscovered\" in obj;\n}\nfunction isColumnDiscoveredId(str) {\n\tif (typeof str !== \"string\") return false;\n\treturn isColumnDiscoveredKey(parseJsonSafely(str));\n}\nfunction distillColumnDiscoveredKey(props) {\n\treturn {\n\t\t__isDiscovered: true,\n\t\tcolumn: props.column,\n\t\tpath: Array.isArray(props.path) && props.path.length > 0 ? props.path : void 0,\n\t\tcolumnQualifications: Array.isArray(props.columnQualifications) && props.columnQualifications.length > 0 ? props.columnQualifications : void 0,\n\t\tqueriesQualifications: props.queriesQualifications && Object.keys(props.queriesQualifications).length > 0 ? props.queriesQualifications : void 0\n\t};\n}\nfunction createColumnDiscoveredId(props) {\n\treturn stringifyColumnDiscoveredId(props);\n}\nfunction createColumnDiscoveredKey(props) {\n\treturn distillColumnDiscoveredKey({\n\t\t__isDiscovered: true,\n\t\t...props\n\t});\n}\nfunction parseColumnDiscoveredId(id) {\n\ttry {\n\t\tconst parsed = JSON.parse(id);\n\t\treturn isColumnDiscoveredKey(parsed) ? parsed : throwError(\"Parsed object is not a valid DiscoveredPColumn\");\n\t} catch {\n\t\tthrow new Error(\"Invalid ColumnDiscoveredId: not a valid JSON or does not conform to DiscoveredPColumn structure\");\n\t}\n}\nfunction stringifyColumnDiscoveredId(id) {\n\treturn canonicalizeJson(distillColumnDiscoveredKey({\n\t\t__isDiscovered: true,\n\t\t...id\n\t}));\n}\n//#endregion\nexport { createColumnDiscoveredId, createColumnDiscoveredKey, distillColumnDiscoveredKey, isColumnDiscoveredId, isColumnDiscoveredKey, parseColumnDiscoveredId, stringifyColumnDiscoveredId };\n\n//# sourceMappingURL=discovered_column.js.map","function identity(x) {\n return x;\n}\n\nexport { identity };\n","function isTypedArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\nexport { isTypedArray };\n","function getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n\nexport { getTag };\n","function isFunction(value) {\n return typeof value === 'function';\n}\n\nexport { isFunction };\n","function isLength(value) {\n return Number.isSafeInteger(value) && value >= 0;\n}\n\nexport { isLength };\n","function isNil(x) {\n return x == null;\n}\n\nexport { isNil };\n","function isString(value) {\n return typeof value === 'string';\n}\n\nexport { isString };\n","import { canonicalizeJson } from \"../../../json.js\";\nimport { applyAxisFilters, isColumnFilteredKey } from \"./filtered_column.js\";\nimport { createPObjectId, isPObjectId, isPObjectKey } from \"../../../pool/spec.js\";\nimport \"../../../pool/index.js\";\nimport { isColumnDiscoveredKey } from \"./discovered_column.js\";\nimport { applySpecOverrides, isColumnOverriddenKey } from \"./overridden.js\";\nimport { throwError } from \"@milaboratories/helpers\";\nimport { isString } from \"es-toolkit\";\n//#region src/drivers/pframe/spec/ids.ts\n/**\n* Canonically serializes a column key to a branded string id. Accepts both\n* the new {@link ColumnUniversalKey} and the deprecated {@link UniversalPColumnId}\n* (anchored / old filtered object form).\n*/\nfunction stringifyColumnId(id) {\n\treturn canonicalizeJson(id);\n}\n/**\n* Parses a canonically serialized column id back to its key form.\n*/\nfunction parseColumnId(str) {\n\treturn JSON.parse(str);\n}\nfunction parseColumnIdSafely(str, fallback = void 0) {\n\ttry {\n\t\treturn JSON.parse(str);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n/**\n* Walk a rich column id down to its terminal leaf {@link PObjectId}.\n*/\nfunction extractPObjectId(id) {\n\tif (isString(id)) {\n\t\tif (isPObjectId(id)) return id;\n\t\treturn extractPObjectId(parseColumnIdSafely(id) ?? throwError(`extractPObjectId: id \"${id}\" is not a valid canonical column id`));\n\t}\n\tif (isPObjectKey(id)) return createPObjectId(id);\n\tif (isColumnFilteredKey(id)) return extractPObjectId(id.source);\n\tif (isColumnOverriddenKey(id)) return extractPObjectId(id.source);\n\tif (isColumnDiscoveredKey(id)) return extractPObjectId(id.column);\n\tthrow new Error(`extractPObjectId: unrecognized column id structure: ${JSON.stringify(id)}`);\n}\n/**\n* Reconstruct the effective {@link PColumnSpec} for a rich column id by walking\n* the id chain from leaf to outermost wrapper, applying each layer's spec\n* transformation in the same order the corresponding recipe would.\n*\n* Layer semantics:\n* - Leaf ({@link LocalPObjectKey} / {@link GlobalPObjectKey}): no transformation.\n* - {@link ColumnDiscoveredKey}: pass-through, descends into `column`.\n* - {@link ColumnFilteredKey}: drops the axes whose positional index appears in\n* `axisFilters[i][0]` from the inner spec's `axesSpec` — mirrors\n* `ColumnFilteredRecipe.getSpec()`.\n* - {@link ColumnOverriddenKey}: applies `specOverrides` via\n* {@link applySpecOverrides} on top of the inner spec.\n*/\nfunction reconstructSpecFromId(baseSpec, id) {\n\tif (isString(id)) {\n\t\tif (isPObjectId(id)) return baseSpec;\n\t\treturn reconstructSpecFromId(baseSpec, parseColumnIdSafely(id) ?? throwError(`reconstructSpecFromId: id \"${id}\" is not a valid canonical column id`));\n\t}\n\tif (isPObjectKey(id)) return baseSpec;\n\tif (isColumnDiscoveredKey(id)) return reconstructSpecFromId(baseSpec, id.column);\n\tif (isColumnFilteredKey(id)) return applyAxisFilters(reconstructSpecFromId(baseSpec, id.source), id.axisFilters);\n\tif (isColumnOverriddenKey(id)) return applySpecOverrides(reconstructSpecFromId(baseSpec, id.source), id.specOverrides);\n\tthrow new Error(`reconstructSpecFromId: unrecognized column id structure: ${JSON.stringify(id)}`);\n}\n//#endregion\nexport { extractPObjectId, parseColumnId, parseColumnIdSafely, reconstructSpecFromId, stringifyColumnId };\n\n//# sourceMappingURL=ids.js.map","import { canonicalizeJson } from \"../../../json.js\";\nimport { parseColumnIdSafely } from \"./ids.js\";\nimport { throwError } from \"@milaboratories/helpers\";\nimport { isNil, isString } from \"es-toolkit\";\n//#region src/drivers/pframe/spec/overridden.ts\nfunction isColumnOverriddenKey(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"__isOverridden\" in obj;\n}\nfunction distillColumnOverriddenKey(props) {\n\treturn {\n\t\t__isOverridden: true,\n\t\tsource: props.source,\n\t\tspecOverrides: props.specOverrides\n\t};\n}\nfunction createColumnOverriddenId(props) {\n\treturn stringifyColumnOverriddenId(createColumnOverriddenKey(props));\n}\nfunction createColumnOverriddenKey(props) {\n\tconst { source, specOverrides } = props;\n\tconst unwrapped = unwrapOverrides(source);\n\treturn {\n\t\t__isOverridden: true,\n\t\tsource: unwrapped ? unwrapped.source : source,\n\t\tspecOverrides: unwrapped ? mergeSpecOverrides(unwrapped.specOverrides, specOverrides) : specOverrides\n\t};\n}\nfunction parseColumnOverriddenId(id) {\n\ttry {\n\t\tconst parsed = JSON.parse(id);\n\t\treturn isColumnOverriddenKey(parsed) ? parsed : throwError(\"Parsed object is not a valid OverriddenPColumn\");\n\t} catch {\n\t\tthrow new Error(\"Invalid ColumnOverriddenId: not a valid JSON or does not conform to OverriddenPColumn structure\");\n\t}\n}\nfunction stringifyColumnOverriddenId(id) {\n\treturn canonicalizeJson(distillColumnOverriddenKey(id));\n}\n/**\n* Peel one override-wrap layer.\n*\n* Invariant: `{source, specOverrides}` can only appear at the top level —\n* the inner `source` is never itself an override-wrap. Anything else throws.\n*/\nfunction unwrapOverrides(id) {\n\tconst parsed = parseColumnIdSafely(id);\n\tif (parsed === void 0 || !isColumnOverriddenKey(parsed)) return void 0;\n\tconst inner = parseColumnIdSafely(parsed.source);\n\tif (inner !== void 0 && isColumnOverriddenKey(inner)) throw new Error(\"nested override-wrap detected — invariant broken\");\n\treturn parsed;\n}\n/**\n* Diff two specs into a {@link SpecOverrides} patch that, when applied on top\n* of `base`, reconstructs `next`.\n*\n* - For top-level `annotations` / `domain` / `contextDomain`: include keys\n* whose value in `next` differs from `base` (or is missing in `base`).\n* Keys present in `base` but missing in `next` are not emitted — overrides\n* merge, they cannot delete.\n* - For `axesSpec`: matched by **positional index**. Each `next[i]` is diffed\n* against `base[i]`; only changed fields are emitted as a patch under key\n* `i`. Indices past `base.length` carry the full new axis (append).\n*/\nfunction deriveSpecDelta(base, next) {\n\tconst annotations = recordDelta(base.annotations, next.annotations);\n\tconst domain = recordDelta(base.domain, next.domain);\n\tconst contextDomain = recordDelta(base.contextDomain, next.contextDomain);\n\tconst axesSpec = deriveAxesDelta(base.axesSpec, next.axesSpec);\n\treturn {\n\t\t...axesSpec && { axesSpec },\n\t\t...annotations && { annotations },\n\t\t...domain && { domain },\n\t\t...contextDomain && { contextDomain }\n\t};\n}\nfunction isEmptySpecDelta(delta) {\n\treturn (!delta.annotations || Object.keys(delta.annotations).length === 0) && (!delta.domain || Object.keys(delta.domain).length === 0) && (!delta.contextDomain || Object.keys(delta.contextDomain).length === 0) && (!delta.axesSpec || Object.keys(delta.axesSpec).length === 0);\n}\nfunction deriveAxesDelta(base, next) {\n\tconst out = {};\n\tlet any = false;\n\tfor (let i = 0; i < next.length; i++) {\n\t\tconst a = next[i];\n\t\tconst b = base[i];\n\t\tif (b === void 0) {\n\t\t\tout[i] = a;\n\t\t\tany = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nameChanged = a.name !== b.name;\n\t\tconst typeChanged = a.type !== b.type;\n\t\tconst annotations = recordDelta(b.annotations, a.annotations);\n\t\tconst domain = recordDelta(b.domain, a.domain);\n\t\tconst contextDomain = recordDelta(b.contextDomain, a.contextDomain);\n\t\tif (!nameChanged && !typeChanged && !annotations && !domain && !contextDomain) continue;\n\t\tout[i] = {\n\t\t\t...nameChanged && { name: a.name },\n\t\t\t...typeChanged && { type: a.type },\n\t\t\t...annotations && { annotations },\n\t\t\t...domain && { domain },\n\t\t\t...contextDomain && { contextDomain }\n\t\t};\n\t\tany = true;\n\t}\n\treturn any ? out : void 0;\n}\nfunction recordDelta(base, next) {\n\tif (!next) return void 0;\n\tlet any = false;\n\tconst diff = {};\n\tfor (const [k, v] of Object.entries(next)) if (!base || base[k] !== v) {\n\t\tdiff[k] = v;\n\t\tany = true;\n\t}\n\treturn any ? diff : void 0;\n}\n/**\n* Apply `specOverrides` from a rich id (`SUniversalPColumnId`) on top of a\n* resolved {@link PColumnSpec}. Returns `base` unchanged when the id carries\n* no overrides.\n*/\nfunction applySpecOverrides(base, idOrOverride) {\n\tif (isNil(idOrOverride)) return base;\n\tconst overrides = isString(idOrOverride) ? unwrapOverrides(idOrOverride)?.specOverrides : idOrOverride;\n\tif (isNil(overrides)) return base;\n\tconst result = { ...base };\n\tif (overrides.annotations) result.annotations = mergeRecord(base.annotations, overrides.annotations);\n\tif (overrides.domain) result.domain = mergeRecord(base.domain, overrides.domain);\n\tif (overrides.contextDomain) result.contextDomain = mergeRecord(base.contextDomain, overrides.contextDomain);\n\tif (overrides.axesSpec) result.axesSpec = applyAxesPatches(base.axesSpec, overrides.axesSpec);\n\treturn result;\n}\n/**\n* Compose two override patches: applying `mergeSpecOverrides(prior, next)` on\n* top of a base spec produces the same result as applying `prior` then `next`.\n*/\nfunction mergeSpecOverrides(prior, next) {\n\tconst result = {};\n\tconst axesSpec = mergeAxesPatches(prior.axesSpec, next.axesSpec);\n\tif (axesSpec !== void 0) result.axesSpec = axesSpec;\n\tconst annotations = mergeRecord(prior.annotations, next.annotations);\n\tif (annotations !== void 0) result.annotations = annotations;\n\tconst domain = mergeRecord(prior.domain, next.domain);\n\tif (domain !== void 0) result.domain = domain;\n\tconst contextDomain = mergeRecord(prior.contextDomain, next.contextDomain);\n\tif (contextDomain !== void 0) result.contextDomain = contextDomain;\n\treturn result;\n}\n/**\n* Apply positional `patches` onto `base.axesSpec`. Patches deep-merge\n* `annotations` / `domain` / `contextDomain` and shallow-override `name` /\n* `type` at their slot. Indices `>= base.length` append new axes; intermediate\n* gaps (if any) are filled with the patch itself, so callers should not leave\n* holes between base.length and the highest patched index.\n*/\nfunction applyAxesPatches(base, patches) {\n\tconst result = base.slice();\n\tfor (const [k, p] of Object.entries(patches)) {\n\t\tconst i = Number(k);\n\t\tconst existing = result[i];\n\t\tresult[i] = existing === void 0 ? p : mergeAxisPatch(existing, p);\n\t}\n\treturn result;\n}\n/**\n* Compose two positional patch maps: `mergeAxesPatches(prior, next)` applied to\n* a base spec must equal applying `prior` then `next`. Patches sharing an\n* index deep-merge field-by-field.\n*/\nfunction mergeAxesPatches(prior, next) {\n\tif (!prior || Object.keys(prior).length === 0) return next;\n\tif (!next || Object.keys(next).length === 0) return prior;\n\tconst result = { ...prior };\n\tfor (const [k, p] of Object.entries(next)) {\n\t\tconst i = Number(k);\n\t\tconst existing = result[i];\n\t\tresult[i] = existing === void 0 ? p : mergeAxisPatch(existing, p);\n\t}\n\treturn result;\n}\nfunction mergeAxisPatch(axis, patch) {\n\tconst result = {\n\t\t...axis,\n\t\t...patch\n\t};\n\tif (patch.annotations) result.annotations = mergeRecord(axis.annotations, patch.annotations);\n\tif (patch.domain) result.domain = mergeRecord(axis.domain, patch.domain);\n\tif (patch.contextDomain) result.contextDomain = mergeRecord(axis.contextDomain, patch.contextDomain);\n\treturn result;\n}\nfunction mergeRecord(a, b) {\n\tif (!b) return a;\n\tif (!a) return b;\n\treturn {\n\t\t...a,\n\t\t...b\n\t};\n}\n//#endregion\nexport { applySpecOverrides, createColumnOverriddenId, createColumnOverriddenKey, deriveSpecDelta, distillColumnOverriddenKey, isColumnOverriddenKey, isEmptySpecDelta, mergeSpecOverrides, parseColumnOverriddenId, stringifyColumnOverriddenId, unwrapOverrides };\n\n//# sourceMappingURL=overridden.js.map","import { getAxisId, matchAxisId } from \"./spec.js\";\nimport { stringifyColumnId } from \"./ids.js\";\nimport canonicalize from \"canonicalize\";\n//#region src/drivers/pframe/spec/anchored.ts\nfunction axisKey(axis) {\n\treturn canonicalize(getAxisId(axis));\n}\nfunction domainKey(key, value) {\n\treturn JSON.stringify([key, value]);\n}\n/**\n* Context for resolving and generating anchored references to columns and axes\n* Maintains maps of known domain values and axes that can be referenced by anchors\n*/\nvar AnchoredIdDeriver = class {\n\tanchors;\n\taxes = /* @__PURE__ */ new Map();\n\tdomains = /* @__PURE__ */ new Map();\n\tcontextDomains = /* @__PURE__ */ new Map();\n\t/**\n\t* Domain packs are used to group domain keys that can be anchored to the same anchor\n\t* This is used to optimize the lookup of domain anchors\n\t*/\n\tdomainPacks = [];\n\tcontextDomainPacks = [];\n\t/**\n\t* Maps domain packs to anchors\n\t*/\n\tdomainPackToAnchor = /* @__PURE__ */ new Map();\n\tcontextDomainPackToAnchor = /* @__PURE__ */ new Map();\n\t/**\n\t* Creates a new anchor context from a set of anchor column specifications\n\t* @param anchors Record of anchor column specifications indexed by anchor ID\n\t*/\n\tconstructor(anchors) {\n\t\tthis.anchors = anchors;\n\t\tconst anchorEntries = Object.entries(anchors);\n\t\tanchorEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\tfor (const [anchorId, spec] of anchorEntries) {\n\t\t\tfor (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {\n\t\t\t\tconst axis = spec.axesSpec[axisIdx];\n\t\t\t\tconst key = axisKey(axis);\n\t\t\t\tthis.axes.set(key, {\n\t\t\t\t\tanchor: anchorId,\n\t\t\t\t\tidx: axisIdx\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (spec.domain !== void 0) {\n\t\t\t\tconst domainEntries = Object.entries(spec.domain);\n\t\t\t\tdomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\tthis.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);\n\t\t\t\tthis.domainPacks.push(domainEntries.map(([dKey]) => dKey));\n\t\t\t\tfor (const [dKey, dValue] of domainEntries) {\n\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\tthis.domains.set(key, anchorId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (spec.contextDomain !== void 0) {\n\t\t\t\tconst contextDomainEntries = Object.entries(spec.contextDomain);\n\t\t\t\tcontextDomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\tthis.contextDomainPackToAnchor.set(JSON.stringify(contextDomainEntries), anchorId);\n\t\t\t\tthis.contextDomainPacks.push(contextDomainEntries.map(([dKey]) => dKey));\n\t\t\t\tfor (const [dKey, dValue] of contextDomainEntries) {\n\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\tthis.contextDomains.set(key, anchorId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Implementation of derive method\n\t*/\n\tderive(spec, axisFilters) {\n\t\tconst result = {\n\t\t\tname: spec.name,\n\t\t\taxes: []\n\t\t};\n\t\tlet skipDomains = void 0;\n\t\tif (spec.domain !== void 0) outer: for (const domainPack of this.domainPacks) {\n\t\t\tconst dAnchor = [];\n\t\t\tfor (const domainKey of domainPack) {\n\t\t\t\tconst dValue = spec.domain[domainKey];\n\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\telse break outer;\n\t\t\t}\n\t\t\tconst domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\tif (domainAnchor !== void 0) {\n\t\t\t\tresult.domainAnchor = domainAnchor;\n\t\t\t\tskipDomains = new Set(domainPack);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {\n\t\t\tif (skipDomains !== void 0 && skipDomains.has(dKey)) continue;\n\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\tconst anchorId = this.domains.get(key);\n\t\t\tresult.domain ??= {};\n\t\t\tresult.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t}\n\t\tlet skipContextDomains = void 0;\n\t\tif (spec.contextDomain !== void 0) outer: for (const contextDomainPack of this.contextDomainPacks) {\n\t\t\tconst dAnchor = [];\n\t\t\tfor (const domainKey of contextDomainPack) {\n\t\t\t\tconst dValue = spec.contextDomain[domainKey];\n\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\telse break outer;\n\t\t\t}\n\t\t\tconst contextDomainAnchor = this.contextDomainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\tif (contextDomainAnchor !== void 0) {\n\t\t\t\tresult.contextDomainAnchor = contextDomainAnchor;\n\t\t\t\tskipContextDomains = new Set(contextDomainPack);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (const [dKey, dValue] of Object.entries(spec.contextDomain ?? {})) {\n\t\t\tif (skipContextDomains !== void 0 && skipContextDomains.has(dKey)) continue;\n\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\tconst anchorId = this.contextDomains.get(key);\n\t\t\tresult.contextDomain ??= {};\n\t\t\tresult.contextDomain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t}\n\t\tresult.axes = spec.axesSpec.map((axis) => {\n\t\t\tconst key = axisKey(axis);\n\t\t\tconst anchorAxisRef = this.axes.get(key);\n\t\t\tif (anchorAxisRef === void 0) return getAxisId(axis);\n\t\t\telse return anchorAxisRef;\n\t\t});\n\t\tif (!axisFilters || axisFilters.length === 0) return result;\n\t\tconst resolvedFilters = [];\n\t\tfor (const filter of axisFilters) {\n\t\t\tconst [axisIdOrIndex, value] = filter;\n\t\t\tif (typeof axisIdOrIndex === \"number\") {\n\t\t\t\tif (axisIdOrIndex < 0 || axisIdOrIndex >= spec.axesSpec.length) throw new Error(`Axis index ${axisIdOrIndex} is out of bounds (0-${spec.axesSpec.length - 1})`);\n\t\t\t\tresolvedFilters.push([axisIdOrIndex, value]);\n\t\t\t} else {\n\t\t\t\tconst axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);\n\t\t\t\tif (axisIndex === -1) throw new Error(`Axis with name \"${axisIdOrIndex}\" not found in the column specification`);\n\t\t\t\tresolvedFilters.push([axisIndex, value]);\n\t\t\t}\n\t\t}\n\t\tresolvedFilters.sort((a, b) => a[0] - b[0]);\n\t\treturn {\n\t\t\tsource: result,\n\t\t\taxisFilters: resolvedFilters\n\t\t};\n\t}\n\t/**\n\t* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column\n\t* @param spec Column specification to anchor\n\t* @param axisFilters Optional axis filters to apply to the column\n\t* @returns A canonicalized string representation of the anchored column identifier\n\t*/\n\tderiveS(spec, axisFilters) {\n\t\treturn stringifyColumnId(this.derive(spec, axisFilters));\n\t}\n};\n/**\n* Resolves anchored references in a column matcher to create a non-anchored matcher.\n* Doing an opposite operation to {@link AnchorIdDeriver.derive()}.\n*\n* @param anchors - Record of anchor column specifications indexed by anchor id\n* @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved\n* @param options - Options for resolving anchors\n* @returns A non-anchored column matcher with all references resolved to actual values\n* @deprecated - This function by parent PColumnCollection\n*/\nfunction resolveAnchors(anchors, matcher, options) {\n\tconst result = { ...matcher };\n\tconst ignoreMissingDomains = options?.ignoreMissingDomains ?? false;\n\tif (result.domainAnchor !== void 0) {\n\t\tconst anchorSpec = anchors[result.domainAnchor];\n\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.domainAnchor}\" not found`);\n\t\tresult.domain = {\n\t\t\t...anchorSpec.domain || {},\n\t\t\t...result.domain\n\t\t};\n\t\tdelete result.domainAnchor;\n\t}\n\tif (result.domain) {\n\t\tconst resolvedDomain = {};\n\t\tfor (const [key, value] of Object.entries(result.domain)) if (typeof value === \"string\") resolvedDomain[key] = value;\n\t\telse {\n\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for domain key \"${key}\"`);\n\t\t\tif (!anchorSpec.domain || anchorSpec.domain[key] === void 0) {\n\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresolvedDomain[key] = anchorSpec.domain[key];\n\t\t}\n\t\tresult.domain = resolvedDomain;\n\t}\n\tif (result.contextDomainAnchor !== void 0) {\n\t\tconst anchorSpec = anchors[result.contextDomainAnchor];\n\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.contextDomainAnchor}\" not found`);\n\t\tresult.contextDomain = {\n\t\t\t...anchorSpec.contextDomain || {},\n\t\t\t...result.contextDomain\n\t\t};\n\t\tdelete result.contextDomainAnchor;\n\t}\n\tif (result.contextDomain) {\n\t\tconst resolvedContextDomain = {};\n\t\tfor (const [key, value] of Object.entries(result.contextDomain)) if (typeof value === \"string\") resolvedContextDomain[key] = value;\n\t\telse {\n\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for contextDomain key \"${key}\"`);\n\t\t\tif (!anchorSpec.contextDomain || anchorSpec.contextDomain[key] === void 0) {\n\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Context domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresolvedContextDomain[key] = anchorSpec.contextDomain[key];\n\t\t}\n\t\tresult.contextDomain = resolvedContextDomain;\n\t}\n\tif (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));\n\treturn result;\n}\n/**\n* Resolves an anchored axis reference to a concrete AxisId\n*/\nfunction resolveAxisReference(anchors, axisRef) {\n\tif (!isAnchorAxisRef(axisRef)) return axisRef;\n\tconst anchorId = axisRef.anchor;\n\tconst anchorSpec = anchors[anchorId];\n\tif (!anchorSpec) throw new Error(`Anchor \"${anchorId}\" not found for axis reference`);\n\tif (\"idx\" in axisRef) {\n\t\tif (axisRef.idx < 0 || axisRef.idx >= anchorSpec.axesSpec.length) throw new Error(`Axis index ${axisRef.idx} out of bounds for anchor \"${anchorId}\"`);\n\t\treturn anchorSpec.axesSpec[axisRef.idx];\n\t} else if (\"name\" in axisRef) {\n\t\tconst matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);\n\t\tif (matches.length > 1) throw new Error(`Multiple axes with name \"${axisRef.name}\" found in anchor \"${anchorId}\"`);\n\t\tif (matches.length === 0) throw new Error(`Axis with name \"${axisRef.name}\" not found in anchor \"${anchorId}\"`);\n\t\treturn matches[0];\n\t} else if (\"id\" in axisRef) {\n\t\tconst matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));\n\t\tif (matches.length > 1) throw new Error(`Multiple matching axes found for matcher in anchor \"${anchorId}\"`);\n\t\tif (matches.length === 0) throw new Error(`No matching axis found for matcher in anchor \"${anchorId}\"`);\n\t\treturn matches[0];\n\t}\n\tthrow new Error(`Unsupported axis reference type`);\n}\n/**\n* Type guard to check if a value is an anchored axis reference\n*/\nfunction isAnchorAxisRef(value) {\n\treturn typeof value === \"object\" && \"anchor\" in value;\n}\n//#endregion\nexport { AnchoredIdDeriver, resolveAnchors };\n\n//# sourceMappingURL=anchored.js.map","import { getAxisId } from \"./spec.js\";\nimport { isPColumnSpec } from \"../../../pool/spec.js\";\nimport \"../../../pool/index.js\";\n//#region src/drivers/pframe/spec/selectors.ts\n/**\n* Checks if a given value is an anchored column identifier\n* @param id - The value to check\n* @returns True if the value is an anchored column identifier, false otherwise\n*/\nfunction isAnchoredPColumnId(id) {\n\treturn typeof id === \"object\" && id !== null && \"name\" in id && \"axes\" in id;\n}\n/**\n* Determines if an axis ID matches an axis selector.\n*\n* @param selector - The selector with criteria to match against\n* @param axis - The AxisId to check against the selector\n* @returns true if the AxisId matches all specified criteria in the selector, false otherwise\n*/\nfunction matchAxis(selector, axis) {\n\tif (selector.name !== void 0 && selector.name !== axis.name) return false;\n\tif (selector.type !== void 0) {\n\t\tif (Array.isArray(selector.type)) {\n\t\t\tif (!selector.type.includes(axis.type)) return false;\n\t\t} else if (selector.type !== axis.type) return false;\n\t}\n\tif (selector.domain !== void 0) {\n\t\tconst axisDomain = axis.domain || {};\n\t\tfor (const [key, value] of Object.entries(selector.domain)) if (axisDomain[key] !== value) return false;\n\t}\n\tif (selector.contextDomain !== void 0) {\n\t\tconst axisContextDomain = axis.contextDomain || {};\n\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (axisContextDomain[key] !== value) return false;\n\t}\n\treturn true;\n}\n/**\n* Determines if a given PColumnSpec matches a selector.\n*\n* @param pcolumn - The PColumnSpec to check against the selector\n* @param selector - The selector criteria to match against\n* @returns true if the PColumnSpec matches all criteria in the selector, false otherwise\n*/\nfunction matchPColumn(pcolumn, selector) {\n\tif (selector.name !== void 0 && pcolumn.name !== selector.name) return false;\n\tif (selector.namePattern !== void 0 && !new RegExp(selector.namePattern).test(pcolumn.name)) return false;\n\tif (selector.type !== void 0) {\n\t\tif (Array.isArray(selector.type)) {\n\t\t\tif (!selector.type.includes(pcolumn.valueType)) return false;\n\t\t} else if (selector.type !== pcolumn.valueType) return false;\n\t}\n\tif (selector.domain !== void 0) {\n\t\tconst columnDomain = pcolumn.domain || {};\n\t\tfor (const [key, value] of Object.entries(selector.domain)) if (columnDomain[key] !== value) return false;\n\t}\n\tif (selector.contextDomain !== void 0) {\n\t\tconst columnContextDomain = pcolumn.contextDomain || {};\n\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (columnContextDomain[key] !== value) return false;\n\t}\n\tif (selector.axes !== void 0) {\n\t\tconst pcolumnAxes = pcolumn.axesSpec.map(getAxisId);\n\t\tif (selector.partialAxesMatch) {\n\t\t\tfor (const selectorAxis of selector.axes) if (!pcolumnAxes.some((columnAxis) => matchAxis(selectorAxis, columnAxis))) return false;\n\t\t} else {\n\t\t\tif (pcolumnAxes.length !== selector.axes.length) return false;\n\t\t\tfor (let i = 0; i < selector.axes.length; i++) if (!matchAxis(selector.axes[i], pcolumnAxes[i])) return false;\n\t\t}\n\t}\n\tif (selector.annotations !== void 0) {\n\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\tfor (const [key, value] of Object.entries(selector.annotations)) if (columnAnnotations[key] !== value) return false;\n\t}\n\tif (selector.annotationPatterns !== void 0) {\n\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\tfor (const [key, pattern] of Object.entries(selector.annotationPatterns)) {\n\t\t\tconst value = columnAnnotations[key];\n\t\t\tif (value === void 0 || !new RegExp(pattern).test(value)) return false;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n* Convert a predicate or array of selectors to a single predicate function\n* @param predicateOrSelectors - Either a function that takes a PColumnSpec and returns a boolean,\n* or an array of PColumnSelectors, or a single PColumnSelector\n* @returns A function that takes a PColumnSpec and returns a boolean\n*/\nfunction legacyColumnSelectorsToPredicate(predicateOrSelectors) {\n\tif (Array.isArray(predicateOrSelectors)) return (spec) => predicateOrSelectors.some((selector) => isPColumnSpec(spec) && matchPColumn(spec, selector));\n\telse return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);\n}\nfunction matchString(matcher, value) {\n\treturn matcher.type === \"exact\" ? value === matcher.value : new RegExp(matcher.value).test(value);\n}\nfunction matchMatcherMap(map, target) {\n\tconst t = target ?? {};\n\tfor (const [key, matchers] of Object.entries(map)) {\n\t\tconst v = t[key];\n\t\tif (v === void 0) return false;\n\t\tif (!matchers.some((m) => matchString(m, v))) return false;\n\t}\n\treturn true;\n}\nfunction matchMultiAxis(selector, axis) {\n\tif (selector.type !== void 0 && !selector.type.includes(axis.type)) return false;\n\tif (selector.name !== void 0 && !selector.name.some((m) => matchString(m, axis.name))) return false;\n\tif (selector.domain !== void 0 && !matchMatcherMap(selector.domain, axis.domain)) return false;\n\tif (selector.contextDomain !== void 0 && !matchMatcherMap(selector.contextDomain, axis.contextDomain)) return false;\n\treturn true;\n}\n/** Match a {@link PColumnSpec} against a {@link MultiColumnSelector}. */\nfunction matchMultiColumnSelector(spec, selector) {\n\tif (selector.type !== void 0 && !selector.type.includes(spec.valueType)) return false;\n\tif (selector.name !== void 0 && !selector.name.some((m) => matchString(m, spec.name))) return false;\n\tif (selector.domain !== void 0 && !matchMatcherMap(selector.domain, spec.domain)) return false;\n\tif (selector.contextDomain !== void 0 && !matchMatcherMap(selector.contextDomain, spec.contextDomain)) return false;\n\tif (selector.annotations !== void 0 && !matchMatcherMap(selector.annotations, spec.annotations)) return false;\n\tif (selector.axes !== void 0) {\n\t\tconst columnAxes = spec.axesSpec.map(getAxisId);\n\t\tif (selector.partialAxesMatch ?? true) {\n\t\t\tfor (const axisSelector of selector.axes) if (!columnAxes.some((axis) => matchMultiAxis(axisSelector, axis))) return false;\n\t\t} else {\n\t\t\tif (columnAxes.length !== selector.axes.length) return false;\n\t\t\tfor (let i = 0; i < selector.axes.length; i++) if (!matchMultiAxis(selector.axes[i], columnAxes[i])) return false;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n* Convert a {@link MultiColumnSelector} (or array; selectors OR-ed) to a predicate.\n* Non-PColumn specs always return false.\n*/\nfunction multiColumnSelectorsToPredicate(selectors) {\n\tconst arr = Array.isArray(selectors) ? selectors : [selectors];\n\treturn (spec) => isPColumnSpec(spec) && arr.some((sel) => matchMultiColumnSelector(spec, sel));\n}\n//#endregion\nexport { isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate };\n\n//# sourceMappingURL=selectors.js.map","import { getAxesId } from \"./spec.js\";\nimport { isPColumnSpec } from \"../../../pool/spec.js\";\nimport \"../../../pool/index.js\";\nimport canonicalize from \"canonicalize\";\n//#region src/drivers/pframe/spec/native_id.ts\nfunction deriveNativeId(spec) {\n\tconst result = {\n\t\tkind: spec.kind,\n\t\tname: spec.name\n\t};\n\tif (spec.domain !== void 0) result.domain = spec.domain;\n\tif (spec.contextDomain !== void 0) result.contextDomain = spec.contextDomain;\n\tif (isPColumnSpec(spec)) result.axesSpec = getAxesId(spec.axesSpec);\n\treturn canonicalize(result);\n}\n//#endregion\nexport { deriveNativeId };\n\n//# sourceMappingURL=native_id.js.map","import { canonicalizeJson, parseJson } from \"../../json.js\";\nimport { Annotation, getArrayFromAxisTree, getAxesTree, getAxisId, getNormalizedAxesList, readAnnotationJson } from \"./spec/spec.js\";\n//#region src/drivers/pframe/linker_columns.ts\nvar LinkerMap = class LinkerMap {\n\t/** Graph of linkers connected by axes (single or grouped by parents) */\n\tdata;\n\tconstructor(linkerMap) {\n\t\tthis.data = linkerMap;\n\t}\n\tget keys() {\n\t\treturn this.data.keys();\n\t}\n\tget keyAxesIds() {\n\t\treturn [...this.data.keys()].map(parseJson);\n\t}\n\tstatic fromColumns(columns) {\n\t\tconst result = /* @__PURE__ */ new Map();\n\t\tfor (const linker of columns.filter((l) => !!readAnnotationJson(l.spec, Annotation.IsLinkerColumn))) {\n\t\t\tconst groups = LinkerMap.getAxesGroups(getNormalizedAxesList(linker.spec.axesSpec));\n\t\t\tif (groups.length !== 2) continue;\n\t\t\tconst [left, right] = groups;\n\t\t\tconst leftKeyVariants = LinkerMap.getAxesRoots(left).map((axis) => {\n\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t});\n\t\t\tconst rightKeyVariants = LinkerMap.getAxesRoots(right).map((axis) => {\n\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t});\n\t\t\tfor (const [keyLeft, spec] of leftKeyVariants) if (!result.has(keyLeft)) result.set(keyLeft, {\n\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t});\n\t\t\tfor (const [keyRight, spec] of rightKeyVariants) if (!result.has(keyRight)) result.set(keyRight, {\n\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t});\n\t\t\tfor (const [keyRight] of rightKeyVariants) for (const [keyLeft] of leftKeyVariants) result.get(keyRight)?.linkWith.set(keyLeft, linker);\n\t\t}\n\t\treturn new this(result);\n\t}\n\t/** Get all available nodes of linker graphs if start from sourceAxesKeys */\n\tsearchAvailableAxesKeys(sourceAxesKeys) {\n\t\tconst startKeys = new Set(sourceAxesKeys);\n\t\tconst allAvailableKeys = /* @__PURE__ */ new Set();\n\t\tlet nextKeys = sourceAxesKeys;\n\t\twhile (nextKeys.length) {\n\t\t\tconst next = [];\n\t\t\tfor (const key of nextKeys) {\n\t\t\t\tconst node = this.data.get(key);\n\t\t\t\tif (!node) continue;\n\t\t\t\tfor (const availableKey of node.linkWith.keys()) if (!allAvailableKeys.has(availableKey) && !startKeys.has(availableKey)) {\n\t\t\t\t\tnext.push(availableKey);\n\t\t\t\t\tallAvailableKeys.add(availableKey);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextKeys = next;\n\t\t}\n\t\treturn allAvailableKeys;\n\t}\n\t/** Get all linker columns that are necessary to reach endKey from startKey */\n\tsearchLinkerPath(startKey, endKey) {\n\t\tconst previous = {};\n\t\tlet nextIds = /* @__PURE__ */ new Set([startKey]);\n\t\tconst visited = /* @__PURE__ */ new Set([startKey]);\n\t\twhile (nextIds.size) {\n\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\tfor (const nextId of nextIds) {\n\t\t\t\tconst node = this.data.get(nextId);\n\t\t\t\tif (!node) continue;\n\t\t\t\tfor (const availableId of node.linkWith.keys()) {\n\t\t\t\t\tprevious[availableId] = nextId;\n\t\t\t\t\tif (availableId === endKey) {\n\t\t\t\t\t\tconst ids = [];\n\t\t\t\t\t\tlet current = endKey;\n\t\t\t\t\t\twhile (previous[current] !== startKey) {\n\t\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\t\tcurrent = previous[current];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\treturn ids.map((id) => this.data.get(previous[id]).linkWith.get(id));\n\t\t\t\t\t} else if (!visited.has(availableId)) {\n\t\t\t\t\t\tnext.add(availableId);\n\t\t\t\t\t\tvisited.add(availableId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextIds = next;\n\t\t}\n\t\treturn [];\n\t}\n\tgetLinkerColumnsForAxes({ from: sourceAxes, to: targetAxes, throwWhenNoLinkExists = true }) {\n\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\treturn Array.from(new Map(LinkerMap.getAxesRoots(targetAxes).map(LinkerMap.getLinkerKeyFromAxisSpec).flatMap((targetKey) => {\n\t\t\tconst linkers = startKeys.map((startKey) => this.searchLinkerPath(startKey, targetKey)).reduce((shortestPath, path) => shortestPath.length && shortestPath.length < path.length || !path.length ? shortestPath : path, []).map((linker) => [linker.columnId, linker]);\n\t\t\tif (!linkers.length && throwWhenNoLinkExists) throw Error(`Unable to find linker column for ${targetKey}`);\n\t\t\treturn linkers;\n\t\t})).values());\n\t}\n\t/** Get list of axisSpecs from keys of linker columns map */\n\tgetAxesListFromKeysList(keys) {\n\t\treturn Array.from(new Map(keys.flatMap((key) => this.data.get(key)?.keyAxesSpec ?? []).map((axis) => [canonicalizeJson(getAxisId(axis)), axis])).values());\n\t}\n\t/** Get axes of target axes that are impossible to be linked to source axes with current linker map */\n\tgetNonLinkableAxes(sourceAxes, targetAxes) {\n\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\tconst targetKeys = targetAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\treturn Array.from(new Map(targetAxes.filter((_targetAxis, idx) => {\n\t\t\tconst targetKey = targetKeys[idx];\n\t\t\treturn !startKeys.some((startKey) => this.searchLinkerPath(startKey, targetKey).length);\n\t\t}).flatMap((axis) => getArrayFromAxisTree(getAxesTree(axis)).map((axis) => [canonicalizeJson(getAxisId(axis)), axis]))).values());\n\t}\n\t/** Get all axes that can be connected to sourceAxes by linkers */\n\tgetReachableByLinkersAxesFromAxesNormalized(sourceAxes, matchAxisIdFn) {\n\t\tlet startKeys = [];\n\t\tif (matchAxisIdFn) {\n\t\t\tconst sourceAxisIdsGrouped = sourceAxes.map((axis) => getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t\t\tfor (const sourceAxisIdsGroup of sourceAxisIdsGrouped) {\n\t\t\t\tconst matched = this.keyAxesIds.find((keyIds) => keyIds.every((linkerKeyAxisId) => sourceAxisIdsGroup.find((sourceAxisId) => matchAxisIdFn(linkerKeyAxisId, sourceAxisId))));\n\t\t\t\tif (matched) startKeys.push(canonicalizeJson(matched));\n\t\t\t}\n\t\t} else startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\tconst availableKeys = this.searchAvailableAxesKeys(startKeys);\n\t\treturn this.getAxesListFromKeysList([...availableKeys]);\n\t}\n\tgetReachableByLinkersAxesFromAxes(sourceAxes, matchAxisIdFn) {\n\t\treturn this.getReachableByLinkersAxesFromAxesNormalized(getNormalizedAxesList(sourceAxes), matchAxisIdFn);\n\t}\n\tstatic getLinkerKeyFromAxisSpec(axis) {\n\t\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t}\n\t/** Split array of axes into several arrays by parents: axes of one group are parents for each other.\n\tThere are no order inside every group. */\n\tstatic getAxesGroups(axesSpec) {\n\t\tswitch (axesSpec.length) {\n\t\t\tcase 0: return [];\n\t\t\tcase 1: return [[axesSpec[0]]];\n\t\t\tdefault: break;\n\t\t}\n\t\tconst axisKeys = axesSpec.map((spec) => canonicalizeJson(getAxisId(spec)));\n\t\tconst axisParentsIdxs = axesSpec.map((spec) => new Set(spec.parentAxesSpec.map((spec) => canonicalizeJson(getAxisId(spec))).map((el) => {\n\t\t\tconst idx = axisKeys.indexOf(el);\n\t\t\tif (idx === -1) throw new Error(`malformed axesSpec: ${JSON.stringify(axesSpec)}, unable to locate parent ${el}`);\n\t\t\treturn idx;\n\t\t})));\n\t\tconst allIdxs = [...axesSpec.keys()];\n\t\tconst groups = [];\n\t\tconst usedIdxs = /* @__PURE__ */ new Set();\n\t\tlet nextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\twhile (nextFreeEl !== void 0) {\n\t\t\tconst currentGroup = [nextFreeEl];\n\t\t\tusedIdxs.add(nextFreeEl);\n\t\t\tlet nextElsOfCurrentGroup = [nextFreeEl];\n\t\t\twhile (nextElsOfCurrentGroup.length) {\n\t\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const groupIdx of nextElsOfCurrentGroup) {\n\t\t\t\t\tconst groupElementParents = axisParentsIdxs[groupIdx];\n\t\t\t\t\tallIdxs.forEach((idx) => {\n\t\t\t\t\t\tif (idx === groupIdx || usedIdxs.has(idx)) return;\n\t\t\t\t\t\tif (axisParentsIdxs[idx].has(groupIdx) || groupElementParents.has(idx)) {\n\t\t\t\t\t\t\tcurrentGroup.push(idx);\n\t\t\t\t\t\t\tnext.add(idx);\n\t\t\t\t\t\t\tusedIdxs.add(idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tnextElsOfCurrentGroup = [...next];\n\t\t\t}\n\t\t\tgroups.push([...currentGroup]);\n\t\t\tnextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\t}\n\t\treturn groups.map((group) => group.map((idx) => axesSpec[idx]));\n\t}\n\t/** Get all axes that are not parents of any other axis */\n\tstatic getAxesRoots(axes) {\n\t\tconst parentsSet = new Set(axes.flatMap((axis) => axis.parentAxesSpec).map((spec) => canonicalizeJson(getAxisId(spec))));\n\t\treturn axes.filter((axis) => !parentsSet.has(canonicalizeJson(getAxisId(axis))));\n\t}\n};\n//#endregion\nexport { LinkerMap };\n\n//# sourceMappingURL=linker_columns.js.map","//#region src/flags/block_flags.ts\n/**\n* Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`\n* version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on\n* older desktop apps.\n*/\nconst REQUIRES_PFRAMES_VERSION = 1001031;\nconst AllSupportsFeatureFlags = [\"supportsLazyState\", \"supportsPframeQueryRanking\"];\nconst AllRequiresFeatureFlags = [\n\t\"requiresUIAPIVersion\",\n\t\"requiresCreatePTable\",\n\t\"requiresPFramesVersion\",\n\t\"requiresModelAPIVersion\"\n];\n//#endregion\nexport { AllRequiresFeatureFlags, AllSupportsFeatureFlags, REQUIRES_PFRAMES_VERSION };\n\n//# sourceMappingURL=block_flags.js.map","import { base32Encode } from \"./base32_encode.js\";\nimport { z } from \"zod\";\n//#region src/plid.ts\n/** Number of raw bytes in the PlId. */\nconst PlIdBytes = 15;\n/** Characters in string representation */\nconst PlIdLength = 24;\nconst PlId = z.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand(\"PlId\");\nfunction uniquePlId() {\n\tconst data = /* @__PURE__ */ new Uint8Array(15);\n\tcrypto.getRandomValues(data);\n\treturn PlId.parse(base32Encode(data, \"RFC4648\"));\n}\nfunction plId(bytes) {\n\tif (bytes.length !== 15) throw new Error(`Wrong number of bytes: ${bytes.length}`);\n\treturn PlId.parse(base32Encode(bytes, \"RFC4648\"));\n}\nasync function digestPlId(data) {\n\tconst encoder = new TextEncoder();\n\tconst bytes = await crypto.subtle.digest(\"SHA-256\", encoder.encode(data));\n\treturn plId(new Uint8Array(bytes.slice(0, 15)));\n}\n//#endregion\nexport { PlId, PlIdBytes, PlIdLength, digestPlId, plId, uniquePlId };\n\n//# sourceMappingURL=plid.js.map","import { z } from \"zod\";\n//#region src/ref.ts\nconst PlRef = z.object({\n\t__isRef: z.literal(true).describe(\"Crucial marker for the block dependency tree reconstruction\"),\n\tblockId: z.string().describe(\"Upstream block id\"),\n\tname: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n\trequireEnrichments: z.literal(true).optional().describe(\"True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block\")\n}).describe(\"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.\").readonly();\n/**\n* Type guard to check if a value is a PlRef.\n*\n* @param value - The value to check.\n* @returns True if the value is a PlRef, false otherwise.\n*/\nfunction isPlRef(value) {\n\treturn typeof value === \"object\" && value !== null && \"__isRef\" in value && value.__isRef === true && \"blockId\" in value && \"name\" in value;\n}\n/**\n* Creates a PlRef with the given blockId and name.\n*\n* @param blockId - The blockId of the reference.\n* @param name - The name of the reference.\n* @param requireEnrichments - Whether the reference requires enrichments.\n*/\nfunction createPlRef(blockId, name, requireEnrichments = false) {\n\tif (requireEnrichments) return {\n\t\t__isRef: true,\n\t\tblockId,\n\t\tname,\n\t\trequireEnrichments: true\n\t};\n\telse return {\n\t\t__isRef: true,\n\t\tblockId,\n\t\tname\n\t};\n}\n/**\n* Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n* requireEnrichments property.\n*\n* @param ref - The original PlRef object.\n* @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n* to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n* @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n*/\nfunction withEnrichments(ref, requireEnrichments = true) {\n\tif (requireEnrichments) return {\n\t\t...ref,\n\t\trequireEnrichments: true\n\t};\n\telse {\n\t\tconst { requireEnrichments: _, ...rest } = ref;\n\t\treturn rest;\n\t}\n}\nfunction isPrimaryRef(value) {\n\treturn typeof value === \"object\" && value !== null && value.__isPrimaryRef === \"v1\" && \"column\" in value;\n}\nfunction createPrimaryRef(column, filter) {\n\tif (filter !== void 0) return {\n\t\t__isPrimaryRef: \"v1\",\n\t\tcolumn,\n\t\tfilter\n\t};\n\telse return {\n\t\t__isPrimaryRef: \"v1\",\n\t\tcolumn\n\t};\n}\nfunction isEnrichmentRef(value) {\n\treturn typeof value === \"object\" && value !== null && value.__isEnrichment === \"v1\" && \"hit\" in value;\n}\nfunction createEnrichmentRef(hit, options = {}) {\n\tconst { path, qualifications } = options;\n\treturn {\n\t\t__isEnrichment: \"v1\",\n\t\thit,\n\t\t...path !== void 0 && path.length > 0 ? { path } : {},\n\t\t...qualifications !== void 0 && qualifications.length > 0 ? { qualifications } : {}\n\t};\n}\n/** Compare two PlRefs and returns true if they are qual */\nfunction plRefsEqual(ref1, ref2, ignoreEnrichments = false) {\n\treturn ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);\n}\n//#endregion\nexport { PlRef, createEnrichmentRef, createPlRef, createPrimaryRef, isEnrichmentRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments };\n\n//# sourceMappingURL=ref.js.map","//#region src/value_or_error.ts\nfunction mapValueInVOE(voe, cb) {\n\treturn voe.ok ? {\n\t\tok: true,\n\t\tvalue: cb(voe.value)\n\t} : voe;\n}\n//#endregion\nexport { mapValueInVOE };\n\n//# sourceMappingURL=value_or_error.js.map","//#region src/resource_types.ts\n/** Well-known resource type names used across the platform. */\nconst ResourceTypeName = {\n\tStreamManager: \"StreamManager\",\n\tStdMap: \"StdMap\",\n\tStdMapSlash: \"std/map\",\n\tEphStdMap: \"EphStdMap\",\n\tPFrame: \"PFrame\",\n\tParquetChunk: \"ParquetChunk\",\n\tBContext: \"BContext\",\n\tBlockPackCustom: \"BlockPackCustom\",\n\tBinaryMap: \"BinaryMap\",\n\tBinaryValue: \"BinaryValue\",\n\tBlobMap: \"BlobMap\",\n\tBResolveSingle: \"BResolveSingle\",\n\tBResolveSingleNoResult: \"BResolveSingleNoResult\",\n\tBQueryResult: \"BQueryResult\",\n\tTengoTemplate: \"TengoTemplate\",\n\tTengoLib: \"TengoLib\",\n\tSoftwareInfo: \"SoftwareInfo\",\n\tDummy: \"Dummy\",\n\tJsonResourceError: \"json/resourceError\",\n\tJsonObject: \"json/object\",\n\tJsonGzObject: \"json-gz/object\",\n\tJsonString: \"json/string\",\n\tJsonArray: \"json/array\",\n\tJsonNumber: \"json/number\",\n\tBContextEnd: \"BContextEnd\",\n\tFrontendFromUrl: \"Frontend/FromUrl\",\n\tFrontendFromFolder: \"Frontend/FromFolder\",\n\tBObjectSpec: \"BObjectSpec\",\n\tBlob: \"Blob\",\n\tNull: \"Null\",\n\tBinary: \"binary\",\n\tLSProvider: \"LSProvider\",\n\tWorkingDirectory: \"WorkingDirectory\",\n\tUserProject: \"UserProject\",\n\tProjects: \"Projects\",\n\tClientRoot: \"ClientRoot\",\n\tSharingOutbox: \"SharingOutbox\",\n\tSharingState: \"SharingState\",\n\tSharedEnvelope: \"SharedEnvelope\"\n};\n/** Resource type name prefix constants. */\nconst ResourceTypePrefix = {\n\tBlob: \"Blob/\",\n\tLS: \"LS/\",\n\tWorkingDirectory: \"WorkingDirectory/\",\n\tStorageSpaceAllocation: \"StorageSpaceAllocation/\",\n\tBlobUpload: \"BlobUpload/\",\n\tBlobIndex: \"BlobIndex/\",\n\tPColumnData: \"PColumnData/\",\n\tStreamWorkdir: \"StreamWorkdir/\"\n};\n//#endregion\nexport { ResourceTypeName, ResourceTypePrefix };\n\n//# sourceMappingURL=resource_types.js.map","import { ServiceAlreadyRegisteredError, ServiceInvalidIdError } from \"../errors.js\";\n//#region src/services/service_types.ts\nconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\nconst { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {\n\tconst typeMap = /* @__PURE__ */ new Map();\n\tconst modelMethodsMap = /* @__PURE__ */ new Map();\n\tconst uiMethodsMap = /* @__PURE__ */ new Map();\n\treturn {\n\t\tservice() {\n\t\t\treturn (options) => {\n\t\t\t\tconst { name, type, modelMethods, uiMethods } = options;\n\t\t\t\tif (!SERVICE_ID_PATTERN.test(name)) throw new ServiceInvalidIdError(`Invalid service ID \"${name}\": must match ${SERVICE_ID_PATTERN}`);\n\t\t\t\tif (typeMap.has(name)) throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n\t\t\t\ttypeMap.set(name, type);\n\t\t\t\tmodelMethodsMap.set(name, modelMethods);\n\t\t\t\tuiMethodsMap.set(name, uiMethods);\n\t\t\t\treturn name;\n\t\t\t};\n\t\t},\n\t\tisNodeService(id) {\n\t\t\treturn typeMap.get(id) === \"node\";\n\t\t},\n\t\tisWasmService(id) {\n\t\t\treturn typeMap.get(id) === \"wasm\";\n\t\t},\n\t\tisMainService(id) {\n\t\t\treturn typeMap.get(id) === \"main\";\n\t\t},\n\t\tgetServiceKind(id) {\n\t\t\treturn typeMap.get(id);\n\t\t},\n\t\tgetServiceModelMethods(id) {\n\t\t\treturn modelMethodsMap.get(id) ?? [];\n\t\t},\n\t\tgetServiceUiMethods(id) {\n\t\t\treturn uiMethodsMap.get(id) ?? [];\n\t\t}\n\t};\n})();\nfunction serviceFnKey(serviceId, method = \"\") {\n\treturn `service:${serviceId}:${method}`;\n}\n//#endregion\nexport { getServiceKind, getServiceModelMethods, getServiceUiMethods, isMainService, isNodeService, isWasmService, service, serviceFnKey };\n\n//# sourceMappingURL=service_types.js.map","import { service } from \"./service_types.js\";\n//#region src/services/service_declarations.ts\nconst Services = {\n\tPFrameSpec: service()({\n\t\ttype: \"wasm\",\n\t\tname: \"pframeSpec\",\n\t\tmodelMethods: [\n\t\t\t\"createSpecFrame\",\n\t\t\t\"listColumns\",\n\t\t\t\"discoverColumns\",\n\t\t\t\"deleteColumn\",\n\t\t\t\"evaluateQuery\",\n\t\t\t\"buildQuery\",\n\t\t\t\"expandAxes\",\n\t\t\t\"collapseAxes\",\n\t\t\t\"findAxis\",\n\t\t\t\"findTableColumn\",\n\t\t\t\"rewriteLegacyFilters\"\n\t\t],\n\t\tuiMethods: [\n\t\t\t\"createSpecFrame\",\n\t\t\t\"listColumns\",\n\t\t\t\"discoverColumns\",\n\t\t\t\"deleteColumn\",\n\t\t\t\"evaluateQuery\",\n\t\t\t\"buildQuery\",\n\t\t\t\"expandAxes\",\n\t\t\t\"collapseAxes\",\n\t\t\t\"findAxis\",\n\t\t\t\"findTableColumn\",\n\t\t\t\"rewriteLegacyFilters\"\n\t\t]\n\t}),\n\tPFrame: service()({\n\t\ttype: \"node\",\n\t\tname: \"pframe\",\n\t\tmodelMethods: [\n\t\t\t\"createPFrame\",\n\t\t\t\"createPTable\",\n\t\t\t\"createPTableV2\"\n\t\t],\n\t\tuiMethods: [\n\t\t\t\"findColumns\",\n\t\t\t\"getColumnSpec\",\n\t\t\t\"listColumns\",\n\t\t\t\"calculateTableData\",\n\t\t\t\"getUniqueValues\",\n\t\t\t\"getShape\",\n\t\t\t\"getSpec\",\n\t\t\t\"getData\",\n\t\t\t\"writePTableToFs\",\n\t\t\t\"exportPTable\"\n\t\t]\n\t}),\n\tDialog: service()({\n\t\ttype: \"main\",\n\t\tname: \"dialog\",\n\t\tmodelMethods: [],\n\t\tuiMethods: [\"showSaveDialog\"]\n\t}),\n\tColumnsCollection: service()({\n\t\ttype: \"wasm\",\n\t\tname: \"columnsCollection\",\n\t\tmodelMethods: [\n\t\t\t\"create\",\n\t\t\t\"isEmpty\",\n\t\t\t\"isFinal\",\n\t\t\t\"getColumns\",\n\t\t\t\"addSource\",\n\t\t\t\"discover\",\n\t\t\t\"filter\"\n\t\t],\n\t\tuiMethods: [\n\t\t\t\"create\",\n\t\t\t\"isEmpty\",\n\t\t\t\"isFinal\",\n\t\t\t\"getColumns\",\n\t\t\t\"addSource\",\n\t\t\t\"discover\",\n\t\t\t\"filter\"\n\t\t]\n\t})\n};\n//#endregion\nexport { Services };\n\n//# sourceMappingURL=service_declarations.js.map","import { Services } from \"./service_declarations.js\";\n//#region src/services/service_capabilities.ts\n/**\n* All service-related `requires*` capability flag names, auto-derived from Services.\n* Single source of truth — use this everywhere runtime capabilities are registered.\n*/\nconst SERVICE_CAPABILITY_FLAGS = Object.keys(Services).map((key) => `requires${key}`);\n/**\n* Register all service capability flags with the given callback.\n* Works with both `RuntimeCapabilities.addSupportedRequirement`\n* and `MiddleLayer.addRuntimeCapability`.\n*/\nfunction registerServiceCapabilities(register) {\n\tfor (const flag of SERVICE_CAPABILITY_FLAGS) register(flag, true);\n}\n/**\n* Resolve which services are required by the given feature flags.\n* Accepts Record<string, unknown> so it works with both BlockCodeKnownFeatureFlags\n* (from middle layer) and Zod-parsed records (from preload).\n*/\nfunction resolveRequiredServices(flags) {\n\tif (!flags) return [];\n\treturn Object.keys(Services).filter((key) => flags[`requires${key}`] === true).map((key) => Services[key]);\n}\nfunction isKnownServiceName(name) {\n\treturn Object.values(Services).some((v) => v === name);\n}\n/** All service require flags set to true, auto-generated from Services.\n* Used to distinguish service-related feature flags from non-service flags. */\nconst SERVICE_FEATURE_FLAGS = Object.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));\n/** Introspect method names on an instance (including prototype chain).\n* Uses Object.getOwnPropertyDescriptor to avoid triggering getters. */\nfunction getMethodNames(instance) {\n\tconst methods = /* @__PURE__ */ new Set();\n\tlet proto = instance;\n\twhile (proto && proto !== Object.prototype) {\n\t\tfor (const key of Object.getOwnPropertyNames(proto)) {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, key);\n\t\t\tif (key !== \"constructor\" && typeof descriptor?.value === \"function\") methods.add(key);\n\t\t}\n\t\tproto = Object.getPrototypeOf(proto);\n\t}\n\treturn [...methods];\n}\n//#endregion\nexport { SERVICE_CAPABILITY_FLAGS, SERVICE_FEATURE_FLAGS, getMethodNames, isKnownServiceName, registerServiceCapabilities, resolveRequiredServices };\n\n//# sourceMappingURL=service_capabilities.js.map","import { getServiceModelMethods, getServiceUiMethods } from \"./service_types.js\";\nimport { Services } from \"./service_declarations.js\";\nimport { resolveRequiredServices } from \"./service_capabilities.js\";\nimport { createNodeServiceHandlers } from \"./node_service_handlers.js\";\n//#region src/services/service_injectors.ts\nlet cachedKit;\nlet cachedHandlers;\nfunction getOrCreateHandlers(driverKit) {\n\tif (!cachedHandlers || cachedKit !== driverKit) {\n\t\tcachedKit = driverKit;\n\t\tcachedHandlers = createNodeServiceHandlers(driverKit);\n\t}\n\treturn cachedHandlers;\n}\n/**\n* Resolve the worker-side handler object for a given service ID. Caches\n* per DriverKit reference. Called from the worker's IPC dispatch path.\n*/\nfunction resolveNodeServiceHandler(driverKit, serviceId) {\n\tconst handlers = getOrCreateHandlers(driverKit);\n\tconst key = Object.keys(Services).find((k) => Services[k] === serviceId);\n\tif (!key) return null;\n\treturn handlers[key];\n}\nfunction buildMethodMap(pick) {\n\tconst result = {};\n\tfor (const id of Object.values(Services)) result[id] = [...pick(id)];\n\treturn result;\n}\n/**\n* UI-side method names per service. Drives ServiceProxy forwarder\n* construction in the renderer.\n*/\nconst SERVICE_METHOD_MAP = buildMethodMap(getServiceUiMethods);\n/**\n* Model-side method names per service. Drives the workflow VM bridge\n* (see pl-middle-layer js_render).\n*/\nconst MODEL_SERVICE_METHOD_MAP = buildMethodMap(getServiceModelMethods);\n/** Build service info for a block from its feature flags. */\nfunction buildServiceInfo(featureFlags) {\n\tconst serviceIds = resolveRequiredServices(featureFlags);\n\treturn Object.fromEntries(serviceIds.map((id) => [id, SERVICE_METHOD_MAP[id] ?? []]));\n}\n//#endregion\nexport { MODEL_SERVICE_METHOD_MAP, SERVICE_METHOD_MAP, buildServiceInfo, createNodeServiceHandlers, resolveNodeServiceHandler };\n\n//# sourceMappingURL=service_injectors.js.map","import { createGlobalPObjectId, createLocalPObjectId } from \"../pool/spec.js\";\nimport \"../pool/index.js\";\nimport { ResourceTypeName } from \"../resource_types.js\";\n//#region src/columns/accessor_traversal.ts\n/** Resource types that hold column collections — DFS stops here and collects. */\nconst COLLECT_TYPES = [ResourceTypeName.PFrame];\n/** Resource types DFS descends through when looking for PFrames. */\nconst DESCEND_TYPES = [ResourceTypeName.StdMap, ResourceTypeName.StdMapSlash];\n/**\n* Enumerate column names backing a PFrame accessor — derived from\n* `<name>.spec` field names, without resolving the spec resources.\n*/\nfunction listColumnNames(accessor, prefix = \"\") {\n\tif (accessor.resourceType.name !== ResourceTypeName.PFrame) return [];\n\tconst out = [];\n\tfor (const field of accessor.listInputFields()) {\n\t\tif (!field.endsWith(\".spec\")) continue;\n\t\tconst raw = field.slice(0, -5);\n\t\tif (!raw.startsWith(prefix)) continue;\n\t\tout.push(raw.slice(prefix.length));\n\t}\n\treturn out;\n}\n/**\n* DFS over the input-field subtree of `root`. Collects nodes whose resource\n* type ∈ `collectTypes`. Descends only through `descendTypes`\n* (default: StdMap / StdMapSlash). Collected nodes are not descended into.\n*\n* Threads the field-name path from `rootPath` to each hit, so callers can\n* build canonical {@link createLocalPObjectId}s without relying on the\n* accessor itself to remember its path.\n*\n* Includes `root` itself in the walk.\n*/\nfunction findDescendantsByType(opts) {\n\tconst { root, rootPath, collectTypes, descendTypes = DESCEND_TYPES } = opts;\n\tconst collectSet = new Set(collectTypes);\n\tconst descendSet = new Set(descendTypes);\n\tconst result = [];\n\tconst stack = [{\n\t\tnode: root,\n\t\tpath: rootPath\n\t}];\n\twhile (stack.length > 0) {\n\t\tconst { node, path } = stack.pop();\n\t\tconst typeName = node.resourceType.name;\n\t\tif (collectSet.has(typeName)) {\n\t\t\tresult.push({\n\t\t\t\tnode,\n\t\t\t\tpath\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!descendSet.has(typeName)) continue;\n\t\tconst fields = node.listInputFields();\n\t\tfor (let i = fields.length - 1; i >= 0; i--) {\n\t\t\tconst child = node.traverse({\n\t\t\t\tfield: fields[i],\n\t\t\t\tassertFieldType: \"Input\",\n\t\t\t\tignoreError: true\n\t\t\t});\n\t\t\tif (child !== void 0) stack.push({\n\t\t\t\tnode: child,\n\t\t\t\tpath: [...path, fields[i]]\n\t\t\t});\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Walk an accessor root and return one {@link LeafEntry} per discovered column.\n* Ids are {@link createLocalPObjectId}-shaped: `{resolvePath, name}`. The\n* `resolvePath` is derived from `rootPath` extended by the DFS traversal.\n*/\nfunction indexAccessorRoot(root, rootPath) {\n\tconst result = [];\n\tfor (const { node, path } of findDescendantsByType({\n\t\troot,\n\t\trootPath,\n\t\tcollectTypes: COLLECT_TYPES,\n\t\tdescendTypes: DESCEND_TYPES\n\t})) for (const name of listColumnNames(node)) result.push({\n\t\taccessor: node,\n\t\tname,\n\t\tid: createLocalPObjectId([...path], name)\n\t});\n\treturn result;\n}\n/**\n* Walk one upstream-block ctx pair (`prodCtx` then `stagingCtx`) and return one\n* {@link LeafEntry} per column. First-wins dedup by name (prod precedes staging).\n* Ids are {@link createGlobalPObjectId}-shaped — `resolvePath` is not involved.\n*/\nfunction indexPoolBlock(block) {\n\tconst accessors = [];\n\tif (block.prodCtx) accessors.push(block.prodCtx);\n\tif (block.stagingCtx) accessors.push(block.stagingCtx);\n\tconst result = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const accessor of accessors) for (const name of listColumnNames(accessor)) {\n\t\tif (seen.has(name)) continue;\n\t\tseen.add(name);\n\t\tresult.push({\n\t\t\taccessor,\n\t\t\tname,\n\t\t\tid: createGlobalPObjectId(block.blockId, name)\n\t\t});\n\t}\n\treturn result;\n}\n//#endregion\nexport { COLLECT_TYPES, DESCEND_TYPES, findDescendantsByType, indexAccessorRoot, indexPoolBlock, listColumnNames };\n\n//# sourceMappingURL=accessor_traversal.js.map","//#region src/columns/column_registry.ts\n/**\n* Id-index over a set of {@link ColumnEntriesProvider}s. Sole job:\n* {@link PObjectId} → {@link LeafEntry}. Generic over the accessor flavour, so\n* the same class backs both sandbox (`TreeNodeAccessor`) and host\n* (`PlTreeNodeAccessor`) usage.\n*\n* Stateless beyond the provider list — every lookup goes through each\n* provider's `getPObjectEntries()` (cached inside the provider). Instantiate\n* directly at the call site that has the providers; there is no ambient\n* singleton.\n*/\nvar ColumnRegistry = class {\n\tproviders;\n\tconstructor(providers) {\n\t\tthis.providers = providers;\n\t}\n\t/**\n\t* Resolve a {@link PObjectId} to its backing {@link LeafEntry}. Returns\n\t* `undefined` if the column is not reachable from any provider — caller\n\t* decides whether that's `absent` or `resolving` via {@link isFinal}.\n\t*/\n\tresolve(id) {\n\t\treturn this.lookupById(id);\n\t}\n\t/** Whether every indexed source has finished enumerating its columns. */\n\tisFinal() {\n\t\treturn this.providers.every((p) => p.isFinal());\n\t}\n\tlookupById(id) {\n\t\tfor (const p of this.providers) {\n\t\t\tconst hit = p.getPObjectEntries().get(id);\n\t\t\tif (hit !== void 0) return hit;\n\t\t}\n\t}\n};\n//#endregion\nexport { ColumnRegistry };\n\n//# sourceMappingURL=column_registry.js.map","import { indexAccessorRoot, indexPoolBlock } from \"./accessor_traversal.js\";\n//#region src/columns/providers.ts\n/**\n* Generic entries provider over a single accessor root. Walks `<root>` once\n* from the supplied `rootPath`, builds an id → {@link LeafEntry} map and\n* exposes `isFinal()` via the root's `getInputsLocked()`.\n*\n* Used directly on the host side; sandbox extends it with `getColumns()`\n* returning {@link ColumnLazy}s — see `AccessorColumnsProvider` in\n* `@platforma-sdk/model`.\n*/\nvar AccessorEntriesProvider = class {\n\troot;\n\tentries;\n\tconstructor(root, rootPath) {\n\t\tthis.root = root;\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tfor (const entry of indexAccessorRoot(root, rootPath)) if (!map.has(entry.id)) map.set(entry.id, entry);\n\t\tthis.entries = map;\n\t}\n\tgetPObjectEntries() {\n\t\treturn this.entries;\n\t}\n\tisFinal() {\n\t\treturn this.root.getInputsLocked();\n\t}\n};\n/**\n* Generic entries provider over a list of upstream-block ctx pairs.\n*\n* Per-block merge: iterate `prod` then `staging`, dedupe by name with\n* first-wins semantics (prod takes precedence).\n*\n* `isFinal()` is the AND of `getInputsLocked()` over every present ctx\n* accessor and `!prodIncomplete && !stagingIncomplete` over every block.\n*/\nvar ResultPoolEntriesProvider = class {\n\tblocks;\n\tcachedEntries;\n\tconstructor(blocks) {\n\t\tthis.blocks = blocks;\n\t}\n\tgetPObjectEntries() {\n\t\tif (this.cachedEntries !== void 0) return this.cachedEntries;\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tfor (const block of this.blocks) for (const entry of indexPoolBlock(block)) if (!map.has(entry.id)) map.set(entry.id, entry);\n\t\treturn this.cachedEntries = map;\n\t}\n\tisFinal() {\n\t\tfor (const block of this.blocks) {\n\t\t\tif (block.prodIncomplete || block.stagingIncomplete) return false;\n\t\t\tif (block.prodCtx && !block.prodCtx.getInputsLocked()) return false;\n\t\t\tif (block.stagingCtx && !block.stagingCtx.getInputsLocked()) return false;\n\t\t}\n\t\treturn true;\n\t}\n};\n//#endregion\nexport { AccessorEntriesProvider, ResultPoolEntriesProvider };\n\n//# sourceMappingURL=providers.js.map","import { getCfgRenderCtx } from \"../internal.js\";\nimport { FutureRef } from \"./future.js\";\nimport { isPColumn, mapPObjectData } from \"@milaboratories/pl-model-common\";\n//#region src/render/accessor.ts\nfunction ifDef(value, cb) {\n\treturn value === void 0 ? void 0 : cb(value);\n}\n/**\n* Decode an error node's content into a display message. The backend serializes\n* a resource error as `{\"message\": \"...\"}` (`ResourceError`); unwrap that to the\n* human-readable message. Falls back to the raw string when the content is not\n* that envelope (e.g. plain text, or an unexpected shape).\n*/\nfunction decodeErrorMessage(raw) {\n\ttry {\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (typeof parsed?.message === \"string\") return parsed.message;\n\t} catch {}\n\treturn raw;\n}\n/** Represent resource tree node accessor */\nvar TreeNodeAccessor = class TreeNodeAccessor {\n\thandle;\n\tresolvePath;\n\tconstructor(handle, resolvePath) {\n\t\tthis.handle = handle;\n\t\tthis.resolvePath = resolvePath;\n\t}\n\tresolve(...steps) {\n\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\tassertFieldType: \"Input\",\n\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t}));\n\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t}\n\tresolveOutput(...steps) {\n\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\tassertFieldType: \"Output\",\n\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t}));\n\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t}\n\tresolveInput(...steps) {\n\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\tassertFieldType: \"Input\",\n\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t}));\n\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t}\n\ttraverse(...steps) {\n\t\treturn this.resolveWithCommon({}, ...steps);\n\t}\n\tresolveWithCommon(commonOptions, ...steps) {\n\t\tconst resolvePath = [...this.resolvePath, ...steps.map((step) => typeof step === \"string\" ? step : step.field)];\n\t\treturn ifDef(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps), (accessor) => new TreeNodeAccessor(accessor, resolvePath));\n\t}\n\tget resourceType() {\n\t\treturn getCfgRenderCtx().getResourceType(this.handle);\n\t}\n\tgetInputsLocked() {\n\t\treturn getCfgRenderCtx().getInputsLocked(this.handle);\n\t}\n\tgetOutputsLocked() {\n\t\treturn getCfgRenderCtx().getOutputsLocked(this.handle);\n\t}\n\tgetIsReadyOrError() {\n\t\treturn getCfgRenderCtx().getIsReadyOrError(this.handle);\n\t}\n\tgetIsFinal() {\n\t\treturn getCfgRenderCtx().getIsFinal(this.handle);\n\t}\n\tgetError() {\n\t\tconst resolvePath = [...this.resolvePath, \"error\"];\n\t\treturn ifDef(getCfgRenderCtx().getError(this.handle), (accsessor) => new TreeNodeAccessor(accsessor, resolvePath));\n\t}\n\tlistInputFields() {\n\t\treturn getCfgRenderCtx().listInputFields(this.handle);\n\t}\n\tlistOutputFields() {\n\t\treturn getCfgRenderCtx().listOutputFields(this.handle);\n\t}\n\tlistDynamicFields() {\n\t\treturn getCfgRenderCtx().listDynamicFields(this.handle);\n\t}\n\tgetKeyValueBase64(key) {\n\t\treturn getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n\t}\n\tgetKeyValueAsString(key) {\n\t\treturn getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n\t}\n\tgetKeyValueAsJson(key) {\n\t\tconst content = this.getKeyValueAsString(key);\n\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\treturn JSON.parse(content);\n\t}\n\thasData() {\n\t\treturn getCfgRenderCtx().hasData(this.handle);\n\t}\n\tgetDataBase64() {\n\t\treturn getCfgRenderCtx().getDataBase64(this.handle);\n\t}\n\tgetDataAsString() {\n\t\treturn getCfgRenderCtx().getDataAsString(this.handle);\n\t}\n\tgetDataAsJson() {\n\t\tconst content = this.getDataAsString();\n\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\treturn JSON.parse(content);\n\t}\n\t/**\n\t* Like {@link getDataAsJson}, but does not throw while the resource is still\n\t* computing. Three states:\n\t*\n\t* - **Not ready** → returns `undefined` (loading).\n\t* - **Errored** → throws the resource's error.\n\t* - **Ready** → returns the parsed content.\n\t*\n\t* Prefer this over {@link getDataAsJson} in reactive output lambdas: a field\n\t* that resolves before its resource is ready (routine on remote backends)\n\t* makes {@link getDataAsJson} throw \"Resource has no content.\" mid-calculation,\n\t* flashing a transient \"Some outputs have errors\" banner that clears when the\n\t* resource finishes (MILAB-6318).\n\t*/\n\tgetDataAsJsonOrUndefined() {\n\t\tif (!this.getIsReadyOrError()) return void 0;\n\t\tconst error = this.getError();\n\t\tif (error !== void 0) {\n\t\t\tconst raw = error.getDataAsString();\n\t\t\tconst message = raw === void 0 ? \"Resource computation failed.\" : decodeErrorMessage(raw);\n\t\t\tconst path = this.resolvePath.join(\".\");\n\t\t\tthrow new Error(path ? `${message} (at ${path})` : message);\n\t\t}\n\t\treturn this.getDataAsJson();\n\t}\n\tgetFileContentAsBase64(range) {\n\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));\n\t}\n\tgetFileContentAsString(range) {\n\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));\n\t}\n\tgetFileContentAsJson(range) {\n\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range)).mapDefined((v) => JSON.parse(v));\n\t}\n\t/** @deprecated */\n\tgetPColumns(errorOnUnknownField = false, prefix = \"\") {\n\t\tconst result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n\t\tif (result === void 0) return void 0;\n\t\treturn Object.entries(result).map(([, obj]) => {\n\t\t\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\t\t\treturn obj;\n\t\t});\n\t}\n\t/** @deprecated */\n\tparsePObjectCollection(errorOnUnknownField = false, prefix = \"\") {\n\t\tconst pObjects = getCfgRenderCtx().parsePObjectCollection(this.handle, errorOnUnknownField, prefix, ...this.resolvePath);\n\t\tif (pObjects === void 0) return void 0;\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(pObjects)) {\n\t\t\tconst resolvePath = [...this.resolvePath, key];\n\t\t\tresult[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* @deprecated use getFileContentAsBase64\n\t*/\n\tgetBlobContentAsBase64() {\n\t\treturn this.getFileContentAsBase64();\n\t}\n\t/**\n\t* @deprecated use getFileContentAsString\n\t*/\n\tgetBlobContentAsString() {\n\t\treturn this.getFileContentAsString();\n\t}\n\t/**\n\t* @returns downloaded file handle\n\t*/\n\tgetFileHandle() {\n\t\treturn new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n\t}\n\t/**\n\t* @deprecated use getFileHandle\n\t*/\n\tgetDownloadedBlobHandle() {\n\t\treturn this.getFileHandle();\n\t}\n\t/**\n\t* @returns downloaded file handle\n\t*/\n\tgetRemoteFileHandle() {\n\t\treturn new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n\t}\n\t/**\n\t* @deprecated use getRemoteFileHandle\n\t*/\n\tgetOnDemandBlobHandle() {\n\t\treturn this.getRemoteFileHandle();\n\t}\n\t/**\n\t* @returns the url to the extracted folder\n\t*/\n\textractArchiveAndGetURL(format) {\n\t\treturn new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));\n\t}\n\tgetImportProgress() {\n\t\treturn new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n\t}\n\tgetLastLogs(nLines) {\n\t\treturn new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n\t}\n\tgetProgressLog(patternToSearch) {\n\t\treturn new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n\t}\n\tgetProgressLogWithInfo(patternToSearch) {\n\t\treturn new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));\n\t}\n\tgetLogHandle() {\n\t\treturn new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n\t}\n\tallFieldsResolved(fieldType = \"Input\") {\n\t\tswitch (fieldType) {\n\t\t\tcase \"Input\": return this.getInputsLocked() && this.listInputFields().every((field) => this.resolve({\n\t\t\t\tfield,\n\t\t\t\tassertFieldType: \"Input\"\n\t\t\t}) !== void 0);\n\t\t\tcase \"Output\": return this.getOutputsLocked() && this.listOutputFields().every((field) => this.resolve({\n\t\t\t\tfield,\n\t\t\t\tassertFieldType: \"Output\"\n\t\t\t}) !== void 0);\n\t\t}\n\t}\n\tmapFields(_mapping, _ops) {\n\t\tconst { fieldType, requireLocked, skipUnresolved } = {\n\t\t\tfieldType: \"Input\",\n\t\t\trequireLocked: true,\n\t\t\tskipUnresolved: false,\n\t\t\t..._ops\n\t\t};\n\t\tconst mapping = _mapping;\n\t\tif (requireLocked) {\n\t\t\tif (fieldType === \"Input\" && !this.getInputsLocked()) return void 0;\n\t\t\tif (fieldType === \"Output\" && !this.getOutputsLocked()) return void 0;\n\t\t}\n\t\tlet fieldEntries = (fieldType === \"Input\" ? this.listInputFields() : fieldType === \"Output\" ? this.listOutputFields() : this.listDynamicFields()).map((field) => [field, this.resolve({\n\t\t\tfield,\n\t\t\tassertFieldType: fieldType\n\t\t})]);\n\t\tif (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== void 0);\n\t\treturn fieldEntries.map(([name, value]) => mapping(name, value));\n\t}\n};\n//#endregion\nexport { TreeNodeAccessor, ifDef };\n\n//# sourceMappingURL=accessor.js.map","import { __exportAll } from \"../_virtual/_rolldown/runtime.js\";\n//#region src/render/internal.ts\nvar internal_exports = /* @__PURE__ */ __exportAll({\n\tGlobalCfgRenderCtxFeatureFlags: () => GlobalCfgRenderCtxFeatureFlags,\n\tMainAccessorName: () => MainAccessorName,\n\tStagingAccessorName: () => StagingAccessorName,\n\tgetAllFutureAwaits: () => getAllFutureAwaits,\n\tisFutureAwait: () => isFutureAwait\n});\nconst MainAccessorName = \"main\";\nconst StagingAccessorName = \"staging\";\nconst GlobalCfgRenderCtxFeatureFlags = {\n\texplicitColumnsSupport: true,\n\tinlineColumnsSupport: true,\n\tactiveArgs: true,\n\tpTablePartitionFiltersSupport: true,\n\tpFrameInSetFilterSupport: true,\n\tlazyColumnStatusSupport: true\n};\nfunction isFutureAwait(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"__awaited_futures__\" in obj;\n}\nfunction addAllFutureAwaits(set, visited, node) {\n\tif (visited.has(node)) return;\n\tvisited.add(node);\n\tif (typeof node === \"object\") {\n\t\tif (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n\t\telse if (Array.isArray(node)) for (const nested of node) addAllFutureAwaits(set, visited, nested);\n\t\telse for (const [, nested] of Object.entries(node)) if (nested !== node) addAllFutureAwaits(set, visited, nested);\n\t}\n}\nfunction getAllFutureAwaits(obj) {\n\tconst set = /* @__PURE__ */ new Set();\n\taddAllFutureAwaits(set, /* @__PURE__ */ new Set(), obj);\n\treturn set;\n}\n//#endregion\nexport { GlobalCfgRenderCtxFeatureFlags, MainAccessorName, StagingAccessorName, getAllFutureAwaits, internal_exports, isFutureAwait };\n\n//# sourceMappingURL=internal.js.map","//#region src/render/util/axis_filtering.ts\nfunction filterDataInfoEntries(dataInfoEntries, axisFilters) {\n\tconst sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\tconst { type } = dataInfoEntries;\n\tswitch (type) {\n\t\tcase \"Json\": {\n\t\t\tconst { keyLength } = dataInfoEntries;\n\t\t\tfor (const [axisIdx] of axisFilters) if (axisIdx >= keyLength) throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"JsonPartitioned\":\n\t\tcase \"BinaryPartitioned\":\n\t\tcase \"ParquetPartitioned\": {\n\t\t\tconst { partitionKeyLength } = dataInfoEntries;\n\t\t\tfor (const [axisIdx] of axisFilters) if (axisIdx >= partitionKeyLength) throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw new Error(`Unsupported data info type: ${type}`);\n\t}\n\tconst keyMatchesFilters = (key) => {\n\t\tfor (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n\t\treturn true;\n\t};\n\tconst removeFilteredAxes = (key) => {\n\t\tconst newKey = [...key];\n\t\tfor (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\t\treturn newKey;\n\t};\n\tswitch (dataInfoEntries.type) {\n\t\tcase \"Json\": return {\n\t\t\ttype: \"Json\",\n\t\t\tkeyLength: dataInfoEntries.keyLength - axisFilters.length,\n\t\t\tdata: dataInfoEntries.data.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\tvalue: entry.value\n\t\t\t}))\n\t\t};\n\t\tcase \"JsonPartitioned\": return {\n\t\t\ttype: \"JsonPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\tvalue: entry.value\n\t\t\t}))\n\t\t};\n\t\tcase \"BinaryPartitioned\": return {\n\t\t\ttype: \"BinaryPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\tvalue: entry.value\n\t\t\t}))\n\t\t};\n\t\tcase \"ParquetPartitioned\": return {\n\t\t\ttype: \"ParquetPartitioned\",\n\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\tvalue: entry.value\n\t\t\t}))\n\t\t};\n\t}\n}\n//#endregion\nexport { filterDataInfoEntries };\n\n//# sourceMappingURL=axis_filtering.js.map","import { Annotation, canonicalizeJson, getAxisId, readAnnotation } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"es-toolkit\";\n//#region src/labels/linked_column_postfix.ts\n/**\n* Structural postfix derivation for linked columns (phase 2 of `deriveDistinctLabels`).\n*\n* A linked column is\n* reached by a CHAIN of linkers, and we distinguish two such columns by the same ideology the main\n* algorithm uses — \"find the minimal difference, escalate until unique\" — over two dimensions:\n*\n* - root: the single source axis of the chain, derived from `linkers[0]` (one of its axesSpec).\n* This is \"the source\" — it's what we prefer to show (\"difference of sources\").\n* - linkers: the linker chain itself (by `LinkLabel`), a per-step fallback used only where roots\n* coincide.\n*\n* Nothing is stored redundantly: the caller passes the linker path (`linkers`) and the hit spec;\n* root and every token are computed on the fly. The caller also supplies the `stem` (label+trace+\n* quals from the existing single-entity machinery); this module only adds the path postfix, and\n* only where stems collide.\n*/\nfunction defaultLinkerFormatter(parts) {\n\tconst chain = parts.linkers.map((l) => l.text).join(\" > \");\n\tconst pieces = [parts.root?.text, chain || void 0].filter((p) => !isNil(p));\n\treturn pieces.length === 0 ? \"\" : `via ${pieces.join(\" \")}`;\n}\nfunction extractAxisIdentity(axis) {\n\tconst id = getAxisId(axis);\n\treturn {\n\t\tlabel: readAnnotation(axis, Annotation.Label)?.trim() || void 0,\n\t\tname: id.name,\n\t\tdomain: id.domain,\n\t\tcontextDomain: id.contextDomain\n\t};\n}\n/**\n* A linker is named ONLY by its human label (`LinkLabel`/`Label`) — never by its technical column\n* name. Returns `undefined` for an unlabeled linker, which callers treat as \"not renderable\": such a\n* step is skipped, and disambiguation falls to another step or the root.\n*/\nfunction extractLinkerIdentity(linker) {\n\tconst label = (readAnnotation(linker, Annotation.LinkLabel) ?? readAnnotation(linker, Annotation.Label))?.trim();\n\treturn label ? {\n\t\tlabel,\n\t\tname: label\n\t} : void 0;\n}\n/** Domain keys where `mine` differs from at least one competitor. */\nfunction differingKeys(mine, others) {\n\tconst my = mine ?? {};\n\tconst diffKeys = /* @__PURE__ */ new Set();\n\tfor (const o of others) {\n\t\tconst od = o ?? {};\n\t\tfor (const k of Object.keys(my)) if (my[k] !== od[k]) diffKeys.add(k);\n\t\tfor (const k of Object.keys(od)) if (my[k] !== od[k]) diffKeys.add(k);\n\t}\n\treturn [...diffKeys];\n}\nfunction renderWithDomain(base, keys, domain) {\n\tif (keys.length === 0) return base;\n\tconst d = domain ?? {};\n\treturn `${base}[${keys.map((k) => `${k}=${d[k] ?? \"∅\"}`).join(\", \")}]`;\n}\n/**\n* Minimal token distinguishing `mine` from `others`: label → name → only the differing domain keys.\n* Falls back to the bare label/name when indistinguishable at this dimension (another one covers it).\n*/\nfunction deriveToken(mine, others) {\n\tconst base = mine.label ?? mine.name;\n\tif (mine.label !== void 0 && others.every((o) => o.label !== mine.label)) return mine.label;\n\tif (others.every((o) => o.name !== mine.name)) return base;\n\tconst dk = differingKeys(mine.domain, others.map((o) => o.domain));\n\tif (dk.length > 0) return renderWithDomain(base, dk, mine.domain);\n\tconst ck = differingKeys(mine.contextDomain, others.map((o) => o.contextDomain));\n\tif (ck.length > 0) return renderWithDomain(base, ck, mine.contextDomain);\n\treturn base;\n}\n/**\n* The chain's single root: the source-side axis of `linkers[0]`. A linker bridges two axis groups;\n* the side facing the next hop (`linkers[1]`, or the hit for a single-linker chain) is the target,\n* the other side is the source → its axis is the root. `undefined` if `linkers[0]` is not a\n* well-formed two-group linker.\n*/\nfunction extractRoot(hit, linkers) {\n\tconst first = linkers[0];\n\tif (first === void 0) return void 0;\n\tconst axes = first.axesSpec;\n\tif (axes.length !== 2) return void 0;\n\tconst second = linkers[1] ?? hit;\n\treturn axes.find((a) => !second.axesSpec.some((b) => b.name === a.name));\n}\nconst ABSENT = \"__ABSENT__\";\nfunction deriveSlotKey(group, slot, row) {\n\tif (slot.kind === \"root\") {\n\t\tconst r = group.roots[row];\n\t\treturn r === void 0 ? ABSENT : canonicalizeJson(getAxisId(r));\n\t} else {\n\t\tconst l = group.entries[row].linkers?.[slot.i];\n\t\tconst id = l && extractLinkerIdentity(l);\n\t\treturn isNil(id) ? ABSENT : canonicalizeJson(id);\n\t}\n}\nfunction deriveSlotToken(group, slot, row) {\n\tif (slot.kind === \"root\") {\n\t\tconst r = group.roots[row];\n\t\tif (r === void 0) return void 0;\n\t\tconst comp = group.roots.filter((o, j) => j !== row && !isNil(o)).map((o) => extractAxisIdentity(o));\n\t\treturn deriveToken(extractAxisIdentity(r), comp);\n\t}\n\tconst l = group.entries[row].linkers?.[slot.i];\n\tconst id = l && extractLinkerIdentity(l);\n\tif (isNil(id)) return void 0;\n\treturn deriveToken(id, group.entries.filter((_, j) => j !== row).map((e) => e.linkers?.[slot.i]).map((x) => x ? extractLinkerIdentity(x) : void 0).filter((x) => !isNil(x)));\n}\nfunction getDiscriminates(group, slot) {\n\treturn new Set(group.entries.map((_, r) => deriveSlotKey(group, slot, r))).size > 1;\n}\n/** Render one row against a chosen slot set: the distinguishing root + linker pieces, formatted. */\nfunction renderRow(group, slots, row) {\n\tconst rootSpec = group.roots[row];\n\tconst rootText = slots.some((s) => s.kind === \"root\") ? deriveSlotToken(group, { kind: \"root\" }, row) : void 0;\n\tconst root = rootSpec !== void 0 && rootText !== void 0 ? {\n\t\tspec: rootSpec,\n\t\ttext: rootText\n\t} : void 0;\n\tconst linkers = slots.filter((s) => s.kind === \"linker\").sort((a, b) => a.i - b.i).map((s) => {\n\t\tconst spec = group.entries[row].linkers?.[s.i];\n\t\tconst text = deriveSlotToken(group, s, row);\n\t\treturn spec !== void 0 && text !== void 0 ? {\n\t\t\tspec,\n\t\t\ttext\n\t\t} : void 0;\n\t}).filter((l) => !isNil(l));\n\tif (root === void 0 && linkers.length === 0) return \"\";\n\treturn group.format({\n\t\troot,\n\t\tlinkers\n\t}, group.entries[row].hit, group.indices[row]) || \"\";\n}\nfunction renderAll(group, slots) {\n\treturn group.entries.map((_, r) => renderRow(group, slots, r));\n}\nfunction allUnique(rendered) {\n\treturn new Set(rendered).size === rendered.length;\n}\n/**\n* Minimal slot set that makes the group unique. Escalate by priority (root, then linkers by step),\n* then drop any redundant slot; render every row symmetrically against the result.\n*\n* KNOWN LIMITATION (review point): symmetric render can over-decorate a row in a mixed group (e.g.\n* `via Sample MapperA` where `via Sample` alone is already unique for that row). Per-row trimming is\n* a generalized `dropRedundantLinkerSuffix`; naive greedy trimming is unstable, so it's deferred.\n*/\nfunction resolveGroup(entries, indices, format) {\n\tconst group = {\n\t\tentries,\n\t\troots: entries.map((e) => e.hit && e.linkers?.length ? extractRoot(e.hit, e.linkers) : void 0),\n\t\tindices,\n\t\tformat\n\t};\n\tconst maxLen = Math.max(0, ...entries.map((e) => e.linkers?.length ?? 0));\n\tconst escalated = [{ kind: \"root\" }, ...Array.from({ length: maxLen }, (_, i) => ({\n\t\tkind: \"linker\",\n\t\ti\n\t}))].reduce((acc, slot) => allUnique(renderAll(group, acc)) || !getDiscriminates(group, slot) ? acc : (acc.push(slot), acc), []);\n\treturn renderAll(group, escalated.reduce((acc, slot) => {\n\t\tconst trial = acc.filter((s) => s !== slot);\n\t\treturn allUnique(renderAll(group, trial)) ? trial : acc;\n\t}, escalated));\n}\n/**\n* Full label per entry: `stem` plus, where stems collide, a minimal postfix distinguishing the\n* linked columns by the difference between their sources.\n*/\nfunction derivePostfixes(entries, format = defaultLinkerFormatter) {\n\tconst postfix = [...entries.reduce((acc, e, idx) => acc.set(e.stem, [...acc.get(e.stem) ?? [], idx]), /* @__PURE__ */ new Map()).values()].reduce((acc, idxs) => {\n\t\tif (idxs.length < 2) return acc;\n\t\tconst resolved = resolveGroup(idxs.map((i) => entries[i]), idxs, format);\n\t\treturn idxs.reduce((m, i, k) => m.set(i, resolved[k]), acc);\n\t}, /* @__PURE__ */ new Map());\n\treturn entries.map((e, i) => {\n\t\tconst p = postfix.get(i);\n\t\treturn p ? `${e.stem} ${p}` : e.stem;\n\t});\n}\n//#endregion\nexport { derivePostfixes, extractRoot };\n\n//# sourceMappingURL=linked_column_postfix.js.map","import { derivePostfixes } from \"./linked_column_postfix.js\";\nimport { Annotation, parseJson, readAnnotation } from \"@milaboratories/pl-model-common\";\nimport { throwError } from \"@milaboratories/helpers\";\nimport { isFunction, isNil as isNil$1 } from \"es-toolkit\";\n//#region src/labels/derive_distinct_labels.ts\nconst DISTANCE_PENALTY = .001;\nconst LABEL_TYPE = \"__LABEL__\";\nconst LABEL_TYPE_FULL = \"__LABEL__@1\";\nconst HIT_QUAL_TYPE = \"__HIT_QUAL__\";\nconst ANCHOR_QUAL_TYPE_PREFIX = \"__ANCHOR_QUAL__:\";\nfunction isAnchorQualType(t) {\n\treturn t.startsWith(ANCHOR_QUAL_TYPE_PREFIX);\n}\nfunction isSyntheticType(t) {\n\treturn t === HIT_QUAL_TYPE || isAnchorQualType(t);\n}\n/**\n* Distinct labels for a set of columns. Two phases:\n* 1. {@link deriveStems} — treats each column as a single entity (native label + trace + hit/anchor\n* qualifications) and produces the minimal distinguishing \"stem\".\n* 2. {@link derivePostfixes} — for columns still colliding on their stem, appends a \"via …\" postfix\n* describing the difference between their linker sources (root axis, then linker chain).\n*/\nfunction deriveDistinctLabels(values, options = {}) {\n\tconst stems = deriveStems(values, options);\n\treturn derivePostfixes(values.map((v, i) => {\n\t\tconst { spec, linkerPath } = extractEntryParts(v);\n\t\treturn {\n\t\t\tstem: stems[i],\n\t\t\thit: spec,\n\t\t\tlinkers: (linkerPath ?? []).map((s) => s.spec)\n\t\t};\n\t}), options.formatters?.linker);\n}\n/** Phase 1: minimal per-column stem — native label + trace + hit/anchor qualifications, no linkers. */\nfunction deriveStems(values, options) {\n\tconst forceTraceElements = options.forceTraceElements !== void 0 && options.forceTraceElements.length > 0 ? new Set(options.forceTraceElements) : void 0;\n\tconst separator = options.separator ?? \" / \";\n\tconst records = values.map((v, i) => enrichRecord(v, i, options));\n\tconst stats = collectTypeStats(records);\n\tconst hasAnySynthetic = records.some((r) => r.fullTrace.some((ft) => isSyntheticType(ft.type)));\n\tconst labelForced = (options.includeNativeLabel === true || hasAnySynthetic) && stats.countByType.has(LABEL_TYPE_FULL);\n\tconst forcedSet = /* @__PURE__ */ new Set();\n\tif (labelForced) forcedSet.add(LABEL_TYPE_FULL);\n\tconst { mainTypes, secondaryTypes } = classifyTypes(stats, values.length);\n\tconst build = (typeSet, force) => buildLabels(records, typeSet, forceTraceElements, separator, force);\n\tif (mainTypes.length === 0) {\n\t\tif (secondaryTypes.length !== 0) throw new Error(\"Non-empty secondary types list while main types list is empty.\");\n\t\treturn build(/* @__PURE__ */ new Set([LABEL_TYPE_FULL]), true) ?? throwError(\"Failed to derive labels using native column labels\");\n\t}\n\tlet includedCount = 0;\n\tlet additionalType = -1;\n\twhile (includedCount < mainTypes.length) {\n\t\tconst currentSet = new Set(forcedSet);\n\t\tfor (let i = 0; i < includedCount; ++i) currentSet.add(mainTypes[i]);\n\t\tif (additionalType >= 0) currentSet.add(mainTypes[additionalType]);\n\t\tconst candidateResult = build(currentSet, false);\n\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) === values.length) {\n\t\t\tconst minimized = minimizeTypeSet(currentSet, records, stats, forceTraceElements, forcedSet, separator);\n\t\t\treturn repairBareByPresence(build(minimized, false) ?? throwError(\"Failed to derive unique labels\"), minimized, records, stats, forcedSet, forceTraceElements, separator);\n\t\t}\n\t\tadditionalType++;\n\t\tif (additionalType >= mainTypes.length) {\n\t\t\tincludedCount++;\n\t\t\tadditionalType = includedCount;\n\t\t}\n\t}\n\tconst minimized = minimizeTypeSet(/* @__PURE__ */ new Set([\n\t\t...forcedSet,\n\t\t...mainTypes,\n\t\t...secondaryTypes\n\t]), records, stats, forceTraceElements, forcedSet, separator);\n\treturn repairBareByPresence(build(minimized, true) ?? throwError(\"Failed to derive unique labels\"), minimized, records, stats, forcedSet, forceTraceElements, separator);\n}\nfunction extractEntryParts(entry) {\n\tif (!(\"spec\" in entry && typeof entry.spec === \"object\")) return {\n\t\tspec: entry,\n\t\textraTrace: void 0,\n\t\tlinkerPath: void 0,\n\t\tqualifications: void 0\n\t};\n\treturn {\n\t\tspec: entry.spec,\n\t\textraTrace: entry.extraTrace,\n\t\tlinkerPath: entry.linkerPath,\n\t\tqualifications: entry.qualifications\n\t};\n}\nfunction formatQualification(q) {\n\tconst ctx = q.contextDomain ?? {};\n\tconst keys = Object.keys(ctx);\n\tif (keys.length === 0) return q.axis.name;\n\tconst pairs = keys.map((k) => `${k}=${ctx[k]}`).join(\", \");\n\treturn Object.prototype.hasOwnProperty.call(ctx, q.axis.name) ? pairs : `${q.axis.name} ${pairs}`;\n}\nfunction formatQualifications(qs) {\n\treturn qs.map(formatQualification).join(\"; \");\n}\nfunction buildFullTrace(trace) {\n\tconst result = [];\n\tconst occurrences = /* @__PURE__ */ new Map();\n\tfor (let i = trace.length - 1; i >= 0; --i) {\n\t\tconst entry = trace[i];\n\t\tconst occurrenceIndex = (occurrences.get(entry.type) ?? 0) + 1;\n\t\toccurrences.set(entry.type, occurrenceIndex);\n\t\tresult.push({\n\t\t\t...entry,\n\t\t\tfullType: `${entry.type}@${occurrenceIndex}`,\n\t\t\toccurrenceIndex\n\t\t});\n\t}\n\tresult.reverse();\n\treturn result;\n}\nfunction enrichRecord(value, index, options) {\n\tconst { spec, extraTrace, qualifications } = extractEntryParts(value);\n\tconst formatters = options.formatters;\n\tconst rawLabel = readAnnotation(spec, Annotation.Label);\n\tconst traceStr = readAnnotation(spec, Annotation.Trace);\n\tconst baseTrace = traceStr ? parseJson(traceStr) ?? [] : [];\n\tconst prefixExtra = extraTrace?.filter((e) => e.position === \"prefix\") ?? [];\n\tconst suffixExtra = extraTrace?.filter((e) => e.position !== \"prefix\") ?? [];\n\tconst trace = [\n\t\t...prefixExtra,\n\t\t...baseTrace,\n\t\t...suffixExtra\n\t];\n\tif (!isNil$1(rawLabel)) {\n\t\tconst label = isFunction(formatters?.native) ? formatters.native(rawLabel, spec, index) : rawLabel;\n\t\tif (!isNil$1(label)) {\n\t\t\tconst labelEntry = {\n\t\t\t\tlabel,\n\t\t\t\ttype: LABEL_TYPE,\n\t\t\t\timportance: -2\n\t\t\t};\n\t\t\tif (options.addLabelAsSuffix === true) trace.push(labelEntry);\n\t\t\telse trace.splice(0, 0, labelEntry);\n\t\t}\n\t}\n\tif (qualifications !== void 0 && qualifications.forQueries !== void 0) {\n\t\tfor (const [anchorId, qs] of Object.entries(qualifications.forQueries)) {\n\t\t\tif (qs.length === 0) continue;\n\t\t\tconst anchorText = isFunction(formatters?.anchorQualification) ? formatters.anchorQualification(anchorId, qs, spec, index) : `[${anchorId}: ${formatQualifications(qs)}]`;\n\t\t\tif (isNil$1(anchorText)) continue;\n\t\t\ttrace.push({\n\t\t\t\ttype: `${ANCHOR_QUAL_TYPE_PREFIX}${anchorId}`,\n\t\t\t\tlabel: anchorText,\n\t\t\t\timportance: -11\n\t\t\t});\n\t\t}\n\t\tif (qualifications.forHit !== void 0 && qualifications.forHit.length > 0) {\n\t\t\tconst hitText = isFunction(formatters?.hitQualification) ? formatters.hitQualification(qualifications.forHit, spec, index) : `[${formatQualifications(qualifications.forHit)}]`;\n\t\t\tif (!isNil$1(hitText)) trace.push({\n\t\t\t\ttype: HIT_QUAL_TYPE,\n\t\t\t\tlabel: hitText,\n\t\t\t\timportance: -12\n\t\t\t});\n\t\t}\n\t}\n\treturn { fullTrace: buildFullTrace(trace) };\n}\nfunction collectTypeStats(records) {\n\tconst importances = /* @__PURE__ */ new Map();\n\tconst countByType = /* @__PURE__ */ new Map();\n\tfor (const record of records) for (let i = 0; i < record.fullTrace.length; i++) {\n\t\tconst { fullType, importance: rawImportance } = record.fullTrace[i];\n\t\tconst importance = rawImportance ?? 0;\n\t\tconst distance = (record.fullTrace.length - i) * DISTANCE_PENALTY;\n\t\tcountByType.set(fullType, (countByType.get(fullType) ?? 0) + 1);\n\t\timportances.set(fullType, Math.max(importances.get(fullType) ?? Number.NEGATIVE_INFINITY, importance - distance));\n\t}\n\treturn {\n\t\timportances,\n\t\tcountByType\n\t};\n}\nfunction classifyTypes(stats, totalRecords) {\n\tconst sorted = [...stats.importances].sort(([, i1], [, i2]) => i2 - i1);\n\tconst mainTypes = [];\n\tconst secondaryTypes = [];\n\tfor (const [typeName] of sorted) if (typeName.endsWith(\"@1\") || stats.countByType.get(typeName) === totalRecords) mainTypes.push(typeName);\n\telse secondaryTypes.push(typeName);\n\treturn {\n\t\tmainTypes,\n\t\tsecondaryTypes\n\t};\n}\nfunction renderRecordLabel(record, includedTypes, forceTraceElements, separator) {\n\tconst traceParts = [];\n\tconst anchorParts = [];\n\tlet hitLabel;\n\tfor (const ft of record.fullTrace) {\n\t\tif (!(includedTypes.has(ft.fullType) || forceTraceElements?.has(ft.type))) continue;\n\t\tif (ft.type === HIT_QUAL_TYPE) hitLabel = ft.label;\n\t\telse if (isAnchorQualType(ft.type)) anchorParts.push(ft.label);\n\t\telse traceParts.push(ft.label);\n\t}\n\tif (traceParts.length === 0 && anchorParts.length === 0 && hitLabel === void 0) return void 0;\n\tlet label = traceParts.join(separator);\n\tconst append = (part) => {\n\t\tlabel = label.length === 0 ? part : `${label} ${part}`;\n\t};\n\tfor (const a of anchorParts) append(a);\n\tif (hitLabel !== void 0) append(hitLabel);\n\treturn label;\n}\nfunction buildLabels(records, includedTypes, forceTraceElements, separator, force) {\n\tconst result = [];\n\tfor (const r of records) {\n\t\tconst rendered = renderRecordLabel(r, includedTypes, forceTraceElements, separator);\n\t\tif (rendered === void 0) {\n\t\t\tif (!force) return void 0;\n\t\t\tresult.push(\"Unlabeled\");\n\t\t\tcontinue;\n\t\t}\n\t\tresult.push(rendered);\n\t}\n\treturn result;\n}\nfunction countUniqueLabels(result) {\n\tif (result === void 0) return 0;\n\treturn new Set(result).size;\n}\nfunction minimizeTypeSet(typeSet, records, stats, forceTraceElements, forcedSet, separator) {\n\tconst initialResult = buildLabels(records, typeSet, forceTraceElements, separator, false);\n\tif (initialResult === void 0) return typeSet;\n\tconst targetCardinality = countUniqueLabels(initialResult);\n\tconst result = new Set(typeSet);\n\tconst removable = [...result].filter((t) => !forceTraceElements?.has(t.split(\"@\")[0]) && !forcedSet.has(t)).sort((a, b) => (stats.importances.get(a) ?? 0) - (stats.importances.get(b) ?? 0));\n\tfor (const typeToRemove of removable) {\n\t\tconst candidate = new Set(result);\n\t\tcandidate.delete(typeToRemove);\n\t\tconst candidateResult = buildLabels(records, candidate, forceTraceElements, separator, false);\n\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) >= targetCardinality) result.delete(typeToRemove);\n\t}\n\treturn result;\n}\nconst ABSENT_VALUE = \"\\0absent\";\n/** Whether `fullType`'s rendered value differs across the group (absence counts as a value). */\nfunction typeDistinguishes(records, group, fullType) {\n\tconst values = /* @__PURE__ */ new Set();\n\tfor (const i of group) {\n\t\tconst ft = records[i].fullTrace.find((e) => e.fullType === fullType);\n\t\tvalues.add(ft?.label ?? ABSENT_VALUE);\n\t\tif (values.size > 1) return true;\n\t}\n\treturn false;\n}\n/** The highest-importance trace type this row HAS (outside `typeSet`) that sets it apart from its\n* group peers. `undefined` when the row carries nothing distinguishing of its own. */\nfunction bestDistinguishingType(records, group, row, typeSet, forcedSet, forceTraceElements, stats) {\n\treturn records[row].fullTrace.reduce((best, ft) => {\n\t\tif (typeSet.has(ft.fullType) || forcedSet.has(ft.fullType) || forceTraceElements?.has(ft.type)) return best;\n\t\tif (!typeDistinguishes(records, group, ft.fullType)) return best;\n\t\tconst imp = stats.importances.get(ft.fullType) ?? 0;\n\t\treturn best === void 0 || imp > best.imp ? {\n\t\t\ttype: ft.fullType,\n\t\t\timp\n\t\t} : best;\n\t}, void 0)?.type;\n}\n/**\n* Un-bare columns distinguished only \"by absence\". After minimization a column can end up with a\n* bare trace zone (only the forced native label) while a peer sharing that same base renders extra\n* tokens — the column reads as unique purely because it LACKS what the peer has. For each such bare\n* column this re-renders JUST that column's label with the highest-importance trace type it actually\n* carries that tells it apart from its peers, so every colliding column is distinguished by a token\n* it HAS rather than by omission.\n*\n* Patches individual labels rather than the shared type set on purpose: the set is global, so adding\n* a type there would also decorate unrelated columns in other groups that happen to carry it. Only\n* bare columns' labels grow (a superset of their previous value), so uniqueness is preserved. Groups\n* are keyed by the base = the label rendered from the forced types alone.\n*/\nfunction repairBareByPresence(labels, minimized, records, stats, forcedSet, forceTraceElements, separator) {\n\tconst base = records.map((r) => renderRecordLabel(r, forcedSet, forceTraceElements, separator));\n\tconst isBare = records.map((r, i) => renderRecordLabel(r, minimized, forceTraceElements, separator) === base[i]);\n\tconst groups = records.reduce((acc, _, i) => acc.set(base[i] ?? \"\", [...acc.get(base[i] ?? \"\") ?? [], i]), /* @__PURE__ */ new Map());\n\tconst patched = [...labels];\n\tfor (const group of groups.values()) {\n\t\tif (!group.some((i) => !isBare[i])) continue;\n\t\tfor (const i of group) {\n\t\t\tif (!isBare[i]) continue;\n\t\t\tconst chosen = bestDistinguishingType(records, group, i, minimized, forcedSet, forceTraceElements, stats);\n\t\t\tif (chosen === void 0) continue;\n\t\t\tconst withToken = /* @__PURE__ */ new Set([...minimized, chosen]);\n\t\t\tpatched[i] = renderRecordLabel(records[i], withToken, forceTraceElements, separator) ?? patched[i];\n\t\t}\n\t}\n\treturn patched;\n}\n//#endregion\nexport { deriveDistinctLabels };\n\n//# sourceMappingURL=derive_distinct_labels.js.map","import { deriveDistinctLabels } from \"../../labels/derive_distinct_labels.js\";\n//#region src/render/util/label.ts\n/** @deprecated Use deriveDistinctLabels */\nfunction deriveLabels(values, getSpec, options = {}) {\n\treturn deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({\n\t\tvalue: values[i],\n\t\tlabel\n\t}));\n}\n//#endregion\nexport { deriveLabels };\n\n//# sourceMappingURL=label.js.map","import { TreeNodeAccessor } from \"../accessor.js\";\nimport { assertNever, dataInfoToEntries, isDataInfo, isDataInfoEntries, visitDataInfo } from \"@milaboratories/pl-model-common\";\n//#region src/render/util/pcolumn_data.ts\nconst RT_RESOURCE_MAP = \"PColumnData/ResourceMap\";\nconst RT_RESOURCE_MAP_PARTITIONED = \"PColumnData/Partitioned/ResourceMap\";\nconst RT_JSON_PARTITIONED = \"PColumnData/JsonPartitioned\";\nconst RT_BINARY_PARTITIONED = \"PColumnData/BinaryPartitioned\";\nconst RT_PARQUET_PARTITIONED = \"PColumnData/ParquetPartitioned\";\nconst RT_JSON_SUPER_PARTITIONED = \"PColumnData/Partitioned/JsonPartitioned\";\nconst RT_BINARY_SUPER_PARTITIONED = \"PColumnData/Partitioned/BinaryPartitioned\";\nconst RT_PARQUET_SUPER_PARTITIONED = \"PColumnData/Partitioned/ParquetPartitioned\";\nfunction populateResourceMapData(acc, resourceParser, data, keyPrefix = [], addEntriesWithNoData) {\n\tif (acc === void 0) return false;\n\tswitch (acc.resourceType.name) {\n\t\tcase RT_RESOURCE_MAP: {\n\t\t\tlet isComplete = acc.getInputsLocked();\n\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: keyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\tconst converted = value === void 0 ? void 0 : resourceParser(value);\n\t\t\t\tif (converted === void 0) isComplete = false;\n\t\t\t\tif (converted !== void 0 || addEntriesWithNoData) data.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: converted\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn isComplete;\n\t\t}\n\t\tcase RT_RESOURCE_MAP_PARTITIONED: {\n\t\t\tlet isComplete = acc.getInputsLocked();\n\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: keyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (value === void 0) isComplete = false;\n\t\t\t\telse {\n\t\t\t\t\tconst populateResult = populateResourceMapData(value, resourceParser, data, [...keyPrefix, ...JSON.parse(keyStr)], addEntriesWithNoData);\n\t\t\t\t\tisComplete = isComplete && populateResult;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn isComplete;\n\t\t}\n\t\tdefault: throw new Error(`Unknown resource type: ${acc.resourceType.name}`);\n\t}\n}\nfunction parseResourceMap(acc, resourceParser, addEntriesWithNoData = false) {\n\tconst data = [];\n\treturn {\n\t\tisComplete: populateResourceMapData(acc, resourceParser, data, [], addEntriesWithNoData),\n\t\tdata\n\t};\n}\nconst removeIndexSuffix = (keyStr) => {\n\tif (keyStr.endsWith(\".index\")) return {\n\t\tbaseKey: keyStr.substring(0, keyStr.length - 6),\n\t\ttype: \"index\"\n\t};\n\telse if (keyStr.endsWith(\".values\")) return {\n\t\tbaseKey: keyStr.substring(0, keyStr.length - 7),\n\t\ttype: \"values\"\n\t};\n\telse throw new Error(`key must ends on .index/.values for binary p-column, got: ${keyStr}`);\n};\n/** Returns a list of all partition keys appeared in the p-column */\nfunction getPartitionKeysList(acc) {\n\tif (!acc) return void 0;\n\tconst rt = acc.resourceType.name;\n\tconst meta = acc.getDataAsJson();\n\tconst data = [];\n\tlet keyLength = 0;\n\tswitch (rt) {\n\t\tcase RT_RESOURCE_MAP:\n\t\t\tkeyLength = meta[\"keyLength\"];\n\t\t\tbreak;\n\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\t\tkeyLength = meta[\"partitionKeyLength\"] + meta[\"keyLength\"];\n\t\t\tbreak;\n\t\tcase RT_JSON_PARTITIONED:\n\t\tcase RT_BINARY_PARTITIONED:\n\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\tkeyLength = meta[\"partitionKeyLength\"];\n\t\t\tbreak;\n\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\tkeyLength = meta[\"superPartitionKeyLength\"] + meta[\"partitionKeyLength\"];\n\t\t\tbreak;\n\t}\n\tswitch (rt) {\n\t\tcase RT_RESOURCE_MAP:\n\t\tcase RT_JSON_PARTITIONED:\n\t\tcase RT_BINARY_PARTITIONED:\n\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\tfor (let keyStr of acc.listInputFields()) {\n\t\t\t\tif (rt === \"PColumnData/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\tconst key = [...JSON.parse(keyStr)];\n\t\t\t\tdata.push(key);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\tconst keyPrefix = [...JSON.parse(supKeyStr)];\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (value !== void 0) for (let keyStr of value.listInputFields()) {\n\t\t\t\t\tif (rt === \"PColumnData/Partitioned/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\tdata.push(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn {\n\t\tdata,\n\t\tkeyLength\n\t};\n}\nfunction getUniquePartitionKeysForDataEntries(list) {\n\tif (list.type !== \"JsonPartitioned\" && list.type !== \"BinaryPartitioned\" && list.type !== \"ParquetPartitioned\") throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${list.type}`);\n\tconst { parts, partitionKeyLength } = list;\n\tconst result = [];\n\tfor (let i = 0; i < partitionKeyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\tfor (const part of parts) {\n\t\tconst key = part.key;\n\t\tif (key.length !== partitionKeyLength) throw new Error(`Key length (${key.length}) does not match partition length (${partitionKeyLength}) for key: ${JSON.stringify(key)}`);\n\t\tfor (let i = 0; i < partitionKeyLength; ++i) result[i].add(key[i]);\n\t}\n\treturn result.map((s) => Array.from(s.values()));\n}\nfunction getUniquePartitionKeys(acc) {\n\tif (acc === void 0) return void 0;\n\tif (isDataInfoEntries(acc)) return getUniquePartitionKeysForDataEntries(acc);\n\tconst list = getPartitionKeysList(acc);\n\tif (!list) return void 0;\n\tconst { data, keyLength } = list;\n\tconst result = [];\n\tfor (let i = 0; i < keyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\tfor (const l of data) {\n\t\tif (l.length !== keyLength) throw new Error(\"key length does not match partition length\");\n\t\tfor (let i = 0; i < keyLength; ++i) result[i].add(l[i]);\n\t}\n\treturn result.map((s) => Array.from(s.values()));\n}\n/**\n* Parses the PColumn data from a TreeNodeAccessor into a DataInfoEntries structure.\n* Returns undefined if any required data is missing.\n* Throws error on validation failures.\n*\n* @param acc - The TreeNodeAccessor containing PColumn data\n* @param keyPrefix - Optional key prefix for recursive calls\n* @returns DataInfoEntries representation of the PColumn data, or undefined if incomplete\n*/\nfunction parsePColumnData(acc, keyPrefix = []) {\n\tif (acc === void 0) return void 0;\n\tif (!acc.getIsReadyOrError()) return void 0;\n\tconst resourceType = acc.resourceType.name;\n\tconst meta = acc.getDataAsJson();\n\tif (keyPrefix.length > 0 && (resourceType === \"PColumnData/Partitioned/JsonPartitioned\" || resourceType === \"PColumnData/Partitioned/BinaryPartitioned\" || resourceType === \"PColumnData/Partitioned/ParquetPartitioned\")) throw new Error(`Unexpected nested super-partitioned resource: ${resourceType}`);\n\tswitch (resourceType) {\n\t\tcase RT_RESOURCE_MAP:\n\t\tcase RT_RESOURCE_MAP_PARTITIONED: throw new Error(`Only data columns are supported, got: ${resourceType}`);\n\t\tcase RT_JSON_PARTITIONED: {\n\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst parts = [];\n\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: keyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\tparts.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tcase RT_BINARY_PARTITIONED: {\n\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst parts = [];\n\t\t\tconst baseKeys = /* @__PURE__ */ new Map();\n\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\tconst suffix = removeIndexSuffix(keyStr);\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: keyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\tlet entry = baseKeys.get(suffix.baseKey);\n\t\t\t\tif (!entry) {\n\t\t\t\t\tentry = {};\n\t\t\t\t\tbaseKeys.set(suffix.baseKey, entry);\n\t\t\t\t}\n\t\t\t\tif (suffix.type === \"index\") entry.index = value;\n\t\t\t\telse entry.values = value;\n\t\t\t}\n\t\t\tfor (const [baseKeyStr, entry] of baseKeys.entries()) {\n\t\t\t\tif (!entry.index || !entry.values) return void 0;\n\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(baseKeyStr)];\n\t\t\t\tparts.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tindex: entry.index,\n\t\t\t\t\t\tvalues: entry.values\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tcase RT_PARQUET_PARTITIONED: {\n\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst parts = [];\n\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\tfield: keyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\tparts.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tcase RT_JSON_SUPER_PARTITIONED: {\n\t\t\tif (typeof meta?.superPartitionKeyLength !== \"number\" || typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\tconst parts = [];\n\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (superPartition === void 0) return void 0;\n\t\t\t\tif (superPartition.resourceType.name !== \"PColumnData/JsonPartitioned\") throw new Error(`Expected ${RT_JSON_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);\n\t\t\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\tif (innerResult.type !== \"JsonPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tcase RT_BINARY_SUPER_PARTITIONED: {\n\t\t\tif (typeof meta?.superPartitionKeyLength !== \"number\" || typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\tconst parts = [];\n\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (superPartition === void 0) return void 0;\n\t\t\t\tif (superPartition.resourceType.name !== \"PColumnData/BinaryPartitioned\") throw new Error(`Expected ${RT_BINARY_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);\n\t\t\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\tif (innerResult.type !== \"BinaryPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tcase RT_PARQUET_SUPER_PARTITIONED: {\n\t\t\tif (typeof meta?.superPartitionKeyLength !== \"number\" || typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);\n\t\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\tconst parts = [];\n\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t});\n\t\t\t\tif (superPartition === void 0) return void 0;\n\t\t\t\tif (superPartition.resourceType.name !== \"PColumnData/ParquetPartitioned\") throw new Error(`Expected ${RT_PARQUET_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);\n\t\t\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\tif (innerResult.type !== \"ParquetPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\tparts\n\t\t\t};\n\t\t}\n\t\tdefault: throw new Error(`Unknown resource type: ${resourceType}`);\n\t}\n}\n/**\n* Converts or parses the input into DataInfoEntries format.\n\n* @param acc - The input data, which can be TreeNodeAccessor, DataInfoEntries, DataInfo, or undefined.\n* @returns The data in DataInfoEntries format, or undefined if the input was undefined or data is not ready.\n*/\nfunction convertOrParsePColumnData(acc) {\n\tif (acc === void 0) return void 0;\n\tif (isDataInfoEntries(acc)) return acc;\n\tif (isDataInfo(acc)) return dataInfoToEntries(acc);\n\tif (acc instanceof TreeNodeAccessor) return parsePColumnData(acc);\n\tthrow new Error(`Unexpected input type: ${typeof acc}`);\n}\n/**\n* Returns the total number of rows in a PColumn, or `undefined` when the count\n* cannot be determined without downloading data blobs.\n*\n* Derivable cases:\n* - Inline values ({@link PColumnValues}): one entry per row.\n* - Inline `Json` {@link DataInfo}: one entry per row.\n* - Parquet (`ParquetPartitioned` / `ParquetSuperPartitioned`): summed from\n* each chunk's precomputed {@link ParquetChunkMetadata.stats} `numberOfRows`,\n* read from the chunk resource metadata without downloading the parquet files.\n*\n* Returns `undefined` when:\n* - the data is `undefined` or still computing / not ready,\n* - the data is `JsonPartitioned` or `BinaryPartitioned` (per-part row counts\n* live inside opaque blobs and are not readable here),\n* - any parquet chunk is missing `stats.numberOfRows`.\n*\n* Note: do not confuse row count with `keyLength` / `partitionKeyLength`, which\n* are axis-tuple lengths, not row counts.\n*/\nfunction getNumberOfRows(data) {\n\tif (data === void 0) return void 0;\n\tif (Array.isArray(data)) return data.length;\n\tconst entries = convertOrParsePColumnData(data);\n\tif (entries === void 0) return void 0;\n\tswitch (entries.type) {\n\t\tcase \"Json\": return entries.data.length;\n\t\tcase \"JsonPartitioned\":\n\t\tcase \"BinaryPartitioned\": return;\n\t\tcase \"ParquetPartitioned\": {\n\t\t\tlet total = 0;\n\t\t\tfor (const { value } of entries.parts) {\n\t\t\t\tconst rows = value.getDataAsJsonOrUndefined()?.stats?.numberOfRows;\n\t\t\t\tif (typeof rows !== \"number\") return void 0;\n\t\t\t\ttotal += rows;\n\t\t\t}\n\t\t\treturn total;\n\t\t}\n\t\tdefault: assertNever(entries);\n\t}\n}\nfunction isPColumnReady(c) {\n\tconst isValues = (d) => Array.isArray(d);\n\tconst isAccessor = (d) => d instanceof TreeNodeAccessor;\n\tlet ready = true;\n\tconst data = c.data;\n\tif (data == null) return false;\n\telse if (isAccessor(data)) ready &&= data.getIsReadyOrError();\n\telse if (isDataInfo(data)) visitDataInfo(data, (v) => ready &&= v.getIsReadyOrError());\n\telse if (!isValues(data)) throw Error(`unsupported column data type: ${data}`);\n\treturn ready;\n}\nfunction allPColumnsReady(columns) {\n\treturn columns.every(isPColumnReady);\n}\n//#endregion\nexport { RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, allPColumnsReady, convertOrParsePColumnData, getNumberOfRows, getPartitionKeysList, getUniquePartitionKeys, isPColumnReady, parsePColumnData, parseResourceMap };\n\n//# sourceMappingURL=pcolumn_data.js.map","import { filterDataInfoEntries } from \"./axis_filtering.js\";\nimport { deriveLabels } from \"./label.js\";\nimport { convertOrParsePColumnData, getUniquePartitionKeys } from \"./pcolumn_data.js\";\nimport { Annotation, LinkerMap, canonicalizeAxisId, deriveNativeId, entriesToDataInfo, getAxisId, getColumnIdAndSpec, isLinkerColumn, isPColumnSpec, isPartitionedDataInfoEntries, legacyColumnSelectorsToPredicate, matchAxisId, resolveAnchors } from \"@milaboratories/pl-model-common\";\nimport canonicalize from \"canonicalize\";\n//#region src/render/util/column_collection.ts\nfunction isPColumnValues(value) {\n\tif (!Array.isArray(value)) return false;\n\tif (value.length === 0) return true;\n\tconst first = value[0];\n\treturn typeof first === \"object\" && first !== null && \"key\" in first && \"val\" in first;\n}\n/**\n* A simple implementation of {@link ColumnProvider} backed by a pre-defined array of columns.\n*/\nvar ArrayColumnsProvider = class {\n\tcolumns;\n\tconstructor(columns) {\n\t\tthis.columns = columns;\n\t}\n\tselectColumns(selectors) {\n\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\treturn this.columns.filter((column) => predicate(column.spec));\n\t}\n};\nfunction splitFiltersToExtraTrace(splitFilters) {\n\tif (splitFilters === void 0) return void 0;\n\treturn splitFilters.map((filter) => ({\n\t\ttype: `split:${canonicalizeAxisId(filter.axisId)}`,\n\t\tlabel: filter.label,\n\t\timportance: 1e6\n\t}));\n}\nfunction splitFiltersToAxisFilter(splitFilters) {\n\tif (!splitFilters) return void 0;\n\treturn splitFilters.map((filter) => [filter.axisIdx, filter.value]);\n}\nfunction fallbackIdDeriver(originalId, axisFilters) {\n\tif (!axisFilters || axisFilters.length === 0) return originalId;\n\treturn canonicalize({\n\t\tid: originalId,\n\t\taxisFilters: [...axisFilters].sort((a, b) => a[0] - b[0])\n\t});\n}\n/** Checks if a selector object uses any anchor properties */\nfunction hasAnchors(selector) {\n\tif (!selector || typeof selector !== \"object\") return false;\n\tconst potentialAnchored = selector;\n\tconst hasAnchorValues = (obj) => obj && typeof obj === \"object\" && Object.values(obj).some((v) => typeof v === \"object\" && v !== null && \"anchor\" in v);\n\tconst domainHasAnchors = hasAnchorValues(potentialAnchored[\"domain\"]);\n\tconst contextDomainHasAnchors = hasAnchorValues(potentialAnchored[\"contextDomain\"]);\n\tconst axesHaveAnchors = potentialAnchored[\"axes\"] && Array.isArray(potentialAnchored[\"axes\"]) && potentialAnchored[\"axes\"].some((a) => typeof a === \"object\" && a !== null && \"anchor\" in a);\n\treturn !!potentialAnchored[\"domainAnchor\"] || !!potentialAnchored[\"contextDomainAnchor\"] || domainHasAnchors || contextDomainHasAnchors || axesHaveAnchors;\n}\n/**\n* Derives the indices of axes marked for splitting based on the selector.\n* Throws an error if splitting is requested alongside `partialAxesMatch`.\n*/\nfunction getSplitAxisIndices(selector) {\n\tif (typeof selector !== \"object\" || !(\"axes\" in selector) || selector.axes === void 0) return [];\n\tconst splitIndices = selector.axes.map((axis, index) => typeof axis === \"object\" && \"split\" in axis && axis.split === true ? index : -1).filter((index) => index !== -1);\n\tif (splitIndices.length > 0 && selector.partialAxesMatch !== void 0) throw new Error(\"Axis splitting is not supported when `partialAxesMatch` is defined.\");\n\tsplitIndices.sort((a, b) => a - b);\n\treturn splitIndices;\n}\nvar PColumnCollection = class {\n\tdefaultProviderStore = [];\n\tproviders = [new ArrayColumnsProvider(this.defaultProviderStore)];\n\taxisLabelProviders = [];\n\tconstructor() {}\n\taddColumnProvider(provider) {\n\t\tthis.providers.push(provider);\n\t\treturn this;\n\t}\n\taddAxisLabelProvider(provider) {\n\t\tthis.axisLabelProviders.push(provider);\n\t\treturn this;\n\t}\n\taddColumns(columns) {\n\t\tthis.defaultProviderStore.push(...columns);\n\t\treturn this;\n\t}\n\taddColumn(column) {\n\t\tthis.defaultProviderStore.push(column);\n\t\treturn this;\n\t}\n\t/** Fetches labels for a given axis from the registered providers */\n\tfindLabels(axis) {\n\t\tfor (const provider of this.axisLabelProviders) {\n\t\t\tconst labels = provider.findLabels(axis);\n\t\t\tif (labels) return labels;\n\t\t}\n\t}\n\tgetUniversalEntries(predicateOrSelectors, opts) {\n\t\tconst { anchorCtx, labelOps: rawLabelOps, dontWaitAllData = false, overrideLabelAnnotation = false, exclude, enrichByLinkers = false } = opts ?? {};\n\t\tconst labelOps = {\n\t\t\t...overrideLabelAnnotation && rawLabelOps?.includeNativeLabel !== false ? { includeNativeLabel: true } : {},\n\t\t\t...rawLabelOps\n\t\t};\n\t\tlet excludePredicate = () => false;\n\t\tif (exclude) {\n\t\t\tconst excludePredicartes = (Array.isArray(exclude) ? exclude : [exclude]).map((selector) => {\n\t\t\t\tif (hasAnchors(selector)) {\n\t\t\t\t\tif (!anchorCtx) throw new Error(\"Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.\");\n\t\t\t\t\treturn legacyColumnSelectorsToPredicate(resolveAnchors(anchorCtx.anchors, selector, opts));\n\t\t\t\t} else return legacyColumnSelectorsToPredicate(selector);\n\t\t\t});\n\t\t\texcludePredicate = (spec) => excludePredicartes.some((predicate) => predicate(spec));\n\t\t}\n\t\tconst selectorsArray = typeof predicateOrSelectors === \"function\" ? [predicateOrSelectors] : Array.isArray(predicateOrSelectors) ? predicateOrSelectors : [predicateOrSelectors];\n\t\tconst intermediateResults = [];\n\t\tconst selectedNativeIds = /* @__PURE__ */ new Set();\n\t\tfor (const rawSelector of selectorsArray) {\n\t\t\tconst usesAnchors = hasAnchors(rawSelector);\n\t\t\tlet currentSelector;\n\t\t\tif (usesAnchors) {\n\t\t\t\tif (!anchorCtx) throw new Error(\"Anchored selectors require an AnchoredIdDeriver to be provided in options.\");\n\t\t\t\tcurrentSelector = resolveAnchors(anchorCtx.anchors, rawSelector, opts);\n\t\t\t} else currentSelector = rawSelector;\n\t\t\tconst selectedIds = /* @__PURE__ */ new Set();\n\t\t\tconst selectedColumns = [];\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tconst providerColumns = provider.selectColumns(currentSelector);\n\t\t\t\tfor (const col of providerColumns) {\n\t\t\t\t\tif (excludePredicate(col.spec)) continue;\n\t\t\t\t\tif (selectedIds.has(col.id)) throw new Error(`Duplicate column id ${col.id} in provider ${provider.constructor.name}`);\n\t\t\t\t\tconst nativeId = deriveNativeId(col.spec);\n\t\t\t\t\tif (selectedNativeIds.has(nativeId)) continue;\n\t\t\t\t\tselectedIds.add(col.id);\n\t\t\t\t\tselectedNativeIds.add(nativeId);\n\t\t\t\t\tselectedColumns.push(col);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selectedColumns.length === 0) continue;\n\t\t\tconst splitAxisIdxs = getSplitAxisIndices(rawSelector);\n\t\t\tconst needsSplitting = splitAxisIdxs.length > 0;\n\t\t\tfor (const column of selectedColumns) {\n\t\t\t\tif (!isPColumnSpec(column.spec)) continue;\n\t\t\t\tconst originalSpec = column.spec;\n\t\t\t\tif (needsSplitting) {\n\t\t\t\t\tif (isPColumnValues(column.data)) throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${column.id}`);\n\t\t\t\t\tconst dataEntries = convertOrParsePColumnData(column.data);\n\t\t\t\t\tif (!dataEntries) {\n\t\t\t\t\t\tif (dontWaitAllData) continue;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isPartitionedDataInfoEntries(dataEntries)) throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${dataEntries.type} for column ${column.id}`);\n\t\t\t\t\tconst uniqueKeys = getUniquePartitionKeys(dataEntries);\n\t\t\t\t\tconst maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n\t\t\t\t\tif (maxSplitIdx >= dataEntries.partitionKeyLength) throw new Error(`Not enough partition keys (${dataEntries.partitionKeyLength}) for requested split axes (max index ${maxSplitIdx}) in column ${originalSpec.name}`);\n\t\t\t\t\tconst axesLabels = splitAxisIdxs.map((idx) => this.findLabels(getAxisId(originalSpec.axesSpec[idx])));\n\t\t\t\t\tconst keyCombinations = [];\n\t\t\t\t\tconst generateCombinations = (currentCombo, sAxisIdx) => {\n\t\t\t\t\t\tif (sAxisIdx >= splitAxisIdxs.length) {\n\t\t\t\t\t\t\tkeyCombinations.push([...currentCombo]);\n\t\t\t\t\t\t\tif (keyCombinations.length > 1e4) throw new Error(\"Too many key combinations, aborting.\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst axisIdx = splitAxisIdxs[sAxisIdx];\n\t\t\t\t\t\tif (axisIdx >= uniqueKeys.length) throw new Error(`Axis index ${axisIdx} out of bounds for unique keys array (length ${uniqueKeys.length}) during split key generation for column ${column.id}`);\n\t\t\t\t\t\tconst axisValues = uniqueKeys[axisIdx];\n\t\t\t\t\t\tif (!axisValues || axisValues.length === 0) {\n\t\t\t\t\t\t\tkeyCombinations.length = 0;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const val of axisValues) {\n\t\t\t\t\t\t\tcurrentCombo.push(val);\n\t\t\t\t\t\t\tgenerateCombinations(currentCombo, sAxisIdx + 1);\n\t\t\t\t\t\t\tcurrentCombo.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tgenerateCombinations([], 0);\n\t\t\t\t\tif (keyCombinations.length === 0) continue;\n\t\t\t\t\tconst newAxesSpec = [...originalSpec.axesSpec];\n\t\t\t\t\tconst splitAxisOriginalIdxs = splitAxisIdxs.map((idx) => idx);\n\t\t\t\t\tfor (let i = splitAxisIdxs.length - 1; i >= 0; i--) newAxesSpec.splice(splitAxisIdxs[i], 1);\n\t\t\t\t\tconst adjustedSpec = {\n\t\t\t\t\t\t...originalSpec,\n\t\t\t\t\t\taxesSpec: newAxesSpec\n\t\t\t\t\t};\n\t\t\t\t\tfor (const keyCombo of keyCombinations) {\n\t\t\t\t\t\tconst splitFilters = keyCombo.map((value, sAxisIdx) => {\n\t\t\t\t\t\t\tconst axisIdx = splitAxisOriginalIdxs[sAxisIdx];\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\taxisIdx,\n\t\t\t\t\t\t\t\taxisId: getAxisId(originalSpec.axesSpec[axisIdx]),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\tlabel: axesLabels[sAxisIdx]?.[value] ?? String(value)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t\tintermediateResults.push({\n\t\t\t\t\t\t\ttype: \"split\",\n\t\t\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\t\t\tadjustedSpec,\n\t\t\t\t\t\t\tdataEntries,\n\t\t\t\t\t\t\taxisFilters: splitFilters\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else intermediateResults.push({\n\t\t\t\t\ttype: \"direct\",\n\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\tadjustedSpec: originalSpec\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (intermediateResults.length === 0) return [];\n\t\tconst labeledResults = deriveLabels(intermediateResults, (entry) => ({\n\t\t\tspec: entry.spec,\n\t\t\textraTrace: entry.type === \"split\" ? splitFiltersToExtraTrace(entry.axisFilters) : void 0\n\t\t}), labelOps);\n\t\tconst result = [];\n\t\tfor (const { value: entry, label } of labeledResults) {\n\t\t\tconst { originalColumn, spec: originalSpec } = entry;\n\t\t\tconst axisFiltersTuple = splitFiltersToAxisFilter(entry.type === \"split\" ? entry.axisFilters : void 0);\n\t\t\tlet finalId;\n\t\t\tif (anchorCtx) finalId = anchorCtx.deriveS(originalSpec, axisFiltersTuple);\n\t\t\telse finalId = fallbackIdDeriver(originalColumn.id, axisFiltersTuple);\n\t\t\tlet finalSpec = { ...entry.adjustedSpec };\n\t\t\tif (overrideLabelAnnotation) finalSpec = {\n\t\t\t\t...finalSpec,\n\t\t\t\tannotations: {\n\t\t\t\t\t...finalSpec.annotations,\n\t\t\t\t\t[Annotation.Label]: label\n\t\t\t\t}\n\t\t\t};\n\t\t\tresult.push({\n\t\t\t\tid: finalId,\n\t\t\t\tspec: finalSpec,\n\t\t\t\tget data() {\n\t\t\t\t\treturn entry.type === \"split\" ? entriesToDataInfo(filterDataInfoEntries(entry.dataEntries, axisFiltersTuple)) : entry.originalColumn.data;\n\t\t\t\t},\n\t\t\t\tlabel\n\t\t\t});\n\t\t}\n\t\tconst ids = new Set(result.map((entry) => entry.id));\n\t\tif (enrichByLinkers && anchorCtx) {\n\t\t\tconst linkers = result.filter((entry) => isLinkerColumn(entry.spec));\n\t\t\tif (linkers.length === 0) return result;\n\t\t\tconst anchorAxes = Object.values(anchorCtx.anchors).flatMap((anchor) => anchor.axesSpec);\n\t\t\tconst linkerMap = LinkerMap.fromColumns(linkers.map(getColumnIdAndSpec));\n\t\t\tfunction matchAxisIdFn(linkerKeyId, sourceAxisId) {\n\t\t\t\treturn matchAxisId(linkerKeyId, sourceAxisId) || matchAxisId(sourceAxisId, linkerKeyId);\n\t\t\t}\n\t\t\tconst availableByLinkersAxes = linkerMap.getReachableByLinkersAxesFromAxes(anchorAxes, matchAxisIdFn);\n\t\t\tconst availableByLinkersColumns = this.getUniversalEntries((spec) => !isLinkerColumn(spec) && spec.axesSpec.some((columnAxisSpec) => {\n\t\t\t\tconst columnAxisId = getAxisId(columnAxisSpec);\n\t\t\t\treturn availableByLinkersAxes.some((axis) => matchAxisIdFn(getAxisId(axis), columnAxisId));\n\t\t\t}), {\n\t\t\t\tanchorCtx,\n\t\t\t\tlabelOps,\n\t\t\t\tdontWaitAllData,\n\t\t\t\toverrideLabelAnnotation,\n\t\t\t\texclude\n\t\t\t});\n\t\t\tif (availableByLinkersColumns) result.push(...availableByLinkersColumns.filter((entry) => !ids.has(entry.id)));\n\t\t}\n\t\treturn result;\n\t}\n\tgetColumns(predicateOrSelectors, opts) {\n\t\tconst entries = this.getUniversalEntries(predicateOrSelectors, {\n\t\t\toverrideLabelAnnotation: true,\n\t\t\t...opts\n\t\t});\n\t\tif (!entries) return void 0;\n\t\tconst columns = [];\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entry.data;\n\t\t\tif (!data) {\n\t\t\t\tif (opts?.dontWaitAllData) continue;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcolumns.push({\n\t\t\t\tid: entry.id,\n\t\t\t\tspec: entry.spec,\n\t\t\t\tdata\n\t\t\t});\n\t\t}\n\t\treturn columns;\n\t}\n};\n//#endregion\nexport { PColumnCollection };\n\n//# sourceMappingURL=column_collection.js.map","import { resolveRequiredServices } from \"@milaboratories/pl-model-common\";\n//#region src/services/block_services.ts\n/**\n* Services required by all V3 blocks by default.\n* Edit this when a new service should be available to all blocks.\n*\n* Standalone module to avoid circular dependencies between block_model.ts\n* and service type resolution.\n*/\nconst BLOCK_SERVICE_FLAGS = {\n\trequiresPFrameSpec: true,\n\trequiresPFrame: true,\n\trequiresDialog: true,\n\trequiresColumnsCollection: true\n};\nconst blockServiceNames = resolveRequiredServices(BLOCK_SERVICE_FLAGS);\n//#endregion\nexport { BLOCK_SERVICE_FLAGS, blockServiceNames };\n\n//# sourceMappingURL=block_services.js.map","//#region src/services/service_bridge.ts\n/**\n* Builds a lazy services object from ServiceDispatch and UiServiceRegistry.\n* Each service is instantiated on first access. Errors are cached to prevent\n* repeated factory calls on failure.\n*/\nfunction buildServices(dispatch, registry) {\n\treturn Object.create(null, Object.fromEntries(dispatch.getServiceNames().map((id) => {\n\t\tlet fetched = false;\n\t\tlet cached;\n\t\treturn [id, {\n\t\t\tenumerable: true,\n\t\t\tget() {\n\t\t\t\tif (!fetched) {\n\t\t\t\t\tfetched = true;\n\t\t\t\t\tcached = registry.get(id);\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t}];\n\t})));\n}\n/**\n* Builds a ServiceProxy from a ServiceDispatch.\n* Each service method call is forwarded to dispatch.callServiceMethod.\n*/\nfunction createServiceProxy(dispatch) {\n\treturn ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));\n}\n//#endregion\nexport { buildServices, createServiceProxy };\n\n//# sourceMappingURL=service_bridge.js.map","import { getCfgRenderCtx } from \"../internal.js\";\nimport { createServiceProxy } from \"./service_bridge.js\";\n//#region src/services/get_services.ts\nconst cachedServices = /* @__PURE__ */ new WeakMap();\nfunction getService(name, deps) {\n\tconst ctx = deps?.ctx ?? getCfgRenderCtx();\n\tconst map = cachedServices.has(ctx) ? cachedServices.get(ctx) : (() => {\n\t\tcachedServices.set(ctx, /* @__PURE__ */ new Map());\n\t\treturn cachedServices.get(ctx);\n\t})();\n\treturn map.has(name) ? map.get(name) : (() => {\n\t\tmap.set(name, createServiceProxy(ctx)(name));\n\t\treturn map.get(name);\n\t})();\n}\n//#endregion\nexport { getService };\n\n//# sourceMappingURL=get_services.js.map","//#region src/render/util/pframe_upgraders.ts\nfunction patchInSetFilters(filters) {\n\tconst inSetToOrEqual = (predicate) => {\n\t\tif (predicate.operator !== \"InSet\") return predicate;\n\t\treturn {\n\t\t\toperator: \"Or\",\n\t\t\toperands: predicate.references.map((reference) => ({\n\t\t\t\toperator: \"Equal\",\n\t\t\t\treference\n\t\t\t}))\n\t\t};\n\t};\n\tconst mapSingleValuePredicate = (filter, cb) => {\n\t\tswitch (filter.operator) {\n\t\t\tcase \"And\": return {\n\t\t\t\t...filter,\n\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t};\n\t\t\tcase \"Or\": return {\n\t\t\t\t...filter,\n\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t};\n\t\t\tcase \"Not\": return {\n\t\t\t\t...filter,\n\t\t\t\toperand: mapSingleValuePredicate(filter.operand, cb)\n\t\t\t};\n\t\t\tdefault: return cb(filter);\n\t\t}\n\t};\n\tconst mapFilter = (filter, cb) => {\n\t\treturn {\n\t\t\t...filter,\n\t\t\tpredicate: mapSingleValuePredicate(filter.predicate, cb)\n\t\t};\n\t};\n\treturn filters.map((filter) => mapFilter(filter, inSetToOrEqual));\n}\n//#endregion\nexport { patchInSetFilters };\n\n//# sourceMappingURL=pframe_upgraders.js.map","import { getPluginData } from \"../block_storage.js\";\nimport { getCfgRenderCtx } from \"../internal.js\";\nimport { TreeNodeAccessor, ifDef } from \"./accessor.js\";\nimport { MainAccessorName, StagingAccessorName } from \"./internal.js\";\nimport { deriveLabels } from \"./util/label.js\";\nimport { allPColumnsReady } from \"./util/pcolumn_data.js\";\nimport { PColumnCollection } from \"./util/column_collection.js\";\nimport { patchInSetFilters } from \"./util/pframe_upgraders.js\";\nimport { getService } from \"../services/get_services.js\";\nimport \"../services/index.js\";\nimport \"./util/index.js\";\nimport { AnchoredIdDeriver, PColumnName, ensurePColumn, extractAllColumns, isDataInfo, isPColumn, isPColumnSpec, isPlRef, legacyColumnSelectorsToPredicate, mapDataInfo, mapPObjectData, mapPTableDef, mapPTableDefV2, mapValueInVOE, parseJson, readAnnotation, visitDataInfo, withEnrichments } from \"@milaboratories/pl-model-common\";\nimport canonicalize from \"canonicalize\";\nimport { throwError } from \"@milaboratories/helpers\";\nimport { isString } from \"es-toolkit\";\n//#region src/render/api.ts\n/**\n* Helper function to match domain objects\n* @param query Optional domain to match against\n* @param target Optional domain to match\n* @returns true if domains match, false otherwise\n*/\nfunction matchDomain(query, target) {\n\tif (query === void 0) return target === void 0;\n\tif (target === void 0) return true;\n\tfor (const k in target) if (query[k] !== target[k]) return false;\n\treturn true;\n}\n/**\n* Transforms PColumn data into the internal representation expected by the platform\n* @param column Data from a PColumn to transform\n* @returns Transformed data compatible with platform API\n*/\nfunction finalizePColumnData(column) {\n\treturn mapPObjectData(column, (data) => {\n\t\tif (data instanceof TreeNodeAccessor) return data.handle;\n\t\telse if (isDataInfo(data)) {\n\t\t\tlet ready = true;\n\t\t\tvisitDataInfo(data, (accessor) => ready &&= accessor?.getIsReadyOrError() ?? false);\n\t\t\tif (!ready) return [];\n\t\t\treturn mapDataInfo(data, (accessor) => accessor?.handle ?? throwError(\"Accessor handle is undefined\"));\n\t\t} else return data ?? [];\n\t});\n}\n/**\n* @deprecated use the direct `ctx.*` methods on `RenderCtxBase` instead.\n*\n* Migration map:\n* - `getSpecs` → `ctx.getSpecs`\n* - `getSpecByRef` / `getPColumnSpecByRef` → `ctx.getSpecByRef` / `ctx.getPColumnSpecByRef`\n* - `getDataByRef` / `getPColumnByRef` → `ctx.getDataByRef` / `ctx.getPColumnByRef`\n* - `getOptions` → `ctx.getOptions`\n*\n* Eager methods `selectColumns` / `getData` / `getDataWithErrors` should be\n* replaced by `ctx.getSpecs` + on-demand `ctx.getStatusByRef` /\n* `ctx.getPColumnByRef` so that the data resource is not subscribed up-front.\n*/\nvar ResultPool = class {\n\tctx = getCfgRenderCtx();\n\tgetOptions(predicateOrSelector, opts) {\n\t\tconst predicate = typeof predicateOrSelector === \"function\" ? predicateOrSelector : legacyColumnSelectorsToPredicate(predicateOrSelector);\n\t\tconst filtered = this.getSpecs().entries.filter((s) => predicate(s.obj));\n\t\tlet labelOps = {};\n\t\tlet refsWithEnrichments = false;\n\t\tif (typeof opts !== \"undefined\") {\n\t\t\tif (typeof opts === \"function\") labelOps = opts;\n\t\t\telse if (typeof opts === \"object\") if (\"includeNativeLabel\" in opts || \"separator\" in opts || \"addLabelAsSuffix\" in opts) labelOps = opts;\n\t\t\telse {\n\t\t\t\topts = opts;\n\t\t\t\tlabelOps = opts.label ?? {};\n\t\t\t\trefsWithEnrichments = opts.refsWithEnrichments ?? false;\n\t\t\t}\n\t\t}\n\t\tif (typeof labelOps === \"object\") return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(({ value: { ref }, label }) => ({\n\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\tlabel\n\t\t}));\n\t\telse return filtered.map(({ ref, obj }) => ({\n\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\tlabel: labelOps(obj, ref)\n\t\t}));\n\t}\n\tresolveAnchorCtx(anchorsOrCtx) {\n\t\tif (anchorsOrCtx instanceof AnchoredIdDeriver) return anchorsOrCtx;\n\t\tconst resolvedAnchors = {};\n\t\tfor (const [key, value] of Object.entries(anchorsOrCtx)) if (isPlRef(value)) {\n\t\t\tconst resolvedSpec = this.getPColumnSpecByRef(value);\n\t\t\tif (!resolvedSpec) return void 0;\n\t\t\tresolvedAnchors[key] = resolvedSpec;\n\t\t} else resolvedAnchors[key] = value;\n\t\treturn new AnchoredIdDeriver(resolvedAnchors);\n\t}\n\t/**\n\t* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.\n\t*\n\t* @param anchorsOrCtx - Anchor context for column selection (same as in getCanonicalOptions)\n\t* @param predicateOrSelectors - Predicate or selectors for filtering columns (same as in getCanonicalOptions)\n\t* @param opts - Optional configuration for label generation and data waiting\n\t* @returns A PFrameHandle for the created PFrame, or undefined if any required data is missing\n\t*/\n\tgetAnchoredPColumns(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\tif (!anchorCtx) return void 0;\n\t\treturn new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getColumns(predicateOrSelectors, {\n\t\t\t...opts,\n\t\t\tanchorCtx\n\t\t});\n\t}\n\t/**\n\t* Calculates anchored identifier options for columns matching a given predicate and returns their\n\t* canonicalized representations.\n\t*\n\t* This function filters column specifications from the result pool that match the provided predicate,\n\t* creates a standardized AnchorCtx from the provided anchors, and generates a list of label-value\n\t* pairs for UI components (like dropdowns).\n\t*\n\t* @param anchorsOrCtx - Either:\n\t* - An existing AnchorCtx instance\n\t* - A record mapping anchor IDs to PColumnSpec objects\n\t* - A record mapping anchor IDs to PlRef objects (which will be resolved to PColumnSpec)\n\t* @param predicateOrSelectors - Either:\n\t* - A predicate function that takes a PColumnSpec and returns a boolean.\n\t* Only specs that return true will be included.\n\t* - An APColumnSelector object for declarative filtering, which will be\n\t* resolved against the provided anchors and matched using matchPColumn.\n\t* - An array of APColumnSelector objects - columns matching ANY selector\n\t* in the array will be included (OR operation).\n\t* @param opts - Optional configuration for label generation:\n\t* - labelOps: Optional configuration for label generation:\n\t* - includeNativeLabel: Whether to include native column labels\n\t* - separator: String to use between label parts (defaults to \" / \")\n\t* - addLabelAsSuffix: Whether to add labels as suffix instead of prefix\n\t* - dontWaitAllData: Whether to skip columns that don't have all data (if not set, will return undefined,\n\t* if at least one column that requires splitting is missing data)\n\t* @returns An array of objects with `label` (display text) and `value` (anchored ID string) properties,\n\t* or undefined if any PlRef resolution fails.\n\t*/\n\tgetCanonicalOptions(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\tif (!anchorCtx) return void 0;\n\t\tconst entries = new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(predicateOrSelectors, {\n\t\t\t...opts,\n\t\t\tanchorCtx\n\t\t});\n\t\tif (!entries) return void 0;\n\t\treturn entries.map((item) => ({\n\t\t\tvalue: item.id,\n\t\t\tlabel: item.label\n\t\t}));\n\t}\n\t/**\n\t* @deprecated use getData()\n\t*/\n\tgetDataFromResultPool() {\n\t\treturn this.getData();\n\t}\n\tgetData() {\n\t\tconst result = this.ctx.getDataFromResultPool();\n\t\treturn {\n\t\t\tisComplete: result.isComplete,\n\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\tref: e.ref,\n\t\t\t\tobj: {\n\t\t\t\t\t...e.obj,\n\t\t\t\t\tdata: new TreeNodeAccessor(e.obj.data, [e.ref.blockId, e.ref.name])\n\t\t\t\t}\n\t\t\t}))\n\t\t};\n\t}\n\t/**\n\t* @deprecated use getDataWithErrors()\n\t*/\n\tgetDataWithErrorsFromResultPool() {\n\t\treturn this.getDataWithErrors();\n\t}\n\tgetDataWithErrors() {\n\t\tconst result = this.ctx.getDataWithErrorsFromResultPool();\n\t\treturn {\n\t\t\tisComplete: result.isComplete,\n\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\tref: e.ref,\n\t\t\t\tobj: {\n\t\t\t\t\t...e.obj,\n\t\t\t\t\tdata: mapValueInVOE(e.obj.data, (handle) => new TreeNodeAccessor(handle, [e.ref.blockId, e.ref.name]))\n\t\t\t\t}\n\t\t\t}))\n\t\t};\n\t}\n\t/**\n\t* @deprecated use getSpecs()\n\t*/\n\tgetSpecsFromResultPool() {\n\t\treturn this.getSpecs();\n\t}\n\tgetSpecs() {\n\t\treturn this.ctx.getSpecsFromResultPool();\n\t}\n\t/**\n\t* @param ref a Ref\n\t* @returns data associated with the ref\n\t*/\n\tgetDataByRef(ref) {\n\t\tconst data = this.ctx.getDataFromResultPoolByRef(ref.blockId, ref.name);\n\t\tif (!data) return void 0;\n\t\treturn mapPObjectData(data, (handle) => new TreeNodeAccessor(handle, [ref.blockId, ref.name]));\n\t}\n\t/**\n\t* Returns data associated with the ref ensuring that it is a p-column.\n\t* @param ref a Ref\n\t* @returns p-column associated with the ref\n\t*/\n\tgetPColumnByRef(ref) {\n\t\tconst data = this.getDataByRef(ref);\n\t\tif (!data) return void 0;\n\t\treturn ensurePColumn(data);\n\t}\n\t/**\n\t* Returns spec associated with the ref ensuring that it is a p-column spec.\n\t* @param ref a Ref\n\t* @returns p-column spec associated with the ref\n\t*/\n\tgetPColumnSpecByRef(ref) {\n\t\tconst spec = this.getSpecByRef(ref);\n\t\tif (!spec) return void 0;\n\t\tif (!isPColumnSpec(spec)) throw new Error(`not a PColumn spec (kind = ${spec.kind})`);\n\t\treturn spec;\n\t}\n\t/**\n\t* @param ref a Ref\n\t* @returns object spec associated with the ref\n\t*/\n\tgetSpecByRef(ref) {\n\t\treturn this.ctx.getSpecFromResultPoolByRef(ref.blockId, ref.name);\n\t}\n\t/**\n\t* @param spec object specification\n\t* @returns array of data objects with compatible specs\n\t* @deprecated delete this method after Jan 1, 2025\n\t*/\n\tfindDataWithCompatibleSpec(spec) {\n\t\tconst result = [];\n\t\tout: for (const data of this.getData().entries) {\n\t\t\tif (!isPColumnSpec(data.obj.spec)) continue;\n\t\t\tconst oth = data.obj.spec;\n\t\t\tif (spec.name !== oth.name) continue;\n\t\t\tif (spec.valueType !== oth.valueType) continue;\n\t\t\tif (spec.axesSpec.length !== oth.axesSpec.length) continue;\n\t\t\tif (!matchDomain(spec.domain, oth.domain)) continue;\n\t\t\tif (!matchDomain(spec.contextDomain, oth.contextDomain)) continue;\n\t\t\tfor (let i = 0; i < spec.axesSpec.length; ++i) {\n\t\t\t\tconst qAx = spec.axesSpec[i];\n\t\t\t\tconst tAx = oth.axesSpec[i];\n\t\t\t\tif (qAx.name !== tAx.name) continue out;\n\t\t\t\tif (qAx.type !== tAx.type) continue out;\n\t\t\t\tif (!matchDomain(qAx.domain, tAx.domain)) continue out;\n\t\t\t\tif (!matchDomain(qAx.contextDomain, tAx.contextDomain)) continue out;\n\t\t\t}\n\t\t\tresult.push(data.obj);\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Find labels data for a given axis id. It will search for a label column and return its data as a map.\n\t* @returns a map of axis value => label\n\t*/\n\tfindLabels(axis) {\n\t\tconst dataPool = this.getData();\n\t\tfor (const column of dataPool.entries) {\n\t\t\tif (!isPColumn(column.obj)) continue;\n\t\t\tconst spec = column.obj.spec;\n\t\t\tif (spec.name === PColumnName.Label && spec.axesSpec.length === 1 && spec.axesSpec[0].name === axis.name && spec.axesSpec[0].type === axis.type && matchDomain(axis.domain, spec.axesSpec[0].domain) && matchDomain(axis.contextDomain, spec.axesSpec[0].contextDomain)) {\n\t\t\t\tif (column.obj.data.resourceType.name !== \"PColumnData/Json\") throw Error(`Expected JSON column for labels, got: ${column.obj.data.resourceType.name}`);\n\t\t\t\treturn Object.fromEntries(Object.entries(column.obj.data.getDataAsJson().data).map((e) => [JSON.parse(e[0])[0], e[1]]));\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Selects columns based on the provided selectors, returning PColumn objects\n\t* with lazily loaded data.\n\t*\n\t* @param selectors - A predicate function, a single selector, or an array of selectors.\n\t* @returns An array of PColumn objects matching the selectors. Data is loaded on first access.\n\t* @deprecated use `RenderCtxBase.rawResultPool` + `ResultPoolColumnsProvider` +\n\t* `discoverColumns` instead. This eager path materializes column data\n\t* unnecessarily for callers that only filter by spec.\n\t*/\n\tselectColumns(selectors) {\n\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\treturn this.getSpecs().entries.filter(({ obj: spec }) => {\n\t\t\tif (!isPColumnSpec(spec)) return false;\n\t\t\treturn predicate(spec);\n\t\t}).map(({ ref, obj: spec }) => {\n\t\t\tconst pcolumnSpec = spec;\n\t\t\tlet _cachedData = null;\n\t\t\tconst self = this;\n\t\t\treturn {\n\t\t\t\tid: canonicalize(ref),\n\t\t\t\tspec: pcolumnSpec,\n\t\t\t\tget data() {\n\t\t\t\t\tif (_cachedData !== null) return _cachedData;\n\t\t\t\t\t_cachedData = self.getPColumnByRef(ref)?.data;\n\t\t\t\t\treturn _cachedData;\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Find labels data for a given axis id of a p-column.\n\t* @returns a map of axis value => label\n\t*/\n\tfindLabelsForColumnAxis(column, axisIdx) {\n\t\tconst labels = this.findLabels(column.axesSpec[axisIdx]);\n\t\tif (!labels) return void 0;\n\t\tconst axisKeys = readAnnotation(column, `pl7.app/axisKeys/${axisIdx}`);\n\t\tif (axisKeys !== void 0) {\n\t\t\tconst keys = JSON.parse(axisKeys);\n\t\t\treturn Object.fromEntries(keys.map((key) => {\n\t\t\t\treturn [key, labels[key] ?? \"Unlabelled\"];\n\t\t\t}));\n\t\t} else return labels;\n\t}\n};\n/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) */\nvar RenderCtxBase = class {\n\tctx;\n\tconstructor() {\n\t\tthis.ctx = getCfgRenderCtx();\n\t}\n\tdataCache;\n\tget data() {\n\t\tif (this.dataCache === void 0) {\n\t\t\tconst raw = this.ctx.data;\n\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\tthis.dataCache = { v: value ? JSON.parse(value) : {} };\n\t\t}\n\t\treturn this.dataCache.v;\n\t}\n\tactiveArgsCache;\n\t/**\n\t* Returns args snapshot the block was executed for (i.e. when \"Run\" button was pressed).\n\t* Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.\n\t* */\n\tget activeArgs() {\n\t\tif (this.activeArgsCache === void 0) {\n\t\t\tconst raw = this.ctx.activeArgs;\n\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\tthis.activeArgsCache = { v: value ? JSON.parse(value) : void 0 };\n\t\t}\n\t\treturn this.activeArgsCache.v;\n\t}\n\tgetService(name) {\n\t\treturn getService(name);\n\t}\n\tgetNamedAccessor(name) {\n\t\treturn ifDef(this.ctx.getAccessorHandleByName(name), (accessor) => new TreeNodeAccessor(accessor, [name]));\n\t}\n\tget prerun() {\n\t\treturn this.getNamedAccessor(StagingAccessorName);\n\t}\n\tget outputs() {\n\t\treturn this.getNamedAccessor(MainAccessorName);\n\t}\n\t/** @deprecated use `rawResultPool` + `ResultPoolColumnsProvider` instead. */\n\tresultPool = new ResultPool();\n\tpatchPTableDef(def) {\n\t\tif (!this.ctx.featureFlags?.pTablePartitionFiltersSupport) def = {\n\t\t\t...def,\n\t\t\tpartitionFilters: [],\n\t\t\tfilters: [...def.partitionFilters, ...def.filters]\n\t\t};\n\t\tif (!this.ctx.featureFlags?.pFrameInSetFilterSupport) def = {\n\t\t\t...def,\n\t\t\tpartitionFilters: patchInSetFilters(def.partitionFilters),\n\t\t\tfilters: patchInSetFilters(def.filters)\n\t\t};\n\t\treturn def;\n\t}\n\tcreatePFrame(def) {\n\t\treturn this.ctx.createPFrame(def.map((v) => isString(v) ? v : finalizePColumnData(v)));\n\t}\n\tcreatePTable(def) {\n\t\tlet rawDef;\n\t\tif (\"columns\" in def) rawDef = this.patchPTableDef({\n\t\t\tsrc: {\n\t\t\t\ttype: \"full\",\n\t\t\t\tentries: def.columns.map((c) => ({\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tcolumn: c\n\t\t\t\t}))\n\t\t\t},\n\t\t\tpartitionFilters: def.filters ?? [],\n\t\t\tfilters: [],\n\t\t\tsorting: def.sorting ?? []\n\t\t});\n\t\telse rawDef = this.patchPTableDef(def);\n\t\tif (!allPColumnsReady(extractAllColumns(rawDef.src))) return void 0;\n\t\treturn this.ctx.createPTable(mapPTableDef(rawDef, finalizePColumnData));\n\t}\n\tcreatePTableV2(def) {\n\t\treturn this.ctx.createPTableV2(mapPTableDefV2(def, { column: (v) => isString(v) ? v : finalizePColumnData(v) }));\n\t}\n\tgetCurrentUnstableMarker() {\n\t\treturn this.ctx.getCurrentUnstableMarker();\n\t}\n\tlogInfo(msg) {\n\t\tthis.ctx.logInfo(msg);\n\t}\n\tlogWarn(msg) {\n\t\tthis.ctx.logWarn(msg);\n\t}\n\tlogError(msg) {\n\t\tthis.ctx.logError(msg);\n\t}\n};\n/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) for v3+ blocks */\nvar BlockRenderCtx = class extends RenderCtxBase {\n\targsCache;\n\tget args() {\n\t\tif (this.argsCache === void 0) {\n\t\t\tconst raw = this.ctx.args;\n\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\tthis.argsCache = { v: value === void 0 ? void 0 : JSON.parse(value) };\n\t\t}\n\t\treturn this.argsCache.v;\n\t}\n};\n/** Render context for legacy v1/v2 blocks - provides backward compatibility */\nvar RenderCtxLegacy = class extends RenderCtxBase {\n\targsCache;\n\tget args() {\n\t\tif (this.argsCache === void 0) {\n\t\t\tconst raw = this.ctx.args;\n\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\tthis.argsCache = { v: JSON.parse(value) };\n\t\t}\n\t\treturn this.argsCache.v;\n\t}\n\tuiStateCache;\n\tget uiState() {\n\t\tif (this.uiStateCache === void 0) {\n\t\t\tconst raw = this.ctx.uiState;\n\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\tthis.uiStateCache = { v: value ? JSON.parse(value) : {} };\n\t\t}\n\t\treturn this.uiStateCache.v;\n\t}\n};\n/**\n* Render context for plugin output functions.\n* Reads plugin data from blockStorage and derives params from pre-wrapped input callbacks.\n*\n* Parameterized on the factory-like phantom F so that getPluginData returns\n* InferFactoryData<F> directly — no casts needed for the data getter.\n*\n* @typeParam F - PluginFactoryLike phantom carrying data/params/outputs types\n*/\nvar PluginRenderCtx = class extends RenderCtxBase {\n\thandle;\n\twrappedInputs;\n\tconstructor(handle, wrappedInputs) {\n\t\tsuper();\n\t\tthis.handle = handle;\n\t\tthis.wrappedInputs = wrappedInputs;\n\t}\n\tpluginDataCache;\n\t/** Plugin's persistent data from blockStorage.__plugins.{pluginId}.__data */\n\tget data() {\n\t\tif (this.pluginDataCache === void 0) {\n\t\t\tconst raw = this.ctx.blockStorage();\n\t\t\tthis.pluginDataCache = { v: getPluginData(parseJson(raw), this.handle) };\n\t\t}\n\t\treturn this.pluginDataCache.v;\n\t}\n\tparamsCache;\n\t/** Params derived from block context via pre-wrapped input callbacks */\n\tget params() {\n\t\tif (this.paramsCache === void 0) {\n\t\t\tconst result = {};\n\t\t\tfor (const [key, fn] of Object.entries(this.wrappedInputs)) result[key] = fn();\n\t\t\tthis.paramsCache = { v: result };\n\t\t}\n\t\treturn this.paramsCache.v;\n\t}\n};\n//#endregion\nexport { BlockRenderCtx, PluginRenderCtx, RenderCtxBase, RenderCtxLegacy, ResultPool, finalizePColumnData };\n\n//# sourceMappingURL=api.js.map","//#region package.json\nvar version = \"1.80.8\";\n//#endregion\nexport { version };\n\n//# sourceMappingURL=package.js.map","import { version } from \"./package.js\";\n//#region src/version.ts\nconst PlatformaSDKVersion = version;\nconst CurrentSdkInfo = { sdkVersion: PlatformaSDKVersion };\n//#endregion\nexport { CurrentSdkInfo, PlatformaSDKVersion };\n\n//# sourceMappingURL=version.js.map","//#region src/bconfig/types.ts\nfunction isConfigLambda(cfgOrFh) {\n\treturn cfgOrFh.__renderLambda === true;\n}\n//#endregion\nexport { isConfigLambda };\n\n//# sourceMappingURL=types.js.map","import { BlockStorageFacadeHandles } from \"../block_storage_facade.js\";\nimport { isConfigLambda } from \"./types.js\";\nimport { extractConfigGeneric } from \"@milaboratories/pl-model-common\";\n//#region src/bconfig/normalization.ts\nfunction downgradeCfgOrLambda(data) {\n\tif (data === void 0) return void 0;\n\tif (isConfigLambda(data)) return data.handle;\n\treturn data;\n}\nfunction extractConfig(cfg) {\n\tconst config = extractConfigGeneric(cfg);\n\tif (config.configVersion === 4 && Object.keys(config.blockLifecycleCallbacks).length === 0) config.blockLifecycleCallbacks = BlockStorageFacadeHandles;\n\treturn config;\n}\n//#endregion\nexport { downgradeCfgOrLambda, extractConfig };\n\n//# sourceMappingURL=normalization.js.map","import { DataModelBuilder } from \"./block_migrations.js\";\nimport { DATA_MODEL_LEGACY_VERSION } from \"./block_storage.js\";\n//#region src/plugin_model.ts\n/** Symbol for internal builder creation method */\nconst FROM_BUILDER = Symbol(\"fromBuilder\");\n/** Internal plugin↔block handshake. `Symbol.for` (not `Symbol`) so it stays\n* identical across multiple `@platforma-sdk/model` copies in one process. */\nconst CREATE_PLUGIN_MODEL = Symbol.for(\"@platforma-sdk/model:createPluginModel\");\n/** Sentinel for PluginInstance without transferAt — no transfer possible. */\nconst NO_TRANSFER_VERSION = \"\";\n/**\n* Plugin data model with typed migration chain and config-aware initialization.\n*\n* @typeParam Data - Current (latest) plugin data type\n* @typeParam Versions - Map of version keys to their data types (accumulated by the chain)\n* @typeParam Config - Config type passed to init function (undefined if none)\n*/\nvar PluginDataModel = class PluginDataModel {\n\tdataModel;\n\tconfigInitFn;\n\tconstructor(dataModel, configInitFn) {\n\t\tthis.dataModel = dataModel;\n\t\tthis.configInitFn = configInitFn;\n\t}\n\t/** @internal */\n\tstatic [FROM_BUILDER](dataModel, configInitFn) {\n\t\treturn new PluginDataModel(dataModel, configInitFn);\n\t}\n\t/** Create fresh data with optional config. */\n\tgetDefaultData(config) {\n\t\tconst data = this.configInitFn(config);\n\t\treturn {\n\t\t\tversion: this.dataModel.version,\n\t\t\tdata\n\t\t};\n\t}\n};\n/**\n* Builder for creating PluginDataModel with type-safe migrations.\n* Mirrors DataModelBuilder — same .from(), .migrate(), .recover(), .init() chain.\n*\n* @example\n* const pluginData = new PluginDataModelBuilder()\n* .from<TableData>(\"v1\")\n* .migrate<FilteredTableData>(\"v2\", (v1) => ({ ...v1, filters: [] }))\n* .init<TableConfig>((config?) => ({\n* state: createDefaultState(config?.ops),\n* filters: [],\n* }));\n*/\nvar PluginDataModelBuilder = class {\n\tfrom(version) {\n\t\treturn PluginDataModelInitialChain[FROM_BUILDER]({\n\t\t\tinitialVersion: version,\n\t\t\tmigrations: []\n\t\t});\n\t}\n};\n/**\n* Chain returned by .migrate(). Supports .migrate(), .recover(), .init().\n* No .upgradeLegacy() — that is only available on the initial chain.\n*/\nvar PluginDataModelChain = class PluginDataModelChain {\n\tstate;\n\tconstructor(state) {\n\t\tthis.state = state;\n\t}\n\t/** @internal */\n\tstatic [FROM_BUILDER](state) {\n\t\treturn new PluginDataModelChain(state);\n\t}\n\t/**\n\t* Add a migration step transforming data from the current version to the next.\n\t*/\n\tmigrate(version, fn) {\n\t\treturn PluginDataModelChain[FROM_BUILDER]({\n\t\t\t...this.state,\n\t\t\tmigrations: [...this.state.migrations, {\n\t\t\t\ttoVersion: version,\n\t\t\t\tfn\n\t\t\t}]\n\t\t});\n\t}\n\t/**\n\t* Set a recovery handler for unknown or legacy versions.\n\t* Can only be called once — the returned chain has no recover() method.\n\t*/\n\trecover(fn) {\n\t\treturn PluginDataModelWithRecover[FROM_BUILDER]({\n\t\t\t...this.state,\n\t\t\trecoverFn: fn,\n\t\t\trecoverAtIndex: this.state.migrations.length\n\t\t});\n\t}\n\t/** Finalize the PluginDataModel. */\n\tinit(fn) {\n\t\treturn buildPluginDataModel(this.state, fn);\n\t}\n};\n/**\n* Initial chain returned by new PluginDataModelBuilder().from().\n* Extends PluginDataModelChain with .upgradeLegacy() — available only before\n* any .migrate() calls, matching the block's DataModelInitialChain pattern.\n*/\nvar PluginDataModelInitialChain = class PluginDataModelInitialChain extends PluginDataModelChain {\n\t/** @internal */\n\tstatic [FROM_BUILDER](state) {\n\t\treturn new PluginDataModelInitialChain(state);\n\t}\n\t/**\n\t* Handle data from a previous plugin type occupying this slot.\n\t* Prepends a migration from DATA_MODEL_LEGACY_VERSION to the initial version.\n\t* When a plugin type changes, the old data arrives with DATA_MODEL_LEGACY_VERSION —\n\t* this function transforms it into the initial version, then the normal chain runs.\n\t*\n\t* Must be called right after .from() — not available after .migrate().\n\t* Mutually exclusive with recover().\n\t*\n\t* @param fn - Transform from old plugin's raw data to this plugin's initial data type\n\t*/\n\tupgradeLegacy(fn) {\n\t\treturn PluginDataModelWithRecover[FROM_BUILDER]({\n\t\t\t...this.state,\n\t\t\tmigrations: [{\n\t\t\t\ttoVersion: this.state.initialVersion,\n\t\t\t\tfn\n\t\t\t}, ...this.state.migrations],\n\t\t\tinitialVersion: DATA_MODEL_LEGACY_VERSION\n\t\t});\n\t}\n};\n/**\n* Chain after .recover() — supports .migrate(), .init(). No second recover().\n*/\nvar PluginDataModelWithRecover = class PluginDataModelWithRecover {\n\tstate;\n\tconstructor(state) {\n\t\tthis.state = state;\n\t}\n\t/** @internal */\n\tstatic [FROM_BUILDER](state) {\n\t\treturn new PluginDataModelWithRecover(state);\n\t}\n\tmigrate(version, fn) {\n\t\treturn PluginDataModelWithRecover[FROM_BUILDER]({\n\t\t\t...this.state,\n\t\t\tmigrations: [...this.state.migrations, {\n\t\t\t\ttoVersion: version,\n\t\t\t\tfn\n\t\t\t}]\n\t\t});\n\t}\n\tinit(fn) {\n\t\treturn buildPluginDataModel(this.state, fn);\n\t}\n};\n/**\n* Builds a PluginDataModel by replaying the stored chain state through DataModelBuilder.\n* @internal\n*/\nfunction buildPluginDataModel(state, configInitFn) {\n\tlet chain = new DataModelBuilder().from(state.initialVersion);\n\tfor (let i = 0; i < state.migrations.length; i++) {\n\t\tif (state.recoverFn !== void 0 && state.recoverAtIndex === i) chain = chain.recover(state.recoverFn);\n\t\tchain = chain.migrate(state.migrations[i].toVersion, state.migrations[i].fn);\n\t}\n\tif (state.recoverFn !== void 0 && state.recoverAtIndex === state.migrations.length) chain = chain.recover(state.recoverFn);\n\tconst dataModel = chain.init(() => configInitFn());\n\treturn PluginDataModel[FROM_BUILDER](dataModel, configInitFn);\n}\n/**\n* A named plugin instance created by `factory.create({ pluginId, ... })`.\n* Passed to both `.transfer()` (on migration chain) and `.plugin()` (on BlockModelV3).\n* Implements TransferTarget so the migration chain can accept it.\n*\n* @typeParam Id - Plugin instance ID literal type\n* @typeParam Data - Plugin data type\n* @typeParam Params - Plugin params type\n* @typeParam Outputs - Plugin outputs type\n* @typeParam TransferData - Type of data entering the plugin via transfer (never if no transfer)\n*/\nvar PluginInstance = class PluginInstance {\n\tid;\n\ttransferVersion;\n\t/** @internal Phantom for type inference; never set at runtime. */\n\t__instanceTypes;\n\t/** Bound closure that creates the PluginModel. Config is captured at factory.create() time. */\n\tcreatePluginModel;\n\tconstructor(id, createPluginModel, transferVersion) {\n\t\tthis.id = id;\n\t\tthis.createPluginModel = createPluginModel;\n\t\tthis.transferVersion = transferVersion;\n\t}\n\t/** @internal Accepts concrete Config — binds it into a closure, avoiding Config variance issues. */\n\tstatic [FROM_BUILDER](id, factory, transferVersion, config) {\n\t\treturn new PluginInstance(id, () => factory[CREATE_PLUGIN_MODEL](config), transferVersion);\n\t}\n\t/** @internal Create a PluginModel from this instance. Used by BlockModelV3.plugin(). */\n\t[CREATE_PLUGIN_MODEL]() {\n\t\treturn this.createPluginModel();\n\t}\n};\n/**\n* Configured plugin instance returned by PluginModelFactory[CREATE_PLUGIN_MODEL]().\n* Contains the plugin's name, data model, and output definitions.\n*/\nvar PluginModel = class PluginModel {\n\t/** Globally unique plugin name */\n\tname;\n\t/** Data model instance for this plugin */\n\tdataModel;\n\t/** Output definitions - functions that compute outputs from plugin context */\n\toutputs;\n\t/** Feature flags declared by this plugin */\n\tfeatureFlags;\n\t/** Create fresh default data. Config (if any) is captured at creation time. */\n\tgetDefaultData;\n\t/** Public output definitions — accessible without usePlugin() via app.plugins */\n\tpublicOutputDef;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.dataModel = options.dataModel;\n\t\tthis.outputs = options.outputs;\n\t\tthis.featureFlags = options.featureFlags;\n\t\tthis.getDefaultData = options.getDefaultData;\n\t\tthis.publicOutputDef = options.publicOutputDef;\n\t}\n\t/**\n\t* Internal method for creating PluginModel from factory.\n\t* Uses Symbol key to prevent external access.\n\t* @internal\n\t*/\n\tstatic [FROM_BUILDER](options) {\n\t\treturn new PluginModel(options);\n\t}\n\tstatic define(options) {\n\t\tif (options.data instanceof PluginDataModel) {\n\t\t\tconst pdm = options.data;\n\t\t\treturn PluginModelInitialBuilder.create({\n\t\t\t\tname: options.name,\n\t\t\t\tdataFn: () => pdm.dataModel,\n\t\t\t\tgetDefaultDataFn: (config) => pdm.getDefaultData(config),\n\t\t\t\tfeatureFlags: options.featureFlags\n\t\t\t});\n\t\t}\n\t\treturn PluginModelInitialBuilder.create({\n\t\t\tname: options.name,\n\t\t\tdataFn: options.data,\n\t\t\tfeatureFlags: options.featureFlags\n\t\t});\n\t}\n};\nvar PluginModelFactory = class PluginModelFactory {\n\tname;\n\tdataFn;\n\tgetDefaultDataFn;\n\toutputs;\n\tfeatureFlags;\n\tpublicOutputDef;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.dataFn = options.dataFn;\n\t\tthis.getDefaultDataFn = options.getDefaultDataFn;\n\t\tthis.outputs = options.outputs;\n\t\tthis.featureFlags = options.featureFlags;\n\t\tthis.publicOutputDef = options.publicOutputDef;\n\t}\n\t/** @internal */\n\tstatic [FROM_BUILDER](options) {\n\t\treturn new PluginModelFactory(options);\n\t}\n\tcreate(options) {\n\t\tconst transferVersion = options.transferAt ?? NO_TRANSFER_VERSION;\n\t\treturn PluginInstance[FROM_BUILDER](options.pluginId, this, transferVersion, options.config);\n\t}\n\t/** @internal Create a PluginModel from config. Config is captured in getDefaultData closure. */\n\t[CREATE_PLUGIN_MODEL](config) {\n\t\tconst dataModel = this.dataFn(config);\n\t\tconst getDefaultDataFn = this.getDefaultDataFn;\n\t\treturn PluginModel[FROM_BUILDER]({\n\t\t\tname: this.name,\n\t\t\tdataModel,\n\t\t\toutputs: this.outputs,\n\t\t\tfeatureFlags: this.featureFlags,\n\t\t\tgetDefaultData: getDefaultDataFn ? () => getDefaultDataFn(config) : () => dataModel.getDefaultData(),\n\t\t\tpublicOutputDef: this.publicOutputDef\n\t\t});\n\t}\n};\n/**\n* Builder for creating PluginType with type-safe output definitions.\n*\n* Use `PluginModel.define()` to create a builder instance.\n*\n* @typeParam Data - Plugin's persistent data type\n* @typeParam Params - Params derived from block's RenderCtx (optional)\n* @typeParam Config - Static configuration passed to plugin factory (optional)\n* @typeParam Outputs - Accumulated output types\n* @typeParam Versions - Version map from PluginDataModel (empty for function-based data)\n*\n* @example\n* const dataTable = PluginModel.define({\n* name: 'dataTable' as PluginName,\n* data: pluginDataModel,\n* })\n* .output('model', (ctx) => createTableModel(ctx))\n* .build();\n*/\nvar PluginModelBuilder = class PluginModelBuilder {\n\tname;\n\tdataFn;\n\tgetDefaultDataFn;\n\toutputs;\n\tfeatureFlags;\n\tpublicOutputDef;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.dataFn = options.dataFn;\n\t\tthis.getDefaultDataFn = options.getDefaultDataFn;\n\t\tthis.outputs = options.outputs ?? {};\n\t\tthis.featureFlags = options.featureFlags;\n\t\tthis.publicOutputDef = options.publicOutputDef;\n\t}\n\t/** @internal */\n\tstatic [FROM_BUILDER](options) {\n\t\treturn new PluginModelBuilder(options);\n\t}\n\t/**\n\t* Adds an output to the plugin.\n\t* All plugin outputs are always wrapped with status — the UI receives\n\t* {@link OutputWithStatus} for every output, allowing it to distinguish\n\t* between pending, success, and error states.\n\t*\n\t* @param key - Output name\n\t* @param fn - Function that computes the output value from plugin context\n\t* @returns Builder with the new output added\n\t*\n\t* @example\n\t* .output('model', (ctx) => createModel(ctx.params.columns, ctx.data.state))\n\t* .output('pFrame', (ctx) => ctx.createPFrame([...]))\n\t*/\n\toutput(key, fn) {\n\t\treturn new PluginModelBuilder({\n\t\t\tname: this.name,\n\t\t\tdataFn: this.dataFn,\n\t\t\tgetDefaultDataFn: this.getDefaultDataFn,\n\t\t\tfeatureFlags: this.featureFlags,\n\t\t\toutputs: {\n\t\t\t\t...this.outputs,\n\t\t\t\t[key]: fn\n\t\t\t},\n\t\t\tpublicOutputDef: this.publicOutputDef\n\t\t});\n\t}\n\t/**\n\t* Exposes a plugin data field as a public output — accessible without `usePlugin()`\n\t* via `app.plugins.pluginName.publicOutputs.key`.\n\t*\n\t* The getter runs against the plugin's reactive data object.\n\t* Public outputs are read-only.\n\t*\n\t* @param key - Name of the public output field\n\t* @param getter - Function deriving the value from plugin data\n\t*\n\t* @example\n\t* .publicOutput('selection', (d) => d.selection)\n\t*/\n\tpublicOutput(key, getter) {\n\t\treturn new PluginModelBuilder({\n\t\t\tname: this.name,\n\t\t\tdataFn: this.dataFn,\n\t\t\tgetDefaultDataFn: this.getDefaultDataFn,\n\t\t\tfeatureFlags: this.featureFlags,\n\t\t\toutputs: this.outputs,\n\t\t\tpublicOutputDef: {\n\t\t\t\t...this.publicOutputDef,\n\t\t\t\t[key]: { getter }\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Finalizes the plugin definition and returns a PluginFactory.\n\t*\n\t* @returns Plugin factory that creates named plugin instances via .create()\n\t*\n\t* @example\n\t* const myPlugin = PluginModel.define({ ... })\n\t* .output('value', (ctx) => ctx.data.value)\n\t* .build();\n\t*\n\t* // Create a named instance:\n\t* const table = myPlugin.create({ pluginId: 'mainTable', config: { ... } });\n\t*/\n\tbuild() {\n\t\treturn PluginModelFactory[FROM_BUILDER]({\n\t\t\tname: this.name,\n\t\t\tdataFn: this.dataFn,\n\t\t\tgetDefaultDataFn: this.getDefaultDataFn,\n\t\t\toutputs: this.outputs,\n\t\t\tpublicOutputDef: this.publicOutputDef,\n\t\t\tfeatureFlags: this.featureFlags\n\t\t});\n\t}\n};\n/**\n* Initial builder returned by PluginModel.define(). Extends PluginModelBuilder with .params().\n* Once .params() or .output() is called, transitions to PluginModelBuilder (no second .params()).\n*/\nvar PluginModelInitialBuilder = class PluginModelInitialBuilder extends PluginModelBuilder {\n\t/** @internal */\n\tstatic create(options) {\n\t\treturn new PluginModelInitialBuilder({\n\t\t\t...options,\n\t\t\tpublicOutputDef: {}\n\t\t});\n\t}\n\t/**\n\t* Sets the Params type for this plugin — the shape of data derived from the block's\n\t* render context and passed into plugin output functions via `ctx.params`.\n\t* Must be called before .output(). Available only on the initial builder.\n\t*\n\t* @example\n\t* .params<{ title: string }>()\n\t* .output('displayText', (ctx) => ctx.params.title)\n\t*/\n\tparams() {\n\t\treturn PluginModelBuilder[FROM_BUILDER]({\n\t\t\tname: this.name,\n\t\t\tdataFn: this.dataFn,\n\t\t\tgetDefaultDataFn: this.getDefaultDataFn,\n\t\t\tfeatureFlags: this.featureFlags,\n\t\t\tpublicOutputDef: {}\n\t\t});\n\t}\n};\n//#endregion\nexport { CREATE_PLUGIN_MODEL, PluginDataModel, PluginDataModelBuilder, PluginDataModelChain, PluginDataModelInitialChain, PluginDataModelWithRecover, PluginInstance, PluginModel };\n\n//# sourceMappingURL=plugin_model.js.map","import { BLOCK_STORAGE_KEY, createBlockStorage, getStorageData, isBlockStorage, migrateBlockStorage, normalizeBlockStorage, updateStorageData } from \"./block_storage.js\";\nimport { stringifyJson } from \"@milaboratories/pl-model-common\";\n//#region src/block_storage_callbacks.ts\n/**\n* BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().\n*\n* Provides pure functions for storage operations (migration, initialization,\n* args derivation, updates, debug views). Each function takes its dependencies\n* explicitly as parameters.\n*\n* @module block_storage_callbacks\n* @internal\n*/\n/**\n* Normalizes raw storage data and extracts state.\n* Handles all formats:\n* - New BlockStorage format (has discriminator)\n* - Legacy V1/V2 format ({ args, uiState })\n* - Raw V3 state (any other format)\n*\n* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n* @returns Object with normalized storage and extracted state\n*/\nfunction normalizeStorage(rawStorage) {\n\tif (rawStorage === void 0 || rawStorage === null) return {\n\t\tstorage: createBlockStorage({}),\n\t\tdata: {}\n\t};\n\tlet parsed = rawStorage;\n\tif (typeof rawStorage === \"string\") try {\n\t\tparsed = JSON.parse(rawStorage);\n\t} catch {\n\t\treturn {\n\t\t\tstorage: createBlockStorage(rawStorage),\n\t\t\tdata: rawStorage\n\t\t};\n\t}\n\tif (isBlockStorage(parsed)) {\n\t\tconst storage = normalizeBlockStorage(parsed);\n\t\treturn {\n\t\t\tstorage,\n\t\t\tdata: getStorageData(storage)\n\t\t};\n\t}\n\tif (isLegacyModelV1ApiFormat(parsed)) return {\n\t\tstorage: createBlockStorage(parsed),\n\t\tdata: parsed\n\t};\n\treturn {\n\t\tstorage: createBlockStorage(parsed),\n\t\tdata: parsed\n\t};\n}\n/**\n* Applies a state update to existing storage.\n* Used when setData is called from the frontend.\n*\n* @param currentStorageJson - Current storage as JSON string (must be defined)\n* @param payload - Update payload with operation type and value\n* @returns Updated storage as StringifiedJson<BlockStorage>\n*/\nfunction applyStorageUpdate(currentStorageJson, payload) {\n\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\treturn stringifyJson(updateStorageData(currentStorage, payload));\n}\n/**\n* Checks if data is in legacy Model API v1 format.\n* Legacy format has { args, uiState? } at top level without the BlockStorage discriminator.\n*/\nfunction isLegacyModelV1ApiFormat(data) {\n\tif (data === null || typeof data !== \"object\") return false;\n\tif (isBlockStorage(data)) return false;\n\treturn \"args\" in data;\n}\n/**\n* Gets storage debug view from raw storage data.\n* Returns structured debug info about the storage state.\n*\n* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n* @returns JSON string with storage debug view\n*/\nfunction getStorageDebugView(rawStorage) {\n\tconst { storage } = normalizeStorage(rawStorage);\n\treturn stringifyJson({\n\t\tdataVersion: storage.__dataVersion,\n\t\tdata: storage.__data\n\t});\n}\n/**\n* Runs storage migration using the provided hooks.\n* This is the main entry point for the middle layer to trigger migrations.\n*\n* @param currentStorageJson - Current storage as JSON string (or undefined)\n* @param hooks - Migration dependencies (block/plugin data migration and creation functions)\n* @returns MigrationResult\n*/\nfunction migrateStorage(currentStorageJson, hooks) {\n\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\tconst newPluginRegistry = hooks.getPluginRegistry();\n\tconst migrationResult = migrateBlockStorage(currentStorage, {\n\t\tmigrateBlockData: hooks.migrateBlockData,\n\t\tmigratePluginData: hooks.migratePluginData,\n\t\tnewPluginRegistry,\n\t\tcreatePluginData: hooks.createPluginData\n\t});\n\tif (!migrationResult.success) return { error: `Migration failed at '${migrationResult.failedAt}': ${migrationResult.error}` };\n\tconst oldVersion = currentStorage.__dataVersion;\n\tconst newVersion = migrationResult.storage.__dataVersion;\n\tconst info = oldVersion === newVersion ? `No migration needed (${oldVersion})` : `Migrated ${oldVersion} -> ${newVersion}`;\n\treturn {\n\t\tnewStorageJson: stringifyJson(migrationResult.storage),\n\t\tinfo\n\t};\n}\n/**\n* Creates complete initial storage (block data + all plugin data) atomically.\n*\n* @param hooks - Dependencies for creating initial block and plugin data\n* @returns Initial storage as branded JSON string\n* @throws If initialDataFn or createPluginData throws\n*/\nfunction createInitialStorage(hooks) {\n\tconst blockDefault = hooks.getDefaultBlockData();\n\tconst pluginRegistry = hooks.getPluginRegistry();\n\tconst plugins = {};\n\tfor (const handle of Object.keys(pluginRegistry)) {\n\t\tconst initial = hooks.createPluginData(handle);\n\t\tplugins[handle] = {\n\t\t\t__dataVersion: initial.version,\n\t\t\t__data: initial.data\n\t\t};\n\t}\n\treturn stringifyJson({\n\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t__dataVersion: blockDefault.version,\n\t\t__data: blockDefault.data,\n\t\t__pluginRegistry: pluginRegistry,\n\t\t__plugins: plugins\n\t});\n}\n/**\n* Derives args from storage using the provided args function.\n* This extracts data from storage and passes it to the block's args() function.\n*\n* @param storageJson - Storage as JSON string\n* @param argsFunction - The block's args derivation function\n* @returns ArgsDeriveResult with derived args or error\n*/\nfunction deriveArgsFromStorage(storageJson, argsFunction) {\n\tconst { data } = normalizeStorage(storageJson);\n\ttry {\n\t\treturn { value: argsFunction(data) };\n\t} catch (e) {\n\t\treturn { error: `args() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t}\n}\n/**\n* Derives prerunArgs from storage.\n* Uses prerunArgsFunction if provided, otherwise falls back to argsFunction.\n*\n* @param storageJson - Storage as JSON string\n* @param argsFunction - The block's args derivation function (fallback)\n* @param prerunArgsFunction - Optional prerun args derivation function\n* @returns ArgsDeriveResult with derived prerunArgs or error\n*/\nfunction derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction) {\n\tconst { data } = normalizeStorage(storageJson);\n\tif (prerunArgsFunction) try {\n\t\treturn { value: prerunArgsFunction(data) };\n\t} catch (e) {\n\t\treturn { error: `prerunArgs() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t}\n\ttry {\n\t\treturn { value: argsFunction(data) };\n\t} catch (e) {\n\t\treturn { error: `args() threw (fallback): ${e instanceof Error ? e.message : String(e)}` };\n\t}\n}\n//#endregion\nexport { BLOCK_STORAGE_KEY, applyStorageUpdate, createInitialStorage, deriveArgsFromStorage, derivePrerunArgsFromStorage, getStorageDebugView, migrateStorage };\n\n//# sourceMappingURL=block_storage_callbacks.js.map","import { pluginOutputKey } from \"./plugin_handle.js\";\nimport { createAndRegisterRenderLambda, getPlatformaInstance, isInUI } from \"./internal.js\";\nimport { BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, registerFacadeCallbacks } from \"./block_storage_facade.js\";\nimport { BLOCK_SERVICE_FLAGS } from \"./services/block_services.js\";\nimport { BlockRenderCtx, PluginRenderCtx } from \"./render/api.js\";\nimport \"./render/index.js\";\nimport { PlatformaSDKVersion } from \"./version.js\";\nimport { isConfigLambda } from \"./bconfig/types.js\";\nimport { downgradeCfgOrLambda } from \"./bconfig/normalization.js\";\nimport \"./bconfig/index.js\";\nimport { CREATE_PLUGIN_MODEL } from \"./plugin_model.js\";\nimport { applyStorageUpdate, createInitialStorage, deriveArgsFromStorage, derivePrerunArgsFromStorage, getStorageDebugView, migrateStorage } from \"./block_storage_callbacks.js\";\nimport { REQUIRES_PFRAMES_VERSION } from \"@milaboratories/pl-model-common\";\n//#region src/block_model.ts\n/**\n* Merges two feature flag objects with type-aware logic:\n* - `supports*` (boolean): OR — `true` if either side is `true`\n* - `requires*` (numeric): MAX — take the higher version requirement\n*/\nfunction mergeFeatureFlags(base, override) {\n\tconst result = { ...base };\n\tfor (const [key, value] of Object.entries(override)) {\n\t\tif (value === void 0) continue;\n\t\tconst existing = result[key];\n\t\tif (typeof value === \"boolean\") result[key] = typeof existing === \"boolean\" && existing || value;\n\t\telse if (typeof value === \"number\") result[key] = Math.max(typeof existing === \"number\" ? existing : 0, value);\n\t}\n\treturn result;\n}\n/** Main entry point that each block should use in it's \"config\" module. Don't forget\n* to call {@link done()} at the end of configuration. Value returned by this builder must be\n* exported as constant with name \"platforma\" from the \"config\" module.\n* API version is 3 (for UI) and 2 (for model) */\nvar BlockModelV3 = class BlockModelV3 {\n\tconfig;\n\tconstructor(config) {\n\t\tthis.config = config;\n\t}\n\tstatic FEATURE_FLAGS = {\n\t\tsupportsLazyState: true,\n\t\tsupportsPframeQueryRanking: true,\n\t\trequiresUIAPIVersion: 3,\n\t\trequiresModelAPIVersion: 2,\n\t\trequiresCreatePTable: 2,\n\t\trequiresPFramesVersion: REQUIRES_PFRAMES_VERSION,\n\t\t...BLOCK_SERVICE_FLAGS\n\t};\n\t/** @deprecated Use FEATURE_FLAGS */\n\tstatic INITIAL_BLOCK_FEATURE_FLAGS = BlockModelV3.FEATURE_FLAGS;\n\t/**\n\t* Creates a new BlockModelV3 builder with the specified data model.\n\t*\n\t* @example\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockData>(\"v1\")\n\t* .init(() => ({ numbers: [], labels: [] }));\n\t*\n\t* BlockModelV3.create(dataModel)\n\t* .args((data) => ({ numbers: data.numbers }))\n\t* .sections(() => [{ type: 'link', href: '/', label: 'Main' }])\n\t* .done();\n\t*\n\t* @param dataModel The data model that defines initial data and migrations\n\t*/\n\tstatic create(dataModel) {\n\t\treturn new BlockModelV3({\n\t\t\trenderingMode: \"Heavy\",\n\t\t\tdataModel,\n\t\t\toutputs: {},\n\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"sections\",\n\t\t\t\tlambda: () => []\n\t\t\t}, true),\n\t\t\ttitle: void 0,\n\t\t\tsubtitle: void 0,\n\t\t\ttags: void 0,\n\t\t\tenrichmentTargets: void 0,\n\t\t\tfeatureFlags: { ...BlockModelV3.FEATURE_FLAGS },\n\t\t\targsFunction: void 0,\n\t\t\tprerunArgsFunction: void 0,\n\t\t\tplugins: {}\n\t\t});\n\t}\n\toutput(key, cfgOrRf, flags = {}) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\toutputs: {\n\t\t\t\t...this.config.outputs,\n\t\t\t\t[key]: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: `block-output#${key}`,\n\t\t\t\t\tlambda: () => cfgOrRf(new BlockRenderCtx()),\n\t\t\t\t\t...flags\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\t}\n\t/** Shortcut for {@link output} with retentive flag set to true. */\n\tretentiveOutput(key, rf) {\n\t\treturn this.output(key, rf, { retentive: true });\n\t}\n\t/** Shortcut for {@link output} with withStatus flag set to true. */\n\toutputWithStatus(key, rf) {\n\t\treturn this.output(key, rf, { withStatus: true });\n\t}\n\t/**\n\t* Sets a function to derive block args from data.\n\t* This is called during setData to compute the args that will be used for block execution.\n\t*\n\t* @example\n\t* .args<BlockArgs>((data) => ({ numbers: data.numbers }))\n\t*\n\t* @example\n\t* .args<BlockArgs>((data) => {\n\t* if (data.numbers.length === 0) throw new Error('Numbers required'); // block not ready\n\t* return { numbers: data.numbers };\n\t* })\n\t*/\n\targs(lambda) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\targsFunction: lambda\n\t\t});\n\t}\n\t/**\n\t* Sets a function to derive pre-run args from data (optional).\n\t* This is called during setData to compute the args that will be used for staging/pre-run phase.\n\t*\n\t* If not defined, defaults to using the args() function result.\n\t* If defined, uses its return value for the staging / prerun phase.\n\t*\n\t* The staging / prerun phase runs only if currentPrerunArgs differs from the executed\n\t* version of prerunArgs (same comparison logic as currentArgs vs prodArgs).\n\t*\n\t* @example\n\t* .prerunArgs((data) => ({ numbers: data.numbers }))\n\t*\n\t* @example\n\t* .prerunArgs((data) => {\n\t* // Return undefined to skip staging for this block\n\t* if (!data.isReady) return undefined;\n\t* return { numbers: data.numbers };\n\t* })\n\t*/\n\tprerunArgs(fn) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tprerunArgsFunction: fn\n\t\t});\n\t}\n\t/** Sets the lambda to generate list of sections in the left block overviews panel. */\n\tsections(rf) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"sections\",\n\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t}, true)\n\t\t});\n\t}\n\t/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */\n\ttitle(rf) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\ttitle: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"title\",\n\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t})\n\t\t});\n\t}\n\tsubtitle(rf) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tsubtitle: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"subtitle\",\n\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t})\n\t\t});\n\t}\n\ttags(rf) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\ttags: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"tags\",\n\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t})\n\t\t});\n\t}\n\t/** Sets or overrides feature flags for the block. */\n\twithFeatureFlags(flags) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tfeatureFlags: {\n\t\t\t\t...this.config.featureFlags,\n\t\t\t\t...flags\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.\n\t* Influences dependency graph construction.\n\t*/\n\tenriches(lambda) {\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tenrichmentTargets: createAndRegisterRenderLambda({\n\t\t\t\thandle: \"enrichmentTargets\",\n\t\t\t\tlambda\n\t\t\t})\n\t\t});\n\t}\n\tplugin(instance, params) {\n\t\tconst pluginId = instance.id;\n\t\tconst plugin = instance[CREATE_PLUGIN_MODEL]();\n\t\tconst resolvedParams = params ?? {};\n\t\tif (pluginId in this.config.plugins) throw new Error(`Plugin '${pluginId}' already registered`);\n\t\tconst registered = {\n\t\t\tmodel: plugin,\n\t\t\tinputs: resolvedParams\n\t\t};\n\t\treturn new BlockModelV3({\n\t\t\t...this.config,\n\t\t\tplugins: {\n\t\t\t\t...this.config.plugins,\n\t\t\t\t[pluginId]: registered\n\t\t\t},\n\t\t\tfeatureFlags: mergeFeatureFlags(this.config.featureFlags, plugin.featureFlags ?? {})\n\t\t});\n\t}\n\t/** Renders all provided block settings into a pre-configured platforma API\n\t* instance, that can be used in frontend to interact with block data, and\n\t* other features provided by the platforma to the block.\n\t*\n\t* Type-level check: if there are unconsumed transfers (from `.transfer()` calls\n\t* in the migration chain), this method requires an impossible `never` argument,\n\t* producing a compile error. Register all transferred plugins via `.plugin(instance)`\n\t* before calling `.done()`.\n\t*/\n\tdone(..._) {\n\t\tif (this.config.argsFunction === void 0) throw new Error(\"Args rendering function not set.\");\n\t\tconst apiVersion = 3;\n\t\tconst { plugins } = this.config;\n\t\tconst pluginRegistry = {};\n\t\tconst pluginHandles = Object.keys(plugins);\n\t\tfor (const handle of pluginHandles) pluginRegistry[handle] = plugins[handle].model.name;\n\t\tconst { dataModel, argsFunction, prerunArgsFunction } = this.config;\n\t\tfunction getPlugin(handle) {\n\t\t\tconst plugin = plugins[handle];\n\t\t\tif (!plugin) throw new Error(`Plugin model not found for '${handle}'`);\n\t\t\treturn plugin;\n\t\t}\n\t\tregisterFacadeCallbacks({\n\t\t\t[BlockStorageFacadeCallbacks.StorageApplyUpdate]: applyStorageUpdate,\n\t\t\t[BlockStorageFacadeCallbacks.StorageDebugView]: getStorageDebugView,\n\t\t\t[BlockStorageFacadeCallbacks.StorageMigrate]: (currentStorageJson) => migrateStorage(currentStorageJson, {\n\t\t\t\tmigrateBlockData: (v) => dataModel.migrate(v),\n\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\tmigratePluginData: (handle, v) => getPlugin(handle).model.dataModel.migrate(v),\n\t\t\t\tcreatePluginData: (handle, transfer) => {\n\t\t\t\t\tif (transfer) return transfer;\n\t\t\t\t\treturn getPlugin(handle).model.getDefaultData();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t[BlockStorageFacadeCallbacks.StorageInitial]: () => createInitialStorage({\n\t\t\t\tgetDefaultBlockData: () => dataModel.getDefaultData(),\n\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\tcreatePluginData: (handle) => getPlugin(handle).model.getDefaultData()\n\t\t\t}),\n\t\t\t[BlockStorageFacadeCallbacks.ArgsDerive]: (storageJson) => deriveArgsFromStorage(storageJson, argsFunction),\n\t\t\t[BlockStorageFacadeCallbacks.PrerunArgsDerive]: (storageJson) => derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction)\n\t\t});\n\t\tconst pluginOutputs = {};\n\t\tfor (const handle of pluginHandles) {\n\t\t\tconst { model, inputs } = plugins[handle];\n\t\t\tconst wrappedInputs = {};\n\t\t\tfor (const [paramKey, paramFn] of Object.entries(inputs)) wrappedInputs[paramKey] = () => paramFn(new BlockRenderCtx());\n\t\t\tconst outputs = model.outputs;\n\t\t\tfor (const [outputKey, outputFn] of Object.entries(outputs)) {\n\t\t\t\tconst key = pluginOutputKey(handle, outputKey);\n\t\t\t\tpluginOutputs[key] = createAndRegisterRenderLambda({\n\t\t\t\t\thandle: key,\n\t\t\t\t\tlambda: () => outputFn(new PluginRenderCtx(handle, wrappedInputs)),\n\t\t\t\t\twithStatus: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst allOutputs = {\n\t\t\t...this.config.outputs,\n\t\t\t...pluginOutputs\n\t\t};\n\t\tglobalThis.platformaApiVersion = apiVersion;\n\t\tif (!isInUI()) return { config: {\n\t\t\tv4: {\n\t\t\t\tconfigVersion: 4,\n\t\t\t\tmodelAPIVersion: 2,\n\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\trenderingMode: this.config.renderingMode,\n\t\t\t\tsections: this.config.sections,\n\t\t\t\ttitle: this.config.title,\n\t\t\t\tsubtitle: this.config.subtitle,\n\t\t\t\ttags: this.config.tags,\n\t\t\t\toutputs: allOutputs,\n\t\t\t\tenrichmentTargets: this.config.enrichmentTargets,\n\t\t\t\tfeatureFlags: this.config.featureFlags,\n\t\t\t\tblockLifecycleCallbacks: { ...BlockStorageFacadeHandles }\n\t\t\t},\n\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\trenderingMode: this.config.renderingMode,\n\t\t\tsections: this.config.sections,\n\t\t\toutputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)]))\n\t\t} };\n\t\telse return {\n\t\t\t...getPlatformaInstance({\n\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\tapiVersion\n\t\t\t}),\n\t\t\tblockModelInfo: {\n\t\t\t\toutputs: Object.fromEntries(Object.entries(allOutputs).map(([key, value]) => [key, { withStatus: Boolean(isConfigLambda(value) && value.withStatus) }])),\n\t\t\t\tpluginIds: pluginHandles,\n\t\t\t\tfeatureFlags: this.config.featureFlags,\n\t\t\t\tpluginPublicOutputs: Object.fromEntries(pluginHandles.map((handle) => [handle, plugins[handle].model.publicOutputDef]))\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\nexport { BlockModelV3 };\n\n//# sourceMappingURL=block_model.js.map","import { Annotation, LinkerMap, canonicalizeJson, getAxisId, getColumnIdAndSpec, matchAxisId, readAnnotation, stringifyJson } from \"@milaboratories/pl-model-common\";\n//#region src/pframe_utils/axes.ts\n/** Create id for column copy with added keys in axes domains */\nconst colId = (id, domains, contextDomains) => {\n\tlet wid = id.toString();\n\tdomains?.forEach((domain) => {\n\t\tif (domain) for (const [k, v] of Object.entries(domain)) {\n\t\t\twid += k;\n\t\t\twid += v;\n\t\t}\n\t});\n\tcontextDomains?.forEach((contextDomain) => {\n\t\tif (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {\n\t\t\twid += k;\n\t\t\twid += v;\n\t\t}\n\t});\n\treturn wid;\n};\n/** All combinations with 1 key from each list */\nfunction getKeysCombinations(idsLists) {\n\tif (!idsLists.length) return [];\n\tlet result = [[]];\n\tidsLists.forEach((list) => {\n\t\tconst nextResult = [];\n\t\tlist.forEach((key) => {\n\t\t\tnextResult.push(...result.map((resultItem) => [...resultItem, key]));\n\t\t});\n\t\tresult = nextResult;\n\t});\n\treturn result;\n}\nfunction getAvailableWithLinkersAxes(linkerColumns, blockAxes) {\n\tconst availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));\n\treturn new Map(availableAxes.map((axisSpec) => {\n\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t}));\n}\n/** Add columns with fully compatible axes created from partial compatible ones */\nfunction enrichCompatible(blockAxes, columns) {\n\treturn columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));\n}\nfunction getAdditionalColumnsForColumn(blockAxes, column) {\n\tconst columnAxesIds = column.spec.axesSpec.map(getAxisId);\n\tif (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];\n\tconst secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {\n\t\tconst result = [];\n\t\tfor (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);\n\t\treturn result;\n\t}));\n\tconst allAddedDomainValues = /* @__PURE__ */ new Set();\n\tconst addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();\n\tconst addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {\n\t\tconst addedSet = /* @__PURE__ */ new Set();\n\t\tidsList.map((axisId, idx) => {\n\t\t\tconst d1 = column.spec.axesSpec[idx].domain;\n\t\t\tconst d2 = axisId.domain;\n\t\t\tObject.entries(d2 ?? {}).forEach(([key, value]) => {\n\t\t\t\tif (d1?.[key] === void 0) {\n\t\t\t\t\tconst item = JSON.stringify([key, value]);\n\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst cd1 = column.spec.axesSpec[idx].contextDomain;\n\t\t\tconst cd2 = axisId.contextDomain;\n\t\t\tObject.entries(cd2 ?? {}).forEach(([key, value]) => {\n\t\t\t\tif (cd1?.[key] === void 0) {\n\t\t\t\t\tconst item = JSON.stringify([\"ctx:\" + key, value]);\n\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\t...axisId,\n\t\t\t\tannotations: column.spec.axesSpec[idx].annotations\n\t\t\t};\n\t\t});\n\t\treturn addedSet;\n\t});\n\t[...allAddedDomainValues].forEach((addedPart) => {\n\t\tif (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);\n\t});\n\treturn [column, ...secondaryIdsVariants.map((idsList, idx) => {\n\t\tconst id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));\n\t\tconst label = readAnnotation(column.spec, Annotation.Label) ?? \"\";\n\t\tconst labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(\" / \");\n\t\tconst annotations = {\n\t\t\t...column.spec.annotations,\n\t\t\t[Annotation.Graph.IsVirtual]: stringifyJson(true)\n\t\t};\n\t\tif (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + \" / \" + labelDomainPart : label + labelDomainPart;\n\t\treturn {\n\t\t\t...column,\n\t\t\tid,\n\t\t\tspec: {\n\t\t\t\t...column.spec,\n\t\t\t\taxesSpec: idsList.map((axisId, idx) => ({\n\t\t\t\t\t...axisId,\n\t\t\t\t\tannotations: column.spec.axesSpec[idx].annotations\n\t\t\t\t})),\n\t\t\t\tannotations\n\t\t\t}\n\t\t};\n\t})];\n}\n//#endregion\nexport { enrichCompatible, getAvailableWithLinkersAxes };\n\n//# sourceMappingURL=axes.js.map","import { mapSpecQueryColumns } from \"@milaboratories/pl-model-common\";\n//#region src/columns/column_recipes/leaf_rebrand.ts\n/**\n* Replace every column leaf whose id equals `fromId` with `toId`, leaving\n* other column refs (linkers, sub-anchors) intact. Wrapper recipes\n* (Overridden / Filtered) and Discovered use this to lift their own id onto\n* the hit leaf, so per-variant uniqueness propagates to the engine and\n* resolver-emitted ids match leaves in the emitted SpecQuery.\n*\n* Generic over all SpecQuery node shapes — including `linkerJoin`, which\n* occurs when a wrapper sits over a {@link ColumnDiscoveredRecipe}: only\n* the deepest hit leaf carries `fromId`, every linker leaf has a different\n* id and is left untouched.\n*/\nfunction rebrandLeafId(node, fromId, toId) {\n\tif (fromId === toId) return node;\n\treturn mapSpecQueryColumns(node, { column: (id) => id === fromId ? toId : id });\n}\n//#endregion\nexport { rebrandLeafId };\n\n//# sourceMappingURL=leaf_rebrand.js.map","import { rebrandLeafId } from \"./leaf_rebrand.js\";\nimport { ColumnRecipe } from \"./index.js\";\nimport { applySpecOverrides, createColumnOverriddenId, mergeSpecOverrides } from \"@milaboratories/pl-model-common\";\n//#region src/columns/column_recipes/column_overrided_recipe.ts\n/**\n* Recipe wrapper that overlays {@link SpecOverrides} on top of any other\n* recipe. The id is `ColumnOverriddenKey { source: inner.id, specOverrides }`.\n*\n* Flat-merge invariant: `inner` is never another {@link ColumnOverriddenRecipe}.\n* Repeated overrides go through {@link wrap} / {@link withSpecs}, which merge\n* `specOverrides` at the current level and keep wrapper depth constant.\n*\n* This invariant matches the one enforced inside `unwrapOverrides` from\n* pl-model-common: it explicitly throws on a nested override-wrap.\n*/\nvar ColumnOverriddenRecipe = class ColumnOverriddenRecipe {\n\tinner;\n\toverrides;\n\t/**\n\t* Wrap any recipe with overrides. If `inner` is already a\n\t* {@link ColumnOverriddenRecipe}, merges `overrides` into the existing ones\n\t* and returns a new Overridden sharing the original `inner`. No\n\t* `Overridden<Overridden<X>>` is produced.\n\t*/\n\tstatic wrap(col, overrides) {\n\t\tif (col instanceof ColumnOverriddenRecipe) return new ColumnOverriddenRecipe(col.inner, mergeSpecOverrides(col.overrides, overrides));\n\t\treturn new ColumnOverriddenRecipe(col, overrides);\n\t}\n\t/**\n\t* Static counterpart to {@link wrap}: returns the resolution status of a\n\t* {@link ColumnOverriddenKey} without constructing the recipe. Overrides\n\t* do not add references — status collapses to the source's status.\n\t*/\n\tstatic getStatusByKey(key, opts = {}) {\n\t\treturn ColumnRecipe.getStatus(key.source, opts);\n\t}\n\tid;\n\tspecCache;\n\tqueryCache;\n\tdataStatusCache;\n\tconstructor(inner, overrides) {\n\t\tthis.inner = inner;\n\t\tthis.overrides = overrides;\n\t\tthis.id = createColumnOverriddenId({\n\t\t\tsource: inner.id,\n\t\t\tspecOverrides: overrides\n\t\t});\n\t}\n\t/** Wrapped recipe — exposed so external walkers can descend. */\n\tgetInner() {\n\t\treturn this.inner;\n\t}\n\t/**\n\t* `inner` owns all references; overrides are a pure spec patch and do not\n\t* introduce new column refs.\n\t*/\n\tgetReferencedIds() {\n\t\treturn this.inner.getReferencedIds();\n\t}\n\tgetDataStatus() {\n\t\tif (this.dataStatusCache === void 0) this.dataStatusCache = { value: this.inner.getDataStatus() };\n\t\treturn this.dataStatusCache.value;\n\t}\n\t/**\n\t* Take the inner spec and overlay our overrides. `applySpecOverrides`\n\t* extracts the overrides from `this.id` itself.\n\t*/\n\tgetSpec() {\n\t\tif (this.specCache === void 0) this.specCache = { value: applySpecOverrides(this.inner.getSpec(), this.id) };\n\t\treturn this.specCache.value;\n\t}\n\t/**\n\t* Emit a client-side `specOverride` node wrapping the inner query.\n\t*\n\t* This is a structural-but-collapsible node: it carries the override\n\t* patch through the query tree so consumers see the full recipe shape,\n\t* but it is collapsed at the host boundary (`resolvePColumn`) before\n\t* the query reaches pframe-engine. The engine never sees this node.\n\t*\n\t* Overrides do not change query topology — they are a pure spec patch.\n\t*/\n\tgetQuery() {\n\t\tif (this.queryCache === void 0) this.queryCache = { value: {\n\t\t\ttype: \"specOverride\",\n\t\t\tinput: rebrandLeafId(this.inner.getQuery(), this.inner.id, this.id),\n\t\t\toverride: this.overrides\n\t\t} };\n\t\treturn this.queryCache.value;\n\t}\n\t/**\n\t* Flat merge: new overrides merge with existing ones; `inner` is unchanged.\n\t* The result is an Overridden of the same depth.\n\t*/\n\twithSpecs(overrides) {\n\t\treturn ColumnOverriddenRecipe.wrap(this, overrides);\n\t}\n};\n//#endregion\nexport { ColumnOverriddenRecipe };\n\n//# sourceMappingURL=column_overrided_recipe.js.map","import { Column } from \"../column.js\";\nimport { rebrandLeafId } from \"./leaf_rebrand.js\";\nimport { ColumnRecipe } from \"./index.js\";\nimport { ColumnOverriddenRecipe } from \"./column_overrided_recipe.js\";\nimport { distillColumnDiscoveredKey, extractPObjectId, stringifyColumnDiscoveredId } from \"@milaboratories/pl-model-common\";\nimport { throwError } from \"@milaboratories/helpers\";\n//#region src/columns/column_recipes/column_discovered_recipe.ts\n/**\n* Recipe for columns identified by a {@link ColumnDiscoveredKey}: a base\n* column + a `path` of linkers + qualifications.\n*\n* Specifics:\n* - References more than one column (`column` + each `path[i].column`);\n* {@link getDataStatus} aggregates across the whole set.\n* - {@link getQuery} assembles the {@link SpecQuery} locally\n* ({@link buildSpecQuery}) — the hit is inlined as its own recipe's query\n* tree, linkers fold inside-out into nested `linkerJoin` nodes.\n* - {@link getSpec} passes through to the hit column's own spec: the linker\n* chain only enables co-indexing and does not remap the hit's `axesSpec`, so\n* no engine round-trip is needed (mirrors the Discovered branch of\n* `reconstructSpecFromId` on the host side).\n*/\nvar ColumnDiscoveredRecipe = class ColumnDiscoveredRecipe {\n\tkey;\n\tcolumns;\n\t/**\n\t* Validate the key + resolve every referenced column via\n\t* {@link ColumnLazy.fromId} (which itself checks the leaf accessor reports\n\t* `hasData()`). Returns `undefined` if the key is malformed or any\n\t* referenced column is not yet spec-resolvable.\n\t*\n\t* Spec JSON is deserialized lazily on first {@link getSpec}/{@link getQuery}.\n\t*/\n\tstatic fromKey(key, opts = {}) {\n\t\tconst distilled = distillColumnDiscoveredKey(key);\n\t\tconst columns = {};\n\t\tfor (const uniId of referencedUniIdsOf(distilled)) {\n\t\t\tconst recipe = Column(uniId, opts);\n\t\t\tif (recipe === void 0) return void 0;\n\t\t\tcolumns[uniId] = recipe;\n\t\t}\n\t\treturn new ColumnDiscoveredRecipe(distilled, columns);\n\t}\n\t/**\n\t* Static counterpart to {@link fromKey}: returns the resolution status of\n\t* a {@link ColumnDiscoveredKey} without constructing the recipe. Worst-wins\n\t* across every referenced {@link ColumnUniversalId} (hit + path linkers),\n\t* each resolved via the top-level {@link ColumnRecipe.getStatus} dispatcher.\n\t*/\n\tstatic getStatusByKey(key, opts = {}) {\n\t\tconst distilled = distillColumnDiscoveredKey(key);\n\t\tlet worst = \"present\";\n\t\tfor (const uniId of referencedUniIdsOf(distilled)) {\n\t\t\tconst s = ColumnRecipe.getStatus(uniId, opts);\n\t\t\tif (s === \"absent\") return \"absent\";\n\t\t\tif (s === \"resolving\") worst = \"resolving\";\n\t\t}\n\t\treturn worst;\n\t}\n\tid;\n\tspecCache;\n\tqueryCache;\n\tdataStatusCache;\n\tconstructor(key, columns) {\n\t\tthis.key = key;\n\t\tthis.columns = columns;\n\t\tthis.id = stringifyColumnDiscoveredId(this.key);\n\t}\n\t/**\n\t* Universal id of the hit column (excluding path/qualifications on top).\n\t* May itself be a wrapped id (Overridden / Filtered / nested Discovered) —\n\t* preserves projections applied to the underlying column.\n\t*/\n\tgetHitId() {\n\t\treturn this.key.column;\n\t}\n\t/**\n\t* Axis qualifications attached to the hit column itself — applied to the\n\t* outer-join entry that wraps this column at the consumer boundary.\n\t*/\n\tgetColumnQualifications() {\n\t\treturn this.key.columnQualifications ?? [];\n\t}\n\t/**\n\t* Per-primary-column qualifications applied to the primary anchors on\n\t* this group's side. Keyed by the external primary column id.\n\t*/\n\tgetQueriesQualifications() {\n\t\treturn this.key.queriesQualifications ?? {};\n\t}\n\t/**\n\t* Leaf {@link PObjectId}s the recipe physically depends on: hit column +\n\t* each linker in `path`, with any projection wrappers unwrapped down to\n\t* their underlying storage column. Used to track real-data dependencies\n\t* (e.g. {@link getDataStatus}), not projected identities.\n\t*/\n\tgetReferencedIds() {\n\t\treturn [...new Set([...referencedUniIdsOf(this.key)].map((uniId) => extractPObjectId(uniId)))];\n\t}\n\t/**\n\t* Final spec of a discovered hit is just the hit column's own spec: the\n\t* linker chain only enables co-indexing, it does not remap the hit's\n\t* `axesSpec`, and axis qualifications live on the outer join entry (see\n\t* {@link buildSpecQuery}), not in the spec. So pass through to the hit\n\t* recipe's `getSpec()` — no engine round-trip needed. This mirrors the\n\t* Discovered branch of `reconstructSpecFromId` on the host side.\n\t*/\n\tgetSpec() {\n\t\tif (this.specCache === void 0) {\n\t\t\tconst hit = this.columns[this.key.column] ?? throwError(`ColumnDiscoveredRecipe.getSpec: missing column ${this.key.column}`);\n\t\t\tthis.specCache = { value: hit.getSpec() };\n\t\t}\n\t\treturn this.specCache.value;\n\t}\n\t/** IR for building the final spec — see {@link buildSpecQuery}. */\n\tgetQuery() {\n\t\tif (this.queryCache === void 0) this.queryCache = { value: this.buildSpecQuery() };\n\t\treturn this.queryCache.value;\n\t}\n\tgetDataStatus() {\n\t\tif (this.dataStatusCache === void 0) this.dataStatusCache = { value: Object.values(this.columns).reduce((worst, lazy) => {\n\t\t\tconst s = lazy.getDataStatus();\n\t\t\tif (s === \"absent\" || worst === \"absent\") return \"absent\";\n\t\t\tif (s === \"resolving\") return \"resolving\";\n\t\t\treturn worst;\n\t\t}, \"present\") };\n\t\treturn this.dataStatusCache.value;\n\t}\n\t/**\n\t* Discovered + overrides → Overridden<Discovered>. Delegates to the\n\t* flat-merge factory of ColumnOverriddenRecipe; subsequent `withSpecs`\n\t* calls merge at the Overridden level (one wrapper, no nesting).\n\t*/\n\twithSpecs(overrides) {\n\t\treturn ColumnOverriddenRecipe.wrap(this, overrides);\n\t}\n\t/**\n\t* Assembles the SpecQuery for this discovered hit by folding `key.path`\n\t* around the hit column.\n\t*\n\t* The hit (innermost) is built by inlining `columns[key.column].getQuery()`\n\t* — recursing into the hit's own recipe — so wrapping layers on the hit\n\t* (Overridden / Filtered / nested Discovered) appear in the produced tree.\n\t* The previous `pframeSpec.buildQuery` path was a flat\n\t* {@link PObjectId}-only call and could not express that.\n\t*\n\t* Linkers stay as plain column references on the linker side of\n\t* `linkerJoin` (the spec node has no slot for a query-side linker); the\n\t* linker's recipe id is used directly. The frame registered in\n\t* {@link getSpec} carries each recipe's final spec under that same id, so\n\t* the engine resolves linker axes from the post-projection spec.\n\t*\n\t* Path ordering matches {@link ColumnDiscoveredKey.path}: `path[0]` is\n\t* outermost, `path[N-1]` is closest to the hit. We fold from the inside\n\t* out — innermost wrap first — so the result lines up with that convention.\n\t*\n\t* `columnQualifications` / `queriesQualifications` are not emitted here —\n\t* qualifications live on a {@link SpecQueryJoinEntry} wrapper (lost on\n\t* unwrapping to {@link SpecQuery}). External consumers apply them at the\n\t* outer join via {@link getColumnQualifications} / {@link getQueriesQualifications}.\n\t*/\n\tbuildSpecQuery() {\n\t\tconst hitRecipe = this.columns[this.key.column] ?? throwError(`ColumnDiscoveredRecipe.buildSpecQuery: missing column ${this.key.column}`);\n\t\tlet query = rebrandLeafId(hitRecipe.getQuery(), hitRecipe.id, this.id);\n\t\tconst path = this.key.path ?? [];\n\t\tfor (let i = path.length - 1; i >= 0; i--) query = {\n\t\t\ttype: \"linkerJoin\",\n\t\t\tlinker: (this.columns[path[i].column] ?? throwError(`ColumnDiscoveredRecipe.buildSpecQuery: missing linker column ${path[i].column}`)).getQuery(),\n\t\t\tsecondary: [{ entry: query }]\n\t\t};\n\t\treturn query;\n\t}\n};\nfunction referencedUniIdsOf(key) {\n\treturn /* @__PURE__ */ new Set([key.column, ...(key.path ?? []).map((item) => item.column)]);\n}\n//#endregion\nexport { ColumnDiscoveredRecipe };\n\n//# sourceMappingURL=column_discovered_recipe.js.map","import { rebrandLeafId } from \"./leaf_rebrand.js\";\nimport { ColumnRecipe } from \"./index.js\";\nimport { ColumnOverriddenRecipe } from \"./column_overrided_recipe.js\";\nimport { applyAxisFilters, stringifyColumnFilteredId } from \"@milaboratories/pl-model-common\";\n//#region src/columns/column_recipes/column_filtered_recipe.ts\n/**\n* Recipe wrapper that fixes the values of selected axes of an inner recipe\n* (axis slicing). The id is `FilteredPColumnId { source: inner.id,\n* axisFilters }`.\n*\n* Flat-merge invariant: `inner` is never another {@link ColumnFilteredRecipe}.\n* Repeated {@link wrap} concatenates `axisFilters` at the current level.\n*\n* Layering: `withSpecs` on a Filtered recipe yields\n* `Overridden<Filtered<inner>>` — Overridden is always the outermost layer.\n* The reverse layering (`Filtered<Overridden<...>>`) is not reachable via\n* the public interface.\n*/\nvar ColumnFilteredRecipe = class ColumnFilteredRecipe {\n\tinner;\n\taxisFilters;\n\t/**\n\t* Wrap any recipe with axis filters. If `inner` is already a\n\t* {@link ColumnFilteredRecipe}, concatenates `axisFilters` and returns a\n\t* new Filtered sharing the original `inner`.\n\t*\n\t* Validates every axis index against `inner.getSpec().axesSpec` at\n\t* construction — throws on an out-of-range index. After {@link wrap}, the\n\t* recipe is guaranteed to be spec-complete.\n\t*\n\t* Order semantics: new filters are appended after existing ones, preserving\n\t* their relative order. AND composition is otherwise commutative; order\n\t* only affects canonicalize/equality.\n\t*/\n\tstatic wrap(col, axisFilters) {\n\t\tconst combined = col instanceof ColumnFilteredRecipe ? [...col.axisFilters, ...axisFilters] : axisFilters;\n\t\tconst base = col instanceof ColumnFilteredRecipe ? col.inner : col;\n\t\tif (combined.length === 0) throw new Error(\"ColumnFilteredRecipe.wrap: at least one axis filter must be provided\");\n\t\tconst innerSpec = base.getSpec();\n\t\tconst fixed = /* @__PURE__ */ new Set();\n\t\tfor (const [idx] of combined) {\n\t\t\tif (innerSpec.axesSpec[idx] === void 0) throw new Error(`ColumnFilteredRecipe.wrap: axis index ${idx} out of range (inner has ${innerSpec.axesSpec.length} axes)`);\n\t\t\tfixed.add(idx);\n\t\t}\n\t\tif (fixed.size >= innerSpec.axesSpec.length) throw new Error(`ColumnFilteredRecipe.wrap: filters fix all ${innerSpec.axesSpec.length} axes — at least one axis must remain`);\n\t\treturn new ColumnFilteredRecipe(base, combined);\n\t}\n\t/**\n\t* Static counterpart to {@link wrap}: returns the resolution status of a\n\t* {@link ColumnFilteredKey} without constructing the recipe. Axis filters\n\t* do not add references — status collapses to the source's status.\n\t*/\n\tstatic getStatusByKey(key, opts = {}) {\n\t\tif (typeof key.source !== \"string\") throw new Error(\"ColumnFilteredRecipe.getStatusByKey: filtered column with non-string source\");\n\t\treturn ColumnRecipe.getStatus(key.source, opts);\n\t}\n\tid;\n\tspecCache;\n\tqueryCache;\n\tdataStatusCache;\n\tconstructor(inner, axisFilters) {\n\t\tthis.inner = inner;\n\t\tthis.axisFilters = axisFilters;\n\t\tthis.id = stringifyColumnFilteredId({\n\t\t\tsource: inner.id,\n\t\t\taxisFilters\n\t\t});\n\t}\n\t/** Wrapped recipe — exposed so external walkers can descend. */\n\tgetInner() {\n\t\treturn this.inner;\n\t}\n\t/** Axis filters do not introduce references to other columns. */\n\tgetReferencedIds() {\n\t\treturn this.inner.getReferencedIds();\n\t}\n\tgetDataStatus() {\n\t\tif (this.dataStatusCache === void 0) this.dataStatusCache = { value: this.inner.getDataStatus() };\n\t\treturn this.dataStatusCache.value;\n\t}\n\t/**\n\t* Final spec — the inner spec with fixed axes removed. Indices in\n\t* `axisFilters` are positional against `inner.getSpec().axesSpec` and were\n\t* validated at {@link wrap} time.\n\t*/\n\tgetSpec() {\n\t\tif (this.specCache === void 0) this.specCache = { value: applyAxisFilters(this.inner.getSpec(), this.axisFilters) };\n\t\treturn this.specCache.value;\n\t}\n\t/**\n\t* Wraps the inner query in `SpecQuerySliceAxes`. Index→selector resolution\n\t* goes through the inner spec — guaranteed available since {@link wrap}\n\t* validated all indices at construction.\n\t*/\n\tgetQuery() {\n\t\tif (this.queryCache === void 0) {\n\t\t\tconst innerQuery = this.inner.getQuery();\n\t\t\tif (this.axisFilters.length === 0) this.queryCache = { value: rebrandLeafId(innerQuery, this.inner.id, this.id) };\n\t\t\telse {\n\t\t\t\tconst innerSpec = this.inner.getSpec();\n\t\t\t\tthis.queryCache = { value: {\n\t\t\t\t\ttype: \"sliceAxes\",\n\t\t\t\t\tinput: rebrandLeafId(innerQuery, this.inner.id, this.id),\n\t\t\t\t\taxisFilters: this.axisFilters.map(([idx, value]) => ({\n\t\t\t\t\t\taxisSelector: toAxisSelector(innerSpec.axesSpec[idx]),\n\t\t\t\t\t\tconstant: value\n\t\t\t\t\t}))\n\t\t\t\t} };\n\t\t\t}\n\t\t}\n\t\treturn this.queryCache.value;\n\t}\n\t/**\n\t* Filtered + overrides → Overridden<Filtered>. Overridden is always the\n\t* outermost layer.\n\t*/\n\twithSpecs(overrides) {\n\t\treturn ColumnOverriddenRecipe.wrap(this, overrides);\n\t}\n};\nfunction toAxisSelector(axis) {\n\tconst selector = {\n\t\tname: axis.name,\n\t\ttype: axis.type\n\t};\n\tif (axis.domain !== void 0 && Object.keys(axis.domain).length > 0) selector.domain = axis.domain;\n\tif (axis.contextDomain !== void 0 && Object.keys(axis.contextDomain).length > 0) selector.contextDomain = axis.contextDomain;\n\treturn selector;\n}\n//#endregion\nexport { ColumnFilteredRecipe };\n\n//# sourceMappingURL=column_filtered_recipe.js.map","/**\n * @module LRUCache\n */\nconst defaultPerf = (typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function') ?\n performance\n : Date;\nconst warned = new Set();\n/* c8 ignore start */\nconst PROCESS = (typeof process === 'object' && !!process ?\n process\n : {});\n/* c8 ignore start */\nconst emitWarning = (msg, type, code, fn) => {\n typeof PROCESS.emitWarning === 'function' ?\n PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`);\n};\nlet AC = globalThis.AbortController;\nlet AS = globalThis.AbortSignal;\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort;\n _onabort = [];\n reason;\n aborted = false;\n addEventListener(_, fn) {\n this._onabort.push(fn);\n }\n };\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill();\n }\n signal = new AS();\n abort(reason) {\n if (this.signal.aborted)\n return;\n //@ts-ignore\n this.signal.reason = reason;\n //@ts-ignore\n this.signal.aborted = true;\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason);\n }\n this.signal.onabort?.(reason);\n }\n };\n let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning)\n return;\n printACPolyfillWarning = false;\n emitWarning('AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);\n };\n}\n/* c8 ignore stop */\nconst shouldWarn = (code) => !warned.has(code);\nconst TYPE = Symbol('type');\nconst isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max) => !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null;\n/* c8 ignore stop */\nclass ZeroArray extends Array {\n constructor(size) {\n super(size);\n this.fill(0);\n }\n}\nclass Stack {\n heap;\n length;\n // private constructor\n static #constructing = false;\n static create(max) {\n const HeapCls = getUintArray(max);\n if (!HeapCls)\n return [];\n Stack.#constructing = true;\n const s = new Stack(max, HeapCls);\n Stack.#constructing = false;\n return s;\n }\n constructor(max, HeapCls) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)');\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max);\n this.length = 0;\n }\n push(n) {\n this.heap[this.length++] = n;\n }\n pop() {\n return this.heap[--this.length];\n }\n}\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n #max;\n #maxSize;\n #dispose;\n #onInsert;\n #disposeAfter;\n #fetchMethod;\n #memoMethod;\n #perf;\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf;\n }\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl;\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution;\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas;\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale;\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet;\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL;\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize;\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort;\n // computed properties\n #size;\n #calculatedSize;\n #keyMap;\n #keyList;\n #valList;\n #next;\n #prev;\n #head;\n #tail;\n #free;\n #disposed;\n #sizes;\n #starts;\n #ttls;\n #autopurgeTimers;\n #hasDispose;\n #hasFetchMethod;\n #hasDisposeAfter;\n #hasOnInsert;\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals(c) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head;\n },\n get tail() {\n return c.#tail;\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p) => c.#isBackgroundFetch(p),\n backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),\n moveToTail: (index) => c.#moveToTail(index),\n indexes: (options) => c.#indexes(options),\n rindexes: (options) => c.#rindexes(options),\n isStale: (index) => c.#isStale(index),\n };\n }\n // Protected read-only members\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max() {\n return this.#max;\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize() {\n return this.#maxSize;\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize() {\n return this.#calculatedSize;\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size() {\n return this.#size;\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod() {\n return this.#fetchMethod;\n }\n get memoMethod() {\n return this.#memoMethod;\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose;\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert;\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter;\n }\n constructor(options) {\n const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf, } = options;\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError('perf option must have a now() method if specified');\n }\n }\n this.#perf = perf ?? defaultPerf;\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer');\n }\n const UintArray = max ? getUintArray(max) : Array;\n if (!UintArray) {\n throw new Error('invalid max value: ' + max);\n }\n this.#max = max;\n this.#maxSize = maxSize;\n this.maxEntrySize = maxEntrySize || this.#maxSize;\n this.sizeCalculation = sizeCalculation;\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function');\n }\n }\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined');\n }\n this.#memoMethod = memoMethod;\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified');\n }\n this.#fetchMethod = fetchMethod;\n this.#hasFetchMethod = !!fetchMethod;\n this.#keyMap = new Map();\n this.#keyList = new Array(max).fill(undefined);\n this.#valList = new Array(max).fill(undefined);\n this.#next = new UintArray(max);\n this.#prev = new UintArray(max);\n this.#head = 0;\n this.#tail = 0;\n this.#free = Stack.create(max);\n this.#size = 0;\n this.#calculatedSize = 0;\n if (typeof dispose === 'function') {\n this.#dispose = dispose;\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert;\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter;\n this.#disposed = [];\n }\n else {\n this.#disposeAfter = undefined;\n this.#disposed = undefined;\n }\n this.#hasDispose = !!this.#dispose;\n this.#hasOnInsert = !!this.#onInsert;\n this.#hasDisposeAfter = !!this.#disposeAfter;\n this.noDisposeOnSet = !!noDisposeOnSet;\n this.noUpdateTTL = !!noUpdateTTL;\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;\n this.ignoreFetchAbort = !!ignoreFetchAbort;\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError('maxSize must be a positive integer if specified');\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError('maxEntrySize must be a positive integer if specified');\n }\n this.#initializeSizeTracking();\n }\n this.allowStale = !!allowStale;\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;\n this.updateAgeOnGet = !!updateAgeOnGet;\n this.updateAgeOnHas = !!updateAgeOnHas;\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;\n this.ttlAutopurge = !!ttlAutopurge;\n this.ttl = ttl || 0;\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified');\n }\n this.#initializeTTLTracking();\n }\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError('At least one of max, maxSize, or ttl is required');\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED';\n if (shouldWarn(code)) {\n warned.add(code);\n const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.';\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);\n }\n }\n }\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key) {\n return this.#keyMap.has(key) ? Infinity : 0;\n }\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max);\n const starts = new ZeroArray(this.#max);\n this.#ttls = ttls;\n this.#starts = starts;\n const purgeTimers = this.ttlAutopurge ?\n new Array(this.#max)\n : undefined;\n this.#autopurgeTimers = purgeTimers;\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0;\n ttls[index] = ttl;\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily.\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index]);\n purgeTimers[index] = undefined;\n }\n if (ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index], 'expire');\n }\n }, ttl + 1);\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n purgeTimers[index] = t;\n }\n };\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;\n };\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index];\n const start = starts[index];\n /* c8 ignore next */\n if (!ttl || !start)\n return;\n status.ttl = ttl;\n status.start = start;\n status.now = cachedNow || getNow();\n const age = status.now - start;\n status.remainingTTL = ttl - age;\n }\n };\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0;\n const getNow = () => {\n const n = this.#perf.now();\n if (this.ttlResolution > 0) {\n cachedNow = n;\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n }\n return n;\n };\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key);\n if (index === undefined) {\n return 0;\n }\n const ttl = ttls[index];\n const start = starts[index];\n if (!ttl || !start) {\n return Infinity;\n }\n const age = (cachedNow || getNow()) - start;\n return ttl - age;\n };\n this.#isStale = index => {\n const s = starts[index];\n const t = ttls[index];\n return !!t && !!s && (cachedNow || getNow()) - s > t;\n };\n }\n // conditionally set private methods related to TTL\n #updateItemAge = () => { };\n #statusTTL = () => { };\n #setItemTTL = () => { };\n /* c8 ignore stop */\n #isStale = () => false;\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max);\n this.#calculatedSize = 0;\n this.#sizes = sizes;\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index];\n sizes[index] = 0;\n };\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0;\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function');\n }\n size = sizeCalculation(v, k);\n if (!isPosInt(size)) {\n throw new TypeError('sizeCalculation return invalid (expect positive integer)');\n }\n }\n else {\n throw new TypeError('invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.');\n }\n }\n return size;\n };\n this.#addItemSize = (index, size, status) => {\n sizes[index] = size;\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index];\n while (this.#calculatedSize > maxSize) {\n this.#evict(true);\n }\n }\n this.#calculatedSize += sizes[index];\n if (status) {\n status.entrySize = size;\n status.totalCalculatedSize = this.#calculatedSize;\n }\n };\n }\n #removeItemSize = _i => { };\n #addItemSize = (_i, _s, _st) => { };\n #requireSize = (_k, _v, size, sizeCalculation) => {\n if (size || sizeCalculation) {\n throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');\n }\n return 0;\n };\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#head) {\n break;\n }\n else {\n i = this.#prev[i];\n }\n }\n }\n }\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#tail) {\n break;\n }\n else {\n i = this.#next[i];\n }\n }\n }\n }\n #isValidIndex(index) {\n return (index !== undefined &&\n this.#keyMap.get(this.#keyList[index]) === index);\n }\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i];\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i];\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries();\n }\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache';\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(fn, getOptions = {}) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n if (fn(value, this.#keyList[i], this)) {\n return this.get(this.#keyList[i], getOptions);\n }\n }\n }\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(fn, thisp = this) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(fn, thisp = this) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false;\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i], 'expire');\n deleted = true;\n }\n }\n return deleted;\n }\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key) {\n const i = this.#keyMap.get(key);\n if (i === undefined)\n return undefined;\n const v = this.#valList[i];\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n return undefined;\n /* c8 ignore end */\n const entry = { value };\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i];\n const start = this.#starts[i];\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start);\n entry.ttl = remain;\n entry.start = Date.now();\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n return entry;\n }\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr = [];\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i];\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined || key === undefined)\n continue;\n const entry = { value };\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i];\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - this.#starts[i];\n entry.start = Math.floor(Date.now() - age);\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n arr.unshift([key, entry]);\n }\n return arr;\n }\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr) {\n this.clear();\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start;\n entry.start = this.#perf.now() - age;\n }\n this.set(key, entry.value, entry);\n }\n }\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(k, v, setOptions = {}) {\n if (v === undefined) {\n this.delete(k);\n return this;\n }\n const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;\n let { noUpdateTTL = this.noUpdateTTL } = setOptions;\n const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss';\n status.maxEntrySizeExceeded = true;\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set');\n return this;\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k);\n if (index === undefined) {\n // addition\n index = (this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size);\n this.#keyList[index] = k;\n this.#valList[index] = v;\n this.#keyMap.set(k, index);\n this.#next[this.#tail] = index;\n this.#prev[index] = this.#tail;\n this.#tail = index;\n this.#size++;\n this.#addItemSize(index, size, status);\n if (status)\n status.set = 'add';\n noUpdateTTL = false;\n if (this.#hasOnInsert) {\n this.#onInsert?.(v, k, 'add');\n }\n }\n else {\n // update\n this.#moveToTail(index);\n const oldVal = this.#valList[index];\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'));\n const { __staleWhileFetching: s } = oldVal;\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set']);\n }\n }\n }\n else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set']);\n }\n }\n this.#removeItemSize(index);\n this.#addItemSize(index, size, status);\n this.#valList[index] = v;\n if (status) {\n status.set = 'replace';\n const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal;\n if (oldValue !== undefined)\n status.oldValue = oldValue;\n }\n }\n else if (status) {\n status.set = 'update';\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking();\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start);\n }\n if (status)\n this.#statusTTL(status, index);\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return this;\n }\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop() {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head];\n this.#evict(true);\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching;\n }\n }\n else if (val !== undefined) {\n return val;\n }\n }\n }\n finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n }\n #evict(free) {\n const head = this.#head;\n const k = this.#keyList[head];\n const v = this.#valList[head];\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict']);\n }\n }\n this.#removeItemSize(head);\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head]);\n this.#autopurgeTimers[head] = undefined;\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined;\n this.#valList[head] = undefined;\n this.#free.push(head);\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0;\n this.#free.length = 0;\n }\n else {\n this.#head = this.#next[head];\n }\n this.#keyMap.delete(k);\n this.#size--;\n return head;\n }\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k, hasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined) {\n return false;\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index);\n }\n if (status) {\n status.has = 'hit';\n this.#statusTTL(status, index);\n }\n return true;\n }\n else if (status) {\n status.has = 'stale';\n this.#statusTTL(status, index);\n }\n }\n else if (status) {\n status.has = 'miss';\n }\n return false;\n }\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k, peekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions;\n const index = this.#keyMap.get(k);\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n return;\n }\n const v = this.#valList[index];\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n }\n #backgroundFetch(k, index, options, context) {\n const v = index === undefined ? undefined : this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n return v;\n }\n const ac = new AC();\n const { signal } = options;\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n });\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n };\n const cb = (v, updateCache = false) => {\n const { aborted } = ac.signal;\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined;\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true;\n options.status.fetchError = ac.signal.reason;\n if (ignoreAbort)\n options.status.fetchAbortIgnored = true;\n }\n else {\n options.status.fetchResolved = true;\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason);\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p;\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index];\n if (vl === p || (ignoreAbort && updateCache && vl === undefined)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index] = bf.__staleWhileFetching;\n }\n else {\n this.#delete(k, 'fetch');\n }\n }\n else {\n if (options.status)\n options.status.fetchUpdated = true;\n this.set(k, v, fetchOpts.options);\n }\n }\n return v;\n };\n const eb = (er) => {\n if (options.status) {\n options.status.fetchRejected = true;\n options.status.fetchError = er;\n }\n return fetchFail(er);\n };\n const fetchFail = (er) => {\n const { aborted } = ac.signal;\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;\n const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;\n const noDelete = allowStale || options.noDeleteOnFetchRejection;\n const bf = p;\n if (this.#valList[index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined;\n if (del) {\n this.#delete(k, 'fetch');\n }\n else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index] = bf.__staleWhileFetching;\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true;\n }\n return bf.__staleWhileFetching;\n }\n else if (bf.__returned === bf) {\n throw er;\n }\n };\n const pcall = (res, rej) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts);\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej);\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined);\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true);\n }\n }\n });\n };\n if (options.status)\n options.status.fetchDispatched = true;\n const p = new Promise(pcall).then(cb, eb);\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n });\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined });\n index = this.#keyMap.get(k);\n }\n else {\n this.#valList[index] = bf;\n }\n return bf;\n }\n #isBackgroundFetch(p) {\n if (!this.#hasFetchMethod)\n return false;\n const b = p;\n return (!!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC);\n }\n async fetch(k, fetchOptions = {}) {\n const { \n // get options\n allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, \n // set options\n ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, \n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;\n if (!this.#hasFetchMethod) {\n if (status)\n status.fetch = 'get';\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n });\n }\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n };\n let index = this.#keyMap.get(k);\n if (index === undefined) {\n if (status)\n status.fetch = 'miss';\n const p = this.#backgroundFetch(k, index, options, context);\n return (p.__returned = p);\n }\n else {\n // in cache, maybe already fetching\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined;\n if (status) {\n status.fetch = 'inflight';\n if (stale)\n status.returnedStale = true;\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v);\n }\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index);\n if (!forceRefresh && !isStale) {\n if (status)\n status.fetch = 'hit';\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n if (status)\n this.#statusTTL(status, index);\n return v;\n }\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context);\n const hasStale = p.__staleWhileFetching !== undefined;\n const staleVal = hasStale && allowStale;\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh';\n if (staleVal && isStale)\n status.returnedStale = true;\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p);\n }\n }\n async forceFetch(k, fetchOptions = {}) {\n const v = await this.fetch(k, fetchOptions);\n if (v === undefined)\n throw new Error('fetch() returned undefined');\n return v;\n }\n memo(k, memoOptions = {}) {\n const memoMethod = this.#memoMethod;\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor');\n }\n const { context, forceRefresh, ...options } = memoOptions;\n const v = this.get(k, options);\n if (!forceRefresh && v !== undefined)\n return v;\n const vv = memoMethod(k, v, {\n options,\n context,\n });\n this.set(k, vv, options);\n return vv;\n }\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k, getOptions = {}) {\n const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const value = this.#valList[index];\n const fetching = this.#isBackgroundFetch(value);\n if (status)\n this.#statusTTL(status, index);\n if (this.#isStale(index)) {\n if (status)\n status.get = 'stale';\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire');\n }\n if (status && allowStale)\n status.returnedStale = true;\n return allowStale ? value : undefined;\n }\n else {\n if (status &&\n allowStale &&\n value.__staleWhileFetching !== undefined) {\n status.returnedStale = true;\n }\n return allowStale ? value.__staleWhileFetching : undefined;\n }\n }\n else {\n if (status)\n status.get = 'hit';\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching;\n }\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n return value;\n }\n }\n else if (status) {\n status.get = 'miss';\n }\n }\n #connect(p, n) {\n this.#prev[n] = p;\n this.#next[p] = n;\n }\n #moveToTail(index) {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n this.#connect(this.#prev[index], this.#next[index]);\n }\n this.#connect(this.#tail, index);\n this.#tail = index;\n }\n }\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k) {\n return this.#delete(k, 'delete');\n }\n #delete(k, reason) {\n let deleted = false;\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index]);\n this.#autopurgeTimers[index] = undefined;\n }\n deleted = true;\n if (this.#size === 1) {\n this.#clear(reason);\n }\n else {\n this.#removeItemSize(index);\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n this.#keyMap.delete(k);\n this.#keyList[index] = undefined;\n this.#valList[index] = undefined;\n if (index === this.#tail) {\n this.#tail = this.#prev[index];\n }\n else if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n const pi = this.#prev[index];\n this.#next[pi] = this.#next[index];\n const ni = this.#next[index];\n this.#prev[ni] = this.#prev[index];\n }\n this.#size--;\n this.#free.push(index);\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return deleted;\n }\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete');\n }\n #clear(reason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else {\n const k = this.#keyList[index];\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n }\n this.#keyMap.clear();\n this.#valList.fill(undefined);\n this.#keyList.fill(undefined);\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0);\n this.#starts.fill(0);\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined)\n clearTimeout(t);\n }\n this.#autopurgeTimers?.fill(undefined);\n }\n if (this.#sizes) {\n this.#sizes.fill(0);\n }\n this.#head = 0;\n this.#tail = 0;\n this.#free.length = 0;\n this.#calculatedSize = 0;\n this.#size = 0;\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { getCfgRenderCtx } from \"../../internal.js\";\nimport { TreeNodeAccessor } from \"../../render/accessor.js\";\nimport \"../../render/index.js\";\nimport { ColumnLazyImpl } from \"../column_lazy.js\";\nimport { AccessorEntriesProvider, ResultPoolEntriesProvider } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"es-toolkit\";\nimport { LRUCache } from \"lru-cache\";\n//#region src/columns/column_providers/providers.ts\n/**\n* Unified memoised factory dispatching to the right provider flavour by the\n* source shape:\n* - `TreeNodeAccessor` → {@link AccessorColumnsProvider}\n* (indexed by `root.handle`, walks the accessor tree once per root).\n* - `UpstreamBlockCtx<AccessorHandle>[]` (or omitted — pulled from the\n* ambient ctx) → {@link ResultPoolColumnsProvider}\n* (indexed by a content-hash of the block list).\n*\n* Both branches return cached instances within their LRU window, so repeated\n* calls with the same source skip re-walking / re-hashing.\n*/\nfunction ColumnsProvider(source) {\n\tif (isNil(source) || Array.isArray(source)) return ResultPoolColumnsProvider(source);\n\telse if (source instanceof TreeNodeAccessor) return AccessorColumnsProvider(source);\n\telse throw new Error(\"Unknown columns provider source\");\n}\n/**\n* Memoised constructor — same `root.handle` returns the same\n* {@link AccessorColumnsProviderImpl}, so `indexAccessorRoot` runs once per\n* accessor root (within the LRU window).\n*/\nconst _accessorProviderCache = new LRUCache({ max: 64 });\nfunction AccessorColumnsProvider(root) {\n\tlet provider = _accessorProviderCache.get(root.handle);\n\tif (provider === void 0) {\n\t\tprovider = new AccessorColumnsProviderImpl(root);\n\t\t_accessorProviderCache.set(root.handle, provider);\n\t}\n\treturn provider;\n}\n/**\n* Memoised constructor — same `rawPool` content returns the same\n* {@link ResultPoolColumnsProviderImpl}, so `indexPoolBlock` runs once per\n* pool snapshot (within the LRU window).\n*/\nconst _resultPoolProviderCache = new LRUCache({ max: 4 });\nfunction ResultPoolColumnsProvider(rawPool = getCfgRenderCtx().getUpstreamBlockCtx()) {\n\tconst key = hashRawPool(rawPool);\n\tlet provider = _resultPoolProviderCache.get(key);\n\tif (provider === void 0) {\n\t\tprovider = new ResultPoolColumnsProviderImpl(rawPool);\n\t\t_resultPoolProviderCache.set(key, provider);\n\t}\n\treturn provider;\n}\n/**\n* Simple provider wrapping an array of PColumns. Sandbox-only —\n* implements {@link ColumnsProvider} (lazy-view enumeration). It is *not* an\n* id-index source — `ColumnRegistry` does not consume it.\n*/\nvar ArrayColumnsProvider = class {\n\t_isFinal;\n\tcolumns;\n\tconstructor(columns, _isFinal) {\n\t\tthis._isFinal = _isFinal;\n\t\tthis.columns = columns.map((c) => ColumnLazyImpl.fromColumn(c));\n\t}\n\tgetColumns() {\n\t\treturn this.columns;\n\t}\n\tisFinal() {\n\t\treturn this._isFinal;\n\t}\n};\n/**\n* Sandbox-specific provider over a {@link TreeNodeAccessor} root. Uses the\n* accessor's own `resolvePath` as the canonical root path for id construction,\n* and adds `getColumns()` returning {@link ColumnLazy}s on top of the generic\n* entries index.\n*/\nvar AccessorColumnsProviderImpl = class extends AccessorEntriesProvider {\n\tcachedColumns;\n\tconstructor(root) {\n\t\tsuper(root, root.resolvePath);\n\t}\n\tgetColumns() {\n\t\tif (this.cachedColumns !== void 0) return this.cachedColumns;\n\t\treturn this.cachedColumns = Array.from(this.entries.values()).map((e) => ColumnLazyImpl.fromAccessor(e)).filter((v) => !isNil(v));\n\t}\n};\n/**\n* Sandbox-specific result-pool provider. Accepts the raw handle-shaped blocks\n* returned by {@link GlobalCfgRenderCtxMethods.getUpstreamBlockCtx} and\n* wraps them into {@link TreeNodeAccessor}s, then adds `getColumns()`.\n*/\nvar ResultPoolColumnsProviderImpl = class extends ResultPoolEntriesProvider {\n\tcachedColumns;\n\tconstructor(rawPool = getCfgRenderCtx().getUpstreamBlockCtx()) {\n\t\tconst blocks = rawPool.map((b) => ({\n\t\t\tblockId: b.blockId,\n\t\t\tprodCtx: b.prodCtx !== void 0 ? new TreeNodeAccessor(b.prodCtx, [b.blockId, \"prodCtx\"]) : void 0,\n\t\t\tstagingCtx: b.stagingCtx !== void 0 ? new TreeNodeAccessor(b.stagingCtx, [b.blockId, \"stagingCtx\"]) : void 0,\n\t\t\tprodIncomplete: b.prodIncomplete,\n\t\t\tstagingIncomplete: b.stagingIncomplete\n\t\t}));\n\t\tsuper(blocks);\n\t}\n\tgetColumns() {\n\t\tif (this.cachedColumns !== void 0) return this.cachedColumns;\n\t\treturn this.cachedColumns = Array.from(this.getPObjectEntries().values()).map((e) => ColumnLazyImpl.fromAccessor(e)).filter((v) => !isNil(v));\n\t}\n};\nfunction hashRawPool(rawPool) {\n\treturn rawPool.map((b) => `${b.blockId}\\x1f${b.prodCtx ?? \"\"}\\x1f${b.stagingCtx ?? \"\"}\\x1f${b.prodIncomplete ? 1 : 0}\\x1f${b.stagingIncomplete ? 1 : 0}`).join(\"\u001e\");\n}\n//#endregion\nexport { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, ColumnsProvider, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl };\n\n//# sourceMappingURL=providers.js.map","import { getCfgRenderCtx } from \"../../internal.js\";\nimport { TreeNodeAccessor } from \"../../render/accessor.js\";\nimport { MainAccessorName, StagingAccessorName } from \"../../render/internal.js\";\nimport { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, ColumnsProvider, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl } from \"./providers.js\";\n//#region src/columns/column_providers/index.ts\n/**\n* Build the default set of ColumnsProviders for the ambient render ctx:\n* - `AccessorColumnsProvider` over `outputs` (if present)\n* - `AccessorColumnsProvider` over `prerun` (if present)\n* - `ResultPoolColumnsProvider` over `rawResultPool`\n*\n* Pulls handles directly from the ambient `cfgRenderCtx`. Returns `[]` when\n* called outside a render context.\n*\n* Result is memoised per-ctx (WeakMap → array). Repeated calls within the\n* same render cycle return the same provider triplet — inner providers are\n* also LRU-memoised by their content keys, so even a cache miss here doesn't\n* re-walk the trees.\n*/\nconst _ctxProvidersCache = /* @__PURE__ */ new WeakMap();\nfunction getCtxProviders(deps) {\n\tconst ctx = deps?.ctx ?? getCfgRenderCtx();\n\tconst cached = _ctxProvidersCache.get(ctx);\n\tif (cached !== void 0) return cached;\n\tconst providers = [];\n\tconst outputs = ctx.getAccessorHandleByName(MainAccessorName);\n\tif (outputs !== void 0) providers.push(ColumnsProvider(new TreeNodeAccessor(outputs, [MainAccessorName])));\n\tconst prerun = ctx.getAccessorHandleByName(StagingAccessorName);\n\tif (prerun !== void 0) providers.push(ColumnsProvider(new TreeNodeAccessor(prerun, [StagingAccessorName])));\n\tproviders.push(ColumnsProvider(ctx.getUpstreamBlockCtx()));\n\t_ctxProvidersCache.set(ctx, providers);\n\treturn providers;\n}\nfunction isColumnProvider(source) {\n\tif (typeof source !== \"object\" || source === null) return false;\n\tconst p = source;\n\treturn typeof p.getColumns === \"function\" && typeof p.isFinal === \"function\";\n}\nfunction toColumnProvider(source) {\n\tif (isColumnArray(source)) return new ArrayColumnsProvider(source.columns, source.isFinal);\n\tif (isColumnProvider(source)) return source;\n\tif (source instanceof TreeNodeAccessor) return ColumnsProvider(source);\n\tthrow new Error(\"Unknown ColumnsSource type\");\n}\nfunction isColumnArray(source) {\n\tif (typeof source !== \"object\" || source === null) return false;\n\tconst s = source;\n\treturn Array.isArray(s.columns) && typeof s.isFinal === \"boolean\";\n}\n//#endregion\nexport { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, ColumnsProvider, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl, _ctxProvidersCache, getCtxProviders, isColumnProvider, toColumnProvider };\n\n//# sourceMappingURL=index.js.map","import { ColumnOverriddenRecipe } from \"./column_recipes/column_overrided_recipe.js\";\nimport { getCtxProviders } from \"./column_providers/index.js\";\nimport { ColumnRegistry, createGlobalPObjectId, isPColumn, isPlRef } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"es-toolkit\";\nimport { LRUCache } from \"lru-cache\";\n//#region src/columns/column_lazy.ts\n/**\n* Thrown by leaf-recipe factories when the requested column is provably\n* absent in the active render ctx — i.e. every relevant accessor reports\n* `inputsLocked` and the column did not appear. Distinct from the\n* `undefined` return that the factories still use for the \"resolving\" case\n* (the column may still appear later).\n*\n* Catch at the boundary (resolver / filter+sort wiring / data-table assembly)\n* when partial absence should be surfaced to the user rather than silently\n* producing an empty result.\n*/\nvar ColumnAbsentError = class extends Error {\n\tid;\n\tconstructor(id) {\n\t\tsuper(`Column is absent in the active render ctx and will not appear: ${id}`);\n\t\tthis.id = id;\n\t\tthis.name = \"ColumnAbsentError\";\n\t}\n};\n/**\n* ColumnLazy is the leaf-recipe building block: a {@link ColumnRecipe} whose\n* `id` is a bare {@link PObjectId} and whose readers are bound to a single\n* tree-accessor leaf. Layered encodings (Overridden / Discovered / Filtered)\n* are reified through their dedicated recipe classes and reference leaf\n* columns by id.\n*/\nvar ColumnLazyImpl = class ColumnLazyImpl {\n\tid;\n\toptions;\n\tspecCache;\n\tdataCache;\n\tdataStatusCache;\n\tconstructor(id, options) {\n\t\tthis.id = id;\n\t\tthis.options = options;\n\t}\n\t/** A leaf-recipe references exactly one column — its own id. */\n\tgetReferencedIds() {\n\t\treturn [this.id];\n\t}\n\tgetSpec() {\n\t\tif (this.specCache === void 0) this.specCache = { value: this.options.getSpec() };\n\t\treturn this.specCache.value;\n\t}\n\t/** Leaf-shaped — points straight at `this.id`. */\n\tgetQuery() {\n\t\treturn {\n\t\t\ttype: \"column\",\n\t\t\tcolumn: this.id\n\t\t};\n\t}\n\t/** Leaf-only: not on the recipe interface — only the leaf can read data directly. */\n\tgetData() {\n\t\tif (this.dataCache === void 0) this.dataCache = { value: this.options.getData() };\n\t\treturn this.dataCache.value;\n\t}\n\tgetDataStatus() {\n\t\tif (this.dataStatusCache === void 0) this.dataStatusCache = { value: this.options.getDataStatus() };\n\t\treturn this.dataStatusCache.value;\n\t}\n\t/**\n\t* Overlay overrides → produces a {@link ColumnOverriddenRecipe} wrapping\n\t* this leaf. ColumnLazy itself stays bare (id remains a plain PObjectId);\n\t* layering lives entirely in the recipe wrappers.\n\t*/\n\twithSpecs(overrides) {\n\t\treturn ColumnOverriddenRecipe.wrap(this, overrides);\n\t}\n\t/**\n\t* Resolve via the ambient {@link ColumnRegistry}. Spec is resolved eagerly:\n\t* returns `undefined` if the leaf isn't reachable yet (resolving). Throws\n\t* {@link ColumnAbsentError} when every relevant accessor is `inputsLocked`\n\t* and the column did not appear — the column will not exist in this ctx.\n\t* Data and dataStatus stay lazy.\n\t*/\n\tstatic fromId(id, { ctx } = {}) {\n\t\tconst registry = new ColumnRegistry(getCtxProviders({ ctx }));\n\t\tconst leaf = registry.resolve(id);\n\t\tif (isNil(leaf)) {\n\t\t\tif (registry.isFinal()) throw new ColumnAbsentError(id);\n\t\t\treturn;\n\t\t}\n\t\tconst spec = readSpecAccessor(leaf);\n\t\tif (isNil(spec)) {\n\t\t\tif (leaf.accessor.getInputsLocked()) throw new ColumnAbsentError(id);\n\t\t\treturn;\n\t\t}\n\t\tif (!spec.hasData()) return void 0;\n\t\treturn new ColumnLazyImpl(id, {\n\t\t\tgetSpec: () => spec.getDataAsJson(),\n\t\t\tgetData: () => readDataAccessor(leaf),\n\t\t\tgetDataStatus: () => readDataStatus(leaf)\n\t\t});\n\t}\n\t/** {@link PlRef} wrapper over {@link fromId}. */\n\tstatic fromPlRef(ref) {\n\t\treturn ColumnLazyImpl.fromId(createGlobalPObjectId(ref.blockId, ref.name));\n\t}\n\t/**\n\t* Bind directly to an accessor-backed {@link LeafEntry} — no registry.\n\t* Throws {@link ColumnAbsentError} if the leaf has no spec field and its\n\t* accessor is `inputsLocked`. Returns `undefined` while still resolving.\n\t*/\n\tstatic fromAccessor(entry) {\n\t\tconst spec = readSpecAccessor(entry);\n\t\tif (isNil(spec)) {\n\t\t\tif (entry.accessor.getInputsLocked()) throw new ColumnAbsentError(entry.id);\n\t\t\treturn;\n\t\t}\n\t\tif (!spec.hasData()) return void 0;\n\t\treturn new ColumnLazyImpl(entry.id, {\n\t\t\tgetSpec: () => spec.getDataAsJson(),\n\t\t\tgetData: () => readDataAccessor(entry),\n\t\t\tgetDataStatus: () => readDataStatus(entry)\n\t\t});\n\t}\n\t/**\n\t* Wrap a materialised {@link PColumn}. If the input is already a\n\t* {@link ColumnLazy} it is returned as-is.\n\t*/\n\tstatic fromColumn(column) {\n\t\tif (column instanceof ColumnLazyImpl) return column;\n\t\treturn new ColumnLazyImpl(column.id, {\n\t\t\tgetSpec: () => column.spec,\n\t\t\tgetData: () => column.data,\n\t\t\tgetDataStatus: () => \"present\"\n\t\t});\n\t}\n\t/**\n\t* Distinguishes `present` / `resolving` / `absent` for a {@link PObjectId}\n\t* in the active render ctx. Falls back to the registry's `isFinal()`\n\t* when the id has no entry — only then we can say `absent` instead of\n\t* `resolving`.\n\t*/\n\tstatic getStatusById(id, { ctx } = {}) {\n\t\tconst registry = new ColumnRegistry(getCtxProviders({ ctx }));\n\t\tconst leaf = registry.resolve(id);\n\t\tif (isNil(leaf)) return registry.isFinal() ? \"absent\" : \"resolving\";\n\t\treturn getLeafEntryStatus(leaf);\n\t}\n\t/** {@link PlRef} wrapper over {@link getStatusById}. */\n\tstatic getStatusByPlRef(ref, opts = {}) {\n\t\treturn ColumnLazyImpl.getStatusById(createGlobalPObjectId(ref.blockId, ref.name), opts);\n\t}\n\t/** No registry — reads straight off the entry's accessor. */\n\tstatic getStatusByAccessor(entry) {\n\t\treturn getLeafEntryStatus(entry);\n\t}\n};\n/**\n* Unified dispatcher — picks the right `ColumnLazyImpl.fromX` by source\n* shape. For ambiguous inputs callers can still use the explicit factories\n* (also attached as properties: `ColumnLazy.fromId`, `.fromPlRef`,\n* `.fromAccessor`, `.fromColumn`).\n*/\nfunction ColumnLazyDispatch(source, opts = {}) {\n\tif (typeof source === \"string\") return ColumnLazyImpl.fromId(source, opts);\n\tif (source instanceof ColumnLazyImpl) return source;\n\tif (\"accessor\" in source) return ColumnLazyImpl.fromAccessor(source);\n\tif (isPlRef(source)) return ColumnLazyImpl.fromPlRef(source);\n\tif (isPColumn(source)) return ColumnLazyImpl.fromColumn(source);\n\tthrow new Error(\"ColumnLazy: unknown source shape\");\n}\n/**\n* Polymorphic counterpart to {@link ColumnLazyDispatch}: returns the\n* {@link ColumnResolutionStatus} for any factory input without constructing\n* the recipe. For already-materialised sources ({@link PColumn} value,\n* existing {@link ColumnLazy}) status is `present` by construction.\n*/\nfunction ColumnLazyGetStatus(source, opts = {}) {\n\tif (typeof source === \"string\") return ColumnLazyImpl.getStatusById(source, opts);\n\tif (source instanceof ColumnLazyImpl) return \"present\";\n\tif (\"accessor\" in source) return ColumnLazyImpl.getStatusByAccessor(source);\n\tif (isPlRef(source)) return ColumnLazyImpl.getStatusByPlRef(source, opts);\n\tif (isPColumn(source)) return \"present\";\n\tthrow new Error(\"ColumnLazy.getStatus: unknown source shape\");\n}\nconst ColumnLazy = Object.assign(ColumnLazyDispatch, {\n\tfromId: ColumnLazyImpl.fromId,\n\tfromPlRef: ColumnLazyImpl.fromPlRef,\n\tfromAccessor: ColumnLazyImpl.fromAccessor,\n\tfromColumn: ColumnLazyImpl.fromColumn,\n\tgetStatus: ColumnLazyGetStatus,\n\tgetStatusById: ColumnLazyImpl.getStatusById,\n\tgetStatusByPlRef: ColumnLazyImpl.getStatusByPlRef,\n\tgetStatusByAccessor: ColumnLazyImpl.getStatusByAccessor\n});\n/**\n* Type-guard narrowing to the leaf recipe. Prefer this over\n* `instanceof ColumnLazyImpl` — `ColumnLazy` (the value) is the dispatcher\n* with statics, not the class, so `instanceof` requires the impl symbol.\n*/\nfunction isColumnLazy(value) {\n\treturn value instanceof ColumnLazyImpl;\n}\nconst readSpecAccessor = memoizeByEntry(({ accessor, name }) => accessor.traverse({\n\tfield: `${name}.spec`,\n\tassertFieldType: \"Input\",\n\tignoreError: true\n}));\n/**\n* Per-entry counterpart to {@link readDataStatus}: tells whether the leaf's\n* **spec** can be read in this ctx, and — for the negative cases —\n* distinguishes `resolving` from `absent` via `getInputsLocked()`.\n*\n* - spec field not yet on the entry's accessor + inputs locked → `absent`\n* - spec field not yet on the entry's accessor + still resolving → `resolving`\n* - spec resource present but bytes not yet written → `resolving`\n* (transient — the spec resource is connected, just unfilled)\n* - spec resource present and `hasData()` → `present`\n*/\nfunction getLeafEntryStatus(entry) {\n\tconst spec = readSpecAccessor(entry);\n\tif (isNil(spec)) return entry.accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n\tif (!spec.hasData()) return \"resolving\";\n\treturn \"present\";\n}\nconst readDataAccessor = memoizeByEntry(({ accessor, name }) => accessor.traverse({\n\tfield: `${name}.data`,\n\tassertFieldType: \"Input\",\n\tignoreError: true\n}));\nconst readDataStatus = memoizeByEntry(({ accessor, name }) => {\n\tif (accessor.listInputFields().includes(`${name}.data`)) return \"present\";\n\treturn accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n});\nfunction memoizeByEntry(fn) {\n\tconst cache = new LRUCache({ max: 1e3 });\n\treturn (entry) => {\n\t\tconst key = `${entry.accessor.handle}:${entry.name}`;\n\t\tlet hit = cache.get(key);\n\t\tif (!hit) cache.set(key, hit = { value: fn(entry) });\n\t\treturn hit.value;\n\t};\n}\n//#endregion\nexport { ColumnAbsentError, ColumnLazy, ColumnLazyImpl, isColumnLazy };\n\n//# sourceMappingURL=column_lazy.js.map","import { ColumnDiscoveredRecipe } from \"./column_discovered_recipe.js\";\nimport { ColumnFilteredRecipe } from \"./column_filtered_recipe.js\";\nimport { ColumnOverriddenRecipe } from \"./column_overrided_recipe.js\";\nimport { ColumnLazyImpl } from \"../column_lazy.js\";\nimport { isColumnDiscoveredKey, isColumnFilteredKey, isColumnOverriddenKey, isPObjectKey, parseColumnIdSafely } from \"@milaboratories/pl-model-common\";\n//#region src/columns/column_recipes/index.ts\n/**\n* Build a `ColumnRecipe` from a stringified id. Dispatches to the matching\n* concrete recipe variant based on the id's encoding and recurses on\n* wrappers' inner `source`:\n*\n* - bare {@link PObjectId} (non-JSON) → `ColumnLazy.fromId`\n* - `ColumnDiscoveredKey` → {@link ColumnDiscoveredRecipe}\n* - `ColumnOverriddenKey { source, specOverrides }` → recurse on `source`,\n* then {@link ColumnOverriddenRecipe.wrap}\n* - `ColumnFilteredKey { source, axisFilters }` → recurse on `source`,\n* then {@link ColumnFilteredRecipe.wrap}\n*\n* Returns `undefined` for unsupported variants (e.g. AnchoredPColumnId,\n* which needs an anchor map to resolve) or when a nested source itself\n* cannot be built.\n*/\nfunction ColumnRecipeBuild(id, opts = {}) {\n\tconst parsed = parseColumnIdSafely(id);\n\tif (isPObjectKey(parsed)) return ColumnLazyImpl.fromId(id, opts);\n\tif (isColumnDiscoveredKey(parsed)) return ColumnDiscoveredRecipe.fromKey(parsed, opts);\n\tif (isColumnOverriddenKey(parsed)) {\n\t\tconst inner = ColumnRecipe(parsed.source, opts);\n\t\tif (inner === void 0) return void 0;\n\t\treturn ColumnOverriddenRecipe.wrap(inner, parsed.specOverrides);\n\t}\n\tif (isColumnFilteredKey(parsed)) {\n\t\tif (typeof parsed.source !== \"string\") throw new Error(`Unsupported ColumnRecipe id variant: filtered column with non-string source (${JSON.stringify(parsed.source)})`);\n\t\tconst inner = ColumnRecipe(parsed.source, opts);\n\t\tif (inner === void 0) return void 0;\n\t\treturn ColumnFilteredRecipe.wrap(inner, parsed.axisFilters);\n\t}\n\tthrow new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\n/**\n* Resolution status counterpart to {@link ColumnRecipeBuild}. Dispatches on\n* the parsed id shape to the matching `getStatusBy*` static — never\n* constructs the recipe. Use this at boundaries (resolver, filter/sort\n* targets) to throw early on `absent` instead of silently producing an empty\n* recipe via {@link ColumnRecipeBuild}.\n*/\nfunction ColumnRecipeGetStatus(id, opts = {}) {\n\tconst parsed = parseColumnIdSafely(id);\n\tif (isPObjectKey(parsed)) return ColumnLazyImpl.getStatusById(id, opts);\n\tif (isColumnDiscoveredKey(parsed)) return ColumnDiscoveredRecipe.getStatusByKey(parsed, opts);\n\tif (isColumnOverriddenKey(parsed)) return ColumnOverriddenRecipe.getStatusByKey(parsed, opts);\n\tif (isColumnFilteredKey(parsed)) return ColumnFilteredRecipe.getStatusByKey(parsed, opts);\n\tthrow new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\nconst ColumnRecipe = Object.assign(ColumnRecipeBuild, { getStatus: ColumnRecipeGetStatus });\n/**\n* Type-guard for any recipe class — leaf {@link ColumnLazyImpl} or any of the\n* wrapper recipes ({@link ColumnDiscoveredRecipe}, {@link ColumnFilteredRecipe},\n* {@link ColumnOverriddenRecipe}). Use when a value may be a raw id, a `PColumn`,\n* or a recipe and you want to branch on the recipe case.\n*/\nfunction isColumnRecipe(value) {\n\treturn value instanceof ColumnLazyImpl || value instanceof ColumnDiscoveredRecipe || value instanceof ColumnFilteredRecipe || value instanceof ColumnOverriddenRecipe;\n}\n//#endregion\nexport { ColumnDiscoveredRecipe, ColumnFilteredRecipe, ColumnOverriddenRecipe, ColumnRecipe, isColumnRecipe };\n\n//# sourceMappingURL=index.js.map","import { ColumnRecipe, isColumnRecipe } from \"./column_recipes/index.js\";\nimport { ColumnLazy } from \"./column_lazy.js\";\n//#region src/columns/column.ts\n/**\n* Unified entry point — routes between the two top-level dispatchers:\n* - string id (`PObjectId` / `ColumnUniversalId`) → {@link ColumnRecipe}\n* - object source (`PlRef` / `LeafEntry` / `PColumn` / `ColumnLazy`) → {@link ColumnLazy}\n*\n* `ColumnLazy` is itself a `ColumnRecipe<PObjectId>`, so the return type is\n* the common `ColumnRecipe`.\n*/\nfunction Column(source, opts) {\n\tif (typeof source === \"string\") return ColumnRecipe(source, opts);\n\treturn ColumnLazy(source, opts);\n}\n/**\n* Type-guard for the `Column` type — currently aliased to `ColumnRecipe`, so\n* this is equivalent to {@link isColumnRecipe}. Kept as a separate export to\n* mirror the `Column` / `ColumnRecipe` / `ColumnLazy` factory triple.\n*/\nfunction isColumn(value) {\n\treturn isColumnRecipe(value);\n}\n//#endregion\nexport { Column, isColumn };\n\n//# sourceMappingURL=column.js.map","import { getCfgRenderCtx } from \"../internal.js\";\nimport { TreeNodeAccessor } from \"../render/accessor.js\";\nimport { MainAccessorName, StagingAccessorName } from \"../render/internal.js\";\nimport { getService } from \"../services/get_services.js\";\nimport { ColumnRecipe } from \"./column_recipes/index.js\";\nimport { isColumnProvider } from \"./column_providers/index.js\";\nimport { isNil } from \"es-toolkit\";\n//#region src/columns/columns_collection.ts\n/**\n* Build a {@link ColumnsCollection} from sandbox-side source descriptors.\n* Resolves the `columnsCollection` driver (either from `deps.driver` or via\n* `getService(\"columnsCollection\")`) and asks the host to mint a fresh\n* handle covering the supplied sources. Pass `sources === undefined` to\n* fall back to the active render ctx (main outputs + prerun + result pool).\n*\n* `sources` accepts {@link ColumnsSourceShorthand} string literals\n* (`\"result_pool\"`, `\"current_block\"`) for the common ctx-derived sources.\n*/\nfunction ColumnsCollection(sources, deps) {\n\tconst driver = deps?.driver ?? getService(\"columnsCollection\", { ctx: deps?.ctx });\n\tconst serialized = sources ? sources.flatMap((s) => toSerializedSources(s, deps?.ctx)) : defaultCtxSources(deps?.ctx);\n\treturn new ColumnsCollectionImpl(driver.create(serialized), driver);\n}\nfunction isColumnsCollection(value) {\n\treturn value instanceof ColumnsCollectionImpl;\n}\n/**\n* Sandbox proxy over the host-side `ColumnsCollection` driver. The driver\n* owns all column-set state; this object only carries an opaque\n* {@link CollectionHandle} plus a reference to the driver service.\n*\n* Construct via {@link ColumnsCollection} — the bare constructor is a\n* trivial `(handle, driver)` pair so that `addSource` / `discover` / `filter`\n* can rebind a freshly-minted handle without going through source\n* serialisation again.\n*\n* Every method returning a `ColumnsCollection` mints a fresh handle on the\n* host — the host VM bridge pins it to the active render ctx, so the sandbox\n* never has to manage refcounts.\n*/\nvar ColumnsCollectionImpl = class ColumnsCollectionImpl {\n\thandle;\n\tdriver;\n\tconstructor(handle, driver) {\n\t\tthis.handle = handle;\n\t\tthis.driver = driver;\n\t}\n\tisEmpty() {\n\t\treturn this.driver.isEmpty(this.handle);\n\t}\n\tisFinal() {\n\t\treturn this.driver.isFinal(this.handle);\n\t}\n\tgetColumnIds() {\n\t\treturn this.driver.getColumns(this.handle);\n\t}\n\tgetColumns() {\n\t\treturn this.getColumnIds().map((id) => ColumnRecipe(id)).filter((c) => !isNil(c));\n\t}\n\taddSource(source) {\n\t\treturn new ColumnsCollectionImpl(this.driver.addSource(this.handle, toSerializedSources(source)), this.driver);\n\t}\n\tdiscover(options) {\n\t\treturn new ColumnsCollectionImpl(this.driver.discover(this.handle, options), this.driver);\n\t}\n\tfilter(options) {\n\t\treturn new ColumnsCollectionImpl(this.driver.filter(this.handle, options), this.driver);\n\t}\n};\nfunction toSerializedSources(source, ctx) {\n\tif (source === \"result_pool\") return [{ kind: \"result_pool\" }];\n\tif (source === \"current_block\") return currentBlockSources(ctx);\n\tif (source instanceof ColumnsCollectionImpl) return [{\n\t\tkind: \"collection\",\n\t\thandle: source.handle\n\t}];\n\tif (source instanceof TreeNodeAccessor) return [{\n\t\tkind: \"accessor\",\n\t\taccessor: source.handle,\n\t\tpath: source.resolvePath\n\t}];\n\tif (isColumnArray(source)) return [{\n\t\tkind: \"ids\",\n\t\tids: source.columns.map((c) => c.id),\n\t\tisFinal: source.isFinal\n\t}];\n\tif (isColumnProvider(source)) return [{\n\t\tkind: \"ids\",\n\t\tids: source.getColumns().map((c) => c.id),\n\t\tisFinal: source.isFinal()\n\t}];\n\tthrow new Error(\"ColumnsCollection: unrecognised ColumnsSource shape\");\n}\nfunction isColumnArray(source) {\n\tif (typeof source !== \"object\" || source === null) return false;\n\tconst s = source;\n\treturn Array.isArray(s.columns) && typeof s.isFinal === \"boolean\";\n}\nfunction currentBlockSources(ctx) {\n\tconst renderCtx = ctx ?? getCfgRenderCtx();\n\tconst sources = [];\n\tconst outputs = renderCtx.getAccessorHandleByName(MainAccessorName);\n\tif (outputs !== void 0) sources.push({\n\t\tkind: \"accessor\",\n\t\taccessor: outputs,\n\t\tpath: [MainAccessorName]\n\t});\n\tconst prerun = renderCtx.getAccessorHandleByName(StagingAccessorName);\n\tif (prerun !== void 0) sources.push({\n\t\tkind: \"accessor\",\n\t\taccessor: prerun,\n\t\tpath: [StagingAccessorName]\n\t});\n\treturn sources;\n}\nfunction defaultCtxSources(ctx) {\n\treturn [...currentBlockSources(ctx), { kind: \"result_pool\" }];\n}\n//#endregion\nexport { ColumnsCollection, ColumnsCollectionImpl, isColumnsCollection };\n\n//# sourceMappingURL=columns_collection.js.map","import { TreeNodeAccessor } from \"../render/accessor.js\";\nimport { deriveDistinctLabels } from \"../labels/derive_distinct_labels.js\";\nimport \"../render/index.js\";\nimport { ColumnDiscoveredRecipe } from \"./column_recipes/column_discovered_recipe.js\";\nimport { ColumnFilteredRecipe } from \"./column_recipes/column_filtered_recipe.js\";\nimport { ColumnOverriddenRecipe } from \"./column_recipes/column_overrided_recipe.js\";\nimport { ColumnLazyImpl } from \"./column_lazy.js\";\nimport { ColumnsCollection, isColumnsCollection } from \"./columns_collection.js\";\nimport { collectSpecQueryColumns, extractPObjectId, isDataInfo, visitDataInfo } from \"@milaboratories/pl-model-common\";\nimport { throwError } from \"@milaboratories/helpers\";\n//#region src/columns/utils.ts\n/**\n* PObjectIds of every non-hit column referenced by `recipe.getQuery()`,\n* deduped in traversal order. The hit column is\n* `extractPObjectId(recipe.id)`; anything else in the query is a linker or\n* other engine-consumed column.\n*\n* Pure query walk — no registry access. Use {@link collectLinkerColumns} for\n* the resolved {@link ColumnLazy} variant.\n*/\nfunction collectLinkerIds(recipe) {\n\tconst hit = extractPObjectId(recipe.id);\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst out = [];\n\tfor (const id of collectSpecQueryColumns(recipe.getQuery())) {\n\t\tconst bare = extractPObjectId(id);\n\t\tif (bare === hit) continue;\n\t\tif (seen.has(bare)) continue;\n\t\tseen.add(bare);\n\t\tout.push(bare);\n\t}\n\treturn out;\n}\n/**\n* {@link collectLinkerIds} resolved against the ambient context as\n* {@link ColumnLazy} instances. Throws if any id fails to resolve —\n* matches the contract of the legacy `resolveLinkers` it replaces.\n*/\nfunction collectLinkerColumns(recipe, opts = {}) {\n\treturn collectLinkerIds(recipe).map((id) => ColumnLazyImpl.fromId(id, opts) ?? throwError(`materializeLinkers: linker ${id} not resolvable`));\n}\n/**\n* Hit-side axis qualifications for the recipe — the ones that should land on\n* the outer-join entry wrapping this column at the consumer boundary.\n*\n* Descends {@link ColumnOverriddenRecipe} / {@link ColumnFilteredRecipe} via\n* `getInner()` until it finds a {@link ColumnDiscoveredRecipe}; otherwise\n* returns `[]`. Pure recipe walk — no query-tree introspection.\n*/\nfunction hitQualifications(recipe) {\n\treturn findDiscovered(recipe)?.getColumnQualifications() ?? [];\n}\n/**\n* Per-primary-column axis qualifications for the recipe — applied to the\n* outer primary anchors on this recipe's group side. Keyed by the external\n* primary column id (NOT by columns inside this recipe's own query).\n*\n* Same walk strategy as {@link hitQualifications}.\n*/\nfunction queriesQualifications(recipe) {\n\treturn findDiscovered(recipe)?.getQueriesQualifications() ?? {};\n}\n/**\n* Whether the recipe's underlying data resources actually carry bytes —\n* strictly stronger than `getDataStatus() === \"present\"`, which only tells\n* that the `.data` field is wired onto the accessor.\n*\n* Walks every physical leaf the recipe depends on via\n* {@link ColumnRecipe.getReferencedIds} (resolves each id back to a\n* {@link ColumnLazy} through the ambient ctx) and ANDs `hasData()` across\n* all of them. Inline {@link PColumnValues} payloads count as present.\n*\n* Returns `false` if any leaf cannot be re-resolved in `opts.ctx` (treat as\n* \"not yet ready\") rather than throwing — this is a UI-facing predicate, not\n* a contract assertion.\n*/\nfunction hasColumnData(recipe, opts = {}) {\n\tfor (const id of recipe.getReferencedIds()) {\n\t\tconst lazy = ColumnLazyImpl.fromId(id, opts);\n\t\tif (lazy === void 0) return false;\n\t\tif (lazy.getDataStatus() !== \"present\") return false;\n\t\tif (!isLazyDataPresent(lazy.getData())) return false;\n\t}\n\treturn true;\n}\nfunction isLazyDataPresent(data) {\n\tif (data === void 0) return false;\n\tif (Array.isArray(data)) return true;\n\tif (data instanceof TreeNodeAccessor) return data.hasData();\n\tif (isDataInfo(data)) {\n\t\tlet ok = true;\n\t\tvisitDataInfo(data, (blob) => {\n\t\t\tok &&= blob.hasData();\n\t\t});\n\t\treturn ok;\n\t}\n\treturn false;\n}\n/**\n* Walk wrapper layers (Overridden, Filtered) until a {@link\n* ColumnDiscoveredRecipe} is found. Returns `undefined` if the recipe chain\n* has no Discovered layer (bare leaves and Overridden-over-leaf cases).\n*\n* Invariant from the wrapper classes themselves: there is at most one\n* Discovered layer in any recipe chain — Discovered is constructed only via\n* its own factory and is never re-wrapped by Discovered.\n*/\nfunction findDiscovered(recipe) {\n\tlet current = recipe;\n\twhile (true) {\n\t\tif (current instanceof ColumnDiscoveredRecipe) return current;\n\t\tif (current instanceof ColumnOverriddenRecipe || current instanceof ColumnFilteredRecipe) {\n\t\t\tcurrent = current.getInner();\n\t\t\tcontinue;\n\t\t}\n\t\treturn;\n\t}\n}\n/**\n* A recipe is a \"leaf\" (directly co-indexed on the anchor, reached without a\n* linker chain) iff its wrapper chain contains no {@link ColumnDiscoveredRecipe}.\n*\n* `Filtered` / `Overridden` over a bare leaf stay leaves; anything wrapping a\n* `Discovered` (e.g. `Overridden(Discovered(...))`) is linked. Use this — not an\n* `instanceof ColumnLazyImpl` check — to split direct vs. linker-joined columns,\n* since projections over a plain leaf are still direct.\n*/\nfunction isLeafColumn(recipe) {\n\treturn findDiscovered(recipe) === void 0;\n}\n/**\n* Data of the bare leaf a \"leaf\" recipe bottoms out at — reads the leaf-only\n* {@link ColumnLazy.getData} after walking the wrapper chain down via\n* {@link extractLeafColumn}. Returns `undefined` when the recipe is not a leaf (its\n* chain reaches a {@link ColumnDiscoveredRecipe}); the symmetric counterpart\n* of {@link isLeafColumn} returning `false`.\n*/\nfunction getLeafColumnData(recipe) {\n\tif (!isLeafColumn(recipe)) throw new Error(`getLeafColumnData: recipe ${recipe.id} is not a leaf column`);\n\treturn extractLeafColumn(recipe)?.getData();\n}\n/**\n* Walk wrapper layers (Overridden, Filtered) down to the bare {@link ColumnLazy}\n* leaf the chain bottoms out at. Returns `undefined` if the chain reaches a\n* {@link ColumnDiscoveredRecipe} instead — i.e. the recipe is not a leaf\n* ({@link isLeafColumn} would return `false`). Mirror of {@link findDiscovered}.\n*/\nfunction extractLeafColumn(recipe) {\n\tlet current = recipe;\n\twhile (true) {\n\t\tif (current instanceof ColumnLazyImpl) return current;\n\t\tif (current instanceof ColumnOverriddenRecipe || current instanceof ColumnFilteredRecipe) {\n\t\t\tcurrent = current.getInner();\n\t\t\tcontinue;\n\t\t}\n\t\tif (current instanceof ColumnDiscoveredRecipe) throw new Error(`extractLeafColumn: recipe ${recipe.id} is not a leaf column`);\n\t\tthrow new Error(`extractLeafColumn: unrecognized recipe layer for ${recipe.id}`);\n\t}\n}\n/**\n* Enumerates every column already in `source` and renders distinct labels\n* from each recipe's spec. Filtering is the caller's job — pass a\n* {@link ColumnsCollection} that was already narrowed via `.filter(...)` /\n* `.discover(...)`, or hand over a raw {@link ColumnsSource} (provider,\n* accessor, column array, or `\"result_pool\"` / `\"current_block\"` shorthand)\n* to be wrapped on the fly.\n*/\nfunction deriveColumnOptions(source, labelOptions = {}) {\n\tconst recipes = (isColumnsCollection(source) ? source : ColumnsCollection(source)).getColumns();\n\tconst labels = deriveDistinctLabels(recipes.map((r) => r.getSpec()), labelOptions);\n\treturn recipes.map((r, i) => ({\n\t\tid: r.id,\n\t\tlabel: labels[i]\n\t}));\n}\n//#endregion\nexport { collectLinkerColumns, collectLinkerIds, deriveColumnOptions, getLeafColumnData, hasColumnData, hitQualifications, isLeafColumn, queriesQualifications };\n\n//# sourceMappingURL=utils.js.map","import { PColumnCollection } from \"../render/util/column_collection.js\";\nimport \"../render/index.js\";\nimport { enrichCompatible, getAvailableWithLinkersAxes } from \"./axes.js\";\nimport { ColumnsCollection } from \"../columns/columns_collection.js\";\nimport \"../columns/index.js\";\nimport { canonicalizeJson, extractPObjectId, getAxisId, getNormalizedAxesList, isLabelColumn, isLinkerColumn, matchAxisId } from \"@milaboratories/pl-model-common\";\n//#region src/pframe_utils/columns.ts\nfunction getAllRelatedColumns(ctx, predicate) {\n\tconst columns = new PColumnCollection();\n\tcolumns.addColumnProvider(ctx.resultPool);\n\tconst allColumns = columns.getColumns(predicate, {\n\t\tdontWaitAllData: true,\n\t\toverrideLabelAnnotation: false\n\t}) ?? [];\n\treturn enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {\n\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t})), allColumns);\n}\nfunction getRelatedColumns(ctx, { columns: rootColumns, predicate }) {\n\tconst columns = new PColumnCollection();\n\tcolumns.addColumnProvider(ctx.resultPool);\n\tcolumns.addColumns(rootColumns);\n\tconst blockAxes = /* @__PURE__ */ new Map();\n\tconst allAxes = /* @__PURE__ */ new Map();\n\tfor (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\tconst aid = getAxisId(spec);\n\t\tblockAxes.set(canonicalizeJson(aid), spec);\n\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t}\n\tconst availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);\n\tfor (const item of availableWithLinkersAxes) {\n\t\tblockAxes.set(...item);\n\t\tallAxes.set(...item);\n\t}\n\tconst blockAxesArr = Array.from(blockAxes.values());\n\tlet compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\tconst axisId = getAxisId(axisSpec);\n\t\treturn blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t}), {\n\t\tdontWaitAllData: true,\n\t\toverrideLabelAnnotation: false\n\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\tfor (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\tconst aid = getAxisId(spec);\n\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t}\n\tconst allAxesArr = Array.from(allAxes.values());\n\tcompatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {\n\t\tconst axisId = getAxisId(axisSpec);\n\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t}), {\n\t\tdontWaitAllData: true,\n\t\toverrideLabelAnnotation: false\n\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\tconst compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\tconst axisId = getAxisId(axisSpec);\n\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t}), {\n\t\tdontWaitAllData: true,\n\t\toverrideLabelAnnotation: false\n\t}) ?? []).filter((column) => isLabelColumn(column.spec));\n\tconst compatible = [...compatibleWithoutLabels, ...compatibleLabels];\n\tconst integrableIds = discoverIntegrableColumnIds(ctx, rootColumns);\n\tconst rootIds = new Set(rootColumns.map((c) => c.id));\n\treturn enrichCompatible(blockAxes, compatible.filter((c) => rootIds.has(c.id) || isLinkerColumn(c.spec) || (integrableIds?.has(c.id) ?? true)));\n}\n/** Column ids that discovery confirms integrate with the block, or `undefined` when it can't decide. */\nfunction discoverIntegrableColumnIds(ctx, rootColumns) {\n\tconst anchorSpecs = Array.from(new Map(rootColumns.map((c) => [canonicalizeJson(c.spec), c.spec])).values());\n\tif (anchorSpecs.length === 0) return void 0;\n\ttry {\n\t\tconst columns = ColumnsCollection(void 0, { ctx: ctx.ctx }).discover({\n\t\t\tmode: \"enrichment\",\n\t\t\tmaxHops: 4,\n\t\t\tanchors: Object.fromEntries(anchorSpecs.map((spec, i) => [`anchor_${i}`, spec]))\n\t\t}).getColumns();\n\t\treturn new Set(columns.map((c) => extractPObjectId(c.id)));\n\t} catch {\n\t\treturn;\n\t}\n}\n//#endregion\nexport { getAllRelatedColumns, getRelatedColumns };\n\n//# sourceMappingURL=columns.js.map","import { enrichCompatible, getAvailableWithLinkersAxes } from \"../pframe_utils/axes.js\";\nimport { getAllRelatedColumns, getRelatedColumns } from \"../pframe_utils/columns.js\";\nimport { Annotation, readAnnotationJson } from \"@milaboratories/pl-model-common\";\n//#region src/components/PFrameForGraphs.ts\nfunction isHiddenFromGraphColumn(column) {\n\treturn !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n}\nfunction isHiddenFromUIColumn(column) {\n\treturn !!readAnnotationJson(column, Annotation.HideDataFromUi);\n}\n/**\nThe aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n(including linker columns and all label columns).\nBlock’s columns are added to pframe as is.\nOther columns are added basing on set of axes of block’s columns, considering available with linker columns.\nCompatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\nresult pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\namong existing ones).\nIn requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\nof partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\nand modified label (with added domain values in case if more than one copy with different domains exist).\n*/\nfunction createPFrameForGraphs(ctx, blockColumns) {\n\tif (blockColumns?.some((v) => v.data === void 0)) return void 0;\n\tconst suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n\tif (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n\treturn ctx.createPFrame(getRelatedColumns(ctx, {\n\t\tcolumns: blockColumns,\n\t\tpredicate: suitableSpec\n\t}));\n}\n//#endregion\nexport { createPFrameForGraphs, enrichCompatible, getAvailableWithLinkersAxes, isHiddenFromGraphColumn, isHiddenFromUIColumn };\n\n//# sourceMappingURL=PFrameForGraphs.js.map","//#region src/filters/traverse.ts\n/**\n* Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.\n*\n* Entries with `{ type: undefined }` inside `and`/`or` arrays are skipped\n* (these represent unfilled filter slots in the UI).\n*\n* Traversal order:\n* 1. Recurse into child filters (`and`/`or`/`not`)\n* 2. Apply the corresponding visitor callback with already-traversed children\n* 3. For leaf nodes, call `leaf` directly\n*/\nfunction traverseFilterSpec(filter, visitor) {\n\treturn traverseFilterSpecImpl(filter, visitor);\n}\n/** Internal implementation with simple generics for clean recursion. */\nfunction traverseFilterSpecImpl(filter, visitor) {\n\tswitch (filter.type) {\n\t\tcase \"and\": return visitor.and(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\tcase \"or\": return visitor.or(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\tcase \"not\": return visitor.not(traverseFilterSpecImpl(filter.filter, visitor));\n\t\tdefault: return visitor.leaf(filter);\n\t}\n}\n/** Collects all column references (`column` and `rhs` fields) from filter leaves. */\nfunction collectFilterSpecColumns(filter) {\n\treturn traverseFilterSpec(filter, {\n\t\tleaf: (leaf) => {\n\t\t\tconst cols = [];\n\t\t\tif (\"column\" in leaf && leaf.column !== void 0) cols.push(leaf.column);\n\t\t\tif (\"rhs\" in leaf && leaf.rhs !== void 0) cols.push(leaf.rhs);\n\t\t\treturn cols;\n\t\t},\n\t\tand: (results) => results.flat(),\n\t\tor: (results) => results.flat(),\n\t\tnot: (result) => result\n\t});\n}\n//#endregion\nexport { collectFilterSpecColumns, traverseFilterSpec };\n\n//# sourceMappingURL=traverse.js.map","import { traverseFilterSpec } from \"../traverse.js\";\nimport { assertNever } from \"@milaboratories/pl-model-common\";\n//#region src/filters/converters/filterToQuery.ts\n/** Converts a QueryColumnId object into a SpecQueryExpression reference. */\nfunction resolveColumnRef(col) {\n\treturn col.type === \"axis\" ? {\n\t\ttype: \"axisRef\",\n\t\tvalue: col.id\n\t} : {\n\t\ttype: \"columnRef\",\n\t\tvalue: col.id\n\t};\n}\n/** Converts a FilterSpec tree into a SpecQueryExpression. */\nfunction filterSpecToSpecQueryExpr(filter) {\n\treturn traverseFilterSpec(filter, {\n\t\tleaf: leafToSpecQueryExpr,\n\t\tand: (inputs) => {\n\t\t\tif (inputs.length === 0) throw new Error(\"AND filter requires at least one operand\");\n\t\t\treturn {\n\t\t\t\ttype: \"and\",\n\t\t\t\tinput: inputs\n\t\t\t};\n\t\t},\n\t\tor: (inputs) => {\n\t\t\tif (inputs.length === 0) throw new Error(\"OR filter requires at least one operand\");\n\t\t\treturn {\n\t\t\t\ttype: \"or\",\n\t\t\t\tinput: inputs\n\t\t\t};\n\t\t},\n\t\tnot: (input) => ({\n\t\t\ttype: \"not\",\n\t\t\tinput\n\t\t})\n\t});\n}\nfunction leafToSpecQueryExpr(filter) {\n\tswitch (filter.type) {\n\t\tcase \"patternEquals\": return {\n\t\t\ttype: \"stringEquals\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tvalue: filter.value,\n\t\t\tcaseInsensitive: false\n\t\t};\n\t\tcase \"patternNotEquals\": return {\n\t\t\ttype: \"not\",\n\t\t\tinput: {\n\t\t\t\ttype: \"stringEquals\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value,\n\t\t\t\tcaseInsensitive: false\n\t\t\t}\n\t\t};\n\t\tcase \"patternContainSubsequence\": return {\n\t\t\ttype: \"stringContains\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tvalue: filter.value,\n\t\t\tcaseInsensitive: false\n\t\t};\n\t\tcase \"patternNotContainSubsequence\": return {\n\t\t\ttype: \"not\",\n\t\t\tinput: {\n\t\t\t\ttype: \"stringContains\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value,\n\t\t\t\tcaseInsensitive: false\n\t\t\t}\n\t\t};\n\t\tcase \"patternMatchesRegularExpression\": return {\n\t\t\ttype: \"stringRegex\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tvalue: filter.value\n\t\t};\n\t\tcase \"patternFuzzyContainSubsequence\": return {\n\t\t\ttype: \"stringContainsFuzzy\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tvalue: filter.value,\n\t\t\tmaxEdits: filter.maxEdits ?? 1,\n\t\t\tcaseInsensitive: false,\n\t\t\tsubstitutionsOnly: filter.substitutionsOnly ?? false,\n\t\t\twildcard: filter.wildcard ?? null\n\t\t};\n\t\tcase \"equal\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"eq\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"notEqual\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"ne\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"lessThan\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"lt\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"greaterThan\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"gt\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"lessThanOrEqual\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"le\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"greaterThanOrEqual\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"ge\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.x\n\t\t\t}\n\t\t};\n\t\tcase \"equalToColumn\": return {\n\t\t\ttype: \"numericComparison\",\n\t\t\toperand: \"eq\",\n\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\tright: resolveColumnRef(filter.rhs)\n\t\t};\n\t\tcase \"lessThanColumn\": {\n\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"lt\",\n\t\t\t\tleft: {\n\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\toperand: \"add\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright: {\n\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tright\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"lt\",\n\t\t\t\tleft,\n\t\t\t\tright\n\t\t\t};\n\t\t}\n\t\tcase \"greaterThanColumn\": {\n\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"gt\",\n\t\t\t\tleft: {\n\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\toperand: \"add\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright: {\n\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tright\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"gt\",\n\t\t\t\tleft,\n\t\t\t\tright\n\t\t\t};\n\t\t}\n\t\tcase \"lessThanColumnOrEqual\": {\n\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"le\",\n\t\t\t\tleft: {\n\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\toperand: \"add\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright: {\n\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tright\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"le\",\n\t\t\t\tleft,\n\t\t\t\tright\n\t\t\t};\n\t\t}\n\t\tcase \"greaterThanColumnOrEqual\": {\n\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ge\",\n\t\t\t\tleft: {\n\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\toperand: \"add\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright: {\n\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tright\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ge\",\n\t\t\t\tleft,\n\t\t\t\tright\n\t\t\t};\n\t\t}\n\t\tcase \"inSet\": return {\n\t\t\ttype: \"isIn\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tset: filter.value,\n\t\t\tnegate: false\n\t\t};\n\t\tcase \"notInSet\": return {\n\t\t\ttype: \"isIn\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\tset: filter.value,\n\t\t\tnegate: true\n\t\t};\n\t\tcase \"isNA\": return {\n\t\t\ttype: \"isNull\",\n\t\t\tinput: resolveColumnRef(filter.column)\n\t\t};\n\t\tcase \"isNotNA\": return {\n\t\t\ttype: \"not\",\n\t\t\tinput: {\n\t\t\t\ttype: \"isNull\",\n\t\t\t\tinput: resolveColumnRef(filter.column)\n\t\t\t}\n\t\t};\n\t\tcase \"ifNa\": return {\n\t\t\ttype: \"fillNull\",\n\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\treplacement: {\n\t\t\t\ttype: \"constant\",\n\t\t\t\tvalue: filter.replacement\n\t\t\t}\n\t\t};\n\t\tcase \"topN\":\n\t\tcase \"bottomN\": throw new Error(`Filter type \"${filter.type}\" is not supported in query expressions`);\n\t\tcase void 0: throw new Error(\"Filter type is undefined\");\n\t\tdefault: assertNever(filter);\n\t}\n}\n//#endregion\nexport { filterSpecToSpecQueryExpr };\n\n//# sourceMappingURL=filterToQuery.js.map","import { isLength } from '../../predicate/isLength.mjs';\n\nfunction isArrayLike(value) {\n return value != null && typeof value !== 'function' && isLength(value.length);\n}\n\nexport { isArrayLike };\n","import { getTag } from '../_internal/getTag.mjs';\n\nfunction isArguments(value) {\n return value !== null && typeof value === 'object' && getTag(value) === '[object Arguments]';\n}\n\nexport { isArguments };\n","function isPrototype(value) {\n const constructor = value?.constructor;\n const prototype = typeof constructor === 'function' ? constructor.prototype : Object.prototype;\n return value === prototype;\n}\n\nexport { isPrototype };\n","import { isTypedArray as isTypedArray$1 } from '../../predicate/isTypedArray.mjs';\n\nfunction isTypedArray(x) {\n return isTypedArray$1(x);\n}\n\nexport { isTypedArray };\n","import { isArguments } from './isArguments.mjs';\nimport { isArrayLike } from './isArrayLike.mjs';\nimport { isTypedArray } from './isTypedArray.mjs';\nimport { isPrototype } from '../_internal/isPrototype.mjs';\n\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value)) {\n if (typeof value.splice !== 'function' &&\n typeof value !== 'string' &&\n (typeof Buffer === 'undefined' || !Buffer.isBuffer(value)) &&\n !isTypedArray(value) &&\n !isArguments(value)) {\n return false;\n }\n return value.length === 0;\n }\n if (typeof value === 'object') {\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n const keys = Object.keys(value);\n if (isPrototype(value)) {\n return keys.filter(x => x !== 'constructor').length === 0;\n }\n return keys.length === 0;\n }\n return true;\n}\n\nexport { isEmpty };\n","import { traverseFilterSpec } from \"./traverse.js\";\nimport { isNil } from \"@milaboratories/helpers\";\nimport { isEmpty } from \"es-toolkit/compat\";\n//#region src/filters/distill.ts\n/**\n* Strips non-FilterSpec metadata (whitelist approach) and removes\n* unfilled leaves (type is undefined or any required field is undefined).\n*/\nfunction distillFilterSpec(filter) {\n\tif (filter == null) return null;\n\treturn traverseFilterSpec(filter, {\n\t\tleaf: (leaf) => {\n\t\t\tconst distilled = distillLeaf(leaf);\n\t\t\treturn isFilledLeaf(distilled) ? distilled : null;\n\t\t},\n\t\tand: (results) => {\n\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: filtered\n\t\t\t};\n\t\t},\n\t\tor: (results) => {\n\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\ttype: \"or\",\n\t\t\t\tfilters: filtered\n\t\t\t};\n\t\t},\n\t\tnot: (result) => result === null ? null : {\n\t\t\ttype: \"not\",\n\t\t\tfilter: result\n\t\t}\n\t});\n}\nfunction distillLeaf(node) {\n\tconst result = {};\n\tfor (const [key, value] of Object.entries(node)) if (KNOWN_LEAF_KEYS.has(key)) result[key] = value;\n\treturn result;\n}\n/** Returns true if the leaf is filled — type is defined and every required field per-type is filled. */\nfunction isFilledLeaf(node) {\n\tif (isNil(node.type)) return false;\n\tconst required = REQUIRED_KEYS_BY_TYPE[node.type];\n\tconst record = node;\n\treturn required.every((key) => isFilledValue(record[key]));\n}\n/**\n* Returns true if the value is considered \"filled\":\n* - primitives (number, boolean): always true\n* - string: non-empty after trim\n* - array: non-empty AND every item is filled\n* - plain object: non-empty AND every field value is filled\n* - null/undefined: false\n*/\nfunction isFilledValue(value) {\n\tif (isNil(value)) return false;\n\tswitch (typeof value) {\n\t\tcase \"number\":\n\t\tcase \"boolean\": return true;\n\t\tcase \"string\": return value.trim() !== \"\";\n\t\tdefault:\n\t\t\tif (isEmpty(value)) return false;\n\t\t\tif (Array.isArray(value)) return value.every(isFilledValue);\n\t\t\treturn Object.values(value).every(isFilledValue);\n\t}\n}\nconst KNOWN_LEAF_KEYS = /* @__PURE__ */ new Set([\n\t\"n\",\n\t\"x\",\n\t\"rhs\",\n\t\"type\",\n\t\"value\",\n\t\"column\",\n\t\"minDiff\",\n\t\"maxEdits\",\n\t\"wildcard\",\n\t\"replacement\",\n\t\"substitutionsOnly\"\n]);\n/** Required fields per leaf type. Optional fields (e.g. minDiff, maxEdits) excluded. */\nconst REQUIRED_KEYS_BY_TYPE = {\n\tisNA: [\"column\"],\n\tisNotNA: [\"column\"],\n\tifNa: [\"column\", \"replacement\"],\n\tpatternEquals: [\"column\", \"value\"],\n\tpatternNotEquals: [\"column\", \"value\"],\n\tpatternContainSubsequence: [\"column\", \"value\"],\n\tpatternNotContainSubsequence: [\"column\", \"value\"],\n\tpatternMatchesRegularExpression: [\"column\", \"value\"],\n\tpatternFuzzyContainSubsequence: [\"column\", \"value\"],\n\tinSet: [\"column\", \"value\"],\n\tnotInSet: [\"column\", \"value\"],\n\ttopN: [\"column\", \"n\"],\n\tbottomN: [\"column\", \"n\"],\n\tequal: [\"column\", \"x\"],\n\tnotEqual: [\"column\", \"x\"],\n\tlessThan: [\"column\", \"x\"],\n\tgreaterThan: [\"column\", \"x\"],\n\tlessThanOrEqual: [\"column\", \"x\"],\n\tgreaterThanOrEqual: [\"column\", \"x\"],\n\tequalToColumn: [\"column\", \"rhs\"],\n\tlessThanColumn: [\"column\", \"rhs\"],\n\tgreaterThanColumn: [\"column\", \"rhs\"],\n\tlessThanColumnOrEqual: [\"column\", \"rhs\"],\n\tgreaterThanColumnOrEqual: [\"column\", \"rhs\"]\n};\n//#endregion\nexport { distillFilterSpec };\n\n//# sourceMappingURL=distill.js.map","import { distillFilterSpec } from \"../../filters/distill.js\";\nimport \"../../filters/index.js\";\nimport { canonicalizeJson, getPTableColumnId, parseJsonSafely } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"es-toolkit\";\n//#region src/components/PlDataTable/state-migration.ts\n/** Upgrade PlDataTableStateV2 to the latest version */\nfunction upgradePlDataTableStateV2(state) {\n\tif (!state) return createPlDataTableStateV2();\n\tif (!(\"version\" in state)) state = createPlDataTableStateV2();\n\tif (state.version === 2) state = {\n\t\tversion: 3,\n\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t...entry,\n\t\t\tfiltersState: []\n\t\t})),\n\t\tpTableParams: createDefaultPTableParamsV7()\n\t};\n\tif (state.version === 3) state = createPlDataTableStateV2();\n\tif (state.version === 4) state = migrateV4toV6(state);\n\tif (state.version === 5) state = migrateV5toV6(state);\n\tif (state.version === 6) state = migrateV6toV7(state);\n\tif (state.version === 7) state = migrateV7toV8(state);\n\treturn state;\n}\n/** Migrate v5 to v6: unwrap `{source, labeled}` colIds in gridState. */\nfunction migrateV5toV6(state) {\n\treturn {\n\t\tversion: 6,\n\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t...entry,\n\t\t\tgridState: unwrapV5GridState(entry.gridState)\n\t\t})),\n\t\tpTableParams: createDefaultPTableParamsV7()\n\t};\n}\n/** Convert v5 wrapped colId JSON to bare PTableColumnSpec JSON, taking `.source`.\n* gridState colIds may include the row-number sentinel (a JSON-stringified\n* literal, not a wrapped spec) — those pass through unchanged. */\nfunction unwrapV5ColId(json) {\n\tconst parsed = parseJsonSafely(json);\n\treturn !isNil(parsed) && typeof parsed === \"object\" && \"source\" in parsed ? canonicalizeJson(parsed.source) : json;\n}\nfunction unwrapV5GridState(gridState) {\n\tconst unwrapAs = (json) => unwrapV5ColId(json);\n\treturn {\n\t\tcolumnOrder: gridState.columnOrder ? { orderedColIds: gridState.columnOrder.orderedColIds.map(unwrapAs) } : void 0,\n\t\tsort: gridState.sort ? { sortModel: gridState.sort.sortModel.map((s) => ({\n\t\t\tcolId: unwrapAs(s.colId),\n\t\t\tsort: s.sort\n\t\t})) } : void 0,\n\t\tcolumnVisibility: gridState.columnVisibility ? { hiddenColIds: gridState.columnVisibility.hiddenColIds.map(unwrapAs) } : void 0\n\t};\n}\n/** Migrate v6 to v7: rewrite each colId from a full PTableColumnSpec to its\n* compact PTableColumnId (drops annotations/spec body, ~16× smaller per column). */\nfunction migrateV6toV7(state) {\n\treturn {\n\t\tversion: 7,\n\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t...entry,\n\t\t\tgridState: shrinkV6GridState(entry.gridState)\n\t\t})),\n\t\tpTableParams: state.pTableParams\n\t};\n}\n/** Convert a v6 fat colId (canonicalized PTableColumnSpec) to a v7 compact colId\n* (canonicalized PTableColumnId). The row-number sentinel is a string literal,\n* not a spec — pass it through unchanged. */\nfunction shrinkV6ColId(json) {\n\tconst parsed = parseJsonSafely(json);\n\tif (!isNil(parsed) && typeof parsed === \"object\" && \"type\" in parsed && \"id\" in parsed) return canonicalizeJson(getPTableColumnId(parsed));\n\treturn json;\n}\nfunction shrinkV6GridState(gridState) {\n\treturn {\n\t\tcolumnOrder: gridState.columnOrder ? { orderedColIds: gridState.columnOrder.orderedColIds.map(shrinkV6ColId) } : void 0,\n\t\tsort: gridState.sort ? { sortModel: gridState.sort.sortModel.map((s) => ({\n\t\t\tcolId: shrinkV6ColId(s.colId),\n\t\t\tsort: s.sort\n\t\t})) } : void 0,\n\t\tcolumnVisibility: gridState.columnVisibility ? { hiddenColIds: gridState.columnVisibility.hiddenColIds.map(shrinkV6ColId) } : void 0\n\t};\n}\n/** Migrate v4 state to v6: convert per-column filters to tree-based format (skips v5). */\nfunction migrateV4toV6(state) {\n\tlet idCounter = 0;\n\tconst nextId = () => ++idCounter;\n\tconst migratedCache = state.stateCache.map((entry) => {\n\t\tconst leaves = [];\n\t\tfor (const f of entry.filtersState) if (f.filter !== null && !f.filter.disabled) leaves.push(migrateTableFilter(canonicalizeJson(f.id), f.filter.value, nextId));\n\t\tconst filtersState = leaves.length > 0 ? {\n\t\t\tid: nextId(),\n\t\t\ttype: \"and\",\n\t\t\tfilters: leaves\n\t\t} : null;\n\t\treturn {\n\t\t\tsourceId: entry.sourceId,\n\t\t\tgridState: entry.gridState,\n\t\t\tsheetsState: entry.sheetsState,\n\t\t\tfiltersState,\n\t\t\tdefaultFiltersState: null\n\t\t};\n\t});\n\tconst oldSourceId = state.pTableParams.sourceId;\n\tconst currentCache = oldSourceId ? migratedCache.find((e) => e.sourceId === oldSourceId) : void 0;\n\treturn {\n\t\tversion: 6,\n\t\tstateCache: migratedCache,\n\t\tpTableParams: currentCache && oldSourceId ? {\n\t\t\tsourceId: oldSourceId,\n\t\t\thiddenColIds: state.pTableParams.hiddenColIds?.map((id) => ({\n\t\t\t\ttype: \"column\",\n\t\t\t\tid\n\t\t\t})) ?? null,\n\t\t\tfilters: distillFilterSpec(currentCache.filtersState),\n\t\t\tdefaultFilters: null,\n\t\t\tsorting: state.pTableParams.sorting\n\t\t} : createDefaultPTableParamsV7()\n\t};\n}\n/** Migrate a single per-column PlTableFilter to a v7-form tree node (legacy\n* string column ids). v7 → v8 later converts these to object form. */\nfunction migrateTableFilter(column, filter, nextId) {\n\tconst id = nextId();\n\tswitch (filter.type) {\n\t\tcase \"isNA\": return {\n\t\t\tid,\n\t\t\ttype: \"isNA\",\n\t\t\tcolumn\n\t\t};\n\t\tcase \"isNotNA\": return {\n\t\t\tid,\n\t\t\ttype: \"isNotNA\",\n\t\t\tcolumn\n\t\t};\n\t\tcase \"number_equals\": return {\n\t\t\tid,\n\t\t\ttype: \"equal\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_notEquals\": return {\n\t\t\tid,\n\t\t\ttype: \"notEqual\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_greaterThan\": return {\n\t\t\tid,\n\t\t\ttype: \"greaterThan\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_greaterThanOrEqualTo\": return {\n\t\t\tid,\n\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_lessThan\": return {\n\t\t\tid,\n\t\t\ttype: \"lessThan\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_lessThanOrEqualTo\": return {\n\t\t\tid,\n\t\t\ttype: \"lessThanOrEqual\",\n\t\t\tcolumn,\n\t\t\tx: filter.reference\n\t\t};\n\t\tcase \"number_between\": return {\n\t\t\tid,\n\t\t\ttype: \"and\",\n\t\t\tfilters: [filter.includeLowerBound ? {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.lowerBound\n\t\t\t} : {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"greaterThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.lowerBound\n\t\t\t}, filter.includeUpperBound ? {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"lessThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.upperBound\n\t\t\t} : {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"lessThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.upperBound\n\t\t\t}]\n\t\t};\n\t\tcase \"string_equals\": return {\n\t\t\tid,\n\t\t\ttype: \"patternEquals\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference\n\t\t};\n\t\tcase \"string_notEquals\": return {\n\t\t\tid,\n\t\t\ttype: \"patternNotEquals\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference\n\t\t};\n\t\tcase \"string_contains\": return {\n\t\t\tid,\n\t\t\ttype: \"patternContainSubsequence\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference\n\t\t};\n\t\tcase \"string_doesNotContain\": return {\n\t\t\tid,\n\t\t\ttype: \"patternNotContainSubsequence\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference\n\t\t};\n\t\tcase \"string_matches\": return {\n\t\t\tid,\n\t\t\ttype: \"patternMatchesRegularExpression\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference\n\t\t};\n\t\tcase \"string_doesNotMatch\": return {\n\t\t\tid,\n\t\t\ttype: \"not\",\n\t\t\tfilter: {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"patternMatchesRegularExpression\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t}\n\t\t};\n\t\tcase \"string_containsFuzzyMatch\": return {\n\t\t\tid,\n\t\t\ttype: \"patternFuzzyContainSubsequence\",\n\t\t\tcolumn,\n\t\t\tvalue: filter.reference,\n\t\t\tmaxEdits: filter.maxEdits,\n\t\t\tsubstitutionsOnly: filter.substitutionsOnly,\n\t\t\t...filter.wildcard !== void 0 ? { wildcard: filter.wildcard } : {}\n\t\t};\n\t}\n}\n/** Default pTableParams in the v7 shape (sorting: []). Used by intermediate\n* migration steps that produce v6/v7 state before the v7 → v8 conversion. */\nfunction createDefaultPTableParamsV7() {\n\treturn {\n\t\tsourceId: null,\n\t\thiddenColIds: null,\n\t\tfilters: null,\n\t\tdefaultFilters: null,\n\t\tsorting: []\n\t};\n}\nfunction createDefaultPTableParams() {\n\treturn {\n\t\tsourceId: null,\n\t\thiddenColIds: null,\n\t\tfilters: null,\n\t\tdefaultFilters: null,\n\t\tsorting: null\n\t};\n}\nfunction createPlDataTableStateV2() {\n\treturn {\n\t\tversion: 8,\n\t\tstateCache: [],\n\t\tpTableParams: createDefaultPTableParams()\n\t};\n}\nfunction migrateV7toV8(state) {\n\tconst newCache = state.stateCache.map((entry) => ({\n\t\tsourceId: entry.sourceId,\n\t\tgridState: entry.gridState,\n\t\tsheetsState: entry.sheetsState,\n\t\tfiltersState: convertFiltersWithMeta(entry.filtersState),\n\t\tdefaultFiltersState: convertFiltersWithMeta(entry.defaultFiltersState),\n\t\tsearchString: entry.searchString\n\t}));\n\tconst params = state.pTableParams;\n\tlet pTableParams;\n\tif (params.sourceId === null) pTableParams = createDefaultPTableParams();\n\telse pTableParams = {\n\t\tsourceId: params.sourceId,\n\t\thiddenColIds: params.hiddenColIds,\n\t\tsorting: params.sorting.length === 0 ? null : params.sorting,\n\t\tfilters: convertFiltersPlain(params.filters),\n\t\tdefaultFilters: convertFiltersPlain(params.defaultFilters)\n\t};\n\treturn {\n\t\tversion: 8,\n\t\tstateCache: newCache,\n\t\tpTableParams\n\t};\n}\nfunction convertFiltersWithMeta(node) {\n\tif (node === null) return null;\n\tconst result = pruneFilterNode(node);\n\tif (result === void 0) return null;\n\treturn result;\n}\nfunction convertFiltersPlain(node) {\n\tif (node === null) return null;\n\tconst result = pruneFilterNode(node);\n\tif (result === void 0) return null;\n\treturn result;\n}\n/** Recursively converts and prunes a legacy v7 filter tree. Preserves meta\n* fields (id/isExpanded/source/isSuppressed) on non-leaf nodes. Returns\n* `undefined` when the subtree is empty after pruning. */\nfunction pruneFilterNode(node) {\n\tif (!node || typeof node !== \"object\") return void 0;\n\tconst n = node;\n\tif (n.type === \"and\" || n.type === \"or\") {\n\t\tconst kept = (n.filters ?? []).map((f) => pruneFilterNode(f)).filter((f) => f !== void 0);\n\t\tif (kept.length === 0) return void 0;\n\t\treturn {\n\t\t\t...n,\n\t\t\ttype: n.type,\n\t\t\tfilters: kept\n\t\t};\n\t}\n\tif (n.type === \"not\") {\n\t\tconst inner = pruneFilterNode(n.filter);\n\t\tif (inner === void 0) return void 0;\n\t\treturn {\n\t\t\t...n,\n\t\t\ttype: \"not\",\n\t\t\tfilter: inner\n\t\t};\n\t}\n\treturn convertLegacyLeaf(n);\n}\nfunction convertLegacyLeaf(leaf) {\n\tif (leaf.type === void 0) return leaf;\n\tconst result = { ...leaf };\n\tif (\"column\" in result) {\n\t\tconst c = parseLegacyLeafColumn(result.column);\n\t\tif (c === void 0) return void 0;\n\t\tresult.column = c;\n\t}\n\tif (\"rhs\" in result) {\n\t\tconst c = parseLegacyLeafColumn(result.rhs);\n\t\tif (c === void 0) return void 0;\n\t\tresult.rhs = c;\n\t}\n\treturn result;\n}\nfunction parseLegacyLeafColumn(s) {\n\tif (typeof s !== \"string\") return void 0;\n\tconst parsed = parseJsonSafely(s);\n\tif (!parsed || typeof parsed !== \"object\") return void 0;\n\tif (!(\"type\" in parsed) || !(\"id\" in parsed)) return void 0;\n\tconst t = parsed.type;\n\tif (t !== \"axis\" && t !== \"column\") return void 0;\n\treturn parsed;\n}\n//#endregion\nexport { createDefaultPTableParams, createPlDataTableStateV2, upgradePlDataTableStateV2 };\n\n//# sourceMappingURL=state-migration.js.map","import { deriveDistinctLabels } from \"../../../labels/derive_distinct_labels.js\";\nimport { ColumnsCollection } from \"../../../columns/columns_collection.js\";\nimport { hasColumnData } from \"../../../columns/utils.js\";\nimport \"../../../columns/index.js\";\nimport \"../../../labels/derive_distinct_tooltips.js\";\nimport { Annotation, extractPObjectId, readAnnotation } from \"@milaboratories/pl-model-common\";\nimport \"@milaboratories/helpers\";\nimport { uniqBy } from \"es-toolkit\";\n//#region src/components/PlDataTable/createPlDataTable/utils.ts\n/** Adapt a {@link ColumnRecipe} to the plain {@link RuleColumn} shape. */\nfunction toRuleColumn(col) {\n\treturn {\n\t\tid: extractPObjectId(col.id),\n\t\tspec: col.getSpec()\n\t};\n}\n/** Check if column should be omitted from the table */\nfunction isColumnHidden(spec) {\n\treturn readAnnotation(spec, Annotation.Table.Visibility) === \"hidden\";\n}\n/** Check if column is hidden by default */\nfunction isColumnOptional(spec) {\n\treturn readAnnotation(spec, Annotation.Table.Visibility) === \"optional\";\n}\n/** Get effective visibility for a column. Rule map lookup first, then annotation fallback. */\nfunction getEffectiveVisibility(col, visibilityByColId) {\n\tconst rule = visibilityByColId?.get(col.id);\n\tif (rule !== void 0) return rule.visibility;\n\tif (isColumnHidden(col.spec)) return \"hidden\";\n\tif (isColumnOptional(col.spec)) return \"optional\";\n}\n/** Get ordering priority for a column. Rule map lookup first, then annotation fallback. */\nfunction getOrderPriority(col, orderByColId) {\n\tconst rule = orderByColId?.get(col.id);\n\tif (rule !== void 0) return rule.priority;\n\tconst annotation = Number(readAnnotation(col.spec, Annotation.Table.OrderPriority));\n\treturn isNaN(annotation) ? void 0 : annotation;\n}\n/**\n* Evaluate display rules against a set of columns and return a map of `colId → winning rule`\n* (first-match-wins, preserving original rule order).\n*\n* Predicate-based rules (`ColumnMatcher`) are evaluated directly on the spec.\n* Selector-based rules (`ColumnSelector`) are matched via the\n* `columnsCollection` service — the inline column ids must be resolvable in\n* the active render ctx for the host to read their specs.\n*/\nfunction evaluateRules(rules, columns) {\n\tconst result = /* @__PURE__ */ new Map();\n\tif (rules.length === 0 || columns.length === 0) return result;\n\tconst selectorRules = rules.filter((rule) => typeof rule.match !== \"function\");\n\tconst selectorHitsByRule = /* @__PURE__ */ new Map();\n\tif (selectorRules.length > 0) {\n\t\tconst baseCollection = ColumnsCollection([{\n\t\t\tcolumns: uniqBy(columns, (col) => col.id),\n\t\t\tisFinal: true\n\t\t}]);\n\t\tfor (const rule of selectorRules) {\n\t\t\tconst hitIds = baseCollection.filter({ include: rule.match }).getColumnIds();\n\t\t\tif (hitIds.length === 0) return result;\n\t\t\tselectorHitsByRule.set(rule, new Set(hitIds.map((id) => extractPObjectId(id))));\n\t\t}\n\t}\n\tfor (const col of columns) {\n\t\tconst colKey = extractPObjectId(col.id);\n\t\tfor (const rule of rules) if (selectorHitsByRule.get(rule)?.has(colKey) ?? false) {\n\t\t\tresult.set(colKey, rule);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Build a sidecar map `columnId → AnnotationDataStatus` derived from each\n* recipe's own status. This is *rendering* metadata — kept out of the spec\n* so it cannot perturb column identity (id-bearing spec overrides would\n* diverge the visible PTable's column ids from the full table / pframe).\n*\n* Mapping `ColumnFieldStatus` × actual byte-presence → `AnnotationDataStatus`:\n* - `absent` → `\"absent\"`\n* - `resolving` → `\"computing\"`\n* - `present` + `hasColumnData()` → `\"ready\"`\n* - `present` + no bytes yet → `\"computing\"`\n*\n* Intentionally scoped to visible columns — the probe is meaningful only for\n* what the user will actually see.\n*/\nfunction buildDataStatusMap(columns, opts = {}) {\n\treturn columns.reduce((acc, c) => (acc[c.id] = deriveDataStatus(c, opts), acc), {});\n}\nfunction deriveDataStatus(column, opts) {\n\tconst field = column.getDataStatus();\n\tif (field === \"absent\") return \"absent\";\n\tif (field === \"resolving\") return \"computing\";\n\treturn hasColumnData(column, opts) ? \"ready\" : \"computing\";\n}\n/** Derive labels for all table elements: columns via deriveDistinctLabels, axes from label columns. */\nfunction deriveAllLabels(options) {\n\tconst { columns, deriveLabelsOptions } = options;\n\treturn deriveDistinctLabels(columns.map((c) => ({\n\t\tspec: c.spec,\n\t\tlinkerPath: c.linkerPath?.map((step) => ({ spec: step.linker.spec })),\n\t\tqualifications: c.qualifications\n\t})), deriveLabelsOptions).reduce((acc, label, index) => (acc[columns[index].id] = label, acc), {});\n}\n//#endregion\nexport { buildDataStatusMap, deriveAllLabels, evaluateRules, getEffectiveVisibility, getOrderPriority, isColumnHidden, isColumnOptional, toRuleColumn };\n\n//# sourceMappingURL=utils.js.map","import { getAxisId, isLabelColumn, matchAxisId } from \"@milaboratories/pl-model-common\";\n//#region src/components/PlDataTable/labels.ts\n/** Get label columns matching the provided columns from the result pool */\nfunction getMatchingLabelColumns(columns, allLabelColumns) {\n\tconst inputLabelColumns = [];\n\tconst inputValueColumns = [];\n\tfor (const column of columns) if (isLabelColumn(column.spec)) inputLabelColumns.push(column);\n\telse inputValueColumns.push(column);\n\tconst unlabeledAxes = [];\n\tfor (const column of inputValueColumns) for (const axis of column.spec.axesSpec) {\n\t\tconst axisId = getAxisId(axis);\n\t\tif (!unlabeledAxes.some((id) => matchAxisId(id, axisId))) unlabeledAxes.push(axisId);\n\t}\n\tfor (const labelColumn of inputLabelColumns) {\n\t\tconst labelAxisId = getAxisId(labelColumn.spec.axesSpec[0]);\n\t\tconst labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));\n\t\tif (labelMatch !== -1) unlabeledAxes.splice(labelMatch, 1);\n\t}\n\tconst colId = (id, domain, contextDomain) => {\n\t\tlet wid = id.toString();\n\t\tif (domain) for (const k in domain) {\n\t\t\twid += k;\n\t\t\twid += domain[k];\n\t\t}\n\t\tif (contextDomain) for (const k in contextDomain) {\n\t\t\twid += k;\n\t\t\twid += contextDomain[k];\n\t\t}\n\t\treturn wid;\n\t};\n\tconst labelColumns = [];\n\tfor (const labelColumn of allLabelColumns) {\n\t\tconst labelAxis = labelColumn.spec.axesSpec[0];\n\t\tconst labelAxisId = getAxisId(labelAxis);\n\t\tconst labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));\n\t\tif (labelMatch !== -1) {\n\t\t\tconst axisId = unlabeledAxes[labelMatch];\n\t\t\tif (Object.keys(axisId.domain ?? {}).length + Object.keys(axisId.contextDomain ?? {}).length > Object.keys(labelAxis.domain ?? {}).length + Object.keys(labelAxis.contextDomain ?? {}).length) labelColumns.push({\n\t\t\t\tid: colId(labelColumn.id, axisId.domain, axisId.contextDomain),\n\t\t\t\tspec: {\n\t\t\t\t\t...labelColumn.spec,\n\t\t\t\t\taxesSpec: [{\n\t\t\t\t\t\t...axisId,\n\t\t\t\t\t\tannotations: labelAxis.annotations\n\t\t\t\t\t}]\n\t\t\t\t},\n\t\t\t\tdata: labelColumn.data\n\t\t\t});\n\t\t\telse labelColumns.push(labelColumn);\n\t\t\tunlabeledAxes.splice(labelMatch, 1);\n\t\t}\n\t}\n\treturn labelColumns;\n}\n//#endregion\nexport { getMatchingLabelColumns };\n\n//# sourceMappingURL=labels.js.map","import { hitQualifications, queriesQualifications } from \"../../../columns/utils.js\";\nimport \"../../../columns/index.js\";\nimport { filterSpecToSpecQueryExpr } from \"../../../filters/converters/filterToQuery.js\";\nimport { distillFilterSpec } from \"../../../filters/distill.js\";\nimport \"../../../filters/index.js\";\nimport { isBooleanExpression } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"es-toolkit\";\n//#region src/components/PlDataTable/createPlDataTable/createPTableDefV3.ts\n/**\n* Assemble a ptable def directly from recipes. Each secondary recipe is its own\n* outer-joined subtree: `getQuery()` encodes its linker chain, and its\n* hit-/queries-qualifications are derived on the spot via {@link hitQualifications}\n* / {@link queriesQualifications} — no pre-extracted DTO. Bare leaves yield empty\n* qualifications, so plain {@link ColumnRecipe} arrays (e.g. label columns) work\n* unchanged.\n*/\nfunction createPTableDefV3(params) {\n\tlet query = {\n\t\ttype: params.primaryJoinType === \"inner\" ? \"innerJoin\" : \"fullJoin\",\n\t\tentries: params.primary.map((c) => columnToJoinEntry(c, []))\n\t};\n\tif (params.secondary.length > 0) query = {\n\t\ttype: \"outerJoin\",\n\t\tprimary: {\n\t\t\tentry: query,\n\t\t\tqualifications: params.secondary.flatMap((s) => {\n\t\t\t\tconst quals = queriesQualifications(s);\n\t\t\t\treturn params.primary.flatMap((p) => quals[p.id] ?? []);\n\t\t\t})\n\t\t},\n\t\tsecondary: params.secondary.map((c) => columnToJoinEntry(c, hitQualifications(c)))\n\t};\n\tif (!isNil(params.filters)) {\n\t\tconst nonEmpty = distillFilterSpec(params.filters);\n\t\tif (!isNil(nonEmpty)) {\n\t\t\tconst pridicate = filterSpecToSpecQueryExpr(nonEmpty);\n\t\t\tif (!isBooleanExpression(pridicate)) throw new Error(`Filter conversion produced a non-boolean expression (got type \"${pridicate.type}\"), expected a boolean predicate for query filtering`);\n\t\t\tquery = {\n\t\t\t\ttype: \"filter\",\n\t\t\t\tinput: query,\n\t\t\t\tpredicate: pridicate\n\t\t\t};\n\t\t}\n\t}\n\tif (!isNil(params.sorting) && params.sorting.length > 0) query = {\n\t\ttype: \"sort\",\n\t\tinput: query,\n\t\tsortBy: params.sorting.map((s) => ({\n\t\t\texpression: columnIdToExpr(s.column),\n\t\t\tascending: s.ascending,\n\t\t\tnullsFirst: s.naAndAbsentAreLeastValues\n\t\t}))\n\t};\n\treturn { query };\n}\nfunction columnIdToExpr(col) {\n\treturn col.type === \"axis\" ? {\n\t\ttype: \"axisRef\",\n\t\tvalue: col.id\n\t} : {\n\t\ttype: \"columnRef\",\n\t\tvalue: col.id\n\t};\n}\nfunction columnToJoinEntry(col, qualifications) {\n\treturn {\n\t\tentry: col.getQuery(),\n\t\tqualifications\n\t};\n}\n//#endregion\nexport { createPTableDefV3 };\n\n//# sourceMappingURL=createPTableDefV3.js.map","import { ColumnLazyImpl } from \"../../../columns/column_lazy.js\";\nimport \"../../../columns/index.js\";\nimport { createPTableDefV3 } from \"./createPTableDefV3.js\";\nimport { getColumnIdAndSpec } from \"@milaboratories/pl-model-common\";\nimport { isFunction } from \"es-toolkit\";\n//#region src/components/PlDataTable/createPlDataTable/createPTableDefV2.ts\nfunction createPTableDefV2(params) {\n\tlet coreColumns = params.columns;\n\tconst secondaryColumns = [];\n\tif (isFunction(params.coreColumnPredicate)) {\n\t\tcoreColumns = [];\n\t\tfor (const c of params.columns) if (params.coreColumnPredicate(getColumnIdAndSpec(c))) coreColumns.push(c);\n\t\telse secondaryColumns.push(c);\n\t}\n\tsecondaryColumns.push(...params.labelColumns);\n\treturn createPTableDefV3({\n\t\tprimary: coreColumns.map((column) => ColumnLazyImpl.fromColumn(column)),\n\t\tsecondary: secondaryColumns.map((column) => ColumnLazyImpl.fromColumn(column)),\n\t\tprimaryJoinType: params.coreJoinType,\n\t\tfilters: params.filters,\n\t\tsorting: params.sorting\n\t});\n}\n//#endregion\nexport { createPTableDefV2 };\n\n//# sourceMappingURL=createPTableDefV2.js.map","import { extractPObjectId, getAxisId, matchAxisId } from \"@milaboratories/pl-model-common\";\n//#region src/components/PlDataTable/columnResolver.ts\nfunction createColumnResolver(columns, deps) {\n\tconst axisIds = [];\n\tfor (const c of columns) for (const ax of c.getSpec().axesSpec) axisIds.push(getAxisId(ax));\n\tconst byFullId = /* @__PURE__ */ new Map();\n\tconst byPObjectId = /* @__PURE__ */ new Map();\n\tfor (const c of columns) {\n\t\tbyFullId.set(c.id, c);\n\t\tconst pid = extractPObjectId(c.id);\n\t\tconst existing = byPObjectId.get(pid);\n\t\tif (existing === void 0) byPObjectId.set(pid, c);\n\t\telse if (existing.id !== c.id) deps?.warn?.(`Ambiguous PObjectId ${pid}: recipe ids ${existing.id} and ${c.id} both match — keeping first.`);\n\t}\n\treturn (ref) => {\n\t\tif (ref.type === \"axis\") return axisIds.some((a) => matchAxisId(ref.id, a)) ? ref : void 0;\n\t\tconst hit = byFullId.get(ref.id) ?? byPObjectId.get(extractPObjectId(ref.id));\n\t\tif (hit === void 0) return void 0;\n\t\treturn {\n\t\t\ttype: \"column\",\n\t\t\tid: hit.id\n\t\t};\n\t};\n}\n//#endregion\nexport { createColumnResolver };\n\n//# sourceMappingURL=columnResolver.js.map","import { deriveLabels } from \"../../../render/util/label.js\";\nimport { allPColumnsReady } from \"../../../render/util/pcolumn_data.js\";\nimport { PColumnCollection } from \"../../../render/util/column_collection.js\";\nimport \"../../../render/index.js\";\nimport { ColumnLazyImpl } from \"../../../columns/column_lazy.js\";\nimport \"../../../columns/index.js\";\nimport { collectFilterSpecColumns, traverseFilterSpec } from \"../../../filters/traverse.js\";\nimport { upgradePlDataTableStateV2 } from \"../state-migration.js\";\nimport { getMatchingLabelColumns } from \"../labels.js\";\nimport { createPTableDefV2 } from \"./createPTableDefV2.js\";\nimport { isColumnOptional } from \"./utils.js\";\nimport { createColumnResolver } from \"../columnResolver.js\";\nimport { Annotation, PColumnName, getColumnIdAndSpec, isLinkerColumn } from \"@milaboratories/pl-model-common\";\nimport { isNil } from \"@milaboratories/helpers\";\nimport { identity } from \"es-toolkit\";\n//#region src/components/PlDataTable/createPlDataTable/createPlDataTableV2.ts\n/**\n* Create p-table spec and handle given ui table state\n*\n* @deprecated This version of createPlDataTable is deprecated and will be removed in future. Please migrate to v3 by switching to the new options format and providing necessary information for column discovery and display configuration. See createPlDataTableOptionsV3 for details.\n* @param ctx context\n* @param columns column list\n* @param tableState table ui state\n* @returns PlAgDataTableV2 table source\n*/\nfunction createPlDataTableV2(ctx, columns, tableState, options) {\n\tif (columns.length === 0) return void 0;\n\tconst tableStateNormalized = upgradePlDataTableStateV2(tableState);\n\tconst allLabelColumns = getAllLabelColumns(ctx.resultPool) ?? [];\n\tlet fullLabelColumns = getMatchingLabelColumns(columns, allLabelColumns);\n\tfullLabelColumns = deriveLabels(fullLabelColumns, identity, { includeNativeLabel: true }).map((v) => {\n\t\treturn {\n\t\t\t...v.value,\n\t\t\tspec: {\n\t\t\t\t...v.value.spec,\n\t\t\t\tannotations: {\n\t\t\t\t\t...v.value.spec.annotations,\n\t\t\t\t\t[Annotation.Label]: v.label\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\tconst fullColumns = [...columns, ...fullLabelColumns];\n\tconst resolver = createColumnResolver(fullColumns.map((c) => ColumnLazyImpl.fromColumn(c)), { warn: ctx.logWarn.bind(ctx) });\n\tconst rawFilters = tableStateNormalized.pTableParams.filters;\n\tconst rawDefaultFilters = options?.filters ?? void 0;\n\tconst filters = remapFiltersThrowing(rawFilters, resolver, \"filter\");\n\tconst defaultFilters = remapFiltersThrowing(rawDefaultFilters ?? null, resolver, \"default filter\");\n\tconst userSorting = tableStateNormalized.pTableParams.sorting;\n\tconst sorting = remapSortingThrowing((isNil(userSorting) ? options?.sorting : userSorting) ?? [], resolver);\n\tconst coreJoinType = options?.coreJoinType ?? \"full\";\n\tconst fullDef = createPTableDefV2({\n\t\tcolumns,\n\t\tlabelColumns: fullLabelColumns,\n\t\tcoreJoinType,\n\t\tfilters: filters ?? null,\n\t\tsorting,\n\t\tcoreColumnPredicate: options?.coreColumnPredicate\n\t});\n\tconst fullHandle = ctx.createPTableV2(fullDef);\n\tconst pframeHandle = ctx.createPFrame(fullColumns);\n\tif (!fullHandle || !pframeHandle) return void 0;\n\tconst hiddenColumns = new Set((() => {\n\t\tif (coreJoinType === \"inner\") return [];\n\t\tconst hiddenColIds = tableStateNormalized.pTableParams.hiddenColIds;\n\t\tif (hiddenColIds !== null) return hiddenColIds.filter((s) => s.type === \"column\").map((s) => s.id);\n\t\treturn columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);\n\t})());\n\tcolumns.filter((c) => isLinkerColumn(c.spec)).forEach((c) => hiddenColumns.delete(c.id));\n\tconst coreColumnPredicate = options?.coreColumnPredicate;\n\tif (coreColumnPredicate) columns.flatMap((c) => coreColumnPredicate(getColumnIdAndSpec(c)) ? [c.id] : []).forEach((c) => hiddenColumns.delete(c));\n\tsorting.map((s) => s.column).filter((c) => c.type === \"column\").forEach((c) => hiddenColumns.delete(c.id));\n\tif (filters) collectFilterSpecColumns(filters).flatMap((c) => c.type === \"column\" ? [c.id] : []).forEach((c) => hiddenColumns.delete(c));\n\tconst visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));\n\tconst visibleLabelColumns = getMatchingLabelColumns(visibleColumns.map(getColumnIdAndSpec), allLabelColumns);\n\tif (!allPColumnsReady([...visibleColumns, ...visibleLabelColumns])) return void 0;\n\tconst visibleDef = createPTableDefV2({\n\t\tcolumns: visibleColumns,\n\t\tlabelColumns: visibleLabelColumns,\n\t\tcoreJoinType,\n\t\tfilters: filters ?? null,\n\t\tsorting,\n\t\tcoreColumnPredicate\n\t});\n\tconst visibleHandle = ctx.createPTableV2(visibleDef);\n\tif (!visibleHandle) return void 0;\n\treturn {\n\t\tsourceId: tableStateNormalized.pTableParams.sourceId,\n\t\tfullTableHandle: fullHandle,\n\t\tfullPframeHandle: pframeHandle,\n\t\tvisibleTableHandle: visibleHandle,\n\t\tdefaultFilters: defaultFilters ?? void 0\n\t};\n}\n/** Rewrite filter column refs through the resolver; throw on any unresolved ref. */\nfunction remapFiltersThrowing(filters, resolver, label) {\n\tif (isNil(filters)) return filters;\n\treturn traverseFilterSpec(filters, {\n\t\tleaf: (leaf) => {\n\t\t\tif (leaf.type === void 0) return leaf;\n\t\t\tconst result = { ...leaf };\n\t\t\tif (\"column\" in result) {\n\t\t\t\tconst c = resolver(result.column);\n\t\t\t\tif (isNil(c)) throw new Error(`Invalid ${label} column ${JSON.stringify(result.column)}: column reference does not match the table columns`);\n\t\t\t\tresult.column = c;\n\t\t\t}\n\t\t\tif (\"rhs\" in result) {\n\t\t\t\tconst c = resolver(result.rhs);\n\t\t\t\tif (isNil(c)) throw new Error(`Invalid ${label} column ${JSON.stringify(result.rhs)}: column reference does not match the table columns`);\n\t\t\t\tresult.rhs = c;\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\tand: (results) => ({\n\t\t\ttype: \"and\",\n\t\t\tfilters: results\n\t\t}),\n\t\tor: (results) => ({\n\t\t\ttype: \"or\",\n\t\t\tfilters: results\n\t\t}),\n\t\tnot: (result) => ({\n\t\t\ttype: \"not\",\n\t\t\tfilter: result\n\t\t})\n\t});\n}\n/** Rewrite sorting column refs through the resolver; throw on any unresolved ref. */\nfunction remapSortingThrowing(sorting, resolver) {\n\treturn sorting.map((s) => {\n\t\tconst c = resolver(s.column);\n\t\tif (isNil(c)) throw new Error(`Invalid sorting column ${JSON.stringify(s.column)}: column reference does not match the table columns`);\n\t\treturn {\n\t\t\t...s,\n\t\t\tcolumn: c\n\t\t};\n\t});\n}\nfunction getAllLabelColumns(resultPool) {\n\treturn new PColumnCollection().addAxisLabelProvider(resultPool).addColumnProvider(resultPool).getColumns({\n\t\tname: PColumnName.Label,\n\t\taxes: [{}]\n\t}, {\n\t\tdontWaitAllData: true,\n\t\toverrideLabelAnnotation: false\n\t});\n}\n//#endregion\nexport { createPlDataTableV2 };\n\n//# sourceMappingURL=createPlDataTableV2.js.map","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","import stringify from \"json-stringify-safe\";\nimport { z } from \"zod\";\n//#region src/error_like_shape.ts\nconst BasePlErrorLike = z.object({\n\ttype: z.literal(\"PlError\"),\n\tname: z.string(),\n\tmessage: z.string(),\n\tfullMessage: z.string().optional(),\n\tstack: z.string().optional()\n});\nconst PlErrorLike = BasePlErrorLike.extend({\n\tcause: z.lazy(() => ErrorLike).optional(),\n\terrors: z.lazy(() => ErrorLike.array()).optional()\n});\nconst StandardErrorLike = z.object({\n\ttype: z.literal(\"StandardError\"),\n\tname: z.string(),\n\tmessage: z.string(),\n\tstack: z.string().optional()\n}).extend({\n\tcause: z.lazy(() => ErrorLike).optional(),\n\terrors: z.lazy(() => ErrorLike.array()).optional()\n});\nconst ErrorLike = z.union([StandardErrorLike, PlErrorLike]);\n/** Converts everything into ErrorLike. */\nfunction ensureErrorLike(error) {\n\tconst result = ErrorShape.safeParse(error);\n\tif (result.success) {\n\t\tconst err = result.data;\n\t\tif (err.name === \"PlQuickJSError\" || err.name === \"PlErrorReport\" || err.name === \"PlInternalError\" || err.name === \"PlTengoError\" || err.name === \"PlRunnerError\" || err.name === \"PlMonetizationError\") return {\n\t\t\ttype: \"PlError\",\n\t\t\tname: err.name,\n\t\t\tmessage: err.message,\n\t\t\tfullMessage: err.fullMessage ?? void 0,\n\t\t\tstack: err.stack ?? void 0,\n\t\t\tcause: err.cause ? ensureErrorLike(err.cause) : void 0,\n\t\t\terrors: err.errors ? err.errors.map(ensureErrorLike) : void 0\n\t\t};\n\t\treturn {\n\t\t\ttype: \"StandardError\",\n\t\t\tname: err.name,\n\t\t\tmessage: err.message,\n\t\t\tstack: err.stack ?? void 0,\n\t\t\tcause: err.cause ? ensureErrorLike(err.cause) : void 0,\n\t\t\terrors: err.errors ? err.errors.map(ensureErrorLike) : void 0\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"StandardError\",\n\t\tname: \"Error\",\n\t\tmessage: stringify(error)\n\t};\n}\n/** Tries to parse strings into ErrorLike. It's needed for keeping old blocks compatible with new UI. */\nfunction parseErrorLikeSafe(err) {\n\ttry {\n\t\treturn ErrorLike.safeParse(JSON.parse(err));\n\t} catch (e) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: /* @__PURE__ */ new Error(`parseErrorLikeSafe: could not parse JSON: ${err}, ${String(e)}`)\n\t\t};\n\t}\n}\nconst ErrorShape = z.object({\n\tname: z.string(),\n\tmessage: z.string(),\n\tfullMessage: z.string().optional(),\n\tstack: z.string().optional()\n}).extend({\n\tcause: z.lazy(() => ErrorShape).optional(),\n\terrors: z.lazy(() => ErrorShape.array()).optional()\n});\n//#endregion\nexport { BasePlErrorLike, ErrorLike, PlErrorLike, StandardErrorLike, ensureErrorLike, parseErrorLikeSafe };\n\n//# sourceMappingURL=error_like_shape.js.map","import { getDefaultBlockLabel } from \"./label.js\";\nimport { DataModelBuilder, createPlDataTableStateV2 } from \"@platforma-sdk/model\";\n//#region src/dataModel.ts\nconst defaultGraphState = () => ({\n\ttitle: \"Sequence Diversity\",\n\ttemplate: \"bar\",\n\tcurrentTab: null\n});\nconst defaultMetrics = () => [\n\t{\n\t\tid: \"observed\",\n\t\ttype: \"observed\",\n\t\tdownsampling: {\n\t\t\ttype: \"hypergeometric\",\n\t\t\tvalueChooser: \"auto\"\n\t\t},\n\t\tisExpanded: false\n\t},\n\t{\n\t\tid: \"shannonWiener\",\n\t\ttype: \"shannonWiener\",\n\t\tdownsampling: {\n\t\t\ttype: \"hypergeometric\",\n\t\t\tvalueChooser: \"auto\"\n\t\t},\n\t\tisExpanded: false\n\t},\n\t{\n\t\tid: \"chao1\",\n\t\ttype: \"chao1\",\n\t\tdownsampling: {\n\t\t\ttype: \"hypergeometric\",\n\t\t\tvalueChooser: \"auto\"\n\t\t},\n\t\tisExpanded: false\n\t},\n\t{\n\t\tid: \"gini\",\n\t\ttype: \"gini\",\n\t\tdownsampling: {\n\t\t\ttype: \"hypergeometric\",\n\t\t\tvalueChooser: \"auto\"\n\t\t},\n\t\tisExpanded: false\n\t},\n\t{\n\t\tid: \"d50\",\n\t\ttype: \"d50\",\n\t\tdownsampling: {\n\t\t\ttype: \"hypergeometric\",\n\t\t\tvalueChooser: \"auto\"\n\t\t},\n\t\tisExpanded: false\n\t}\n];\nconst blockDataModel = new DataModelBuilder().from(\"v1\").upgradeLegacy(({ args, uiState }) => ({\n\tabundanceRef: args?.abundanceRef,\n\tmetrics: uiState?.metrics ?? (args?.metrics?.length ? args.metrics.map((metric, i) => ({\n\t\t...metric,\n\t\tid: `metric-${i}`,\n\t\tisExpanded: false\n\t})) : defaultMetrics()),\n\tdefaultBlockLabel: args?.defaultBlockLabel ?? getDefaultBlockLabel({}),\n\tcustomBlockLabel: args?.customBlockLabel ?? \"\",\n\ttableState: uiState?.tableState ?? createPlDataTableStateV2(),\n\tgraphState: uiState?.graphState ?? defaultGraphState()\n})).init(() => ({\n\tabundanceRef: void 0,\n\tmetrics: defaultMetrics(),\n\tdefaultBlockLabel: getDefaultBlockLabel({}),\n\tcustomBlockLabel: \"\",\n\ttableState: createPlDataTableStateV2(),\n\tgraphState: defaultGraphState()\n}));\n//#endregion\nexport { blockDataModel };\n\n//# sourceMappingURL=dataModel.js.map","","import { convertMetricsUiToArgs } from \"./converters.js\";\nimport { getDefaultBlockLabel } from \"./label.js\";\nimport { blockDataModel } from \"./dataModel.js\";\nimport strings from \"@milaboratories/strings\";\nimport { BlockModelV3, createPFrameForGraphs, createPlDataTableV2 } from \"@platforma-sdk/model\";\n//#region src/index.ts\nconst platforma = BlockModelV3.create(blockDataModel).args((data) => {\n\tif (data.abundanceRef === void 0) throw new Error(\"Abundance column is required\");\n\tconst metrics = convertMetricsUiToArgs(data.metrics);\n\tif (metrics.some((metric) => metric.type === void 0)) throw new Error(\"Each metric requires a type\");\n\treturn {\n\t\tabundanceRef: data.abundanceRef,\n\t\tmetrics\n\t};\n}).output(\"abundanceOptions\", (ctx) => ctx.resultPool.getOptions([{\n\taxes: [{ name: \"pl7.app/sampleId\" }, {}],\n\tannotations: {\n\t\t\"pl7.app/isAbundance\": \"true\",\n\t\t\"pl7.app/abundance/normalized\": \"false\",\n\t\t\"pl7.app/abundance/isPrimary\": \"true\"\n\t}\n}], { includeNativeLabel: true })).outputWithStatus(\"pt\", (ctx) => {\n\tconst pCols = ctx.outputs?.resolve(\"pf\")?.getPColumns();\n\tif (pCols === void 0) return;\n\treturn createPlDataTableV2(ctx, pCols, ctx.data.tableState);\n}).outputWithStatus(\"pf\", (ctx) => {\n\tconst pCols = ctx.outputs?.resolve(\"pf\")?.getPColumns();\n\tif (pCols === void 0) return;\n\treturn createPFrameForGraphs(ctx, pCols);\n}).output(\"pcols\", (ctx) => {\n\tconst pCols = ctx.outputs?.resolve(\"pf\")?.getPColumns();\n\tif (pCols === void 0 || pCols.length === 0) return;\n\treturn pCols.map((c) => ({\n\t\tcolumnId: c.id,\n\t\tspec: c.spec\n\t}));\n}).output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title(() => \"Sequence Diversity\").subtitle((ctx) => ctx.data.customBlockLabel || ctx.data.defaultBlockLabel).sections(() => [{\n\ttype: \"link\",\n\thref: \"/\",\n\tlabel: strings.titles.main\n}, {\n\ttype: \"link\",\n\thref: \"/diversityGraph\",\n\tlabel: \"Diversity Graph\"\n}]).done();\n//#endregion\nexport { blockDataModel, convertMetricsUiToArgs, getDefaultBlockLabel, platforma };\n\n//# sourceMappingURL=index.js.map","// This file is managed by `block-tools structure`. Do not edit by hand.\n// Author content lives in ./block-extra.ts.\n\nimport { platforma } from \"@platforma-open/milaboratories.repertoire-diversity-2.model\";\nimport {\n InferOutputsType,\n InferDataType,\n InferHrefType,\n} from \"@platforma-sdk/model\";\n\nexport { platforma };\n\nexport type BlockContract = {\n outputs: InferOutputsType<typeof platforma>;\n data: InferDataType<typeof platforma>;\n href: InferHrefType<typeof platforma>;\n};\n\nexport type BlockOutputs = BlockContract[\"outputs\"];\nexport type BlockData = BlockContract[\"data\"];\n\n// import.meta.url is a file: URL (always forward-slash, even on Windows:\n// file:///C:/…). We expose URLs, NOT paths — the facade stays dependency-free\n// and loadable in minimal engines (e.g. QuickJS), and each consumer converts\n// at its own edge with the right tool (fileURLToPath in Node), where Windows\n// drive letters / %-encoding / UNC are handled correctly. The bundled entry\n// sits one dir under the package root (dist/index.js, or src/index.ts in dev),\n// so the root is two URL segments up. The structurer owns this layout —\n// consumers read these URLs, they never reconstruct <root>/block-pack.\n//\n// TypeScript ships `ImportMeta.url` only in the `dom`/`webworker` libs; the\n// facade tsconfig is lib-minimal (no `dom`, no `@types/node`) by design. We\n// type the one ESM-standard member we use with a local cast rather than a\n// `declare global` — a global augmentation would leak into the published\n// `dist/index.d.ts` and clash with `@types/node`'s `ImportMeta` in full-Node\n// consumers (test packages, the Middle Layer).\nconst selfUrl = (import.meta as ImportMeta & { url: string }).url;\nconst dirUrl = selfUrl.slice(0, selfUrl.lastIndexOf(\"/\"));\nconst rootUrl = dirUrl.slice(0, dirUrl.lastIndexOf(\"/\"));\n\nexport const BlockPointer = {\n type: \"from-pack-v2\" as const,\n packUrl: rootUrl + \"/block-pack\",\n rootUrl,\n} as const;\n\n// Block-named aliases for readable cross-block imports in tests and\n// consumer code. Same types / same runtime value as the universal\n// names above; the aliases avoid `as`-renames at the import site.\nexport type RepertoireDiversity2BlockContract = BlockContract;\nexport type RepertoireDiversity2BlockOutputs = BlockOutputs;\nexport type RepertoireDiversity2BlockData = BlockData;\nexport const RepertoireDiversity2BlockPointer = BlockPointer;\n\nexport * from \"./block-extra\";\n"],"x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,113],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,0BAA0B,YAAY;CAC3C,OAAO,QAAQ,KAAK,WAAW;EAC9B,OAAO;GACN,MAAM,OAAO;GACb,cAAc,OAAO;EACtB;CACD,CAAC;AACF;;;ACPA,SAAS,qBAAqB,MAAM;CACnC,IAAI,KAAK,gBAAgB,OAAO,KAAK;CACrC,OAAO;AACR;;;ACHA,MAAM,uBAAuB;;AAE7B,SAAS,gBAAgB,QAAQ,WAAW;CAC3C,OAAO,GAAG,uBAAuB,OAAO,GAAG;AAC5C;;;;;;;ACCA,MAAM,oBAAoB;;;;;AAK1B,MAAM,4BAA4B;;;;;AAKlC,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU,OAAO;CACxD,OAAO,MAAM,uBAAuB;AACrC;;;;;;;;AAQA,SAAS,mBAAmB,cAAc,CAAC,GAAG,UAAU,2BAA2B;CAClF,OAAO;GACL,oBAAoB;EACrB,eAAe;EACf,QAAQ;EACR,kBAAkB,CAAC;EACnB,WAAW,CAAC;CACb;AACD;;;;;;;;;AASA,SAAS,sBAAsB,KAAK;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