@platforma-open/milaboratories.sequence-properties.model 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/model.json CHANGED
@@ -1 +1 @@
1
- {"v4":{"configVersion":4,"modelAPIVersion":2,"sdkVersion":"1.75.5","renderingMode":"Heavy","sections":{"__renderLambda":true,"handle":"sections"},"title":{"__renderLambda":true,"handle":"title"},"subtitle":{"__renderLambda":true,"handle":"subtitle"},"outputs":{"inputOptions":{"__renderLambda":true,"handle":"block-output#inputOptions"},"inputSpec":{"__renderLambda":true,"handle":"block-output#inputSpec"},"info":{"__renderLambda":true,"handle":"block-output#info"},"isRunning":{"__renderLambda":true,"handle":"block-output#isRunning"},"processingLog":{"__renderLambda":true,"handle":"block-output#processingLog"},"propertiesTable":{"__renderLambda":true,"handle":"block-output#propertiesTable","withStatus":true},"propertiesPfHandle":{"__renderLambda":true,"handle":"block-output#propertiesPfHandle","withStatus":true},"propertiesPfCols":{"__renderLambda":true,"handle":"block-output#propertiesPfCols"}},"featureFlags":{"supportsLazyState":true,"supportsPframeQueryRanking":true,"requiresUIAPIVersion":3,"requiresModelAPIVersion":2,"requiresCreatePTable":2,"requiresPFramesVersion":1001031,"requiresPFrameSpec":true,"requiresPFrame":true,"requiresDialog":true},"blockLifecycleCallbacks":{"__pl_storage_applyUpdate":{"__renderLambda":true,"handle":"__pl_storage_applyUpdate"},"__pl_storage_debugView":{"__renderLambda":true,"handle":"__pl_storage_debugView"},"__pl_storage_migrate":{"__renderLambda":true,"handle":"__pl_storage_migrate"},"__pl_args_derive":{"__renderLambda":true,"handle":"__pl_args_derive"},"__pl_prerunArgs_derive":{"__renderLambda":true,"handle":"__pl_prerunArgs_derive"},"__pl_storage_initial":{"__renderLambda":true,"handle":"__pl_storage_initial"}}},"sdkVersion":"1.75.5","renderingMode":"Heavy","sections":{"__renderLambda":true,"handle":"sections"},"outputs":{"inputOptions":"block-output#inputOptions","inputSpec":"block-output#inputSpec","info":"block-output#info","isRunning":"block-output#isRunning","processingLog":"block-output#processingLog","propertiesTable":"block-output#propertiesTable","propertiesPfHandle":"block-output#propertiesPfHandle","propertiesPfCols":"block-output#propertiesPfCols"},"code":{"type":"plain","content":"(function(global, factory) {\n\ttypeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([\"exports\"], factory) : (global = typeof globalThis !== \"undefined\" ? globalThis : global || self, factory(global[\"block-model\"] = {}));\n})(this, function(exports) {\n\tObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n\t//#region \\0rolldown/runtime.js\n\tvar __create = Object.create;\n\tvar __defProp = Object.defineProperty;\n\tvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n\tvar __getOwnPropNames = Object.getOwnPropertyNames;\n\tvar __getProtoOf = Object.getPrototypeOf;\n\tvar __hasOwnProp = Object.prototype.hasOwnProperty;\n\tvar __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);\n\tvar __copyProps = (to, from, except, desc) => {\n\t\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t});\n\t\t}\n\t\treturn to;\n\t};\n\tvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target, mod));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/plugin_handle.js\n\tconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\t/** Construct the output key for a plugin output in the block outputs map. */\n\tfunction pluginOutputKey(handle, outputKey) {\n\t\treturn `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/block_storage.js\n\t/**\n\t* Discriminator key for BlockStorage format detection.\n\t* This unique hash-based key identifies data as BlockStorage vs legacy formats.\n\t*/\n\tconst BLOCK_STORAGE_KEY = \"__pl_a7f3e2b9__\";\n\t/**\n\t* Default data version for new blocks without migrations.\n\t* Unique identifier ensures blocks are created via DataModel API.\n\t*/\n\tconst DATA_MODEL_LEGACY_VERSION = \"__pl_v1_d4e8f2a1__\";\n\t/**\n\t* Type guard to check if a value is a valid BlockStorage object.\n\t* Checks for the discriminator key and valid schema version.\n\t*/\n\tfunction isBlockStorage(value) {\n\t\tif (value === null || typeof value !== \"object\") return false;\n\t\treturn value[BLOCK_STORAGE_KEY] === \"v1\";\n\t}\n\t/**\n\t* Creates a BlockStorage with the given initial data\n\t*\n\t* @param initialData - The initial data value (defaults to empty object)\n\t* @param version - The initial data version key (defaults to DATA_MODEL_LEGACY_VERSION)\n\t* @returns A new BlockStorage instance with discriminator key\n\t*/\n\tfunction createBlockStorage(initialData = {}, version = DATA_MODEL_LEGACY_VERSION) {\n\t\treturn {\n\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t__dataVersion: version,\n\t\t\t__data: initialData,\n\t\t\t__pluginRegistry: {},\n\t\t\t__plugins: {}\n\t\t};\n\t}\n\t/**\n\t* Normalizes raw storage data to BlockStorage format.\n\t* If the input is already a BlockStorage, returns it as-is (with defaults for missing fields).\n\t* If the input is legacy format (raw state), wraps it in BlockStorage structure.\n\t*\n\t* @param raw - Raw storage data (may be legacy format or BlockStorage)\n\t* @returns Normalized BlockStorage\n\t*/\n\tfunction normalizeBlockStorage(raw) {\n\t\tif (isBlockStorage(raw)) {\n\t\t\tconst storage = raw;\n\t\t\treturn {\n\t\t\t\t...storage,\n\t\t\t\t__dataVersion: typeof storage.__dataVersion === \"number\" ? DATA_MODEL_LEGACY_VERSION : storage.__dataVersion,\n\t\t\t\t__pluginRegistry: storage.__pluginRegistry ?? {},\n\t\t\t\t__plugins: storage.__plugins ?? {}\n\t\t\t};\n\t\t}\n\t\treturn createBlockStorage(raw);\n\t}\n\t/**\n\t* Gets the data from BlockStorage\n\t*\n\t* @param storage - The BlockStorage instance\n\t* @returns The data value\n\t*/\n\tfunction getStorageData(storage) {\n\t\treturn storage.__data;\n\t}\n\t/**\n\t* Updates the data in BlockStorage (immutable)\n\t*\n\t* @param storage - The current BlockStorage\n\t* @param payload - The update payload with operation and value\n\t* @returns A new BlockStorage with updated data\n\t*/\n\tfunction updateStorageData(storage, payload) {\n\t\tswitch (payload.operation) {\n\t\t\tcase \"update-block-data\": return {\n\t\t\t\t...storage,\n\t\t\t\t__data: payload.value\n\t\t\t};\n\t\t\tcase \"update-plugin-data\": {\n\t\t\t\tconst { pluginId, value } = payload;\n\t\t\t\tconst currentPlugins = storage.__plugins ?? {};\n\t\t\t\tconst version = currentPlugins[pluginId]?.__dataVersion ?? \"__pl_v1_d4e8f2a1__\";\n\t\t\t\treturn {\n\t\t\t\t\t...storage,\n\t\t\t\t\t__plugins: {\n\t\t\t\t\t\t...currentPlugins,\n\t\t\t\t\t\t[pluginId]: {\n\t\t\t\t\t\t\t__dataVersion: version,\n\t\t\t\t\t\t\t__data: value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unknown storage operation: ${payload.operation}`);\n\t\t}\n\t}\n\t/**\n\t* Performs atomic migration of block storage including block data and all plugins.\n\t*\n\t* Migration is atomic: either everything succeeds and a new storage is returned,\n\t* or an error is returned and the original storage is completely untouched.\n\t*\n\t* Migration steps:\n\t* 1. Migrate block data\n\t* 2. For each plugin in newPluginRegistry:\n\t* - If plugin exists with same name: migrate its data\n\t* - Otherwise (new or type changed): create with initial data\n\t* Plugins not in newPluginRegistry are dropped.\n\t*\n\t* If any step throws, migration fails and original storage is preserved.\n\t* User can then choose to:\n\t* - Abort: keep original storage, don't update block\n\t* - Reset: call createBlockStorage() to start fresh\n\t*\n\t* @param storage - The original storage (will not be modified)\n\t* @param config - Migration configuration\n\t* @returns Migration result - either success with new storage, or failure with error info\n\t*\n\t* @example\n\t* const result = migrateBlockStorage(storage, {\n\t* migrateBlockData: (versioned) => blockDataModel.migrate(versioned),\n\t* migratePluginData: (pluginId, versioned) => getPluginModel(pluginId).migrate(versioned),\n\t* newPluginRegistry: { table1: 'dataTable' as PluginName },\n\t* createPluginData: (pluginId) => getPluginModel(pluginId).getDefaultData(),\n\t* });\n\t*\n\t* if (result.success) {\n\t* commitStorage(result.storage);\n\t* } else {\n\t* const userChoice = await askUser(`Migration failed: ${result.error}. Reset data?`);\n\t* if (userChoice === 'reset') {\n\t* commitStorage(createBlockStorage(initialData, currentVersion));\n\t* }\n\t* // else: abort, keep original\n\t* }\n\t*/\n\tfunction migrateBlockStorage(storage, config) {\n\t\tconst { migrateBlockData, migratePluginData, newPluginRegistry, createPluginData } = config;\n\t\tlet migratedData;\n\t\tlet newVersion;\n\t\tlet transfers;\n\t\ttry {\n\t\t\tconst result = migrateBlockData({\n\t\t\t\tversion: storage.__dataVersion,\n\t\t\t\tdata: storage.__data\n\t\t\t});\n\t\t\tmigratedData = result.data;\n\t\t\tnewVersion = result.version;\n\t\t\ttransfers = result.transfers;\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: \"block\"\n\t\t\t};\n\t\t}\n\t\tconst oldPlugins = storage.__plugins ?? {};\n\t\tconst oldRegistry = storage.__pluginRegistry ?? {};\n\t\tconst newPlugins = {};\n\t\tfor (const [key, pluginName] of Object.entries(newPluginRegistry)) {\n\t\t\tconst handle = key;\n\t\t\tconst existingEntry = oldPlugins[handle];\n\t\t\tconst existingName = oldRegistry[handle];\n\t\t\ttry {\n\t\t\t\tif (existingEntry && existingName === pluginName) {\n\t\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\t\tversion: existingEntry.__dataVersion,\n\t\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t\t});\n\t\t\t\t\tif (migrated) newPlugins[handle] = {\n\t\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t\t__data: migrated.data\n\t\t\t\t\t};\n\t\t\t\t} else if (existingEntry) {\n\t\t\t\t\tlet recovered = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\t\t\tversion: DATA_MODEL_LEGACY_VERSION,\n\t\t\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (migrated) {\n\t\t\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t\t\t\t__data: migrated.data\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\trecovered = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (recoverError) {\n\t\t\t\t\t\tif (!isDataUnrecoverableError(recoverError)) throw recoverError;\n\t\t\t\t\t}\n\t\t\t\t\tif (!recovered) {\n\t\t\t\t\t\tconst transfer = transfers[handle];\n\t\t\t\t\t\tconst initial = createPluginData(handle, transfer);\n\t\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t\t\t\t__data: initial.data\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\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} catch (error) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tfailedAt: handle\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tstorage: {\n\t\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t\t__dataVersion: newVersion,\n\t\t\t\t__data: migratedData,\n\t\t\t\t__pluginRegistry: newPluginRegistry,\n\t\t\t\t__plugins: newPlugins\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Gets plugin-specific data from block storage.\n\t* Accepts raw storage (any format) and normalizes internally.\n\t*\n\t* When called with a typed PluginHandle<F>, the return type is automatically\n\t* inferred from the factory's phantom `__types.data` field.\n\t*\n\t* @param rawStorage - Raw block storage (may be legacy format or BlockStorage)\n\t* @param handle - The plugin handle (branded plugin instance id)\n\t* @returns The plugin data, typed via factory inference\n\t* @throws If plugin is not found in storage\n\t*/\n\tfunction getPluginData(rawStorage, handle) {\n\t\tconst pluginEntry = normalizeBlockStorage(rawStorage).__plugins?.[handle];\n\t\tif (!pluginEntry) throw new Error(`Plugin '${handle}' not found in block storage`);\n\t\treturn pluginEntry.__data;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/block_migrations.js\n\t/** Create a DataVersioned wrapper with correct shape */\n\tfunction makeVersionedData(version, data) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tdata\n\t\t};\n\t}\n\t/** Thrown by recover() to signal unrecoverable data. */\n\tvar DataUnrecoverableError = class extends Error {\n\t\tname = \"DataUnrecoverableError\";\n\t\tconstructor(dataVersion) {\n\t\t\tsuper(`Unknown version '${dataVersion}'`);\n\t\t}\n\t};\n\tfunction isDataUnrecoverableError(error) {\n\t\treturn error instanceof Error && error.name === \"DataUnrecoverableError\";\n\t}\n\t/**\n\t* Default recover function for unknown versions.\n\t* Use as fallback at the end of custom recover functions.\n\t*\n\t* @example\n\t* .recover((version, data) => {\n\t* if (version === 'legacy') {\n\t* return transformLegacyData(data);\n\t* }\n\t* return defaultRecover(version, data);\n\t* })\n\t*/\n\tconst defaultRecover = (version, _data) => {\n\t\tthrow new DataUnrecoverableError(version);\n\t};\n\t/** Symbol for internal builder creation method */\n\tconst FROM_BUILDER = Symbol(\"fromBuilder\");\n\t/**\n\t* Abstract base for both migration chain types.\n\t* Holds shared state, buildStep() helper, and init().\n\t* migrate() cannot be shared due to a TypeScript limitation: when the base class\n\t* migrate() return type is abstract, subclasses cannot narrow it without losing type safety.\n\t* Each subclass therefore owns its migrate() with the correct concrete return type.\n\t*\n\t* @internal\n\t*/\n\tvar MigrationChainBase = class {\n\t\tversionChain;\n\t\tmigrationSteps;\n\t\ttransferSteps;\n\t\tconstructor(state) {\n\t\t\tthis.versionChain = state.versionChain;\n\t\t\tthis.migrationSteps = state.steps;\n\t\t\tthis.transferSteps = state.transferSteps ?? [];\n\t\t}\n\t\t/** Appends a migration step and returns the new versionChain and steps arrays. */\n\t\tbuildStep(nextVersion, fn) {\n\t\t\tif (this.versionChain.includes(nextVersion)) throw new Error(`Duplicate version '${nextVersion}' in migration chain`);\n\t\t\tconst step = {\n\t\t\t\tfromVersion: this.versionChain[this.versionChain.length - 1],\n\t\t\t\ttoVersion: nextVersion,\n\t\t\t\tmigrate: fn\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tversionChain: [...this.versionChain, nextVersion],\n\t\t\t\tsteps: [...this.migrationSteps, step]\n\t\t\t};\n\t\t}\n\t\t/** Validates uniqueness and records a TransferStep. */\n\t\tbuildTransfer(target, extract) {\n\t\t\tif (this.transferSteps.some((t) => t.pluginId === target.id)) throw new Error(`Duplicate transfer for plugin '${target.id}'`);\n\t\t\tconst entry = {\n\t\t\t\tpluginId: target.id,\n\t\t\t\tbeforeStepIndex: this.migrationSteps.length,\n\t\t\t\textract,\n\t\t\t\ttargetVersion: target.transferVersion\n\t\t\t};\n\t\t\treturn { transferSteps: [...this.transferSteps, entry] };\n\t\t}\n\t\t/** Returns recover-specific fields for DataModel construction. Overridden by WithRecover. */\n\t\trecoverState() {\n\t\t\treturn {};\n\t\t}\n\t\t/**\n\t\t* Finalize the DataModel with initial data factory.\n\t\t*\n\t\t* @param initialData - Factory function returning the initial state\n\t\t* @returns Finalized DataModel instance\n\t\t*/\n\t\tinit(initialData) {\n\t\t\treturn DataModel[FROM_BUILDER]({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\tinitialDataFn: initialData,\n\t\t\t\t...this.recoverState()\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Migration chain after recover() or upgradeLegacy() has been called.\n\t* Further migrate() and transfer() calls are allowed; recover() and upgradeLegacy() are not\n\t* (enforced by type — no such methods on this class).\n\t*\n\t* @typeParam Current - Data type at the current point in the chain\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelMigrationChainWithRecover = class DataModelMigrationChainWithRecover extends MigrationChainBase {\n\t\trecoverFn;\n\t\trecoverFromIndex;\n\t\t/** @internal */\n\t\tconstructor(state) {\n\t\t\tsuper(state);\n\t\t\tthis.recoverFn = state.recoverFn;\n\t\t\tthis.recoverFromIndex = state.recoverFromIndex;\n\t\t}\n\t\trecoverState() {\n\t\t\treturn {\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Add a migration step. Same semantics as on the base chain.\n\t\t* recover() and upgradeLegacy() are not available — one has already been called.\n\t\t*/\n\t\tmigrate(nextVersion, fn) {\n\t\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Extract data at the current chain position for seeding a new plugin.\n\t\t* The extract function's return type must match the plugin's transfer data type.\n\t\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t\t*/\n\t\ttransfer(target, extract) {\n\t\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps,\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Migration chain builder.\n\t* Each migrate() call advances the current data type. recover() can be called once\n\t* at any point — it removes itself from the returned chain so it cannot be called again.\n\t* Duplicate version keys throw at runtime.\n\t*\n\t* @typeParam Current - Data type at the current point in the migration chain\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelMigrationChain = class DataModelMigrationChain extends MigrationChainBase {\n\t\t/** @internal */\n\t\tconstructor({ versionChain, steps = [], transferSteps = [] }) {\n\t\t\tsuper({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Add a migration step transforming data from the current version to the next.\n\t\t*\n\t\t* @typeParam Next - Data type of the next version\n\t\t* @param nextVersion - Version key to migrate to (must be unique in the chain)\n\t\t* @param fn - Migration function\n\t\t* @returns Builder with the next version as current\n\t\t*\n\t\t* @example\n\t\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n\t\t*/\n\t\tmigrate(nextVersion, fn) {\n\t\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\t\treturn new DataModelMigrationChain({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps: this.transferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Extract data at the current chain position for seeding a new plugin.\n\t\t* The extract function's return type must match the plugin's transfer data type.\n\t\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t\t*\n\t\t* Calling .transfer() on DataModelInitialChain returns DataModelMigrationChain,\n\t\t* which removes .upgradeLegacy() from the chain (preventing a problematic combination).\n\t\t*\n\t\t* @example\n\t\t* .from<V1>(\"v1\")\n\t\t* .transfer(tablePlugin, (v1) => ({ state: v1.tableState }))\n\t\t* .migrate<V2>(\"v2\", ({ tableState: _, ...rest }) => rest)\n\t\t*/\n\t\ttransfer(target, extract) {\n\t\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\t\treturn new DataModelMigrationChain({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Set a recovery handler for unknown or legacy versions.\n\t\t*\n\t\t* The recover function is called when data has a version not in the migration chain.\n\t\t* It must return data of the type at this point in the chain (Current). Any migrate()\n\t\t* steps added after recover() will then run on the recovered data.\n\t\t*\n\t\t* Can only be called once — the returned chain has no recover() method.\n\t\t*\n\t\t* @param fn - Recovery function returning Current (the type at this chain position)\n\t\t* @returns Builder with migrate() and init() but without recover()\n\t\t*\n\t\t* @example\n\t\t* // Recover between migrations — recovered data goes through v3 migration\n\t\t* new DataModelBuilder<V1>(\"v1\")\n\t\t* .migrate<V2>(\"v2\", (v1) => ({ ...v1, label: \"\" }))\n\t\t* .recover((version, data) => {\n\t\t* if (version === 'legacy') return transformLegacy(data); // returns V2\n\t\t* return defaultRecover(version, data);\n\t\t* })\n\t\t* .migrate<V3>(\"v3\", (v2) => ({ ...v2, description: \"\" }))\n\t\t* .init(() => ({ count: 0, label: \"\", description: \"\" }));\n\t\t*/\n\t\trecover(fn) {\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\trecoverFn: fn,\n\t\t\t\trecoverFromIndex: this.migrationSteps.length\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Initial migration chain returned by `.from()`.\n\t* Extends DataModelMigrationChain with `upgradeLegacy()` — available only before\n\t* any `.migrate()` calls, since legacy data always arrives at the initial version.\n\t*\n\t* @typeParam Current - Data type at the initial version\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelInitialChain = class extends DataModelMigrationChain {\n\t\t/**\n\t\t* Handle legacy V1 model state ({ args, uiState }) when upgrading a block from\n\t\t* BlockModel V1 to BlockModelV3.\n\t\t*\n\t\t* When a V1 block is upgraded, its stored state `{ args, uiState }` is normalized\n\t\t* to the internal default version. This method inserts a migration step from that\n\t\t* internal version to the version specified in `.from()`, using the provided typed\n\t\t* callback to transform the legacy shape. Non-legacy data passes through unchanged.\n\t\t*\n\t\t* Must be called right after `.from()` — not available after `.migrate()` calls.\n\t\t* Any `.migrate()` steps added after `upgradeLegacy()` will run on the transformed result.\n\t\t*\n\t\t* Can only be called once — the returned chain has no upgradeLegacy() method.\n\t\t* Mutually exclusive with recover().\n\t\t*\n\t\t* @typeParam Args - Type of the legacy block args\n\t\t* @typeParam UiState - Type of the legacy block uiState\n\t\t* @param fn - Typed transform from { args, uiState } to Current\n\t\t* @returns Builder with migrate() and init() but without recover() or upgradeLegacy()\n\t\t*\n\t\t* @example\n\t\t* type OldArgs = { inputFile: string; threshold: number };\n\t\t* type OldUiState = { selectedTab: string };\n\t\t* type BlockData = { inputFile: string; threshold: number; selectedTab: string };\n\t\t*\n\t\t* const dataModel = new DataModelBuilder()\n\t\t* .from<BlockData>(\"v1\")\n\t\t* .upgradeLegacy<OldArgs, OldUiState>(({ args, uiState }) => ({\n\t\t* inputFile: args.inputFile,\n\t\t* threshold: args.threshold,\n\t\t* selectedTab: uiState.selectedTab,\n\t\t* }))\n\t\t* .init(() => ({ inputFile: '', threshold: 0, selectedTab: 'main' }));\n\t\t*/\n\t\tupgradeLegacy(fn) {\n\t\t\tconst wrappedFn = (data) => {\n\t\t\t\tif (data !== null && typeof data === \"object\" && \"args\" in data) return fn(data);\n\t\t\t\treturn data;\n\t\t\t};\n\t\t\tconst step = {\n\t\t\t\tfromVersion: DATA_MODEL_LEGACY_VERSION,\n\t\t\t\ttoVersion: this.versionChain[0],\n\t\t\t\tmigrate: wrappedFn\n\t\t\t};\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: [DATA_MODEL_LEGACY_VERSION, ...this.versionChain],\n\t\t\t\tsteps: [step, ...this.migrationSteps],\n\t\t\t\ttransferSteps: this.transferSteps.map((t) => ({\n\t\t\t\t\t...t,\n\t\t\t\t\tbeforeStepIndex: t.beforeStepIndex + 1\n\t\t\t\t}))\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Builder entry point for creating DataModel with type-safe migrations.\n\t*\n\t* @example\n\t* // Simple (no migrations):\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockData>(\"v1\")\n\t* .init(() => ({ numbers: [] }));\n\t*\n\t* @example\n\t* // With migrations:\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockDataV1>(\"v1\")\n\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n\t* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n\t* .init(() => ({ numbers: [], labels: [], description: '' }));\n\t*\n\t* @example\n\t* // With recover() between migrations — recovered data goes through remaining migrations:\n\t* const dataModelChain = new DataModelBuilder()\n\t* .from<BlockDataV1>(\"v1\")\n\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }));\n\t*\n\t* // recover() placed before the v3 migration: recovered data goes through v3\n\t* const dataModel = dataModelChain\n\t* .recover((version, data) => {\n\t* if (version === 'legacy' && isLegacyData(data)) return transformLegacy(data); // returns V2\n\t* return defaultRecover(version, data);\n\t* })\n\t* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n\t* .init(() => ({ numbers: [], labels: [], description: '' }));\n\t*\n\t* @example\n\t* // With upgradeLegacy() — typed upgrade from BlockModel V1 state:\n\t* type OldArgs = { inputFile: string };\n\t* type OldUiState = { selectedTab: string };\n\t* type BlockData = { inputFile: string; 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* selectedTab: uiState.selectedTab,\n\t* }))\n\t* .init(() => ({ inputFile: '', selectedTab: 'main' }));\n\t*/\n\tvar DataModelBuilder = class {\n\t\t/**\n\t\t* Start the migration chain with the given initial data type and version key.\n\t\t*\n\t\t* @typeParam T - Data type for the initial version\n\t\t* @param initialVersion - Version key string (e.g. \"v1\")\n\t\t* @returns Migration chain builder\n\t\t*/\n\t\tfrom(initialVersion) {\n\t\t\treturn new DataModelInitialChain({ versionChain: [initialVersion] });\n\t\t}\n\t};\n\t/**\n\t* DataModel defines the block's data structure, initial values, and migrations.\n\t* Used by BlockModelV3 to manage data state.\n\t*\n\t* Use `new DataModelBuilder()` to create a DataModel.\n\t*\n\t* @example\n\t* // With recover() between migrations:\n\t* // Recovered data (V2) goes through the v2→v3 migration automatically.\n\t* const dataModel = new DataModelBuilder()\n\t* .from<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\tvar DataModel = class DataModel {\n\t\t/** Latest version key — O(1) access for the common \"already current\" check. */\n\t\tlatestVersion;\n\t\t/** Maps each known version key to the index of the first step to run from it. O(1) lookup. */\n\t\tstepsByFromVersion;\n\t\tsteps;\n\t\ttransferSteps;\n\t\tinitialDataFn;\n\t\trecoverFn;\n\t\trecoverFromIndex;\n\t\tconstructor({ versionChain, steps, transferSteps = [], initialDataFn, recoverFn = defaultRecover, recoverFromIndex }) {\n\t\t\tif (versionChain.length === 0) throw new Error(\"DataModel requires at least one version key\");\n\t\t\tthis.latestVersion = versionChain[versionChain.length - 1];\n\t\t\tthis.stepsByFromVersion = new Map(versionChain.map((v, i) => [v, i]));\n\t\t\tthis.steps = steps;\n\t\t\tthis.transferSteps = transferSteps;\n\t\t\tthis.initialDataFn = initialDataFn;\n\t\t\tthis.recoverFn = recoverFn;\n\t\t\tthis.recoverFromIndex = recoverFromIndex ?? steps.length;\n\t\t}\n\t\t/**\n\t\t* Internal method for creating DataModel from builder.\n\t\t* Uses Symbol key to prevent external access.\n\t\t* @internal\n\t\t*/\n\t\tstatic [FROM_BUILDER](state) {\n\t\t\treturn new DataModel(state);\n\t\t}\n\t\t/**\n\t\t* The latest (current) version key in the migration chain.\n\t\t*/\n\t\tget version() {\n\t\t\treturn this.latestVersion;\n\t\t}\n\t\t/**\n\t\t* Get a fresh copy of the initial data.\n\t\t*/\n\t\tinitialData() {\n\t\t\treturn this.initialDataFn();\n\t\t}\n\t\t/**\n\t\t* Get initial data wrapped with current version.\n\t\t* Used when creating new blocks or resetting to defaults.\n\t\t*/\n\t\tgetDefaultData() {\n\t\t\treturn makeVersionedData(this.latestVersion, this.initialDataFn());\n\t\t}\n\t\trecoverFrom(data, version) {\n\t\t\tlet currentData = this.recoverFn(version, data);\n\t\t\tfor (let i = this.recoverFromIndex; i < this.steps.length; i++) currentData = this.steps[i].migrate(currentData);\n\t\t\treturn {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata: currentData\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Migrate versioned data from any version to the latest.\n\t\t* Collects transfer extractions at their designated chain positions.\n\t\t*\n\t\t* - If version is in chain, applies needed migrations (O(1) lookup)\n\t\t* - If version is unknown, attempts recovery; falls back to initial data\n\t\t* - If a migration step fails, throws so the caller can preserve original data\n\t\t*\n\t\t* Transfers only fire during normal step-by-step migration:\n\t\t* - Recovery path: returns empty transfers\n\t\t* - Fast-path (already at latest): returns empty transfers\n\t\t*\n\t\t* @param versioned - Data with version tag\n\t\t* @returns Migrated data at the latest version with transfer record\n\t\t* @throws If a migration step from a known version fails\n\t\t*/\n\t\tmigrate(versioned) {\n\t\t\tconst { version: fromVersion, data } = versioned;\n\t\t\tif (fromVersion === this.latestVersion) return {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata,\n\t\t\t\ttransfers: {}\n\t\t\t};\n\t\t\tconst startIndex = this.stepsByFromVersion.get(fromVersion);\n\t\t\tif (startIndex === void 0) try {\n\t\t\t\treturn {\n\t\t\t\t\t...this.recoverFrom(data, fromVersion),\n\t\t\t\t\ttransfers: {}\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\treturn {\n\t\t\t\t\t...this.getDefaultData(),\n\t\t\t\t\ttransfers: {}\n\t\t\t\t};\n\t\t\t}\n\t\t\tlet currentData = data;\n\t\t\tconst transfers = {};\n\t\t\tfor (let i = startIndex; i < this.steps.length; i++) {\n\t\t\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex === i) transfers[t.pluginId] = {\n\t\t\t\t\tversion: t.targetVersion,\n\t\t\t\t\tdata: t.extract(currentData)\n\t\t\t\t};\n\t\t\t\tcurrentData = this.steps[i].migrate(currentData);\n\t\t\t}\n\t\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex >= this.steps.length && t.beforeStepIndex >= startIndex) 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\treturn {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata: currentData,\n\t\t\t\ttransfers\n\t\t\t};\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/internal.js\n\t/** Utility code helping to identify whether the code is running in actual UI environment */\n\tfunction isInUI() {\n\t\treturn typeof globalThis.getPlatforma !== \"undefined\" || typeof globalThis.platforma !== \"undefined\";\n\t}\n\t/** Utility code helping to retrieve a platforma instance form the environment */\n\tfunction getPlatformaInstance(config) {\n\t\tif (config && typeof globalThis.getPlatforma === \"function\") return globalThis.getPlatforma(config);\n\t\telse if (typeof globalThis.platforma !== \"undefined\") return globalThis.platforma;\n\t\telse throw new Error(\"Can't get platforma instance.\");\n\t}\n\tfunction tryGetCfgRenderCtx() {\n\t\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\t\telse return void 0;\n\t}\n\tfunction getCfgRenderCtx() {\n\t\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\t\telse throw new Error(\"Not in config rendering context\");\n\t}\n\tfunction tryRegisterCallback(key, callback) {\n\t\tconst ctx = tryGetCfgRenderCtx();\n\t\tif (ctx === void 0) return false;\n\t\tif (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n\t\tctx.callbackRegistry[key] = callback;\n\t\treturn true;\n\t}\n\t/**\n\t* Registers a callback, replacing any existing callback with the same key.\n\t* Use this for callbacks that have a default value but can be overridden.\n\t*\n\t* @param key - The callback registry key\n\t* @param callback - The callback function to register\n\t* @returns true if registered, false if not in render context\n\t*/\n\tfunction replaceCallback(key, callback) {\n\t\tconst ctx = tryGetCfgRenderCtx();\n\t\tif (ctx === void 0) return false;\n\t\tctx.callbackRegistry[key] = callback;\n\t\treturn true;\n\t}\n\t/** Creates a ConfigRenderLambda descriptor without registering a callback. */\n\tfunction createRenderLambda(opts) {\n\t\tconst { handle, ...flags } = opts;\n\t\treturn {\n\t\t\t__renderLambda: true,\n\t\t\thandle,\n\t\t\t...flags\n\t\t};\n\t}\n\t/** Registers a callback and returns a ConfigRenderLambda descriptor. */\n\tfunction createAndRegisterRenderLambda(opts, replace) {\n\t\tconst { handle, lambda, ...flags } = opts;\n\t\tif (replace) replaceCallback(handle, lambda);\n\t\telse tryRegisterCallback(handle, lambda);\n\t\treturn createRenderLambda({\n\t\t\thandle,\n\t\t\t...flags\n\t\t});\n\t}\n\tconst futureResolves = /* @__PURE__ */ new Map();\n\tfunction registerFutureAwait(handle, onResolve) {\n\t\tif (!(handle in getCfgRenderCtx().callbackRegistry)) {\n\t\t\tgetCfgRenderCtx().callbackRegistry[handle] = (value) => {\n\t\t\t\tfor (const res of futureResolves.get(handle)) res(value);\n\t\t\t};\n\t\t\tfutureResolves.set(handle, []);\n\t\t}\n\t\tfutureResolves.get(handle).push(onResolve);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/block_storage_facade.js\n\t/**\n\t* All facade callback names as constants.\n\t* These are the source of truth - the interface is derived from these.\n\t*\n\t* IMPORTANT: When adding a new callback:\n\t* 1. Add the constant here\n\t* 2. Add the callback signature to FacadeCallbackTypes below\n\t* 3. The BlockStorageFacade type will automatically include it\n\t*/\n\tconst BlockStorageFacadeCallbacks = {\n\t\tStorageApplyUpdate: \"__pl_storage_applyUpdate\",\n\t\tStorageDebugView: \"__pl_storage_debugView\",\n\t\tStorageMigrate: \"__pl_storage_migrate\",\n\t\tArgsDerive: \"__pl_args_derive\",\n\t\tPrerunArgsDerive: \"__pl_prerunArgs_derive\",\n\t\tStorageInitial: \"__pl_storage_initial\"\n\t};\n\t/**\n\t* Creates a map of lambda handles from a callbacks constant object.\n\t* Keys are the callback string values (e.g., '__pl_storage_applyUpdate').\n\t*/\n\tfunction createFacadeHandles(callbacks) {\n\t\treturn Object.fromEntries(Object.values(callbacks).map((handle) => [handle, createRenderLambda({ handle })]));\n\t}\n\t/**\n\t* Lambda handles for facade callbacks.\n\t* Used by the middle layer to invoke callbacks via executeSingleLambda().\n\t*/\n\tconst BlockStorageFacadeHandles = createFacadeHandles(BlockStorageFacadeCallbacks);\n\t/** Register all facade callbacks at once. Ensures all required callbacks are provided. */\n\tfunction registerFacadeCallbacks(callbacks) {\n\t\tfor (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/config/actions.js\n\tfunction getFromCfg(variable) {\n\t\treturn {\n\t\t\ttype: \"GetFromCtx\",\n\t\t\tvariable\n\t\t};\n\t}\n\tgetFromCfg(\"$args\");\n\tgetFromCfg(\"$it\");\n\tgetFromCfg(\"$prod\");\n\tgetFromCfg(\"$staging\");\n\tgetFromCfg(\"$ui\");\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/future.js\n\tvar FutureRef = class FutureRef {\n\t\tisResolved = false;\n\t\tresolvedValue;\n\t\tconstructor(handle, postProcess = (v) => v) {\n\t\t\tthis.handle = handle;\n\t\t\tthis.postProcess = postProcess;\n\t\t\tregisterFutureAwait(handle, (value) => {\n\t\t\t\tthis.resolvedValue = postProcess(value);\n\t\t\t\tthis.isResolved = true;\n\t\t\t});\n\t\t}\n\t\tmap(mapping) {\n\t\t\treturn new FutureRef(this.handle, (v) => mapping(this.postProcess(v)));\n\t\t}\n\t\tmapDefined(mapping) {\n\t\t\treturn new FutureRef(this.handle, (v) => {\n\t\t\t\tconst vv = this.postProcess(v);\n\t\t\t\treturn vv ? mapping(vv) : void 0;\n\t\t\t});\n\t\t}\n\t\ttoJSON() {\n\t\t\treturn this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js\n\tvar util;\n\t(function(util) {\n\t\tutil.assertEqual = (_) => {};\n\t\tfunction assertIs(_arg) {}\n\t\tutil.assertIs = assertIs;\n\t\tfunction assertNever(_x) {\n\t\t\tthrow new Error();\n\t\t}\n\t\tutil.assertNever = assertNever;\n\t\tutil.arrayToEnum = (items) => {\n\t\t\tconst obj = {};\n\t\t\tfor (const item of items) obj[item] = item;\n\t\t\treturn obj;\n\t\t};\n\t\tutil.getValidEnumValues = (obj) => {\n\t\t\tconst validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n\t\t\tconst filtered = {};\n\t\t\tfor (const k of validKeys) filtered[k] = obj[k];\n\t\t\treturn util.objectValues(filtered);\n\t\t};\n\t\tutil.objectValues = (obj) => {\n\t\t\treturn util.objectKeys(obj).map(function(e) {\n\t\t\t\treturn obj[e];\n\t\t\t});\n\t\t};\n\t\tutil.objectKeys = typeof Object.keys === \"function\" ? (obj) => Object.keys(obj) : (object) => {\n\t\t\tconst keys = [];\n\t\t\tfor (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) keys.push(key);\n\t\t\treturn keys;\n\t\t};\n\t\tutil.find = (arr, checker) => {\n\t\t\tfor (const item of arr) if (checker(item)) return item;\n\t\t};\n\t\tutil.isInteger = typeof Number.isInteger === \"function\" ? (val) => Number.isInteger(val) : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n\t\tfunction joinValues(array, separator = \" | \") {\n\t\t\treturn array.map((val) => typeof val === \"string\" ? `'${val}'` : val).join(separator);\n\t\t}\n\t\tutil.joinValues = joinValues;\n\t\tutil.jsonStringifyReplacer = (_, value) => {\n\t\t\tif (typeof value === \"bigint\") return value.toString();\n\t\t\treturn value;\n\t\t};\n\t})(util || (util = {}));\n\tvar objectUtil;\n\t(function(objectUtil) {\n\t\tobjectUtil.mergeShapes = (first, second) => {\n\t\t\treturn {\n\t\t\t\t...first,\n\t\t\t\t...second\n\t\t\t};\n\t\t};\n\t})(objectUtil || (objectUtil = {}));\n\tconst ZodParsedType = util.arrayToEnum([\n\t\t\"string\",\n\t\t\"nan\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"float\",\n\t\t\"boolean\",\n\t\t\"date\",\n\t\t\"bigint\",\n\t\t\"symbol\",\n\t\t\"function\",\n\t\t\"undefined\",\n\t\t\"null\",\n\t\t\"array\",\n\t\t\"object\",\n\t\t\"unknown\",\n\t\t\"promise\",\n\t\t\"void\",\n\t\t\"never\",\n\t\t\"map\",\n\t\t\"set\"\n\t]);\n\tconst getParsedType = (data) => {\n\t\tswitch (typeof data) {\n\t\t\tcase \"undefined\": return ZodParsedType.undefined;\n\t\t\tcase \"string\": return ZodParsedType.string;\n\t\t\tcase \"number\": return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n\t\t\tcase \"boolean\": return ZodParsedType.boolean;\n\t\t\tcase \"function\": return ZodParsedType.function;\n\t\t\tcase \"bigint\": return ZodParsedType.bigint;\n\t\t\tcase \"symbol\": return ZodParsedType.symbol;\n\t\t\tcase \"object\":\n\t\t\t\tif (Array.isArray(data)) return ZodParsedType.array;\n\t\t\t\tif (data === null) return ZodParsedType.null;\n\t\t\t\tif (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") return ZodParsedType.promise;\n\t\t\t\tif (typeof Map !== \"undefined\" && data instanceof Map) return ZodParsedType.map;\n\t\t\t\tif (typeof Set !== \"undefined\" && data instanceof Set) return ZodParsedType.set;\n\t\t\t\tif (typeof Date !== \"undefined\" && data instanceof Date) return ZodParsedType.date;\n\t\t\t\treturn ZodParsedType.object;\n\t\t\tdefault: return ZodParsedType.unknown;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js\n\tconst ZodIssueCode = util.arrayToEnum([\n\t\t\"invalid_type\",\n\t\t\"invalid_literal\",\n\t\t\"custom\",\n\t\t\"invalid_union\",\n\t\t\"invalid_union_discriminator\",\n\t\t\"invalid_enum_value\",\n\t\t\"unrecognized_keys\",\n\t\t\"invalid_arguments\",\n\t\t\"invalid_return_type\",\n\t\t\"invalid_date\",\n\t\t\"invalid_string\",\n\t\t\"too_small\",\n\t\t\"too_big\",\n\t\t\"invalid_intersection_types\",\n\t\t\"not_multiple_of\",\n\t\t\"not_finite\"\n\t]);\n\tvar ZodError = class ZodError extends Error {\n\t\tget errors() {\n\t\t\treturn this.issues;\n\t\t}\n\t\tconstructor(issues) {\n\t\t\tsuper();\n\t\t\tthis.issues = [];\n\t\t\tthis.addIssue = (sub) => {\n\t\t\t\tthis.issues = [...this.issues, sub];\n\t\t\t};\n\t\t\tthis.addIssues = (subs = []) => {\n\t\t\t\tthis.issues = [...this.issues, ...subs];\n\t\t\t};\n\t\t\tconst actualProto = new.target.prototype;\n\t\t\tif (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto);\n\t\t\telse this.__proto__ = actualProto;\n\t\t\tthis.name = \"ZodError\";\n\t\t\tthis.issues = issues;\n\t\t}\n\t\tformat(_mapper) {\n\t\t\tconst mapper = _mapper || function(issue) {\n\t\t\t\treturn issue.message;\n\t\t\t};\n\t\t\tconst fieldErrors = { _errors: [] };\n\t\t\tconst processError = (error) => {\n\t\t\t\tfor (const issue of error.issues) if (issue.code === \"invalid_union\") issue.unionErrors.map(processError);\n\t\t\t\telse if (issue.code === \"invalid_return_type\") processError(issue.returnTypeError);\n\t\t\t\telse if (issue.code === \"invalid_arguments\") processError(issue.argumentsError);\n\t\t\t\telse if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));\n\t\t\t\telse {\n\t\t\t\t\tlet curr = fieldErrors;\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\twhile (i < issue.path.length) {\n\t\t\t\t\t\tconst el = issue.path[i];\n\t\t\t\t\t\tif (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurr[el] = curr[el] || { _errors: [] };\n\t\t\t\t\t\t\tcurr[el]._errors.push(mapper(issue));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurr = curr[el];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tprocessError(this);\n\t\t\treturn fieldErrors;\n\t\t}\n\t\tstatic assert(value) {\n\t\t\tif (!(value instanceof ZodError)) throw new Error(`Not a ZodError: ${value}`);\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.message;\n\t\t}\n\t\tget message() {\n\t\t\treturn JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n\t\t}\n\t\tget isEmpty() {\n\t\t\treturn this.issues.length === 0;\n\t\t}\n\t\tflatten(mapper = (issue) => issue.message) {\n\t\t\tconst fieldErrors = {};\n\t\t\tconst formErrors = [];\n\t\t\tfor (const sub of this.issues) if (sub.path.length > 0) {\n\t\t\t\tconst firstEl = sub.path[0];\n\t\t\t\tfieldErrors[firstEl] = fieldErrors[firstEl] || [];\n\t\t\t\tfieldErrors[firstEl].push(mapper(sub));\n\t\t\t} else formErrors.push(mapper(sub));\n\t\t\treturn {\n\t\t\t\tformErrors,\n\t\t\t\tfieldErrors\n\t\t\t};\n\t\t}\n\t\tget formErrors() {\n\t\t\treturn this.flatten();\n\t\t}\n\t};\n\tZodError.create = (issues) => {\n\t\treturn new ZodError(issues);\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js\n\tconst errorMap = (issue, _ctx) => {\n\t\tlet message;\n\t\tswitch (issue.code) {\n\t\t\tcase ZodIssueCode.invalid_type:\n\t\t\t\tif (issue.received === ZodParsedType.undefined) message = \"Required\";\n\t\t\t\telse message = `Expected ${issue.expected}, received ${issue.received}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_literal:\n\t\t\t\tmessage = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.unrecognized_keys:\n\t\t\t\tmessage = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_union:\n\t\t\t\tmessage = `Invalid input`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_union_discriminator:\n\t\t\t\tmessage = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_enum_value:\n\t\t\t\tmessage = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_arguments:\n\t\t\t\tmessage = `Invalid function arguments`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_return_type:\n\t\t\t\tmessage = `Invalid function return type`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_date:\n\t\t\t\tmessage = `Invalid date`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_string:\n\t\t\t\tif (typeof issue.validation === \"object\") if (\"includes\" in issue.validation) {\n\t\t\t\t\tmessage = `Invalid input: must include \"${issue.validation.includes}\"`;\n\t\t\t\t\tif (typeof issue.validation.position === \"number\") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n\t\t\t\t} else if (\"startsWith\" in issue.validation) message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n\t\t\t\telse if (\"endsWith\" in issue.validation) message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n\t\t\t\telse util.assertNever(issue.validation);\n\t\t\t\telse if (issue.validation !== \"regex\") message = `Invalid ${issue.validation}`;\n\t\t\t\telse message = \"Invalid\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.too_small:\n\t\t\t\tif (issue.type === \"array\") message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n\t\t\t\telse if (issue.type === \"string\") message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n\t\t\t\telse if (issue.type === \"number\") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n\t\t\t\telse if (issue.type === \"bigint\") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n\t\t\t\telse if (issue.type === \"date\") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n\t\t\t\telse message = \"Invalid input\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.too_big:\n\t\t\t\tif (issue.type === \"array\") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n\t\t\t\telse if (issue.type === \"string\") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n\t\t\t\telse if (issue.type === \"number\") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n\t\t\t\telse if (issue.type === \"bigint\") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n\t\t\t\telse if (issue.type === \"date\") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n\t\t\t\telse message = \"Invalid input\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.custom:\n\t\t\t\tmessage = `Invalid input`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_intersection_types:\n\t\t\t\tmessage = `Intersection results could not be merged`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.not_multiple_of:\n\t\t\t\tmessage = `Number must be a multiple of ${issue.multipleOf}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.not_finite:\n\t\t\t\tmessage = \"Number must be finite\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmessage = _ctx.defaultError;\n\t\t\t\tutil.assertNever(issue);\n\t\t}\n\t\treturn { message };\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js\n\tlet overrideErrorMap = errorMap;\n\tfunction getErrorMap() {\n\t\treturn overrideErrorMap;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js\n\tconst makeIssue = (params) => {\n\t\tconst { data, path, errorMaps, issueData } = params;\n\t\tconst fullPath = [...path, ...issueData.path || []];\n\t\tconst fullIssue = {\n\t\t\t...issueData,\n\t\t\tpath: fullPath\n\t\t};\n\t\tif (issueData.message !== void 0) return {\n\t\t\t...issueData,\n\t\t\tpath: fullPath,\n\t\t\tmessage: issueData.message\n\t\t};\n\t\tlet errorMessage = \"\";\n\t\tconst maps = errorMaps.filter((m) => !!m).slice().reverse();\n\t\tfor (const map of maps) errorMessage = map(fullIssue, {\n\t\t\tdata,\n\t\t\tdefaultError: errorMessage\n\t\t}).message;\n\t\treturn {\n\t\t\t...issueData,\n\t\t\tpath: fullPath,\n\t\t\tmessage: errorMessage\n\t\t};\n\t};\n\tfunction addIssueToContext(ctx, issueData) {\n\t\tconst overrideMap = getErrorMap();\n\t\tconst issue = makeIssue({\n\t\t\tissueData,\n\t\t\tdata: ctx.data,\n\t\t\tpath: ctx.path,\n\t\t\terrorMaps: [\n\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\tctx.schemaErrorMap,\n\t\t\t\toverrideMap,\n\t\t\t\toverrideMap === errorMap ? void 0 : errorMap\n\t\t\t].filter((x) => !!x)\n\t\t});\n\t\tctx.common.issues.push(issue);\n\t}\n\tvar ParseStatus = class ParseStatus {\n\t\tconstructor() {\n\t\t\tthis.value = \"valid\";\n\t\t}\n\t\tdirty() {\n\t\t\tif (this.value === \"valid\") this.value = \"dirty\";\n\t\t}\n\t\tabort() {\n\t\t\tif (this.value !== \"aborted\") this.value = \"aborted\";\n\t\t}\n\t\tstatic mergeArray(status, results) {\n\t\t\tconst arrayValue = [];\n\t\t\tfor (const s of results) {\n\t\t\t\tif (s.status === \"aborted\") return INVALID;\n\t\t\t\tif (s.status === \"dirty\") status.dirty();\n\t\t\t\tarrayValue.push(s.value);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: arrayValue\n\t\t\t};\n\t\t}\n\t\tstatic async mergeObjectAsync(status, pairs) {\n\t\t\tconst syncPairs = [];\n\t\t\tfor (const pair of pairs) {\n\t\t\t\tconst key = await pair.key;\n\t\t\t\tconst value = await pair.value;\n\t\t\t\tsyncPairs.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 ParseStatus.mergeObjectSync(status, syncPairs);\n\t\t}\n\t\tstatic mergeObjectSync(status, pairs) {\n\t\t\tconst finalObject = {};\n\t\t\tfor (const pair of pairs) {\n\t\t\t\tconst { key, value } = pair;\n\t\t\t\tif (key.status === \"aborted\") return INVALID;\n\t\t\t\tif (value.status === \"aborted\") return INVALID;\n\t\t\t\tif (key.status === \"dirty\") status.dirty();\n\t\t\t\tif (value.status === \"dirty\") status.dirty();\n\t\t\t\tif (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) finalObject[key.value] = value.value;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: finalObject\n\t\t\t};\n\t\t}\n\t};\n\tconst INVALID = Object.freeze({ status: \"aborted\" });\n\tconst DIRTY = (value) => ({\n\t\tstatus: \"dirty\",\n\t\tvalue\n\t});\n\tconst OK = (value) => ({\n\t\tstatus: \"valid\",\n\t\tvalue\n\t});\n\tconst isAborted = (x) => x.status === \"aborted\";\n\tconst isDirty = (x) => x.status === \"dirty\";\n\tconst isValid = (x) => x.status === \"valid\";\n\tconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js\n\tvar errorUtil;\n\t(function(errorUtil) {\n\t\terrorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n\t\terrorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n\t})(errorUtil || (errorUtil = {}));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js\n\tvar ParseInputLazyPath = class {\n\t\tconstructor(parent, value, path, key) {\n\t\t\tthis._cachedPath = [];\n\t\t\tthis.parent = parent;\n\t\t\tthis.data = value;\n\t\t\tthis._path = path;\n\t\t\tthis._key = key;\n\t\t}\n\t\tget path() {\n\t\t\tif (!this._cachedPath.length) if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key);\n\t\t\telse this._cachedPath.push(...this._path, this._key);\n\t\t\treturn this._cachedPath;\n\t\t}\n\t};\n\tconst handleResult = (ctx, result) => {\n\t\tif (isValid(result)) return {\n\t\t\tsuccess: true,\n\t\t\tdata: result.value\n\t\t};\n\t\telse {\n\t\t\tif (!ctx.common.issues.length) throw new Error(\"Validation failed but no issues detected.\");\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tget error() {\n\t\t\t\t\tif (this._error) return this._error;\n\t\t\t\t\tconst error = new ZodError(ctx.common.issues);\n\t\t\t\t\tthis._error = error;\n\t\t\t\t\treturn this._error;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\tfunction processCreateParams(params) {\n\t\tif (!params) return {};\n\t\tconst { errorMap, invalid_type_error, required_error, description } = params;\n\t\tif (errorMap && (invalid_type_error || required_error)) throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n\t\tif (errorMap) return {\n\t\t\terrorMap,\n\t\t\tdescription\n\t\t};\n\t\tconst customMap = (iss, ctx) => {\n\t\t\tconst { message } = params;\n\t\t\tif (iss.code === \"invalid_enum_value\") return { message: message ?? ctx.defaultError };\n\t\t\tif (typeof ctx.data === \"undefined\") return { message: message ?? required_error ?? ctx.defaultError };\n\t\t\tif (iss.code !== \"invalid_type\") return { message: ctx.defaultError };\n\t\t\treturn { message: message ?? invalid_type_error ?? ctx.defaultError };\n\t\t};\n\t\treturn {\n\t\t\terrorMap: customMap,\n\t\t\tdescription\n\t\t};\n\t}\n\tvar ZodType = class {\n\t\tget description() {\n\t\t\treturn this._def.description;\n\t\t}\n\t\t_getType(input) {\n\t\t\treturn getParsedType(input.data);\n\t\t}\n\t\t_getOrReturnCtx(input, ctx) {\n\t\t\treturn ctx || {\n\t\t\t\tcommon: input.parent.common,\n\t\t\t\tdata: input.data,\n\t\t\t\tparsedType: getParsedType(input.data),\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tpath: input.path,\n\t\t\t\tparent: input.parent\n\t\t\t};\n\t\t}\n\t\t_processInputParams(input) {\n\t\t\treturn {\n\t\t\t\tstatus: new ParseStatus(),\n\t\t\t\tctx: {\n\t\t\t\t\tcommon: input.parent.common,\n\t\t\t\t\tdata: input.data,\n\t\t\t\t\tparsedType: getParsedType(input.data),\n\t\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\t\tpath: input.path,\n\t\t\t\t\tparent: input.parent\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t_parseSync(input) {\n\t\t\tconst result = this._parse(input);\n\t\t\tif (isAsync(result)) throw new Error(\"Synchronous parse encountered promise.\");\n\t\t\treturn result;\n\t\t}\n\t\t_parseAsync(input) {\n\t\t\tconst result = this._parse(input);\n\t\t\treturn Promise.resolve(result);\n\t\t}\n\t\tparse(data, params) {\n\t\t\tconst result = this.safeParse(data, params);\n\t\t\tif (result.success) return result.data;\n\t\t\tthrow result.error;\n\t\t}\n\t\tsafeParse(data, params) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: params?.async ?? false,\n\t\t\t\t\tcontextualErrorMap: params?.errorMap\n\t\t\t\t},\n\t\t\t\tpath: params?.path || [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\treturn handleResult(ctx, this._parseSync({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}));\n\t\t}\n\t\t\"~validate\"(data) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: !!this[\"~standard\"].async\n\t\t\t\t},\n\t\t\t\tpath: [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\tif (!this[\"~standard\"].async) try {\n\t\t\t\tconst result = this._parseSync({\n\t\t\t\t\tdata,\n\t\t\t\t\tpath: [],\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\treturn isValid(result) ? { value: result.value } : { issues: ctx.common.issues };\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.message?.toLowerCase()?.includes(\"encountered\")) this[\"~standard\"].async = true;\n\t\t\t\tctx.common = {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: true\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn this._parseAsync({\n\t\t\t\tdata,\n\t\t\t\tpath: [],\n\t\t\t\tparent: ctx\n\t\t\t}).then((result) => isValid(result) ? { value: result.value } : { issues: ctx.common.issues });\n\t\t}\n\t\tasync parseAsync(data, params) {\n\t\t\tconst result = await this.safeParseAsync(data, params);\n\t\t\tif (result.success) return result.data;\n\t\t\tthrow result.error;\n\t\t}\n\t\tasync safeParseAsync(data, params) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tcontextualErrorMap: params?.errorMap,\n\t\t\t\t\tasync: true\n\t\t\t\t},\n\t\t\t\tpath: params?.path || [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\tconst maybeAsyncResult = this._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t\treturn handleResult(ctx, await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)));\n\t\t}\n\t\trefine(check, message) {\n\t\t\tconst getIssueProperties = (val) => {\n\t\t\t\tif (typeof message === \"string\" || typeof message === \"undefined\") return { message };\n\t\t\t\telse if (typeof message === \"function\") return message(val);\n\t\t\t\telse return message;\n\t\t\t};\n\t\t\treturn this._refinement((val, ctx) => {\n\t\t\t\tconst result = check(val);\n\t\t\t\tconst setError = () => ctx.addIssue({\n\t\t\t\t\tcode: ZodIssueCode.custom,\n\t\t\t\t\t...getIssueProperties(val)\n\t\t\t\t});\n\t\t\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) return result.then((data) => {\n\t\t\t\t\tif (!data) {\n\t\t\t\t\t\tsetError();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else return true;\n\t\t\t\t});\n\t\t\t\tif (!result) {\n\t\t\t\t\tsetError();\n\t\t\t\t\treturn false;\n\t\t\t\t} else return true;\n\t\t\t});\n\t\t}\n\t\trefinement(check, refinementData) {\n\t\t\treturn this._refinement((val, ctx) => {\n\t\t\t\tif (!check(val)) {\n\t\t\t\t\tctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n\t\t\t\t\treturn false;\n\t\t\t\t} else return true;\n\t\t\t});\n\t\t}\n\t\t_refinement(refinement) {\n\t\t\treturn new ZodEffects({\n\t\t\t\tschema: this,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t\teffect: {\n\t\t\t\t\ttype: \"refinement\",\n\t\t\t\t\trefinement\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsuperRefine(refinement) {\n\t\t\treturn this._refinement(refinement);\n\t\t}\n\t\tconstructor(def) {\n\t\t\t/** Alias of safeParseAsync */\n\t\t\tthis.spa = this.safeParseAsync;\n\t\t\tthis._def = def;\n\t\t\tthis.parse = this.parse.bind(this);\n\t\t\tthis.safeParse = this.safeParse.bind(this);\n\t\t\tthis.parseAsync = this.parseAsync.bind(this);\n\t\t\tthis.safeParseAsync = this.safeParseAsync.bind(this);\n\t\t\tthis.spa = this.spa.bind(this);\n\t\t\tthis.refine = this.refine.bind(this);\n\t\t\tthis.refinement = this.refinement.bind(this);\n\t\t\tthis.superRefine = this.superRefine.bind(this);\n\t\t\tthis.optional = this.optional.bind(this);\n\t\t\tthis.nullable = this.nullable.bind(this);\n\t\t\tthis.nullish = this.nullish.bind(this);\n\t\t\tthis.array = this.array.bind(this);\n\t\t\tthis.promise = this.promise.bind(this);\n\t\t\tthis.or = this.or.bind(this);\n\t\t\tthis.and = this.and.bind(this);\n\t\t\tthis.transform = this.transform.bind(this);\n\t\t\tthis.brand = this.brand.bind(this);\n\t\t\tthis.default = this.default.bind(this);\n\t\t\tthis.catch = this.catch.bind(this);\n\t\t\tthis.describe = this.describe.bind(this);\n\t\t\tthis.pipe = this.pipe.bind(this);\n\t\t\tthis.readonly = this.readonly.bind(this);\n\t\t\tthis.isNullable = this.isNullable.bind(this);\n\t\t\tthis.isOptional = this.isOptional.bind(this);\n\t\t\tthis[\"~standard\"] = {\n\t\t\t\tversion: 1,\n\t\t\t\tvendor: \"zod\",\n\t\t\t\tvalidate: (data) => this[\"~validate\"](data)\n\t\t\t};\n\t\t}\n\t\toptional() {\n\t\t\treturn ZodOptional.create(this, this._def);\n\t\t}\n\t\tnullable() {\n\t\t\treturn ZodNullable.create(this, this._def);\n\t\t}\n\t\tnullish() {\n\t\t\treturn this.nullable().optional();\n\t\t}\n\t\tarray() {\n\t\t\treturn ZodArray.create(this);\n\t\t}\n\t\tpromise() {\n\t\t\treturn ZodPromise.create(this, this._def);\n\t\t}\n\t\tor(option) {\n\t\t\treturn ZodUnion.create([this, option], this._def);\n\t\t}\n\t\tand(incoming) {\n\t\t\treturn ZodIntersection.create(this, incoming, this._def);\n\t\t}\n\t\ttransform(transform) {\n\t\t\treturn new ZodEffects({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tschema: this,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t\teffect: {\n\t\t\t\t\ttype: \"transform\",\n\t\t\t\t\ttransform\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tdefault(def) {\n\t\t\tconst defaultValueFunc = typeof def === \"function\" ? def : () => def;\n\t\t\treturn new ZodDefault({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tinnerType: this,\n\t\t\t\tdefaultValue: defaultValueFunc,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDefault\n\t\t\t});\n\t\t}\n\t\tbrand() {\n\t\t\treturn new ZodBranded({\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBranded,\n\t\t\t\ttype: this,\n\t\t\t\t...processCreateParams(this._def)\n\t\t\t});\n\t\t}\n\t\tcatch(def) {\n\t\t\tconst catchValueFunc = typeof def === \"function\" ? def : () => def;\n\t\t\treturn new ZodCatch({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tinnerType: this,\n\t\t\t\tcatchValue: catchValueFunc,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodCatch\n\t\t\t});\n\t\t}\n\t\tdescribe(description) {\n\t\t\tconst This = this.constructor;\n\t\t\treturn new This({\n\t\t\t\t...this._def,\n\t\t\t\tdescription\n\t\t\t});\n\t\t}\n\t\tpipe(target) {\n\t\t\treturn ZodPipeline.create(this, target);\n\t\t}\n\t\treadonly() {\n\t\t\treturn ZodReadonly.create(this);\n\t\t}\n\t\tisOptional() {\n\t\t\treturn this.safeParse(void 0).success;\n\t\t}\n\t\tisNullable() {\n\t\t\treturn this.safeParse(null).success;\n\t\t}\n\t};\n\tconst cuidRegex = /^c[^\\s-]{8,}$/i;\n\tconst cuid2Regex = /^[0-9a-z]+$/;\n\tconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n\tconst 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;\n\tconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\n\tconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n\tconst 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\tconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n\tconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\n\tlet emojiRegex;\n\tconst 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])$/;\n\tconst 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\tconst 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]))$/;\n\tconst 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\tconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n\tconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n\tconst 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])))`;\n\tconst dateRegex = new RegExp(`^${dateRegexSource}$`);\n\tfunction timeRegexSource(args) {\n\t\tlet secondsRegexSource = `[0-5]\\\\d`;\n\t\tif (args.precision) secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n\t\telse if (args.precision == null) secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n\t\tconst secondsQuantifier = args.precision ? \"+\" : \"?\";\n\t\treturn `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n\t}\n\tfunction timeRegex(args) {\n\t\treturn new RegExp(`^${timeRegexSource(args)}$`);\n\t}\n\tfunction datetimeRegex(args) {\n\t\tlet regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n\t\tconst opts = [];\n\t\topts.push(args.local ? `Z?` : `Z`);\n\t\tif (args.offset) opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n\t\tregex = `${regex}(${opts.join(\"|\")})`;\n\t\treturn new RegExp(`^${regex}$`);\n\t}\n\tfunction isValidIP(ip, version) {\n\t\tif ((version === \"v4\" || !version) && ipv4Regex.test(ip)) return true;\n\t\tif ((version === \"v6\" || !version) && ipv6Regex.test(ip)) return true;\n\t\treturn false;\n\t}\n\tfunction isValidJWT(jwt, alg) {\n\t\tif (!jwtRegex.test(jwt)) return false;\n\t\ttry {\n\t\t\tconst [header] = jwt.split(\".\");\n\t\t\tif (!header) return false;\n\t\t\tconst base64 = header.replace(/-/g, \"+\").replace(/_/g, \"/\").padEnd(header.length + (4 - header.length % 4) % 4, \"=\");\n\t\t\tconst decoded = JSON.parse(atob(base64));\n\t\t\tif (typeof decoded !== \"object\" || decoded === null) return false;\n\t\t\tif (\"typ\" in decoded && decoded?.typ !== \"JWT\") return false;\n\t\t\tif (!decoded.alg) return false;\n\t\t\tif (alg && decoded.alg !== alg) return false;\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfunction isValidCidr(ip, version) {\n\t\tif ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) return true;\n\t\tif ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) return true;\n\t\treturn false;\n\t}\n\tvar ZodString = class ZodString extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = String(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.string) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.string,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst status = new ParseStatus();\n\t\t\tlet ctx = void 0;\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (input.data.length < check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (input.data.length > check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"length\") {\n\t\t\t\tconst tooBig = input.data.length > check.value;\n\t\t\t\tconst tooSmall = input.data.length < check.value;\n\t\t\t\tif (tooBig || tooSmall) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\tif (tooBig) addIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\telse if (tooSmall) addIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"email\") {\n\t\t\t\tif (!emailRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"email\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"emoji\") {\n\t\t\t\tif (!emojiRegex) emojiRegex = new RegExp(_emojiRegex, \"u\");\n\t\t\t\tif (!emojiRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"emoji\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"uuid\") {\n\t\t\t\tif (!uuidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"uuid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"nanoid\") {\n\t\t\t\tif (!nanoidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"nanoid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cuid\") {\n\t\t\t\tif (!cuidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cuid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cuid2\") {\n\t\t\t\tif (!cuid2Regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cuid2\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"ulid\") {\n\t\t\t\tif (!ulidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"ulid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"url\") try {\n\t\t\t\tnew URL(input.data);\n\t\t\t} catch {\n\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tvalidation: \"url\",\n\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\tmessage: check.message\n\t\t\t\t});\n\t\t\t\tstatus.dirty();\n\t\t\t}\n\t\t\telse if (check.kind === \"regex\") {\n\t\t\t\tcheck.regex.lastIndex = 0;\n\t\t\t\tif (!check.regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"regex\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"trim\") input.data = input.data.trim();\n\t\t\telse if (check.kind === \"includes\") {\n\t\t\t\tif (!input.data.includes(check.value, check.position)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: {\n\t\t\t\t\t\t\tincludes: check.value,\n\t\t\t\t\t\t\tposition: check.position\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"toLowerCase\") input.data = input.data.toLowerCase();\n\t\t\telse if (check.kind === \"toUpperCase\") input.data = input.data.toUpperCase();\n\t\t\telse if (check.kind === \"startsWith\") {\n\t\t\t\tif (!input.data.startsWith(check.value)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: { startsWith: check.value },\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"endsWith\") {\n\t\t\t\tif (!input.data.endsWith(check.value)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: { endsWith: check.value },\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"datetime\") {\n\t\t\t\tif (!datetimeRegex(check).test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"datetime\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"date\") {\n\t\t\t\tif (!dateRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"date\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"time\") {\n\t\t\t\tif (!timeRegex(check).test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"time\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"duration\") {\n\t\t\t\tif (!durationRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"duration\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"ip\") {\n\t\t\t\tif (!isValidIP(input.data, check.version)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"ip\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"jwt\") {\n\t\t\t\tif (!isValidJWT(input.data, check.alg)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"jwt\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cidr\") {\n\t\t\t\tif (!isValidCidr(input.data, check.version)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cidr\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"base64\") {\n\t\t\t\tif (!base64Regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"base64\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"base64url\") {\n\t\t\t\tif (!base64urlRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"base64url\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\t_regex(regex, validation, message) {\n\t\t\treturn this.refinement((data) => regex.test(data), {\n\t\t\t\tvalidation,\n\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\temail(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"email\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\turl(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"url\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\temoji(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"emoji\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tuuid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"uuid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tnanoid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"nanoid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tcuid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cuid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tcuid2(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cuid2\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tulid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"ulid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tbase64(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"base64\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tbase64url(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"base64url\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tjwt(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"jwt\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tip(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"ip\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tcidr(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cidr\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tdatetime(options) {\n\t\t\tif (typeof options === \"string\") return this._addCheck({\n\t\t\t\tkind: \"datetime\",\n\t\t\t\tprecision: null,\n\t\t\t\toffset: false,\n\t\t\t\tlocal: false,\n\t\t\t\tmessage: options\n\t\t\t});\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"datetime\",\n\t\t\t\tprecision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n\t\t\t\toffset: options?.offset ?? false,\n\t\t\t\tlocal: options?.local ?? false,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tdate(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"date\",\n\t\t\t\tmessage\n\t\t\t});\n\t\t}\n\t\ttime(options) {\n\t\t\tif (typeof options === \"string\") return this._addCheck({\n\t\t\t\tkind: \"time\",\n\t\t\t\tprecision: null,\n\t\t\t\tmessage: options\n\t\t\t});\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"time\",\n\t\t\t\tprecision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tduration(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"duration\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tregex(regex, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"regex\",\n\t\t\t\tregex,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tincludes(value, options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"includes\",\n\t\t\t\tvalue,\n\t\t\t\tposition: options?.position,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tstartsWith(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"startsWith\",\n\t\t\t\tvalue,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tendsWith(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"endsWith\",\n\t\t\t\tvalue,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tmin(minLength, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: minLength,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tmax(maxLength, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: maxLength,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tlength(len, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"length\",\n\t\t\t\tvalue: len,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Equivalent to `.min(1)`\n\t\t*/\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, errorUtil.errToObj(message));\n\t\t}\n\t\ttrim() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"trim\" }]\n\t\t\t});\n\t\t}\n\t\ttoLowerCase() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"toLowerCase\" }]\n\t\t\t});\n\t\t}\n\t\ttoUpperCase() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"toUpperCase\" }]\n\t\t\t});\n\t\t}\n\t\tget isDatetime() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n\t\t}\n\t\tget isDate() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"date\");\n\t\t}\n\t\tget isTime() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"time\");\n\t\t}\n\t\tget isDuration() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"duration\");\n\t\t}\n\t\tget isEmail() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"email\");\n\t\t}\n\t\tget isURL() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"url\");\n\t\t}\n\t\tget isEmoji() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n\t\t}\n\t\tget isUUID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n\t\t}\n\t\tget isNANOID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n\t\t}\n\t\tget isCUID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n\t\t}\n\t\tget isCUID2() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n\t\t}\n\t\tget isULID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n\t\t}\n\t\tget isIP() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"ip\");\n\t\t}\n\t\tget isCIDR() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n\t\t}\n\t\tget isBase64() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"base64\");\n\t\t}\n\t\tget isBase64url() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n\t\t}\n\t\tget minLength() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxLength() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t};\n\tZodString.create = (params) => {\n\t\treturn new ZodString({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodString,\n\t\t\tcoerce: params?.coerce ?? false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction floatSafeRemainder(val, step) {\n\t\tconst valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n\t\tconst stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n\t\tconst decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n\t\treturn Number.parseInt(val.toFixed(decCount).replace(\".\", \"\")) % Number.parseInt(step.toFixed(decCount).replace(\".\", \"\")) / 10 ** decCount;\n\t}\n\tvar ZodNumber = class ZodNumber extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.min = this.gte;\n\t\t\tthis.max = this.lte;\n\t\t\tthis.step = this.multipleOf;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = Number(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.number) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.number,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tlet ctx = void 0;\n\t\t\tconst status = new ParseStatus();\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"int\") {\n\t\t\t\tif (!util.isInteger(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\t\texpected: \"integer\",\n\t\t\t\t\t\treceived: \"float\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"min\") {\n\t\t\t\tif (check.inclusive ? input.data < check.value : input.data <= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (check.inclusive ? input.data > check.value : input.data >= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"multipleOf\") {\n\t\t\t\tif (floatSafeRemainder(input.data, check.value) !== 0) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_multiple_of,\n\t\t\t\t\t\tmultipleOf: check.value,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"finite\") {\n\t\t\t\tif (!Number.isFinite(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_finite,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\tgte(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tgt(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tlte(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tlt(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tsetLimit(kind, value, inclusive, message) {\n\t\t\treturn new ZodNumber({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, {\n\t\t\t\t\tkind,\n\t\t\t\t\tvalue,\n\t\t\t\t\tinclusive,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodNumber({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tint(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"int\",\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmultipleOf(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"multipleOf\",\n\t\t\t\tvalue,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tfinite(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"finite\",\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tsafe(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tinclusive: true,\n\t\t\t\tvalue: Number.MIN_SAFE_INTEGER,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t})._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tinclusive: true,\n\t\t\t\tvalue: Number.MAX_SAFE_INTEGER,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minValue() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxValue() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\tget isInt() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"int\" || ch.kind === \"multipleOf\" && util.isInteger(ch.value));\n\t\t}\n\t\tget isFinite() {\n\t\t\tlet max = null;\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") return true;\n\t\t\telse if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t} else if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn Number.isFinite(min) && Number.isFinite(max);\n\t\t}\n\t};\n\tZodNumber.create = (params) => {\n\t\treturn new ZodNumber({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNumber,\n\t\t\tcoerce: params?.coerce || false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBigInt = class ZodBigInt extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.min = this.gte;\n\t\t\tthis.max = this.lte;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) try {\n\t\t\t\tinput.data = BigInt(input.data);\n\t\t\t} catch {\n\t\t\t\treturn this._getInvalidInput(input);\n\t\t\t}\n\t\t\tif (this._getType(input) !== ZodParsedType.bigint) return this._getInvalidInput(input);\n\t\t\tlet ctx = void 0;\n\t\t\tconst status = new ParseStatus();\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (check.inclusive ? input.data < check.value : input.data <= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\ttype: \"bigint\",\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (check.inclusive ? input.data > check.value : input.data >= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\ttype: \"bigint\",\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"multipleOf\") {\n\t\t\t\tif (input.data % check.value !== BigInt(0)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_multiple_of,\n\t\t\t\t\t\tmultipleOf: check.value,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\t_getInvalidInput(input) {\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\taddIssueToContext(ctx, {\n\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\texpected: ZodParsedType.bigint,\n\t\t\t\treceived: ctx.parsedType\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t\tgte(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tgt(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tlte(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tlt(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tsetLimit(kind, value, inclusive, message) {\n\t\t\treturn new ZodBigInt({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, {\n\t\t\t\t\tkind,\n\t\t\t\t\tvalue,\n\t\t\t\t\tinclusive,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodBigInt({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmultipleOf(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"multipleOf\",\n\t\t\t\tvalue,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minValue() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxValue() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t};\n\tZodBigInt.create = (params) => {\n\t\treturn new ZodBigInt({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBigInt,\n\t\t\tcoerce: params?.coerce ?? false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBoolean = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = Boolean(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.boolean) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.boolean,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodBoolean.create = (params) => {\n\t\treturn new ZodBoolean({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBoolean,\n\t\t\tcoerce: params?.coerce || false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodDate = class ZodDate extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = new Date(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.date) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.date,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (Number.isNaN(input.data.getTime())) {\n\t\t\t\taddIssueToContext(this._getOrReturnCtx(input), { code: ZodIssueCode.invalid_date });\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst status = new ParseStatus();\n\t\t\tlet ctx = void 0;\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (input.data.getTime() < check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tmessage: check.message,\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"date\"\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (input.data.getTime() > check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmessage: check.message,\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"date\"\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: new Date(input.data.getTime())\n\t\t\t};\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodDate({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tmin(minDate, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: minDate.getTime(),\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmax(maxDate, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: maxDate.getTime(),\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minDate() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min != null ? new Date(min) : null;\n\t\t}\n\t\tget maxDate() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max != null ? new Date(max) : null;\n\t\t}\n\t};\n\tZodDate.create = (params) => {\n\t\treturn new ZodDate({\n\t\t\tchecks: [],\n\t\t\tcoerce: params?.coerce || false,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDate,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodSymbol = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.symbol) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.symbol,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodSymbol.create = (params) => {\n\t\treturn new ZodSymbol({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodSymbol,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUndefined = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.undefined) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.undefined,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodUndefined.create = (params) => {\n\t\treturn new ZodUndefined({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUndefined,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNull = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.null) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.null,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodNull.create = (params) => {\n\t\treturn new ZodNull({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNull,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodAny = class extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._any = true;\n\t\t}\n\t\t_parse(input) {\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodAny.create = (params) => {\n\t\treturn new ZodAny({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodAny,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUnknown = class extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._unknown = true;\n\t\t}\n\t\t_parse(input) {\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodUnknown.create = (params) => {\n\t\treturn new ZodUnknown({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUnknown,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNever = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\taddIssueToContext(ctx, {\n\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\texpected: ZodParsedType.never,\n\t\t\t\treceived: ctx.parsedType\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t};\n\tZodNever.create = (params) => {\n\t\treturn new ZodNever({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNever,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodVoid = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.undefined) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.void,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodVoid.create = (params) => {\n\t\treturn new ZodVoid({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodVoid,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodArray = class ZodArray extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx, status } = this._processInputParams(input);\n\t\t\tconst def = this._def;\n\t\t\tif (ctx.parsedType !== ZodParsedType.array) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.array,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (def.exactLength !== null) {\n\t\t\t\tconst tooBig = ctx.data.length > def.exactLength.value;\n\t\t\t\tconst tooSmall = ctx.data.length < def.exactLength.value;\n\t\t\t\tif (tooBig || tooSmall) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: tooSmall ? def.exactLength.value : void 0,\n\t\t\t\t\t\tmaximum: tooBig ? def.exactLength.value : void 0,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: def.exactLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.minLength !== null) {\n\t\t\t\tif (ctx.data.length < def.minLength.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: def.minLength.value,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.minLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.maxLength !== null) {\n\t\t\t\tif (ctx.data.length > def.maxLength.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: def.maxLength.value,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.maxLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.all([...ctx.data].map((item, i) => {\n\t\t\t\treturn def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n\t\t\t})).then((result) => {\n\t\t\t\treturn ParseStatus.mergeArray(status, result);\n\t\t\t});\n\t\t\tconst result = [...ctx.data].map((item, i) => {\n\t\t\t\treturn def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n\t\t\t});\n\t\t\treturn ParseStatus.mergeArray(status, result);\n\t\t}\n\t\tget element() {\n\t\t\treturn this._def.type;\n\t\t}\n\t\tmin(minLength, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\tminLength: {\n\t\t\t\t\tvalue: minLength,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tmax(maxLength, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\tmaxLength: {\n\t\t\t\t\tvalue: maxLength,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tlength(len, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\texactLength: {\n\t\t\t\t\tvalue: len,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, message);\n\t\t}\n\t};\n\tZodArray.create = (schema, params) => {\n\t\treturn new ZodArray({\n\t\t\ttype: schema,\n\t\t\tminLength: null,\n\t\t\tmaxLength: null,\n\t\t\texactLength: null,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodArray,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction deepPartialify(schema) {\n\t\tif (schema instanceof ZodObject) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key in schema.shape) {\n\t\t\t\tconst fieldSchema = schema.shape[key];\n\t\t\t\tnewShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...schema._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t} else if (schema instanceof ZodArray) return new ZodArray({\n\t\t\t...schema._def,\n\t\t\ttype: deepPartialify(schema.element)\n\t\t});\n\t\telse if (schema instanceof ZodOptional) return ZodOptional.create(deepPartialify(schema.unwrap()));\n\t\telse if (schema instanceof ZodNullable) return ZodNullable.create(deepPartialify(schema.unwrap()));\n\t\telse if (schema instanceof ZodTuple) return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n\t\telse return schema;\n\t}\n\tvar ZodObject = class ZodObject extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._cached = null;\n\t\t\t/**\n\t\t\t* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n\t\t\t* If you want to pass through unknown properties, use `.passthrough()` instead.\n\t\t\t*/\n\t\t\tthis.nonstrict = this.passthrough;\n\t\t\t/**\n\t\t\t* @deprecated Use `.extend` instead\n\t\t\t* */\n\t\t\tthis.augment = this.extend;\n\t\t}\n\t\t_getCached() {\n\t\t\tif (this._cached !== null) return this._cached;\n\t\t\tconst shape = this._def.shape();\n\t\t\tconst keys = util.objectKeys(shape);\n\t\t\tthis._cached = {\n\t\t\t\tshape,\n\t\t\t\tkeys\n\t\t\t};\n\t\t\treturn this._cached;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.object) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst { shape, keys: shapeKeys } = this._getCached();\n\t\t\tconst extraKeys = [];\n\t\t\tif (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n\t\t\t\tfor (const key in ctx.data) if (!shapeKeys.includes(key)) extraKeys.push(key);\n\t\t\t}\n\t\t\tconst pairs = [];\n\t\t\tfor (const key of shapeKeys) {\n\t\t\t\tconst keyValidator = shape[key];\n\t\t\t\tconst value = ctx.data[key];\n\t\t\t\tpairs.push({\n\t\t\t\t\tkey: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: key\n\t\t\t\t\t},\n\t\t\t\t\tvalue: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n\t\t\t\t\talwaysSet: key in ctx.data\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._def.catchall instanceof ZodNever) {\n\t\t\t\tconst unknownKeys = this._def.unknownKeys;\n\t\t\t\tif (unknownKeys === \"passthrough\") for (const key of extraKeys) pairs.push({\n\t\t\t\t\tkey: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: key\n\t\t\t\t\t},\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: ctx.data[key]\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\telse if (unknownKeys === \"strict\") {\n\t\t\t\t\tif (extraKeys.length > 0) {\n\t\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\t\tcode: ZodIssueCode.unrecognized_keys,\n\t\t\t\t\t\t\tkeys: extraKeys\n\t\t\t\t\t\t});\n\t\t\t\t\t\tstatus.dirty();\n\t\t\t\t\t}\n\t\t\t\t} else if (unknownKeys === \"strip\") {} else throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n\t\t\t} else {\n\t\t\t\tconst catchall = this._def.catchall;\n\t\t\t\tfor (const key of extraKeys) {\n\t\t\t\t\tconst value = ctx.data[key];\n\t\t\t\t\tpairs.push({\n\t\t\t\t\t\tkey: {\n\t\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\t\tvalue: key\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalue: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n\t\t\t\t\t\talwaysSet: key in ctx.data\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.resolve().then(async () => {\n\t\t\t\tconst syncPairs = [];\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tconst key = await pair.key;\n\t\t\t\t\tconst value = await pair.value;\n\t\t\t\t\tsyncPairs.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\talwaysSet: pair.alwaysSet\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn syncPairs;\n\t\t\t}).then((syncPairs) => {\n\t\t\t\treturn ParseStatus.mergeObjectSync(status, syncPairs);\n\t\t\t});\n\t\t\telse return ParseStatus.mergeObjectSync(status, pairs);\n\t\t}\n\t\tget shape() {\n\t\t\treturn this._def.shape();\n\t\t}\n\t\tstrict(message) {\n\t\t\terrorUtil.errToObj;\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"strict\",\n\t\t\t\t...message !== void 0 ? { errorMap: (issue, ctx) => {\n\t\t\t\t\tconst defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n\t\t\t\t\tif (issue.code === \"unrecognized_keys\") return { message: errorUtil.errToObj(message).message ?? defaultError };\n\t\t\t\t\treturn { message: defaultError };\n\t\t\t\t} } : {}\n\t\t\t});\n\t\t}\n\t\tstrip() {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"strip\"\n\t\t\t});\n\t\t}\n\t\tpassthrough() {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"passthrough\"\n\t\t\t});\n\t\t}\n\t\textend(augmentation) {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => ({\n\t\t\t\t\t...this._def.shape(),\n\t\t\t\t\t...augmentation\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Prior to zod@1.0.12 there was a bug in the\n\t\t* inferred type of merged objects. Please\n\t\t* upgrade if you are experiencing issues.\n\t\t*/\n\t\tmerge(merging) {\n\t\t\treturn new ZodObject({\n\t\t\t\tunknownKeys: merging._def.unknownKeys,\n\t\t\t\tcatchall: merging._def.catchall,\n\t\t\t\tshape: () => ({\n\t\t\t\t\t...this._def.shape(),\n\t\t\t\t\t...merging._def.shape()\n\t\t\t\t}),\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject\n\t\t\t});\n\t\t}\n\t\tsetKey(key, schema) {\n\t\t\treturn this.augment({ [key]: schema });\n\t\t}\n\t\tcatchall(index) {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tcatchall: index\n\t\t\t});\n\t\t}\n\t\tpick(mask) {\n\t\t\tconst shape = {};\n\t\t\tfor (const key of util.objectKeys(mask)) if (mask[key] && this.shape[key]) shape[key] = this.shape[key];\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => shape\n\t\t\t});\n\t\t}\n\t\tomit(mask) {\n\t\t\tconst shape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) if (!mask[key]) shape[key] = this.shape[key];\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => shape\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* @deprecated\n\t\t*/\n\t\tdeepPartial() {\n\t\t\treturn deepPartialify(this);\n\t\t}\n\t\tpartial(mask) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) {\n\t\t\t\tconst fieldSchema = this.shape[key];\n\t\t\t\tif (mask && !mask[key]) newShape[key] = fieldSchema;\n\t\t\t\telse newShape[key] = fieldSchema.optional();\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t}\n\t\trequired(mask) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) if (mask && !mask[key]) newShape[key] = this.shape[key];\n\t\t\telse {\n\t\t\t\tlet newField = this.shape[key];\n\t\t\t\twhile (newField instanceof ZodOptional) newField = newField._def.innerType;\n\t\t\t\tnewShape[key] = newField;\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t}\n\t\tkeyof() {\n\t\t\treturn createZodEnum(util.objectKeys(this.shape));\n\t\t}\n\t};\n\tZodObject.create = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape: () => shape,\n\t\t\tunknownKeys: \"strip\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.strictCreate = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape: () => shape,\n\t\t\tunknownKeys: \"strict\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.lazycreate = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape,\n\t\t\tunknownKeys: \"strip\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUnion = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst options = this._def.options;\n\t\t\tfunction handleResults(results) {\n\t\t\t\tfor (const result of results) if (result.result.status === \"valid\") return result.result;\n\t\t\t\tfor (const result of results) if (result.result.status === \"dirty\") {\n\t\t\t\t\tctx.common.issues.push(...result.ctx.common.issues);\n\t\t\t\t\treturn result.result;\n\t\t\t\t}\n\t\t\t\tconst unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union,\n\t\t\t\t\tunionErrors\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.all(options.map(async (option) => {\n\t\t\t\tconst childCtx = {\n\t\t\t\t\t...ctx,\n\t\t\t\t\tcommon: {\n\t\t\t\t\t\t...ctx.common,\n\t\t\t\t\t\tissues: []\n\t\t\t\t\t},\n\t\t\t\t\tparent: null\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tresult: await option._parseAsync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: childCtx\n\t\t\t\t\t}),\n\t\t\t\t\tctx: childCtx\n\t\t\t\t};\n\t\t\t})).then(handleResults);\n\t\t\telse {\n\t\t\t\tlet dirty = void 0;\n\t\t\t\tconst issues = [];\n\t\t\t\tfor (const option of options) {\n\t\t\t\t\tconst childCtx = {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t...ctx.common,\n\t\t\t\t\t\t\tissues: []\n\t\t\t\t\t\t},\n\t\t\t\t\t\tparent: null\n\t\t\t\t\t};\n\t\t\t\t\tconst result = option._parseSync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: childCtx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"valid\") return result;\n\t\t\t\t\telse if (result.status === \"dirty\" && !dirty) dirty = {\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tctx: childCtx\n\t\t\t\t\t};\n\t\t\t\t\tif (childCtx.common.issues.length) issues.push(childCtx.common.issues);\n\t\t\t\t}\n\t\t\t\tif (dirty) {\n\t\t\t\t\tctx.common.issues.push(...dirty.ctx.common.issues);\n\t\t\t\t\treturn dirty.result;\n\t\t\t\t}\n\t\t\t\tconst unionErrors = issues.map((issues) => new ZodError(issues));\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union,\n\t\t\t\t\tunionErrors\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.options;\n\t\t}\n\t};\n\tZodUnion.create = (types, params) => {\n\t\treturn new ZodUnion({\n\t\t\toptions: types,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUnion,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tconst getDiscriminator = (type) => {\n\t\tif (type instanceof ZodLazy) return getDiscriminator(type.schema);\n\t\telse if (type instanceof ZodEffects) return getDiscriminator(type.innerType());\n\t\telse if (type instanceof ZodLiteral) return [type.value];\n\t\telse if (type instanceof ZodEnum) return type.options;\n\t\telse if (type instanceof ZodNativeEnum) return util.objectValues(type.enum);\n\t\telse if (type instanceof ZodDefault) return getDiscriminator(type._def.innerType);\n\t\telse if (type instanceof ZodUndefined) return [void 0];\n\t\telse if (type instanceof ZodNull) return [null];\n\t\telse if (type instanceof ZodOptional) return [void 0, ...getDiscriminator(type.unwrap())];\n\t\telse if (type instanceof ZodNullable) return [null, ...getDiscriminator(type.unwrap())];\n\t\telse if (type instanceof ZodBranded) return getDiscriminator(type.unwrap());\n\t\telse if (type instanceof ZodReadonly) return getDiscriminator(type.unwrap());\n\t\telse if (type instanceof ZodCatch) return getDiscriminator(type._def.innerType);\n\t\telse return [];\n\t};\n\tvar ZodDiscriminatedUnion = class ZodDiscriminatedUnion extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.object) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst discriminator = this.discriminator;\n\t\t\tconst discriminatorValue = ctx.data[discriminator];\n\t\t\tconst option = this.optionsMap.get(discriminatorValue);\n\t\t\tif (!option) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union_discriminator,\n\t\t\t\t\toptions: Array.from(this.optionsMap.keys()),\n\t\t\t\t\tpath: [discriminator]\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.common.async) return option._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t\telse return option._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tget discriminator() {\n\t\t\treturn this._def.discriminator;\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.options;\n\t\t}\n\t\tget optionsMap() {\n\t\t\treturn this._def.optionsMap;\n\t\t}\n\t\t/**\n\t\t* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n\t\t* However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n\t\t* have a different value for each object in the union.\n\t\t* @param discriminator the name of the discriminator property\n\t\t* @param types an array of object schemas\n\t\t* @param params\n\t\t*/\n\t\tstatic create(discriminator, options, params) {\n\t\t\tconst optionsMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const type of options) {\n\t\t\t\tconst discriminatorValues = getDiscriminator(type.shape[discriminator]);\n\t\t\t\tif (!discriminatorValues.length) throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n\t\t\t\tfor (const value of discriminatorValues) {\n\t\t\t\t\tif (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n\t\t\t\t\toptionsMap.set(value, type);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ZodDiscriminatedUnion({\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n\t\t\t\tdiscriminator,\n\t\t\t\toptions,\n\t\t\t\toptionsMap,\n\t\t\t\t...processCreateParams(params)\n\t\t\t});\n\t\t}\n\t};\n\tfunction mergeValues(a, b) {\n\t\tconst aType = getParsedType(a);\n\t\tconst bType = getParsedType(b);\n\t\tif (a === b) return {\n\t\t\tvalid: true,\n\t\t\tdata: a\n\t\t};\n\t\telse if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n\t\t\tconst bKeys = util.objectKeys(b);\n\t\t\tconst sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n\t\t\tconst newObj = {\n\t\t\t\t...a,\n\t\t\t\t...b\n\t\t\t};\n\t\t\tfor (const key of sharedKeys) {\n\t\t\t\tconst sharedValue = mergeValues(a[key], b[key]);\n\t\t\t\tif (!sharedValue.valid) return { valid: false };\n\t\t\t\tnewObj[key] = sharedValue.data;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: newObj\n\t\t\t};\n\t\t} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n\t\t\tif (a.length !== b.length) return { valid: false };\n\t\t\tconst newArray = [];\n\t\t\tfor (let index = 0; index < a.length; index++) {\n\t\t\t\tconst itemA = a[index];\n\t\t\t\tconst itemB = b[index];\n\t\t\t\tconst sharedValue = mergeValues(itemA, itemB);\n\t\t\t\tif (!sharedValue.valid) return { valid: false };\n\t\t\t\tnewArray.push(sharedValue.data);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: newArray\n\t\t\t};\n\t\t} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) return {\n\t\t\tvalid: true,\n\t\t\tdata: a\n\t\t};\n\t\telse return { valid: false };\n\t}\n\tvar ZodIntersection = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst handleParsed = (parsedLeft, parsedRight) => {\n\t\t\t\tif (isAborted(parsedLeft) || isAborted(parsedRight)) return INVALID;\n\t\t\t\tconst merged = mergeValues(parsedLeft.value, parsedRight.value);\n\t\t\t\tif (!merged.valid) {\n\t\t\t\t\taddIssueToContext(ctx, { code: ZodIssueCode.invalid_intersection_types });\n\t\t\t\t\treturn INVALID;\n\t\t\t\t}\n\t\t\t\tif (isDirty(parsedLeft) || isDirty(parsedRight)) status.dirty();\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: merged.data\n\t\t\t\t};\n\t\t\t};\n\t\t\tif (ctx.common.async) return Promise.all([this._def.left._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}), this._def.right._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t})]).then(([left, right]) => handleParsed(left, right));\n\t\t\telse return handleParsed(this._def.left._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}), this._def.right._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}));\n\t\t}\n\t};\n\tZodIntersection.create = (left, right, params) => {\n\t\treturn new ZodIntersection({\n\t\t\tleft,\n\t\t\tright,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodIntersection,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodTuple = class ZodTuple extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.array) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.array,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.data.length < this._def.items.length) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\tminimum: this._def.items.length,\n\t\t\t\t\tinclusive: true,\n\t\t\t\t\texact: false,\n\t\t\t\t\ttype: \"array\"\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._def.rest && ctx.data.length > this._def.items.length) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\tmaximum: this._def.items.length,\n\t\t\t\t\tinclusive: true,\n\t\t\t\t\texact: false,\n\t\t\t\t\ttype: \"array\"\n\t\t\t\t});\n\t\t\t\tstatus.dirty();\n\t\t\t}\n\t\t\tconst items = [...ctx.data].map((item, itemIndex) => {\n\t\t\t\tconst schema = this._def.items[itemIndex] || this._def.rest;\n\t\t\t\tif (!schema) return null;\n\t\t\t\treturn schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n\t\t\t}).filter((x) => !!x);\n\t\t\tif (ctx.common.async) return Promise.all(items).then((results) => {\n\t\t\t\treturn ParseStatus.mergeArray(status, results);\n\t\t\t});\n\t\t\telse return ParseStatus.mergeArray(status, items);\n\t\t}\n\t\tget items() {\n\t\t\treturn this._def.items;\n\t\t}\n\t\trest(rest) {\n\t\t\treturn new ZodTuple({\n\t\t\t\t...this._def,\n\t\t\t\trest\n\t\t\t});\n\t\t}\n\t};\n\tZodTuple.create = (schemas, params) => {\n\t\tif (!Array.isArray(schemas)) throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n\t\treturn new ZodTuple({\n\t\t\titems: schemas,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodTuple,\n\t\t\trest: null,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodRecord = class ZodRecord extends ZodType {\n\t\tget keySchema() {\n\t\t\treturn this._def.keyType;\n\t\t}\n\t\tget valueSchema() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.object) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst pairs = [];\n\t\t\tconst keyType = this._def.keyType;\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tfor (const key in ctx.data) pairs.push({\n\t\t\t\tkey: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n\t\t\t\tvalue: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n\t\t\t\talwaysSet: key in ctx.data\n\t\t\t});\n\t\t\tif (ctx.common.async) return ParseStatus.mergeObjectAsync(status, pairs);\n\t\t\telse return ParseStatus.mergeObjectSync(status, pairs);\n\t\t}\n\t\tget element() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\tstatic create(first, second, third) {\n\t\t\tif (second instanceof ZodType) return new ZodRecord({\n\t\t\t\tkeyType: first,\n\t\t\t\tvalueType: second,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodRecord,\n\t\t\t\t...processCreateParams(third)\n\t\t\t});\n\t\t\treturn new ZodRecord({\n\t\t\t\tkeyType: ZodString.create(),\n\t\t\t\tvalueType: first,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodRecord,\n\t\t\t\t...processCreateParams(second)\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodMap = class extends ZodType {\n\t\tget keySchema() {\n\t\t\treturn this._def.keyType;\n\t\t}\n\t\tget valueSchema() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.map) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.map,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst keyType = this._def.keyType;\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tconst pairs = [...ctx.data.entries()].map(([key, value], index) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n\t\t\t\t\tvalue: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"]))\n\t\t\t\t};\n\t\t\t});\n\t\t\tif (ctx.common.async) {\n\t\t\t\tconst finalMap = /* @__PURE__ */ new Map();\n\t\t\t\treturn Promise.resolve().then(async () => {\n\t\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\t\tconst key = await pair.key;\n\t\t\t\t\t\tconst value = await pair.value;\n\t\t\t\t\t\tif (key.status === \"aborted\" || value.status === \"aborted\") return INVALID;\n\t\t\t\t\t\tif (key.status === \"dirty\" || value.status === \"dirty\") status.dirty();\n\t\t\t\t\t\tfinalMap.set(key.value, value.value);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\tvalue: finalMap\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst finalMap = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tconst key = pair.key;\n\t\t\t\t\tconst value = pair.value;\n\t\t\t\t\tif (key.status === \"aborted\" || value.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (key.status === \"dirty\" || value.status === \"dirty\") status.dirty();\n\t\t\t\t\tfinalMap.set(key.value, value.value);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: finalMap\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\tZodMap.create = (keyType, valueType, params) => {\n\t\treturn new ZodMap({\n\t\t\tvalueType,\n\t\t\tkeyType,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodMap,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodSet = class ZodSet extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.set) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.set,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst def = this._def;\n\t\t\tif (def.minSize !== null) {\n\t\t\t\tif (ctx.data.size < def.minSize.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: def.minSize.value,\n\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.minSize.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.maxSize !== null) {\n\t\t\t\tif (ctx.data.size > def.maxSize.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: def.maxSize.value,\n\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.maxSize.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tfunction finalizeSet(elements) {\n\t\t\t\tconst parsedSet = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const element of elements) {\n\t\t\t\t\tif (element.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (element.status === \"dirty\") status.dirty();\n\t\t\t\t\tparsedSet.add(element.value);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: parsedSet\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n\t\t\tif (ctx.common.async) return Promise.all(elements).then((elements) => finalizeSet(elements));\n\t\t\telse return finalizeSet(elements);\n\t\t}\n\t\tmin(minSize, message) {\n\t\t\treturn new ZodSet({\n\t\t\t\t...this._def,\n\t\t\t\tminSize: {\n\t\t\t\t\tvalue: minSize,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tmax(maxSize, message) {\n\t\t\treturn new ZodSet({\n\t\t\t\t...this._def,\n\t\t\t\tmaxSize: {\n\t\t\t\t\tvalue: maxSize,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsize(size, message) {\n\t\t\treturn this.min(size, message).max(size, message);\n\t\t}\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, message);\n\t\t}\n\t};\n\tZodSet.create = (valueType, params) => {\n\t\treturn new ZodSet({\n\t\t\tvalueType,\n\t\t\tminSize: null,\n\t\t\tmaxSize: null,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodSet,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodFunction = class ZodFunction extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.validate = this.implement;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.function) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.function,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tfunction makeArgsIssue(args, error) {\n\t\t\t\treturn makeIssue({\n\t\t\t\t\tdata: args,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMaps: [\n\t\t\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\t\t\tctx.schemaErrorMap,\n\t\t\t\t\t\tgetErrorMap(),\n\t\t\t\t\t\terrorMap\n\t\t\t\t\t].filter((x) => !!x),\n\t\t\t\t\tissueData: {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_arguments,\n\t\t\t\t\t\targumentsError: error\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction makeReturnsIssue(returns, error) {\n\t\t\t\treturn makeIssue({\n\t\t\t\t\tdata: returns,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMaps: [\n\t\t\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\t\t\tctx.schemaErrorMap,\n\t\t\t\t\t\tgetErrorMap(),\n\t\t\t\t\t\terrorMap\n\t\t\t\t\t].filter((x) => !!x),\n\t\t\t\t\tissueData: {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_return_type,\n\t\t\t\t\t\treturnTypeError: error\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst params = { errorMap: ctx.common.contextualErrorMap };\n\t\t\tconst fn = ctx.data;\n\t\t\tif (this._def.returns instanceof ZodPromise) {\n\t\t\t\tconst me = this;\n\t\t\t\treturn OK(async function(...args) {\n\t\t\t\t\tconst error = new ZodError([]);\n\t\t\t\t\tconst parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n\t\t\t\t\t\terror.addIssue(makeArgsIssue(args, e));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t\tconst result = await Reflect.apply(fn, this, parsedArgs);\n\t\t\t\t\treturn await me._def.returns._def.type.parseAsync(result, params).catch((e) => {\n\t\t\t\t\t\terror.addIssue(makeReturnsIssue(result, e));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst me = this;\n\t\t\t\treturn OK(function(...args) {\n\t\t\t\t\tconst parsedArgs = me._def.args.safeParse(args, params);\n\t\t\t\t\tif (!parsedArgs.success) throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n\t\t\t\t\tconst result = Reflect.apply(fn, this, parsedArgs.data);\n\t\t\t\t\tconst parsedReturns = me._def.returns.safeParse(result, params);\n\t\t\t\t\tif (!parsedReturns.success) throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n\t\t\t\t\treturn parsedReturns.data;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tparameters() {\n\t\t\treturn this._def.args;\n\t\t}\n\t\treturnType() {\n\t\t\treturn this._def.returns;\n\t\t}\n\t\targs(...items) {\n\t\t\treturn new ZodFunction({\n\t\t\t\t...this._def,\n\t\t\t\targs: ZodTuple.create(items).rest(ZodUnknown.create())\n\t\t\t});\n\t\t}\n\t\treturns(returnType) {\n\t\t\treturn new ZodFunction({\n\t\t\t\t...this._def,\n\t\t\t\treturns: returnType\n\t\t\t});\n\t\t}\n\t\timplement(func) {\n\t\t\treturn this.parse(func);\n\t\t}\n\t\tstrictImplement(func) {\n\t\t\treturn this.parse(func);\n\t\t}\n\t\tstatic create(args, returns, params) {\n\t\t\treturn new ZodFunction({\n\t\t\t\targs: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),\n\t\t\t\treturns: returns || ZodUnknown.create(),\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodFunction,\n\t\t\t\t...processCreateParams(params)\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodLazy = class extends ZodType {\n\t\tget schema() {\n\t\t\treturn this._def.getter();\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\treturn this._def.getter()._parse({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t};\n\tZodLazy.create = (getter, params) => {\n\t\treturn new ZodLazy({\n\t\t\tgetter,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodLazy,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodLiteral = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (input.data !== this._def.value) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_literal,\n\t\t\t\t\texpected: this._def.value\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\tget value() {\n\t\t\treturn this._def.value;\n\t\t}\n\t};\n\tZodLiteral.create = (value, params) => {\n\t\treturn new ZodLiteral({\n\t\t\tvalue,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodLiteral,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction createZodEnum(values, params) {\n\t\treturn new ZodEnum({\n\t\t\tvalues,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEnum,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t}\n\tvar ZodEnum = class ZodEnum extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (typeof input.data !== \"string\") {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\tconst expectedValues = this._def.values;\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\texpected: util.joinValues(expectedValues),\n\t\t\t\t\treceived: ctx.parsedType,\n\t\t\t\t\tcode: ZodIssueCode.invalid_type\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._cache) this._cache = new Set(this._def.values);\n\t\t\tif (!this._cache.has(input.data)) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\tconst expectedValues = this._def.values;\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_enum_value,\n\t\t\t\t\toptions: expectedValues\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.values;\n\t\t}\n\t\tget enum() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\tget Values() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\tget Enum() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\textract(values, newDef = this._def) {\n\t\t\treturn ZodEnum.create(values, {\n\t\t\t\t...this._def,\n\t\t\t\t...newDef\n\t\t\t});\n\t\t}\n\t\texclude(values, newDef = this._def) {\n\t\t\treturn ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n\t\t\t\t...this._def,\n\t\t\t\t...newDef\n\t\t\t});\n\t\t}\n\t};\n\tZodEnum.create = createZodEnum;\n\tvar ZodNativeEnum = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst nativeEnumValues = util.getValidEnumValues(this._def.values);\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n\t\t\t\tconst expectedValues = util.objectValues(nativeEnumValues);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\texpected: util.joinValues(expectedValues),\n\t\t\t\t\treceived: ctx.parsedType,\n\t\t\t\t\tcode: ZodIssueCode.invalid_type\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._cache) this._cache = new Set(util.getValidEnumValues(this._def.values));\n\t\t\tif (!this._cache.has(input.data)) {\n\t\t\t\tconst expectedValues = util.objectValues(nativeEnumValues);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_enum_value,\n\t\t\t\t\toptions: expectedValues\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t\tget enum() {\n\t\t\treturn this._def.values;\n\t\t}\n\t};\n\tZodNativeEnum.create = (values, params) => {\n\t\treturn new ZodNativeEnum({\n\t\t\tvalues,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodPromise = class extends ZodType {\n\t\tunwrap() {\n\t\t\treturn this._def.type;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.promise,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK((ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data)).then((data) => {\n\t\t\t\treturn this._def.type.parseAsync(data, {\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMap: ctx.common.contextualErrorMap\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t};\n\tZodPromise.create = (schema, params) => {\n\t\treturn new ZodPromise({\n\t\t\ttype: schema,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodPromise,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodEffects = class extends ZodType {\n\t\tinnerType() {\n\t\t\treturn this._def.schema;\n\t\t}\n\t\tsourceType() {\n\t\t\treturn this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst effect = this._def.effect || null;\n\t\t\tconst checkCtx = {\n\t\t\t\taddIssue: (arg) => {\n\t\t\t\t\taddIssueToContext(ctx, arg);\n\t\t\t\t\tif (arg.fatal) status.abort();\n\t\t\t\t\telse status.dirty();\n\t\t\t\t},\n\t\t\t\tget path() {\n\t\t\t\t\treturn ctx.path;\n\t\t\t\t}\n\t\t\t};\n\t\t\tcheckCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n\t\t\tif (effect.type === \"preprocess\") {\n\t\t\t\tconst processed = effect.transform(ctx.data, checkCtx);\n\t\t\t\tif (ctx.common.async) return Promise.resolve(processed).then(async (processed) => {\n\t\t\t\t\tif (status.value === \"aborted\") return INVALID;\n\t\t\t\t\tconst result = await this._def.schema._parseAsync({\n\t\t\t\t\t\tdata: processed,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (result.status === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\tif (status.value === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\treturn result;\n\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tif (status.value === \"aborted\") return INVALID;\n\t\t\t\t\tconst result = this._def.schema._parseSync({\n\t\t\t\t\t\tdata: processed,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (result.status === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\tif (status.value === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (effect.type === \"refinement\") {\n\t\t\t\tconst executeRefinement = (acc) => {\n\t\t\t\t\tconst result = effect.refinement(acc, checkCtx);\n\t\t\t\t\tif (ctx.common.async) return Promise.resolve(result);\n\t\t\t\t\tif (result instanceof Promise) throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n\t\t\t\t\treturn acc;\n\t\t\t\t};\n\t\t\t\tif (ctx.common.async === false) {\n\t\t\t\t\tconst inner = this._def.schema._parseSync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (inner.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inner.status === \"dirty\") status.dirty();\n\t\t\t\t\texecuteRefinement(inner.value);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\tvalue: inner.value\n\t\t\t\t\t};\n\t\t\t\t} else return this._def.schema._parseAsync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t}).then((inner) => {\n\t\t\t\t\tif (inner.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inner.status === \"dirty\") status.dirty();\n\t\t\t\t\treturn executeRefinement(inner.value).then(() => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\t\tvalue: inner.value\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (effect.type === \"transform\") if (ctx.common.async === false) {\n\t\t\t\tconst base = this._def.schema._parseSync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\tif (!isValid(base)) return INVALID;\n\t\t\t\tconst result = effect.transform(base.value, checkCtx);\n\t\t\t\tif (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t} else return this._def.schema._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}).then((base) => {\n\t\t\t\tif (!isValid(base)) return INVALID;\n\t\t\t\treturn Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: result\n\t\t\t\t}));\n\t\t\t});\n\t\t\tutil.assertNever(effect);\n\t\t}\n\t};\n\tZodEffects.create = (schema, effect, params) => {\n\t\treturn new ZodEffects({\n\t\t\tschema,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\teffect,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n\t\treturn new ZodEffects({\n\t\t\tschema,\n\t\t\teffect: {\n\t\t\t\ttype: \"preprocess\",\n\t\t\t\ttransform: preprocess\n\t\t\t},\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodOptional = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) === ZodParsedType.undefined) return OK(void 0);\n\t\t\treturn this._def.innerType._parse(input);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodOptional.create = (type, params) => {\n\t\treturn new ZodOptional({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodOptional,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNullable = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) === ZodParsedType.null) return OK(null);\n\t\t\treturn this._def.innerType._parse(input);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodNullable.create = (type, params) => {\n\t\treturn new ZodNullable({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNullable,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodDefault = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tlet data = ctx.data;\n\t\t\tif (ctx.parsedType === ZodParsedType.undefined) data = this._def.defaultValue();\n\t\t\treturn this._def.innerType._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tremoveDefault() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodDefault.create = (type, params) => {\n\t\treturn new ZodDefault({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDefault,\n\t\t\tdefaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodCatch = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst newCtx = {\n\t\t\t\t...ctx,\n\t\t\t\tcommon: {\n\t\t\t\t\t...ctx.common,\n\t\t\t\t\tissues: []\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst result = this._def.innerType._parse({\n\t\t\t\tdata: newCtx.data,\n\t\t\t\tpath: newCtx.path,\n\t\t\t\tparent: { ...newCtx }\n\t\t\t});\n\t\t\tif (isAsync(result)) return result.then((result) => {\n\t\t\t\treturn {\n\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\tvalue: result.status === \"valid\" ? result.value : this._def.catchValue({\n\t\t\t\t\t\tget error() {\n\t\t\t\t\t\t\treturn new ZodError(newCtx.common.issues);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinput: newCtx.data\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t});\n\t\t\telse return {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: result.status === \"valid\" ? result.value : this._def.catchValue({\n\t\t\t\t\tget error() {\n\t\t\t\t\t\treturn new ZodError(newCtx.common.issues);\n\t\t\t\t\t},\n\t\t\t\t\tinput: newCtx.data\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\tremoveCatch() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodCatch.create = (type, params) => {\n\t\treturn new ZodCatch({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodCatch,\n\t\t\tcatchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNaN = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.nan) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.nan,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t};\n\tZodNaN.create = (params) => {\n\t\treturn new ZodNaN({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNaN,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBranded = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst data = ctx.data;\n\t\t\treturn this._def.type._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.type;\n\t\t}\n\t};\n\tvar ZodPipeline = class ZodPipeline extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.common.async) {\n\t\t\t\tconst handleAsync = async () => {\n\t\t\t\t\tconst inResult = await this._def.in._parseAsync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (inResult.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inResult.status === \"dirty\") {\n\t\t\t\t\t\tstatus.dirty();\n\t\t\t\t\t\treturn DIRTY(inResult.value);\n\t\t\t\t\t} else return this._def.out._parseAsync({\n\t\t\t\t\t\tdata: inResult.value,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\treturn handleAsync();\n\t\t\t} else {\n\t\t\t\tconst inResult = this._def.in._parseSync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\tif (inResult.status === \"aborted\") return INVALID;\n\t\t\t\tif (inResult.status === \"dirty\") {\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: \"dirty\",\n\t\t\t\t\t\tvalue: inResult.value\n\t\t\t\t\t};\n\t\t\t\t} else return this._def.out._parseSync({\n\t\t\t\t\tdata: inResult.value,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tstatic create(a, b) {\n\t\t\treturn new ZodPipeline({\n\t\t\t\tin: a,\n\t\t\t\tout: b,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodPipeline\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodReadonly = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst result = this._def.innerType._parse(input);\n\t\t\tconst freeze = (data) => {\n\t\t\t\tif (isValid(data)) data.value = Object.freeze(data.value);\n\t\t\t\treturn data;\n\t\t\t};\n\t\t\treturn isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodReadonly.create = (type, params) => {\n\t\treturn new ZodReadonly({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodReadonly,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.lazycreate;\n\tvar ZodFirstPartyTypeKind;\n\t(function(ZodFirstPartyTypeKind) {\n\t\tZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n\t\tZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n\t\tZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n\t\tZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n\t\tZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n\t\tZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n\t\tZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n\t\tZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n\t\tZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n\t\tZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n\t\tZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n\t\tZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n\t\tZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n\t\tZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n\t\tZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n\t\tZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n\t\tZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n\t\tZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n\t\tZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n\t\tZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n\t\tZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n\t\tZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n\t\tZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n\t\tZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n\t\tZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n\t\tZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n\t\tZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n\t\tZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n\t\tZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n\t\tZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n\t\tZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n\t\tZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n\t\tZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n\t\tZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n\t\tZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n\t\tZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n\t})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n\tconst stringType = ZodString.create;\n\tconst numberType = ZodNumber.create;\n\tZodNaN.create;\n\tZodBigInt.create;\n\tconst booleanType = ZodBoolean.create;\n\tZodDate.create;\n\tZodSymbol.create;\n\tZodUndefined.create;\n\tZodNull.create;\n\tZodAny.create;\n\tconst unknownType = ZodUnknown.create;\n\tZodNever.create;\n\tZodVoid.create;\n\tconst arrayType = ZodArray.create;\n\tconst objectType = ZodObject.create;\n\tZodObject.strictCreate;\n\tconst unionType = ZodUnion.create;\n\tZodDiscriminatedUnion.create;\n\tZodIntersection.create;\n\tZodTuple.create;\n\tconst recordType = ZodRecord.create;\n\tZodMap.create;\n\tZodSet.create;\n\tZodFunction.create;\n\tconst lazyType = ZodLazy.create;\n\tconst literalType = ZodLiteral.create;\n\tconst enumType = ZodEnum.create;\n\tZodNativeEnum.create;\n\tZodPromise.create;\n\tZodEffects.create;\n\tZodOptional.create;\n\tZodNullable.create;\n\tZodEffects.createWithPreprocess;\n\tZodPipeline.create;\n\tobjectType({\n\t\ttype: literalType(\"plain\"),\n\t\tcontent: stringType()\n\t});\n\tobjectType({\n\t\tfrom: numberType().min(0),\n\t\tto: numberType().min(1)\n\t});\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/util.js\n\tfunction assertNever(x) {\n\t\tthrow new Error(\"Unexpected object: \" + x);\n\t}\n\t/**\n\t* Return unique entries of the array by the provided id\n\t* For each id, the last entry is kept\n\t*/\n\tfunction uniqueBy(array, makeId) {\n\t\treturn [...new Map(array.map((e) => [makeId(e), e])).values()];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js\n\t/**\n\t* Type guard function that checks if the given value is a valid DataInfo.\n\t*\n\t* @param value - The value to check\n\t* @returns True if the value is a valid DataInfo, false otherwise\n\t*/\n\tfunction isDataInfo(value) {\n\t\tif (!value || typeof value !== \"object\") return false;\n\t\tconst data = value;\n\t\tif (!(\"type\" in data)) return false;\n\t\tswitch (data.type) {\n\t\t\tcase \"Json\": return typeof data.keyLength === \"number\" && data.data !== void 0 && typeof data.data === \"object\";\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && data.parts !== void 0 && typeof data.parts === \"object\";\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\tfunction mapDataInfo(dataInfo, mapFn) {\n\t\tif (dataInfo === void 0) return;\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": return dataInfo;\n\t\t\tcase \"JsonPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"BinaryPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, chunk] of Object.entries(dataInfo.parts)) newParts[key] = {\n\t\t\t\t\tindex: mapFn(chunk.index),\n\t\t\t\t\tvalues: mapFn(chunk.values)\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"ParquetPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* @param dataInfo - The source DataInfo object\n\t* @param cb - Callback, function that have access to every blob to visit them all\n\t* @returns Nothing\n\t*/\n\tfunction visitDataInfo(dataInfo, cb) {\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": break;\n\t\t\tcase \"JsonPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\t\tbreak;\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach((chunk) => {\n\t\t\t\t\tcb(chunk.index);\n\t\t\t\t\tcb(chunk.values);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"ParquetPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t/**\n\t* Type guard function that checks if the given value is a valid DataInfoEntries.\n\t*\n\t* @param value - The value to check\n\t* @returns True if the value is a valid DataInfoEntries, false otherwise\n\t*/\n\tfunction isDataInfoEntries(value) {\n\t\tif (!value || typeof value !== \"object\") return false;\n\t\tconst data = value;\n\t\tif (!(\"type\" in data)) return false;\n\t\tswitch (data.type) {\n\t\t\tcase \"Json\": return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\t/**\n\t* Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n\t*\n\t* @template Blob - Type parameter representing the storage reference type\n\t* @param value - The value to check\n\t* @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n\t*/\n\tfunction isPartitionedDataInfoEntries(value) {\n\t\tif (!isDataInfoEntries(value)) return false;\n\t\tswitch (value.type) {\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return true;\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\t/**\n\t* Converts DataInfo to DataInfoEntries\n\t*\n\t* @param dataInfo - The record-based DataInfo object\n\t* @returns The equivalent entry-based DataInfoEntries object\n\t*/\n\tfunction dataInfoToEntries(dataInfo) {\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfo.keyLength,\n\t\t\t\tdata: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: blob\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: chunk\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: blob\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tdefault: assertNever(dataInfo);\n\t\t}\n\t}\n\t/**\n\t* Converts DataInfoEntries to DataInfo\n\t*\n\t* @param dataInfoEntries - The entry-based DataInfoEntries object\n\t* @returns The equivalent record-based DataInfo object\n\t*/\n\tfunction entriesToDataInfo(dataInfoEntries) {\n\t\tswitch (dataInfoEntries.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfoEntries.keyLength,\n\t\t\t\tdata: Object.fromEntries(dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tdefault: assertNever(dataInfoEntries);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/errors.js\n\tvar ServiceError = class extends Error {\n\t\tname = \"ServiceError\";\n\t};\n\tvar ServiceInvalidIdError = class extends ServiceError {\n\t\tname = \"ServiceError.InvalidId\";\n\t};\n\tvar ServiceAlreadyRegisteredError = class extends ServiceError {\n\t\tname = \"ServiceError.AlreadyRegistered\";\n\t};\n\tfunction stringifyValue(value) {\n\t\tif (typeof value === \"string\") return `String value was thrown: ${value}`;\n\t\tif (value && typeof value === \"object\") try {\n\t\t\treturn `Plain object was thrown: ${JSON.stringify(value)}`;\n\t\t} catch (jsonError) {\n\t\t\treturn `Non-serializable object was thrown (JSON.stringify failed: ${jsonError instanceof Error ? jsonError.message : String(jsonError)}): ${String(value)}`;\n\t\t}\n\t\treturn String(`Non-Error value (${typeof value}) was thrown: ${value}`);\n\t}\n\tfunction ensureError(value) {\n\t\tif (value instanceof Error) return value;\n\t\treturn new Error(stringifyValue(value));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/json.js\n\tvar import_canonicalize = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t\tmodule.exports = function serialize(object) {\n\t\t\tif (typeof object === \"number\" && isNaN(object)) throw new Error(\"NaN is not allowed\");\n\t\t\tif (typeof object === \"number\" && !isFinite(object)) throw new Error(\"Infinity is not allowed\");\n\t\t\tif (object === null || typeof object !== \"object\") return JSON.stringify(object);\n\t\t\tif (object.toJSON instanceof Function) return serialize(object.toJSON());\n\t\t\tif (Array.isArray(object)) return `[${object.reduce((t, cv, ci) => {\n\t\t\t\treturn `${t}${ci === 0 ? \"\" : \",\"}${serialize(cv === void 0 || typeof cv === \"symbol\" ? null : cv)}`;\n\t\t\t}, \"\")}]`;\n\t\t\treturn `{${Object.keys(object).sort().reduce((t, cv) => {\n\t\t\t\tif (object[cv] === void 0 || typeof object[cv] === \"symbol\") return t;\n\t\t\t\treturn `${t}${t.length === 0 ? \"\" : \",\"}${serialize(cv)}:${serialize(object[cv])}`;\n\t\t\t}, \"\")}}`;\n\t\t};\n\t})))(), 1);\n\tfunction stringifyJson(value) {\n\t\treturn JSON.stringify(value);\n\t}\n\tfunction canonicalizeJson(value) {\n\t\treturn (0, import_canonicalize.default)(value);\n\t}\n\tfunction parseJson(value) {\n\t\treturn JSON.parse(value);\n\t}\n\tfunction parseJsonSafely(value, fallback) {\n\t\ttry {\n\t\t\treturn JSON.parse(value);\n\t\t} catch {\n\t\t\treturn fallback;\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js\n\tfunction readMetadata(metadata, key) {\n\t\treturn metadata?.[key];\n\t}\n\tfunction readMetadataJsonOrThrow(metadata, metadataJson, key, methodNameInError = \"readMetadataJsonOrThrow\") {\n\t\tconst json = readMetadata(metadata, key);\n\t\tif (json === void 0) return void 0;\n\t\tconst schema = metadataJson[key];\n\t\ttry {\n\t\t\tconst value = JSON.parse(json);\n\t\t\treturn schema.parse(value);\n\t\t} catch (error) {\n\t\t\tthrow new Error(`${methodNameInError} failed, key: ${String(key)}, value: ${json}, error: ${ensureError(error)}`);\n\t\t}\n\t}\n\tfunction readMetadataJson(metadata, metadataJson, key) {\n\t\ttry {\n\t\t\treturn readMetadataJsonOrThrow(metadata, metadataJson, key);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tconst Annotation = {\n\t\tAxisNature: \"pl7.app/axisNature\",\n\t\tAlphabet: \"pl7.app/alphabet\",\n\t\tDescription: \"pl7.app/description\",\n\t\tDataStatus: \"pl7.app/dataStatus\",\n\t\tDiscreteValues: \"pl7.app/discreteValues\",\n\t\tFormat: \"pl7.app/format\",\n\t\tGraph: {\n\t\t\tAxis: {\n\t\t\t\tHighCardinality: \"pl7.app/graph/axis/highCardinality\",\n\t\t\t\tLowerLimit: \"pl7.app/graph/axis/lowerLimit\",\n\t\t\t\tSymmetricRange: \"pl7.app/graph/axis/symmetricRange\",\n\t\t\t\tUpperLimit: \"pl7.app/graph/axis/upperLimit\"\n\t\t\t},\n\t\t\tIsDenseAxis: \"pl7.app/graph/isDenseAxis\",\n\t\t\tIsVirtual: \"pl7.app/graph/isVirtual\",\n\t\t\tPalette: \"pl7.app/graph/palette\",\n\t\t\tThresholds: \"pl7.app/graph/thresholds\",\n\t\t\tTreatAbsentValuesAs: \"pl7.app/graph/treatAbsentValuesAs\"\n\t\t},\n\t\tHideDataFromUi: \"pl7.app/hideDataFromUi\",\n\t\tHideDataFromGraphs: \"pl7.app/hideDataFromGraphs\",\n\t\tIsDiscreteFilter: \"pl7.app/isDiscreteFilter\",\n\t\tIsAnchor: \"pl7.app/isAnchor\",\n\t\tIsLinkerColumn: \"pl7.app/isLinkerColumn\",\n\t\tIsScore: \"pl7.app/isScore\",\n\t\tIsSubset: \"pl7.app/isSubset\",\n\t\tLabel: \"pl7.app/label\",\n\t\tLinkLabel: \"pl7.app/linkLabel\",\n\t\tMax: \"pl7.app/max\",\n\t\tMin: \"pl7.app/min\",\n\t\tMultipliesBy: \"pl7.app/multipliesBy\",\n\t\tParents: \"pl7.app/parents\",\n\t\tScore: {\n\t\t\tDefaultCutoff: \"pl7.app/score/defaultCutoff\",\n\t\t\tRankingOrder: \"pl7.app/score/rankingOrder\"\n\t\t},\n\t\tSequence: {\n\t\t\tAnnotation: { Mapping: \"pl7.app/sequence/annotation/mapping\" },\n\t\t\tIsAnnotation: \"pl7.app/sequence/isAnnotation\"\n\t\t},\n\t\tTable: {\n\t\t\tFontFamily: \"pl7.app/table/fontFamily\",\n\t\t\tOrderPriority: \"pl7.app/table/orderPriority\",\n\t\t\tVisibility: \"pl7.app/table/visibility\",\n\t\t\tInfo: \"pl7.app/table/info\"\n\t\t},\n\t\tTrace: \"pl7.app/trace\",\n\t\tVDJ: {\n\t\t\tIsAssemblingFeature: \"pl7.app/vdj/isAssemblingFeature\",\n\t\t\tIsMainSequence: \"pl7.app/vdj/isMainSequence\"\n\t\t}\n\t};\n\tconst TraceEntrySchema = objectType({\n\t\ttype: stringType(),\n\t\tlabel: stringType()\n\t}).catchall(unknownType());\n\tconst ValueTypeSchema = enumType([\n\t\t\"Int\",\n\t\t\"Long\",\n\t\t\"Float\",\n\t\t\"Double\",\n\t\t\"String\"\n\t]);\n\tconst AnnotationJson = {\n\t\t[Annotation.DiscreteValues]: arrayType(stringType()).or(arrayType(numberType())),\n\t\t[Annotation.Graph.Axis.HighCardinality]: booleanType(),\n\t\t[Annotation.Graph.Axis.LowerLimit]: numberType(),\n\t\t[Annotation.Graph.Axis.UpperLimit]: numberType(),\n\t\t[Annotation.Graph.Axis.SymmetricRange]: booleanType(),\n\t\t[Annotation.Graph.IsDenseAxis]: booleanType(),\n\t\t[Annotation.Graph.Palette]: objectType({\n\t\t\tmapping: recordType(numberType()),\n\t\t\tname: stringType()\n\t\t}),\n\t\t[Annotation.Graph.Thresholds]: arrayType(objectType({\n\t\t\tcolumnId: objectType({\n\t\t\t\tvalueType: ValueTypeSchema,\n\t\t\t\tname: stringType()\n\t\t\t}),\n\t\t\tvalue: numberType()\n\t\t})),\n\t\t[Annotation.Graph.TreatAbsentValuesAs]: numberType(),\n\t\t[Annotation.Graph.IsVirtual]: booleanType(),\n\t\t[Annotation.HideDataFromUi]: booleanType(),\n\t\t[Annotation.HideDataFromGraphs]: booleanType(),\n\t\t[Annotation.IsDiscreteFilter]: booleanType(),\n\t\t[Annotation.IsLinkerColumn]: booleanType(),\n\t\t[Annotation.IsSubset]: booleanType(),\n\t\t[Annotation.Max]: numberType(),\n\t\t[Annotation.Min]: numberType(),\n\t\t[Annotation.MultipliesBy]: arrayType(stringType()),\n\t\t[Annotation.Parents]: arrayType(stringType()),\n\t\t[Annotation.Sequence.Annotation.Mapping]: recordType(stringType(), stringType()),\n\t\t[Annotation.Sequence.IsAnnotation]: booleanType(),\n\t\t[Annotation.Table.OrderPriority]: numberType(),\n\t\t[Annotation.Trace]: arrayType(TraceEntrySchema),\n\t\t[Annotation.VDJ.IsAssemblingFeature]: booleanType()\n\t};\n\tfunction readAnnotation(spec, key) {\n\t\treturn readMetadata(spec?.annotations, key);\n\t}\n\tfunction readAnnotationJson(spec, key) {\n\t\treturn readMetadataJson(spec?.annotations, AnnotationJson, key);\n\t}\n\tfunction isLinkerColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.IsLinkerColumn);\n\t}\n\tfunction makeAxisTree(axis) {\n\t\treturn {\n\t\t\taxis,\n\t\t\tchildren: []\n\t\t};\n\t}\n\t/** Build tree by axis parents annotations */\n\tfunction getAxesTree(rootAxis) {\n\t\tconst root = makeAxisTree(rootAxis);\n\t\tlet nodesQ = [root];\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tfor (const node of nodesQ) {\n\t\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\t\tnextNodes.push(...node.children);\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn root;\n\t}\n\t/** Get array of axisSpecs from axisTree */\n\tfunction getArrayFromAxisTree(tree) {\n\t\tconst res = [tree.axis];\n\t\tlet nodesQ = [tree];\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tfor (const node of nodesQ) for (const parent of node.children) {\n\t\t\t\tres.push(parent.axis);\n\t\t\t\tnextNodes.push(parent);\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn res;\n\t}\n\tfunction canonicalizeAxisWithParents(axis) {\n\t\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t}\n\tfunction normalizingAxesComparator(axis1, axis2) {\n\t\tif (axis1.name !== axis2.name) return axis1.name < axis2.name ? 1 : -1;\n\t\tif (axis1.type !== axis2.type) return axis1.type < axis2.type ? 1 : -1;\n\t\tconst domain1 = canonicalizeJson(axis1.domain ?? {});\n\t\tconst domain2 = canonicalizeJson(axis2.domain ?? {});\n\t\tif (domain1 !== domain2) return domain1 < domain2 ? 1 : -1;\n\t\tconst contextDomain1 = canonicalizeJson(axis1.contextDomain ?? {});\n\t\tconst contextDomain2 = canonicalizeJson(axis2.contextDomain ?? {});\n\t\tif (contextDomain1 !== contextDomain2) return contextDomain1 < contextDomain2 ? 1 : -1;\n\t\tconst parents1 = canonicalizeAxisWithParents(axis1);\n\t\tconst parents2 = canonicalizeAxisWithParents(axis2);\n\t\tif (parents1 !== parents2) return parents1 < parents2 ? 1 : -1;\n\t\tconst annotation1 = canonicalizeJson(axis1.annotations ?? {});\n\t\tconst annotation2 = canonicalizeJson(axis2.annotations ?? {});\n\t\tif (annotation1 !== annotation2) return annotation1 < annotation2 ? 1 : -1;\n\t\treturn 0;\n\t}\n\tfunction parseParentsFromAnnotations(axis) {\n\t\tconst parentsList = readAnnotationJson(axis, Annotation.Parents);\n\t\tif (parentsList === void 0) return [];\n\t\treturn parentsList;\n\t}\n\tfunction sortParentsDeep(axisSpec) {\n\t\taxisSpec.parentAxesSpec.forEach(sortParentsDeep);\n\t\taxisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n\t}\n\tfunction hasCycleOfParents(axisSpec) {\n\t\tlet nodesQ = [makeAxisTree(axisSpec)];\n\t\tconst ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tconst levelIds = /* @__PURE__ */ new Set();\n\t\t\tfor (const node of nodesQ) {\n\t\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\t\tfor (const child of node.children) {\n\t\t\t\t\tconst childId = canonicalizeJson(getAxisId(child.axis));\n\t\t\t\t\tif (!levelIds.has(childId)) {\n\t\t\t\t\t\tnextNodes.push(child);\n\t\t\t\t\t\tlevelIds.add(childId);\n\t\t\t\t\t\tif (ancestors.has(childId)) return true;\n\t\t\t\t\t\tancestors.add(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn false;\n\t}\n\t/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\n\tfunction getNormalizedAxesList(axes) {\n\t\tif (!axes.length) return [];\n\t\tconst modifiedAxes = axes.map((axis) => {\n\t\t\tconst { parentAxes: _, ...copiedRest } = axis;\n\t\t\treturn {\n\t\t\t\t...copiedRest,\n\t\t\t\tannotations: { ...copiedRest.annotations },\n\t\t\t\tparentAxesSpec: []\n\t\t\t};\n\t\t});\n\t\taxes.forEach((axis, idx) => {\n\t\t\tconst modifiedAxis = modifiedAxes[idx];\n\t\t\tif (axis.parentAxes) modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n\t\t\telse {\n\t\t\t\tconst parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n\t\t\t\tmodifiedAxis.parentAxesSpec = parents.some((p) => p === void 0) ? [] : parents;\n\t\t\t}\n\t\t});\n\t\tif (modifiedAxes.some(hasCycleOfParents)) modifiedAxes.forEach((axis) => {\n\t\t\taxis.parentAxesSpec = [];\n\t\t});\n\t\telse modifiedAxes.forEach((axis) => {\n\t\t\tsortParentsDeep(axis);\n\t\t});\n\t\treturn modifiedAxes;\n\t}\n\tconst PColumnName = {\n\t\tLabel: \"pl7.app/label\",\n\t\tTable: { RowSelection: \"pl7.app/table/row-selection\" },\n\t\tVDJ: {\n\t\t\tLeadSelection: \"pl7.app/vdj/lead-selection\",\n\t\t\tRankingOrder: \"pl7.app/vdj/ranking-order\",\n\t\t\tSequence: \"pl7.app/vdj/sequence\"\n\t\t}\n\t};\n\tfunction isLabelColumn(column) {\n\t\treturn column.axesSpec.length === 1 && column.name === PColumnName.Label;\n\t}\n\t/** Get column id and spec from a column */\n\tfunction getColumnIdAndSpec(column) {\n\t\treturn {\n\t\t\tcolumnId: column.id,\n\t\t\tspec: column.spec\n\t\t};\n\t}\n\t/** Extracts axis ids from axis spec */\n\tfunction getAxisId(spec) {\n\t\tconst { type, name, domain, contextDomain } = spec;\n\t\tconst result = {\n\t\t\ttype,\n\t\t\tname\n\t\t};\n\t\tif (domain && Object.entries(domain).length > 0) Object.assign(result, { domain });\n\t\tif (contextDomain && Object.entries(contextDomain).length > 0) Object.assign(result, { contextDomain });\n\t\treturn result;\n\t}\n\t/** Extracts axes ids from axes spec array from column spec */\n\tfunction getAxesId(spec) {\n\t\treturn spec.map(getAxisId);\n\t}\n\t/** Canonicalizes axis id */\n\tfunction canonicalizeAxisId(id) {\n\t\treturn canonicalizeJson(getAxisId(id));\n\t}\n\t/** Returns true if all domains from query are found in target */\n\tfunction matchDomain$1(query, target) {\n\t\tif (query === void 0) return target === void 0;\n\t\tif (target === void 0) return true;\n\t\tfor (const k in target) if (query[k] !== target[k]) return false;\n\t\treturn true;\n\t}\n\t/** Returns whether \"match\" axis id is compatible with the \"query\" */\n\tfunction matchAxisId(query, target) {\n\t\treturn query.name === target.name && matchDomain$1(query.domain, target.domain) && matchDomain$1(query.contextDomain, target.contextDomain);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js\n\tconst booleanTypesSet = new Set([\n\t\t\"numericComparison\",\n\t\t\"stringEquals\",\n\t\t\"stringContains\",\n\t\t\"stringContainsFuzzy\",\n\t\t\"stringRegex\",\n\t\t\"isNull\",\n\t\t\"not\",\n\t\t\"and\",\n\t\t\"or\",\n\t\t\"isIn\"\n\t]);\n\tfunction isBooleanExpression(expr) {\n\t\treturn booleanTypesSet.has(expr.type);\n\t}\n\t/**\n\t* Recursively traverses a SpecQuery tree bottom-up, applying visitor callbacks.\n\t*\n\t* Traversal order:\n\t* 1. Recurse into child queries\n\t* 2. Apply `column` to transform column references in leaf nodes\n\t* 3. Apply `joinEntry` to each join entry (with inner query already traversed)\n\t* 4. Assemble node with transformed children\n\t* 5. Apply `node` to the assembled node\n\t*/\n\tfunction traverseQuerySpec(query, visitor) {\n\t\tconst traverseEntry = (entry) => {\n\t\t\tconst traversed = {\n\t\t\t\t...entry,\n\t\t\t\tentry: traverseQuerySpec(entry.entry, visitor)\n\t\t\t};\n\t\t\treturn visitor.joinEntry ? visitor.joinEntry(traversed) : traversed;\n\t\t};\n\t\tlet result;\n\t\tswitch (query.type) {\n\t\t\tcase \"column\":\n\t\t\t\tresult = {\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"sparseToDenseColumn\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"inlineColumn\":\n\t\t\t\tresult = query;\n\t\t\t\tbreak;\n\t\t\tcase \"innerJoin\":\n\t\t\tcase \"fullJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tentries: query.entries.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"outerJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tprimary: traverseEntry(query.primary),\n\t\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"linkerJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tlinker: {\n\t\t\t\t\t\t...query.linker,\n\t\t\t\t\t\tcolumn: visitor.column(query.linker.column)\n\t\t\t\t\t},\n\t\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"filter\":\n\t\t\tcase \"sort\":\n\t\t\tcase \"sliceAxes\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tinput: traverseQuerySpec(query.input, visitor)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault: assertNever(query);\n\t\t}\n\t\treturn visitor.node ? visitor.node(result) : result;\n\t}\n\t/** Recursively maps all column references in a SpecQuery tree. */\n\tfunction mapSpecQueryColumns(query, cb) {\n\t\treturn traverseQuerySpec(query, { column: cb });\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js\n\tfunction mapPTableDef(def, cb) {\n\t\treturn {\n\t\t\t...def,\n\t\t\tsrc: mapJoinEntry(def.src, cb)\n\t\t};\n\t}\n\tfunction mapPTableDefV2(def, cb) {\n\t\treturn { query: mapSpecQueryColumns(def.query, cb) };\n\t}\n\tfunction mapJoinEntry(entry, cb) {\n\t\tswitch (entry.type) {\n\t\t\tcase \"column\": return {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: cb(entry.column)\n\t\t\t};\n\t\t\tcase \"slicedColumn\": return {\n\t\t\t\ttype: \"slicedColumn\",\n\t\t\t\tcolumn: cb(entry.column),\n\t\t\t\tnewId: entry.newId,\n\t\t\t\taxisFilters: entry.axisFilters\n\t\t\t};\n\t\t\tcase \"artificialColumn\": return {\n\t\t\t\ttype: \"artificialColumn\",\n\t\t\t\tcolumn: cb(entry.column),\n\t\t\t\tnewId: entry.newId,\n\t\t\t\taxesIndices: entry.axesIndices\n\t\t\t};\n\t\t\tcase \"inlineColumn\": return entry;\n\t\t\tcase \"inner\":\n\t\t\tcase \"full\": return {\n\t\t\t\ttype: entry.type,\n\t\t\t\tentries: entry.entries.map((col) => mapJoinEntry(col, cb))\n\t\t\t};\n\t\t\tcase \"outer\": return {\n\t\t\t\ttype: \"outer\",\n\t\t\t\tprimary: mapJoinEntry(entry.primary, cb),\n\t\t\t\tsecondary: entry.secondary.map((col) => mapJoinEntry(col, cb))\n\t\t\t};\n\t\t\tdefault: assertNever(entry);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js\n\t/**\n\t* Canonically serializes a {@link UniversalPColumnId} to a string.\n\t* @param id - The column identifier to serialize\n\t* @returns The canonically serialized string\n\t*/\n\tfunction stringifyColumnId(id) {\n\t\treturn (0, import_canonicalize.default)(id);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js\n\tfunction axisKey(axis) {\n\t\treturn (0, import_canonicalize.default)(getAxisId(axis));\n\t}\n\tfunction domainKey(key, value) {\n\t\treturn JSON.stringify([key, value]);\n\t}\n\t/**\n\t* Context for resolving and generating anchored references to columns and axes\n\t* Maintains maps of known domain values and axes that can be referenced by anchors\n\t*/\n\tvar AnchoredIdDeriver = class {\n\t\taxes = /* @__PURE__ */ new Map();\n\t\tdomains = /* @__PURE__ */ new Map();\n\t\tcontextDomains = /* @__PURE__ */ new Map();\n\t\t/**\n\t\t* Domain packs are used to group domain keys that can be anchored to the same anchor\n\t\t* This is used to optimize the lookup of domain anchors\n\t\t*/\n\t\tdomainPacks = [];\n\t\tcontextDomainPacks = [];\n\t\t/**\n\t\t* Maps domain packs to anchors\n\t\t*/\n\t\tdomainPackToAnchor = /* @__PURE__ */ new Map();\n\t\tcontextDomainPackToAnchor = /* @__PURE__ */ new Map();\n\t\t/**\n\t\t* Creates a new anchor context from a set of anchor column specifications\n\t\t* @param anchors Record of anchor column specifications indexed by anchor ID\n\t\t*/\n\t\tconstructor(anchors) {\n\t\t\tthis.anchors = anchors;\n\t\t\tconst anchorEntries = Object.entries(anchors);\n\t\t\tanchorEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\tfor (const [anchorId, spec] of anchorEntries) {\n\t\t\t\tfor (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {\n\t\t\t\t\tconst axis = spec.axesSpec[axisIdx];\n\t\t\t\t\tconst key = axisKey(axis);\n\t\t\t\t\tthis.axes.set(key, {\n\t\t\t\t\t\tanchor: anchorId,\n\t\t\t\t\t\tidx: axisIdx\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (spec.domain !== void 0) {\n\t\t\t\t\tconst domainEntries = Object.entries(spec.domain);\n\t\t\t\t\tdomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\t\tthis.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);\n\t\t\t\t\tthis.domainPacks.push(domainEntries.map(([dKey]) => dKey));\n\t\t\t\t\tfor (const [dKey, dValue] of domainEntries) {\n\t\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\t\tthis.domains.set(key, anchorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (spec.contextDomain !== void 0) {\n\t\t\t\t\tconst contextDomainEntries = Object.entries(spec.contextDomain);\n\t\t\t\t\tcontextDomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\t\tthis.contextDomainPackToAnchor.set(JSON.stringify(contextDomainEntries), anchorId);\n\t\t\t\t\tthis.contextDomainPacks.push(contextDomainEntries.map(([dKey]) => dKey));\n\t\t\t\t\tfor (const [dKey, dValue] of contextDomainEntries) {\n\t\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\t\tthis.contextDomains.set(key, anchorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Implementation of derive method\n\t\t*/\n\t\tderive(spec, axisFilters) {\n\t\t\tconst result = {\n\t\t\t\tname: spec.name,\n\t\t\t\taxes: []\n\t\t\t};\n\t\t\tlet skipDomains = void 0;\n\t\t\tif (spec.domain !== void 0) outer: for (const domainPack of this.domainPacks) {\n\t\t\t\tconst dAnchor = [];\n\t\t\t\tfor (const domainKey of domainPack) {\n\t\t\t\t\tconst dValue = spec.domain[domainKey];\n\t\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\t\telse break outer;\n\t\t\t\t}\n\t\t\t\tconst domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\t\tif (domainAnchor !== void 0) {\n\t\t\t\t\tresult.domainAnchor = domainAnchor;\n\t\t\t\t\tskipDomains = new Set(domainPack);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {\n\t\t\t\tif (skipDomains !== void 0 && skipDomains.has(dKey)) continue;\n\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\tconst anchorId = this.domains.get(key);\n\t\t\t\tresult.domain ??= {};\n\t\t\t\tresult.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t\t}\n\t\t\tlet skipContextDomains = void 0;\n\t\t\tif (spec.contextDomain !== void 0) outer: for (const contextDomainPack of this.contextDomainPacks) {\n\t\t\t\tconst dAnchor = [];\n\t\t\t\tfor (const domainKey of contextDomainPack) {\n\t\t\t\t\tconst dValue = spec.contextDomain[domainKey];\n\t\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\t\telse break outer;\n\t\t\t\t}\n\t\t\t\tconst contextDomainAnchor = this.contextDomainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\t\tif (contextDomainAnchor !== void 0) {\n\t\t\t\t\tresult.contextDomainAnchor = contextDomainAnchor;\n\t\t\t\t\tskipContextDomains = new Set(contextDomainPack);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [dKey, dValue] of Object.entries(spec.contextDomain ?? {})) {\n\t\t\t\tif (skipContextDomains !== void 0 && skipContextDomains.has(dKey)) continue;\n\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\tconst anchorId = this.contextDomains.get(key);\n\t\t\t\tresult.contextDomain ??= {};\n\t\t\t\tresult.contextDomain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t\t}\n\t\t\tresult.axes = spec.axesSpec.map((axis) => {\n\t\t\t\tconst key = axisKey(axis);\n\t\t\t\tconst anchorAxisRef = this.axes.get(key);\n\t\t\t\tif (anchorAxisRef === void 0) return getAxisId(axis);\n\t\t\t\telse return anchorAxisRef;\n\t\t\t});\n\t\t\tif (!axisFilters || axisFilters.length === 0) return result;\n\t\t\tconst resolvedFilters = [];\n\t\t\tfor (const filter of axisFilters) {\n\t\t\t\tconst [axisIdOrIndex, value] = filter;\n\t\t\t\tif (typeof axisIdOrIndex === \"number\") {\n\t\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\t\tresolvedFilters.push([axisIdOrIndex, value]);\n\t\t\t\t} else {\n\t\t\t\t\tconst axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);\n\t\t\t\t\tif (axisIndex === -1) throw new Error(`Axis with name \"${axisIdOrIndex}\" not found in the column specification`);\n\t\t\t\t\tresolvedFilters.push([axisIndex, value]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolvedFilters.sort((a, b) => a[0] - b[0]);\n\t\t\treturn {\n\t\t\t\tsource: result,\n\t\t\t\taxisFilters: resolvedFilters\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column\n\t\t* @param spec Column specification to anchor\n\t\t* @param axisFilters Optional axis filters to apply to the column\n\t\t* @returns A canonicalized string representation of the anchored column identifier\n\t\t*/\n\t\tderiveS(spec, axisFilters) {\n\t\t\treturn stringifyColumnId(this.derive(spec, axisFilters));\n\t\t}\n\t};\n\t/**\n\t* Resolves anchored references in a column matcher to create a non-anchored matcher.\n\t* Doing an opposite operation to {@link AnchorIdDeriver.derive()}.\n\t*\n\t* @param anchors - Record of anchor column specifications indexed by anchor id\n\t* @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved\n\t* @param options - Options for resolving anchors\n\t* @returns A non-anchored column matcher with all references resolved to actual values\n\t* @deprecated - This function by parent PColumnCollection\n\t*/\n\tfunction resolveAnchors(anchors, matcher, options) {\n\t\tconst result = { ...matcher };\n\t\tconst ignoreMissingDomains = options?.ignoreMissingDomains ?? false;\n\t\tif (result.domainAnchor !== void 0) {\n\t\t\tconst anchorSpec = anchors[result.domainAnchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.domainAnchor}\" not found`);\n\t\t\tresult.domain = {\n\t\t\t\t...anchorSpec.domain || {},\n\t\t\t\t...result.domain\n\t\t\t};\n\t\t\tdelete result.domainAnchor;\n\t\t}\n\t\tif (result.domain) {\n\t\t\tconst resolvedDomain = {};\n\t\t\tfor (const [key, value] of Object.entries(result.domain)) if (typeof value === \"string\") resolvedDomain[key] = value;\n\t\t\telse {\n\t\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for domain key \"${key}\"`);\n\t\t\t\tif (!anchorSpec.domain || anchorSpec.domain[key] === void 0) {\n\t\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresolvedDomain[key] = anchorSpec.domain[key];\n\t\t\t}\n\t\t\tresult.domain = resolvedDomain;\n\t\t}\n\t\tif (result.contextDomainAnchor !== void 0) {\n\t\t\tconst anchorSpec = anchors[result.contextDomainAnchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.contextDomainAnchor}\" not found`);\n\t\t\tresult.contextDomain = {\n\t\t\t\t...anchorSpec.contextDomain || {},\n\t\t\t\t...result.contextDomain\n\t\t\t};\n\t\t\tdelete result.contextDomainAnchor;\n\t\t}\n\t\tif (result.contextDomain) {\n\t\t\tconst resolvedContextDomain = {};\n\t\t\tfor (const [key, value] of Object.entries(result.contextDomain)) if (typeof value === \"string\") resolvedContextDomain[key] = value;\n\t\t\telse {\n\t\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for contextDomain key \"${key}\"`);\n\t\t\t\tif (!anchorSpec.contextDomain || anchorSpec.contextDomain[key] === void 0) {\n\t\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Context domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresolvedContextDomain[key] = anchorSpec.contextDomain[key];\n\t\t\t}\n\t\t\tresult.contextDomain = resolvedContextDomain;\n\t\t}\n\t\tif (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));\n\t\treturn result;\n\t}\n\t/**\n\t* Resolves an anchored axis reference to a concrete AxisId\n\t*/\n\tfunction resolveAxisReference(anchors, axisRef) {\n\t\tif (!isAnchorAxisRef(axisRef)) return axisRef;\n\t\tconst anchorId = axisRef.anchor;\n\t\tconst anchorSpec = anchors[anchorId];\n\t\tif (!anchorSpec) throw new Error(`Anchor \"${anchorId}\" not found for axis reference`);\n\t\tif (\"idx\" in axisRef) {\n\t\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\t\treturn anchorSpec.axesSpec[axisRef.idx];\n\t\t} else if (\"name\" in axisRef) {\n\t\t\tconst matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);\n\t\t\tif (matches.length > 1) throw new Error(`Multiple axes with name \"${axisRef.name}\" found in anchor \"${anchorId}\"`);\n\t\t\tif (matches.length === 0) throw new Error(`Axis with name \"${axisRef.name}\" not found in anchor \"${anchorId}\"`);\n\t\t\treturn matches[0];\n\t\t} else if (\"id\" in axisRef) {\n\t\t\tconst matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));\n\t\t\tif (matches.length > 1) throw new Error(`Multiple matching axes found for matcher in anchor \"${anchorId}\"`);\n\t\t\tif (matches.length === 0) throw new Error(`No matching axis found for matcher in anchor \"${anchorId}\"`);\n\t\t\treturn matches[0];\n\t\t}\n\t\tthrow new Error(`Unsupported axis reference type`);\n\t}\n\t/**\n\t* Type guard to check if a value is an anchored axis reference\n\t*/\n\tfunction isAnchorAxisRef(value) {\n\t\treturn typeof value === \"object\" && \"anchor\" in value;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js\n\tfunction isPColumnSpec(spec) {\n\t\treturn spec.kind === \"PColumn\";\n\t}\n\tfunction isPColumn(obj) {\n\t\treturn isPColumnSpec(obj.spec);\n\t}\n\tfunction ensurePColumn(obj) {\n\t\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\t\treturn obj;\n\t}\n\tfunction mapPObjectData(pObj, cb) {\n\t\treturn pObj === void 0 ? void 0 : {\n\t\t\t...pObj,\n\t\t\tdata: cb(typeof pObj.data === \"function\" ? pObj.data() : pObj.data)\n\t\t};\n\t}\n\tfunction extractAllColumns(entry) {\n\t\tconst columns = /* @__PURE__ */ new Map();\n\t\tconst addAllColumns = (entry) => {\n\t\t\tswitch (entry.type) {\n\t\t\t\tcase \"column\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"slicedColumn\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"artificialColumn\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"inlineColumn\": return;\n\t\t\t\tcase \"full\":\n\t\t\t\tcase \"inner\":\n\t\t\t\t\tfor (const e of entry.entries) addAllColumns(e);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"outer\":\n\t\t\t\t\taddAllColumns(entry.primary);\n\t\t\t\t\tfor (const e of entry.secondary) addAllColumns(e);\n\t\t\t\t\treturn;\n\t\t\t\tdefault: assertNever(entry);\n\t\t\t}\n\t\t};\n\t\taddAllColumns(entry);\n\t\treturn [...columns.values()];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js\n\t/**\n\t* Determines if an axis ID matches an axis selector.\n\t*\n\t* @param selector - The selector with criteria to match against\n\t* @param axis - The AxisId to check against the selector\n\t* @returns true if the AxisId matches all specified criteria in the selector, false otherwise\n\t*/\n\tfunction matchAxis(selector, axis) {\n\t\tif (selector.name !== void 0 && selector.name !== axis.name) return false;\n\t\tif (selector.type !== void 0) {\n\t\t\tif (Array.isArray(selector.type)) {\n\t\t\t\tif (!selector.type.includes(axis.type)) return false;\n\t\t\t} else if (selector.type !== axis.type) return false;\n\t\t}\n\t\tif (selector.domain !== void 0) {\n\t\t\tconst axisDomain = axis.domain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.domain)) if (axisDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.contextDomain !== void 0) {\n\t\t\tconst axisContextDomain = axis.contextDomain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (axisContextDomain[key] !== value) return false;\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* Determines if a given PColumnSpec matches a selector.\n\t*\n\t* @param pcolumn - The PColumnSpec to check against the selector\n\t* @param selector - The selector criteria to match against\n\t* @returns true if the PColumnSpec matches all criteria in the selector, false otherwise\n\t*/\n\tfunction matchPColumn(pcolumn, selector) {\n\t\tif (selector.name !== void 0 && pcolumn.name !== selector.name) return false;\n\t\tif (selector.namePattern !== void 0 && !new RegExp(selector.namePattern).test(pcolumn.name)) return false;\n\t\tif (selector.type !== void 0) {\n\t\t\tif (Array.isArray(selector.type)) {\n\t\t\t\tif (!selector.type.includes(pcolumn.valueType)) return false;\n\t\t\t} else if (selector.type !== pcolumn.valueType) return false;\n\t\t}\n\t\tif (selector.domain !== void 0) {\n\t\t\tconst columnDomain = pcolumn.domain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.domain)) if (columnDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.contextDomain !== void 0) {\n\t\t\tconst columnContextDomain = pcolumn.contextDomain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (columnContextDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.axes !== void 0) {\n\t\t\tconst pcolumnAxes = pcolumn.axesSpec.map(getAxisId);\n\t\t\tif (selector.partialAxesMatch) {\n\t\t\t\tfor (const selectorAxis of selector.axes) if (!pcolumnAxes.some((columnAxis) => matchAxis(selectorAxis, columnAxis))) return false;\n\t\t\t} else {\n\t\t\t\tif (pcolumnAxes.length !== selector.axes.length) return false;\n\t\t\t\tfor (let i = 0; i < selector.axes.length; i++) if (!matchAxis(selector.axes[i], pcolumnAxes[i])) return false;\n\t\t\t}\n\t\t}\n\t\tif (selector.annotations !== void 0) {\n\t\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.annotations)) if (columnAnnotations[key] !== value) return false;\n\t\t}\n\t\tif (selector.annotationPatterns !== void 0) {\n\t\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\t\tfor (const [key, pattern] of Object.entries(selector.annotationPatterns)) {\n\t\t\t\tconst value = columnAnnotations[key];\n\t\t\t\tif (value === void 0 || !new RegExp(pattern).test(value)) return false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* Convert a predicate or array of selectors to a single predicate function\n\t* @param predicateOrSelectors - Either a function that takes a PColumnSpec and returns a boolean,\n\t* or an array of PColumnSelectors, or a single PColumnSelector\n\t* @returns A function that takes a PColumnSpec and returns a boolean\n\t*/\n\tfunction legacyColumnSelectorsToPredicate(predicateOrSelectors) {\n\t\tif (Array.isArray(predicateOrSelectors)) return (spec) => predicateOrSelectors.some((selector) => isPColumnSpec(spec) && matchPColumn(spec, selector));\n\t\telse return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js\n\tfunction deriveNativeId(spec) {\n\t\tconst result = {\n\t\t\tkind: spec.kind,\n\t\t\tname: spec.name\n\t\t};\n\t\tif (spec.domain !== void 0) result.domain = spec.domain;\n\t\tif (spec.contextDomain !== void 0) result.contextDomain = spec.contextDomain;\n\t\tif (isPColumnSpec(spec)) result.axesSpec = getAxesId(spec.axesSpec);\n\t\treturn (0, import_canonicalize.default)(result);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/utils.js\n\tfunction isNil$1(v) {\n\t\treturn v === null || v === void 0;\n\t}\n\tArray.isArray;\n\tfunction isObject(value) {\n\t\treturn typeof value === \"object\" && value !== null;\n\t}\n\t/**\n\t* Checks if the given value is a plain object.\n\t*\n\t* A plain object is defined as an object created by the `{}` literal,\n\t* an object created with `Object.create(null)`, or an object with a\n\t* prototype that resolves to `Object.prototype`.\n\t*\n\t* @param value - The value to check.\n\t* @returns `true` if the value is a plain object, otherwise `false`.\n\t*\n\t* @example\n\t* ```typescript\n\t* isPlainObject({}); // true\n\t* isPlainObject(Object.create(null)); // true\n\t* isPlainObject(new Date()); // false\n\t* isPlainObject(null); // false\n\t* isPlainObject([]); // false\n\t* ```\n\t*/\n\tfunction isPlainObject(value) {\n\t\tif (!isObject(value)) return false;\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\treturn prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;\n\t}\n\t/**\n\t* Reads a property from a union-typed object where the key may exist only on some members of the union.\n\t*\n\t* `K` is constrained to keys of the union's intersection, so any key present on at least one union\n\t* member is accepted. The return type resolves to `T[K]` when `K` is a key of `T`, otherwise `undefined`\n\t* — matching the runtime behavior of reading a missing property.\n\t*\n\t* @param obj - source object (may be a union of shapes)\n\t* @param prop - property name, must be a key of at least one union member\n\t* @returns the property value if present, otherwise `undefined`\n\t*/\n\tfunction getField(obj, prop) {\n\t\treturn obj[prop];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/error.js\n\tfunction throwError(v) {\n\t\tif (typeof v === \"string\") throw new Error(v);\n\t\telse throw v;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/uniqId.js\n\tfunction createGetIncrementalId() {\n\t\tlet idx = 0n;\n\t\treturn () => idx++;\n\t}\n\tcreateGetIncrementalId();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js\n\tfunction distillDiscoveredPColumn(props) {\n\t\treturn {\n\t\t\tcolumn: props.column,\n\t\t\tpath: Array.isArray(props.path) && props.path.length > 0 ? props.path : void 0,\n\t\t\tcolumnQualifications: Array.isArray(props.columnQualifications) && props.columnQualifications.length > 0 ? props.columnQualifications : void 0,\n\t\t\tqueriesQualifications: props.queriesQualifications && Object.keys(props.queriesQualifications).length > 0 ? props.queriesQualifications : void 0\n\t\t};\n\t}\n\tfunction createDiscoveredPColumnId(props) {\n\t\treturn stringifyDiscoveredPColumnId(props);\n\t}\n\tfunction stringifyDiscoveredPColumnId(id) {\n\t\treturn canonicalizeJson(distillDiscoveredPColumn(id));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js\n\tvar LinkerMap = class LinkerMap {\n\t\t/** Graph of linkers connected by axes (single or grouped by parents) */\n\t\tdata;\n\t\tconstructor(linkerMap) {\n\t\t\tthis.data = linkerMap;\n\t\t}\n\t\tget keys() {\n\t\t\treturn this.data.keys();\n\t\t}\n\t\tget keyAxesIds() {\n\t\t\treturn [...this.data.keys()].map(parseJson);\n\t\t}\n\t\tstatic fromColumns(columns) {\n\t\t\tconst result = /* @__PURE__ */ new Map();\n\t\t\tfor (const linker of columns.filter((l) => !!readAnnotationJson(l.spec, Annotation.IsLinkerColumn))) {\n\t\t\t\tconst groups = LinkerMap.getAxesGroups(getNormalizedAxesList(linker.spec.axesSpec));\n\t\t\t\tif (groups.length !== 2) continue;\n\t\t\t\tconst [left, right] = groups;\n\t\t\t\tconst leftKeyVariants = LinkerMap.getAxesRoots(left).map((axis) => {\n\t\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t\t});\n\t\t\t\tconst rightKeyVariants = LinkerMap.getAxesRoots(right).map((axis) => {\n\t\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t\t});\n\t\t\t\tfor (const [keyLeft, spec] of leftKeyVariants) if (!result.has(keyLeft)) result.set(keyLeft, {\n\t\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t\t});\n\t\t\t\tfor (const [keyRight, spec] of rightKeyVariants) if (!result.has(keyRight)) result.set(keyRight, {\n\t\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t\t});\n\t\t\t\tfor (const [keyRight] of rightKeyVariants) for (const [keyLeft] of leftKeyVariants) result.get(keyRight)?.linkWith.set(keyLeft, linker);\n\t\t\t}\n\t\t\treturn new this(result);\n\t\t}\n\t\t/** Get all available nodes of linker graphs if start from sourceAxesKeys */\n\t\tsearchAvailableAxesKeys(sourceAxesKeys) {\n\t\t\tconst startKeys = new Set(sourceAxesKeys);\n\t\t\tconst allAvailableKeys = /* @__PURE__ */ new Set();\n\t\t\tlet nextKeys = sourceAxesKeys;\n\t\t\twhile (nextKeys.length) {\n\t\t\t\tconst next = [];\n\t\t\t\tfor (const key of nextKeys) {\n\t\t\t\t\tconst node = this.data.get(key);\n\t\t\t\t\tif (!node) continue;\n\t\t\t\t\tfor (const availableKey of node.linkWith.keys()) if (!allAvailableKeys.has(availableKey) && !startKeys.has(availableKey)) {\n\t\t\t\t\t\tnext.push(availableKey);\n\t\t\t\t\t\tallAvailableKeys.add(availableKey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextKeys = next;\n\t\t\t}\n\t\t\treturn allAvailableKeys;\n\t\t}\n\t\t/** Get all linker columns that are necessary to reach endKey from startKey */\n\t\tsearchLinkerPath(startKey, endKey) {\n\t\t\tconst previous = {};\n\t\t\tlet nextIds = new Set([startKey]);\n\t\t\tconst visited = new Set([startKey]);\n\t\t\twhile (nextIds.size) {\n\t\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const nextId of nextIds) {\n\t\t\t\t\tconst node = this.data.get(nextId);\n\t\t\t\t\tif (!node) continue;\n\t\t\t\t\tfor (const availableId of node.linkWith.keys()) {\n\t\t\t\t\t\tprevious[availableId] = nextId;\n\t\t\t\t\t\tif (availableId === endKey) {\n\t\t\t\t\t\t\tconst ids = [];\n\t\t\t\t\t\t\tlet current = endKey;\n\t\t\t\t\t\t\twhile (previous[current] !== startKey) {\n\t\t\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\t\t\tcurrent = previous[current];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\t\treturn ids.map((id) => this.data.get(previous[id]).linkWith.get(id));\n\t\t\t\t\t\t} else if (!visited.has(availableId)) {\n\t\t\t\t\t\t\tnext.add(availableId);\n\t\t\t\t\t\t\tvisited.add(availableId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextIds = next;\n\t\t\t}\n\t\t\treturn [];\n\t\t}\n\t\tgetLinkerColumnsForAxes({ from: sourceAxes, to: targetAxes, throwWhenNoLinkExists = true }) {\n\t\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\treturn Array.from(new Map(LinkerMap.getAxesRoots(targetAxes).map(LinkerMap.getLinkerKeyFromAxisSpec).flatMap((targetKey) => {\n\t\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\t\tif (!linkers.length && throwWhenNoLinkExists) throw Error(`Unable to find linker column for ${targetKey}`);\n\t\t\t\treturn linkers;\n\t\t\t})).values());\n\t\t}\n\t\t/** Get list of axisSpecs from keys of linker columns map */\n\t\tgetAxesListFromKeysList(keys) {\n\t\t\treturn Array.from(new Map(keys.flatMap((key) => this.data.get(key)?.keyAxesSpec ?? []).map((axis) => [canonicalizeJson(getAxisId(axis)), axis])).values());\n\t\t}\n\t\t/** Get axes of target axes that are impossible to be linked to source axes with current linker map */\n\t\tgetNonLinkableAxes(sourceAxes, targetAxes) {\n\t\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\tconst targetKeys = targetAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\treturn Array.from(new Map(targetAxes.filter((_targetAxis, idx) => {\n\t\t\t\tconst targetKey = targetKeys[idx];\n\t\t\t\treturn !startKeys.some((startKey) => this.searchLinkerPath(startKey, targetKey).length);\n\t\t\t}).flatMap((axis) => getArrayFromAxisTree(getAxesTree(axis)).map((axis) => [canonicalizeJson(getAxisId(axis)), axis]))).values());\n\t\t}\n\t\t/** Get all axes that can be connected to sourceAxes by linkers */\n\t\tgetReachableByLinkersAxesFromAxesNormalized(sourceAxes, matchAxisIdFn) {\n\t\t\tlet startKeys = [];\n\t\t\tif (matchAxisIdFn) {\n\t\t\t\tconst sourceAxisIdsGrouped = sourceAxes.map((axis) => getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t\t\t\tfor (const sourceAxisIdsGroup of sourceAxisIdsGrouped) {\n\t\t\t\t\tconst matched = this.keyAxesIds.find((keyIds) => keyIds.every((linkerKeyAxisId) => sourceAxisIdsGroup.find((sourceAxisId) => matchAxisIdFn(linkerKeyAxisId, sourceAxisId))));\n\t\t\t\t\tif (matched) startKeys.push(canonicalizeJson(matched));\n\t\t\t\t}\n\t\t\t} else startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\tconst availableKeys = this.searchAvailableAxesKeys(startKeys);\n\t\t\treturn this.getAxesListFromKeysList([...availableKeys]);\n\t\t}\n\t\tgetReachableByLinkersAxesFromAxes(sourceAxes, matchAxisIdFn) {\n\t\t\treturn this.getReachableByLinkersAxesFromAxesNormalized(getNormalizedAxesList(sourceAxes), matchAxisIdFn);\n\t\t}\n\t\tstatic getLinkerKeyFromAxisSpec(axis) {\n\t\t\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t\t}\n\t\t/** Split array of axes into several arrays by parents: axes of one group are parents for each other.\n\t\tThere are no order inside every group. */\n\t\tstatic getAxesGroups(axesSpec) {\n\t\t\tswitch (axesSpec.length) {\n\t\t\t\tcase 0: return [];\n\t\t\t\tcase 1: return [[axesSpec[0]]];\n\t\t\t\tdefault: break;\n\t\t\t}\n\t\t\tconst axisKeys = axesSpec.map((spec) => canonicalizeJson(getAxisId(spec)));\n\t\t\tconst axisParentsIdxs = axesSpec.map((spec) => new Set(spec.parentAxesSpec.map((spec) => canonicalizeJson(getAxisId(spec))).map((el) => {\n\t\t\t\tconst idx = axisKeys.indexOf(el);\n\t\t\t\tif (idx === -1) throw new Error(`malformed axesSpec: ${JSON.stringify(axesSpec)}, unable to locate parent ${el}`);\n\t\t\t\treturn idx;\n\t\t\t})));\n\t\t\tconst allIdxs = [...axesSpec.keys()];\n\t\t\tconst groups = [];\n\t\t\tconst usedIdxs = /* @__PURE__ */ new Set();\n\t\t\tlet nextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\t\twhile (nextFreeEl !== void 0) {\n\t\t\t\tconst currentGroup = [nextFreeEl];\n\t\t\t\tusedIdxs.add(nextFreeEl);\n\t\t\t\tlet nextElsOfCurrentGroup = [nextFreeEl];\n\t\t\t\twhile (nextElsOfCurrentGroup.length) {\n\t\t\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\t\t\tfor (const groupIdx of nextElsOfCurrentGroup) {\n\t\t\t\t\t\tconst groupElementParents = axisParentsIdxs[groupIdx];\n\t\t\t\t\t\tallIdxs.forEach((idx) => {\n\t\t\t\t\t\t\tif (idx === groupIdx || usedIdxs.has(idx)) return;\n\t\t\t\t\t\t\tif (axisParentsIdxs[idx].has(groupIdx) || groupElementParents.has(idx)) {\n\t\t\t\t\t\t\t\tcurrentGroup.push(idx);\n\t\t\t\t\t\t\t\tnext.add(idx);\n\t\t\t\t\t\t\t\tusedIdxs.add(idx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnextElsOfCurrentGroup = [...next];\n\t\t\t\t}\n\t\t\t\tgroups.push([...currentGroup]);\n\t\t\t\tnextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\t\t}\n\t\t\treturn groups.map((group) => group.map((idx) => axesSpec[idx]));\n\t\t}\n\t\t/** Get all axes that are not parents of any other axis */\n\t\tstatic getAxesRoots(axes) {\n\t\t\tconst parentsSet = new Set(axes.flatMap((axis) => axis.parentAxesSpec).map((spec) => canonicalizeJson(getAxisId(spec))));\n\t\t\treturn axes.filter((axis) => !parentsSet.has(canonicalizeJson(getAxisId(axis))));\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/driver.js\n\tfunction assert() {}\n\tassert();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js\n\t/**\n\t* Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`\n\t* version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on\n\t* older desktop apps.\n\t*/\n\tconst REQUIRES_PFRAMES_VERSION = 1001031;\n\tstringType().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand(\"PlId\");\n\tobjectType({\n\t\t__isRef: literalType(true).describe(\"Crucial marker for the block dependency tree reconstruction\"),\n\t\tblockId: stringType().describe(\"Upstream block id\"),\n\t\tname: stringType().describe(\"Name of the output provided to the upstream block's output context\"),\n\t\trequireEnrichments: literalType(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\t}).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\t/**\n\t* Type guard to check if a value is a PlRef.\n\t*\n\t* @param value - The value to check.\n\t* @returns True if the value is a PlRef, false otherwise.\n\t*/\n\tfunction isPlRef(value) {\n\t\treturn typeof value === \"object\" && value !== null && \"__isRef\" in value && value.__isRef === true && \"blockId\" in value && \"name\" in value;\n\t}\n\t/**\n\t* Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n\t* requireEnrichments property.\n\t*\n\t* @param ref - The original PlRef object.\n\t* @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n\t* to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n\t* @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n\t*/\n\tfunction withEnrichments(ref, requireEnrichments = true) {\n\t\tif (requireEnrichments) return {\n\t\t\t...ref,\n\t\t\trequireEnrichments: true\n\t\t};\n\t\telse {\n\t\t\tconst { requireEnrichments: _, ...rest } = ref;\n\t\t\treturn rest;\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js\n\tfunction mapValueInVOE(voe, cb) {\n\t\treturn voe.ok ? {\n\t\t\tok: true,\n\t\t\tvalue: cb(voe.value)\n\t\t} : voe;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/resource_types.js\n\t/** Well-known resource type names used across the platform. */\n\tconst ResourceTypeName = {\n\t\tStreamManager: \"StreamManager\",\n\t\tStdMap: \"StdMap\",\n\t\tStdMapSlash: \"std/map\",\n\t\tEphStdMap: \"EphStdMap\",\n\t\tPFrame: \"PFrame\",\n\t\tParquetChunk: \"ParquetChunk\",\n\t\tBContext: \"BContext\",\n\t\tBlockPackCustom: \"BlockPackCustom\",\n\t\tBinaryMap: \"BinaryMap\",\n\t\tBinaryValue: \"BinaryValue\",\n\t\tBlobMap: \"BlobMap\",\n\t\tBResolveSingle: \"BResolveSingle\",\n\t\tBResolveSingleNoResult: \"BResolveSingleNoResult\",\n\t\tBQueryResult: \"BQueryResult\",\n\t\tTengoTemplate: \"TengoTemplate\",\n\t\tTengoLib: \"TengoLib\",\n\t\tSoftwareInfo: \"SoftwareInfo\",\n\t\tDummy: \"Dummy\",\n\t\tJsonResourceError: \"json/resourceError\",\n\t\tJsonObject: \"json/object\",\n\t\tJsonGzObject: \"json-gz/object\",\n\t\tJsonString: \"json/string\",\n\t\tJsonArray: \"json/array\",\n\t\tJsonNumber: \"json/number\",\n\t\tBContextEnd: \"BContextEnd\",\n\t\tFrontendFromUrl: \"Frontend/FromUrl\",\n\t\tFrontendFromFolder: \"Frontend/FromFolder\",\n\t\tBObjectSpec: \"BObjectSpec\",\n\t\tBlob: \"Blob\",\n\t\tNull: \"Null\",\n\t\tBinary: \"binary\",\n\t\tLSProvider: \"LSProvider\",\n\t\tWorkingDirectory: \"WorkingDirectory\",\n\t\tUserProject: \"UserProject\",\n\t\tProjects: \"Projects\",\n\t\tClientRoot: \"ClientRoot\"\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js\n\tconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\tconst { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {\n\t\tconst typeMap = /* @__PURE__ */ new Map();\n\t\tconst modelMethodsMap = /* @__PURE__ */ new Map();\n\t\tconst uiMethodsMap = /* @__PURE__ */ new Map();\n\t\treturn {\n\t\t\tservice() {\n\t\t\t\treturn (options) => {\n\t\t\t\t\tconst { name, type, modelMethods, uiMethods } = options;\n\t\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\t\tif (typeMap.has(name)) throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n\t\t\t\t\ttypeMap.set(name, type);\n\t\t\t\t\tmodelMethodsMap.set(name, modelMethods);\n\t\t\t\t\tuiMethodsMap.set(name, uiMethods);\n\t\t\t\t\treturn name;\n\t\t\t\t};\n\t\t\t},\n\t\t\tisNodeService(id) {\n\t\t\t\treturn typeMap.get(id) === \"node\";\n\t\t\t},\n\t\t\tisWasmService(id) {\n\t\t\t\treturn typeMap.get(id) === \"wasm\";\n\t\t\t},\n\t\t\tisMainService(id) {\n\t\t\t\treturn typeMap.get(id) === \"main\";\n\t\t\t},\n\t\t\tgetServiceKind(id) {\n\t\t\t\treturn typeMap.get(id);\n\t\t\t},\n\t\t\tgetServiceModelMethods(id) {\n\t\t\t\treturn modelMethodsMap.get(id) ?? [];\n\t\t\t},\n\t\t\tgetServiceUiMethods(id) {\n\t\t\t\treturn uiMethodsMap.get(id) ?? [];\n\t\t\t}\n\t\t};\n\t})();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js\n\tconst Services = {\n\t\tPFrameSpec: service()({\n\t\t\ttype: \"wasm\",\n\t\t\tname: \"pframeSpec\",\n\t\t\tmodelMethods: [\n\t\t\t\t\"createSpecFrame\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"discoverColumns\",\n\t\t\t\t\"deleteColumn\",\n\t\t\t\t\"evaluateQuery\",\n\t\t\t\t\"buildQuery\",\n\t\t\t\t\"expandAxes\",\n\t\t\t\t\"collapseAxes\",\n\t\t\t\t\"findAxis\",\n\t\t\t\t\"findTableColumn\"\n\t\t\t],\n\t\t\tuiMethods: [\n\t\t\t\t\"createSpecFrame\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"discoverColumns\",\n\t\t\t\t\"deleteColumn\",\n\t\t\t\t\"evaluateQuery\",\n\t\t\t\t\"buildQuery\",\n\t\t\t\t\"expandAxes\",\n\t\t\t\t\"collapseAxes\",\n\t\t\t\t\"findAxis\",\n\t\t\t\t\"findTableColumn\"\n\t\t\t]\n\t\t}),\n\t\tPFrame: service()({\n\t\t\ttype: \"node\",\n\t\t\tname: \"pframe\",\n\t\t\tmodelMethods: [\n\t\t\t\t\"createPFrame\",\n\t\t\t\t\"createPTable\",\n\t\t\t\t\"createPTableV2\"\n\t\t\t],\n\t\t\tuiMethods: [\n\t\t\t\t\"findColumns\",\n\t\t\t\t\"getColumnSpec\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"calculateTableData\",\n\t\t\t\t\"getUniqueValues\",\n\t\t\t\t\"getShape\",\n\t\t\t\t\"getSpec\",\n\t\t\t\t\"getData\",\n\t\t\t\t\"writePTableToFs\"\n\t\t\t]\n\t\t}),\n\t\tDialog: service()({\n\t\t\ttype: \"main\",\n\t\t\tname: \"dialog\",\n\t\t\tmodelMethods: [],\n\t\t\tuiMethods: [\"showSaveDialog\"]\n\t\t})\n\t};\n\tObject.keys(Services).map((key) => `requires${key}`);\n\t/**\n\t* Resolve which services are required by the given feature flags.\n\t* Accepts Record<string, unknown> so it works with both BlockCodeKnownFeatureFlags\n\t* (from middle layer) and Zod-parsed records (from preload).\n\t*/\n\tfunction resolveRequiredServices(flags) {\n\t\tif (!flags) return [];\n\t\treturn Object.keys(Services).filter((key) => flags[`requires${key}`] === true).map((key) => Services[key]);\n\t}\n\tObject.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js\n\tfunction buildMethodMap(pick) {\n\t\tconst result = {};\n\t\tfor (const id of Object.values(Services)) result[id] = [...pick(id)];\n\t\treturn result;\n\t}\n\tbuildMethodMap(getServiceUiMethods);\n\tbuildMethodMap(getServiceModelMethods);\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/accessor.js\n\tfunction ifDef(value, cb) {\n\t\treturn value === void 0 ? void 0 : cb(value);\n\t}\n\t/** Represent resource tree node accessor */\n\tvar TreeNodeAccessor = class TreeNodeAccessor {\n\t\tconstructor(handle, resolvePath) {\n\t\t\tthis.handle = handle;\n\t\t\tthis.resolvePath = resolvePath;\n\t\t}\n\t\tresolve(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Input\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveOutput(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Output\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveInput(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Input\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveAny(...steps) {\n\t\t\treturn this.resolveWithCommon({}, ...steps);\n\t\t}\n\t\tresolveWithCommon(commonOptions, ...steps) {\n\t\t\tconst resolvePath = [...this.resolvePath, ...steps.map((step) => typeof step === \"string\" ? step : step.field)];\n\t\t\treturn ifDef(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps), (accessor) => new TreeNodeAccessor(accessor, resolvePath));\n\t\t}\n\t\tget resourceType() {\n\t\t\treturn getCfgRenderCtx().getResourceType(this.handle);\n\t\t}\n\t\tgetInputsLocked() {\n\t\t\treturn getCfgRenderCtx().getInputsLocked(this.handle);\n\t\t}\n\t\tgetOutputsLocked() {\n\t\t\treturn getCfgRenderCtx().getOutputsLocked(this.handle);\n\t\t}\n\t\tgetIsReadyOrError() {\n\t\t\treturn getCfgRenderCtx().getIsReadyOrError(this.handle);\n\t\t}\n\t\tgetIsFinal() {\n\t\t\treturn getCfgRenderCtx().getIsFinal(this.handle);\n\t\t}\n\t\tgetError() {\n\t\t\tconst resolvePath = [...this.resolvePath, \"error\"];\n\t\t\treturn ifDef(getCfgRenderCtx().getError(this.handle), (accsessor) => new TreeNodeAccessor(accsessor, resolvePath));\n\t\t}\n\t\tlistInputFields() {\n\t\t\treturn getCfgRenderCtx().listInputFields(this.handle);\n\t\t}\n\t\tlistOutputFields() {\n\t\t\treturn getCfgRenderCtx().listOutputFields(this.handle);\n\t\t}\n\t\tlistDynamicFields() {\n\t\t\treturn getCfgRenderCtx().listDynamicFields(this.handle);\n\t\t}\n\t\tgetKeyValueBase64(key) {\n\t\t\treturn getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n\t\t}\n\t\tgetKeyValueAsString(key) {\n\t\t\treturn getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n\t\t}\n\t\tgetKeyValueAsJson(key) {\n\t\t\tconst content = this.getKeyValueAsString(key);\n\t\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\t\treturn JSON.parse(content);\n\t\t}\n\t\tgetDataBase64() {\n\t\t\treturn getCfgRenderCtx().getDataBase64(this.handle);\n\t\t}\n\t\tgetDataAsString() {\n\t\t\treturn getCfgRenderCtx().getDataAsString(this.handle);\n\t\t}\n\t\tgetDataAsJson() {\n\t\t\tconst content = this.getDataAsString();\n\t\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\t\treturn JSON.parse(content);\n\t\t}\n\t\t/**\n\t\t*\n\t\t*/\n\t\tgetPColumns(errorOnUnknownField = false, prefix = \"\") {\n\t\t\tconst result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n\t\t\tif (result === void 0) return void 0;\n\t\t\treturn Object.entries(result).map(([, obj]) => {\n\t\t\t\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\t\t\t\treturn obj;\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t*\n\t\t*/\n\t\tparsePObjectCollection(errorOnUnknownField = false, prefix = \"\") {\n\t\t\tconst pObjects = getCfgRenderCtx().parsePObjectCollection(this.handle, errorOnUnknownField, prefix, ...this.resolvePath);\n\t\t\tif (pObjects === void 0) return void 0;\n\t\t\tconst result = {};\n\t\t\tfor (const [key, value] of Object.entries(pObjects)) {\n\t\t\t\tconst resolvePath = [...this.resolvePath, key];\n\t\t\t\tresult[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tgetFileContentAsBase64(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));\n\t\t}\n\t\tgetFileContentAsString(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));\n\t\t}\n\t\tgetFileContentAsJson(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range)).mapDefined((v) => JSON.parse(v));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileContentAsBase64\n\t\t*/\n\t\tgetBlobContentAsBase64() {\n\t\t\treturn this.getFileContentAsBase64();\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileContentAsString\n\t\t*/\n\t\tgetBlobContentAsString() {\n\t\t\treturn this.getFileContentAsString();\n\t\t}\n\t\t/**\n\t\t* @returns downloaded file handle\n\t\t*/\n\t\tgetFileHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileHandle\n\t\t*/\n\t\tgetDownloadedBlobHandle() {\n\t\t\treturn this.getFileHandle();\n\t\t}\n\t\t/**\n\t\t* @returns downloaded file handle\n\t\t*/\n\t\tgetRemoteFileHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getRemoteFileHandle\n\t\t*/\n\t\tgetOnDemandBlobHandle() {\n\t\t\treturn this.getRemoteFileHandle();\n\t\t}\n\t\t/**\n\t\t* @returns the url to the extracted folder\n\t\t*/\n\t\textractArchiveAndGetURL(format) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));\n\t\t}\n\t\tgetImportProgress() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n\t\t}\n\t\tgetLastLogs(nLines) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n\t\t}\n\t\tgetProgressLog(patternToSearch) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n\t\t}\n\t\tgetProgressLogWithInfo(patternToSearch) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));\n\t\t}\n\t\tgetLogHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n\t\t}\n\t\tallFieldsResolved(fieldType = \"Input\") {\n\t\t\tswitch (fieldType) {\n\t\t\t\tcase \"Input\": return this.getInputsLocked() && this.listInputFields().every((field) => this.resolve({\n\t\t\t\t\tfield,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t}) !== void 0);\n\t\t\t\tcase \"Output\": return this.getOutputsLocked() && this.listOutputFields().every((field) => this.resolve({\n\t\t\t\t\tfield,\n\t\t\t\t\tassertFieldType: \"Output\"\n\t\t\t\t}) !== void 0);\n\t\t\t}\n\t\t}\n\t\tmapFields(_mapping, _ops) {\n\t\t\tconst { fieldType, requireLocked, skipUnresolved } = {\n\t\t\t\tfieldType: \"Input\",\n\t\t\t\trequireLocked: true,\n\t\t\t\tskipUnresolved: false,\n\t\t\t\t..._ops\n\t\t\t};\n\t\t\tconst mapping = _mapping;\n\t\t\tif (requireLocked) {\n\t\t\t\tif (fieldType === \"Input\" && !this.getInputsLocked()) return void 0;\n\t\t\t\tif (fieldType === \"Output\" && !this.getOutputsLocked()) return void 0;\n\t\t\t}\n\t\t\tlet fieldEntries = (fieldType === \"Input\" ? this.listInputFields() : fieldType === \"Output\" ? this.listOutputFields() : this.listDynamicFields()).map((field) => [field, this.resolve({\n\t\t\t\tfield,\n\t\t\t\tassertFieldType: fieldType\n\t\t\t})]);\n\t\t\tif (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== void 0);\n\t\t\treturn fieldEntries.map(([name, value]) => mapping(name, value));\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/internal.js\n\tconst StagingAccessorName = \"staging\";\n\tconst MainAccessorName = \"main\";\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js\n\tfunction filterDataInfoEntries(dataInfoEntries, axisFilters) {\n\t\tconst sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\t\tconst { type } = dataInfoEntries;\n\t\tswitch (type) {\n\t\t\tcase \"Json\": {\n\t\t\t\tconst { keyLength } = dataInfoEntries;\n\t\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\t\tbreak;\n\t\t\t}\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": {\n\t\t\t\tconst { partitionKeyLength } = dataInfoEntries;\n\t\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\t\tbreak;\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unsupported data info type: ${type}`);\n\t\t}\n\t\tconst keyMatchesFilters = (key) => {\n\t\t\tfor (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n\t\t\treturn true;\n\t\t};\n\t\tconst removeFilteredAxes = (key) => {\n\t\t\tconst newKey = [...key];\n\t\t\tfor (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\t\t\treturn newKey;\n\t\t};\n\t\tswitch (dataInfoEntries.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfoEntries.keyLength - axisFilters.length,\n\t\t\t\tdata: dataInfoEntries.data.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/function/flow.mjs\n\tfunction flow(...funcs) {\n\t\treturn function(...args) {\n\t\t\tlet result = funcs.length ? funcs[0].apply(this, args) : args[0];\n\t\t\tfor (let i = 1; i < funcs.length; i++) result = funcs[i].call(this, result);\n\t\t\treturn result;\n\t\t};\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs\n\tfunction isTypedArray$1(x) {\n\t\treturn ArrayBuffer.isView(x) && !(x instanceof DataView);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs\n\tfunction getTag(value) {\n\t\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\t\treturn Object.prototype.toString.call(value);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isFunction.mjs\n\tfunction isFunction(value) {\n\t\treturn typeof value === \"function\";\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isLength.mjs\n\tfunction isLength(value) {\n\t\treturn Number.isSafeInteger(value) && value >= 0;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isNil.mjs\n\tfunction isNil(x) {\n\t\treturn x == null;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js\n\tconst DISTANCE_PENALTY = .001;\n\tconst LABEL_TYPE = \"__LABEL__\";\n\tconst LABEL_TYPE_FULL = \"__LABEL__@1\";\n\tconst LINKER_TYPE = \"__LINKER__\";\n\tconst LINKER_TYPE_FULL = \"__LINKER__@1\";\n\tconst HIT_QUAL_TYPE = \"__HIT_QUAL__\";\n\tconst ANCHOR_QUAL_TYPE_PREFIX = \"__ANCHOR_QUAL__:\";\n\tfunction isAnchorQualType(t) {\n\t\treturn t.startsWith(ANCHOR_QUAL_TYPE_PREFIX);\n\t}\n\tfunction isSyntheticType(t) {\n\t\treturn t === LINKER_TYPE || t === HIT_QUAL_TYPE || isAnchorQualType(t);\n\t}\n\tfunction deriveDistinctLabels(values, options = {}) {\n\t\tconst forceTraceElements = options.forceTraceElements !== void 0 && options.forceTraceElements.length > 0 ? new Set(options.forceTraceElements) : void 0;\n\t\tconst separator = options.separator ?? \" / \";\n\t\tconst records = values.map((v, i) => enrichRecord(v, i, options));\n\t\tconst stats = collectTypeStats(records);\n\t\tconst hasAnySynthetic = records.some((r) => r.fullTrace.some((ft) => isSyntheticType(ft.type)));\n\t\tconst labelForced = (options.includeNativeLabel === true || hasAnySynthetic) && stats.countByType.has(LABEL_TYPE_FULL);\n\t\tconst linkerForced = stats.countByType.get(LINKER_TYPE_FULL) === values.length;\n\t\tconst forcedSet = /* @__PURE__ */ new Set();\n\t\tif (labelForced) forcedSet.add(LABEL_TYPE_FULL);\n\t\tif (linkerForced) forcedSet.add(LINKER_TYPE_FULL);\n\t\tconst { mainTypes, secondaryTypes } = classifyTypes(stats, values.length);\n\t\tconst build = (typeSet, force) => buildLabels(records, typeSet, forceTraceElements, separator, force);\n\t\tif (mainTypes.length === 0) {\n\t\t\tif (secondaryTypes.length !== 0) throw new Error(\"Non-empty secondary types list while main types list is empty.\");\n\t\t\treturn build(new Set([LABEL_TYPE_FULL]), true) ?? throwError(\"Failed to derive labels using native column labels\");\n\t\t}\n\t\tlet includedCount = 0;\n\t\tlet additionalType = -1;\n\t\twhile (includedCount < mainTypes.length) {\n\t\t\tconst currentSet = new Set(forcedSet);\n\t\t\tfor (let i = 0; i < includedCount; ++i) currentSet.add(mainTypes[i]);\n\t\t\tif (additionalType >= 0) currentSet.add(mainTypes[additionalType]);\n\t\t\tconst candidateResult = build(currentSet, false);\n\t\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) === values.length) return build(minimizeTypeSet(currentSet, records, stats, forceTraceElements, forcedSet, separator), false) ?? throwError(\"Failed to derive unique labels\");\n\t\t\tadditionalType++;\n\t\t\tif (additionalType >= mainTypes.length) {\n\t\t\t\tincludedCount++;\n\t\t\t\tadditionalType = includedCount;\n\t\t\t}\n\t\t}\n\t\treturn build(minimizeTypeSet(new Set([\n\t\t\t...forcedSet,\n\t\t\t...mainTypes,\n\t\t\t...secondaryTypes\n\t\t]), records, stats, forceTraceElements, forcedSet, separator), true) ?? throwError(\"Failed to derive unique labels\");\n\t}\n\tfunction extractEntryParts(entry) {\n\t\tif (!(\"spec\" in entry && typeof entry.spec === \"object\")) return {\n\t\t\tspec: entry,\n\t\t\textraTrace: void 0,\n\t\t\tlinkerPath: void 0,\n\t\t\tqualifications: void 0\n\t\t};\n\t\treturn {\n\t\t\tspec: entry.spec,\n\t\t\textraTrace: entry.extraTrace,\n\t\t\tlinkerPath: entry.linkerPath,\n\t\t\tqualifications: entry.qualifications\n\t\t};\n\t}\n\tfunction formatQualification$1(q) {\n\t\tconst ctx = q.contextDomain ?? {};\n\t\tconst keys = Object.keys(ctx);\n\t\tif (keys.length === 0) return q.axis.name;\n\t\tconst pairs = keys.map((k) => `${k}=${ctx[k]}`).join(\", \");\n\t\treturn Object.prototype.hasOwnProperty.call(ctx, q.axis.name) ? pairs : `${q.axis.name} ${pairs}`;\n\t}\n\tfunction formatQualifications(qs) {\n\t\treturn qs.map(formatQualification$1).join(\"; \");\n\t}\n\tfunction computeStepLabel(step, stepIndex, formatters) {\n\t\tconst base = (readAnnotation(step.spec, Annotation.LinkLabel) ?? readAnnotation(step.spec, Annotation.Label))?.trim();\n\t\tif (isNil(base) || base.length === 0) return void 0;\n\t\tif (step.qualifications === void 0 || step.qualifications.length === 0) return base;\n\t\tconst qualText = isFunction(formatters?.linkerStepQualification) ? formatters.linkerStepQualification(step.qualifications, stepIndex, step.spec) : `[${formatQualifications(step.qualifications)}]`;\n\t\treturn isNil(qualText) ? base : `${base} ${qualText}`;\n\t}\n\tfunction buildFullTrace(trace) {\n\t\tconst result = [];\n\t\tconst occurrences = /* @__PURE__ */ new Map();\n\t\tfor (let i = trace.length - 1; i >= 0; --i) {\n\t\t\tconst entry = trace[i];\n\t\t\tconst occurrenceIndex = (occurrences.get(entry.type) ?? 0) + 1;\n\t\t\toccurrences.set(entry.type, occurrenceIndex);\n\t\t\tresult.push({\n\t\t\t\t...entry,\n\t\t\t\tfullType: `${entry.type}@${occurrenceIndex}`,\n\t\t\t\toccurrenceIndex\n\t\t\t});\n\t\t}\n\t\tresult.reverse();\n\t\treturn result;\n\t}\n\tfunction enrichRecord(value, index, options) {\n\t\tconst { spec, extraTrace, linkerPath, qualifications } = extractEntryParts(value);\n\t\tconst formatters = options.formatters;\n\t\tconst rawLabel = readAnnotation(spec, Annotation.Label);\n\t\tconst traceStr = readAnnotation(spec, Annotation.Trace);\n\t\tconst baseTrace = traceStr ? parseJson(traceStr) ?? [] : [];\n\t\tconst prefixExtra = extraTrace?.filter((e) => e.position === \"prefix\") ?? [];\n\t\tconst suffixExtra = extraTrace?.filter((e) => e.position !== \"prefix\") ?? [];\n\t\tconst trace = [\n\t\t\t...prefixExtra,\n\t\t\t...baseTrace,\n\t\t\t...suffixExtra\n\t\t];\n\t\tif (!isNil(rawLabel)) {\n\t\t\tconst label = isFunction(formatters?.native) ? formatters.native(rawLabel, spec, index) : rawLabel;\n\t\t\tif (!isNil(label)) {\n\t\t\t\tconst labelEntry = {\n\t\t\t\t\tlabel,\n\t\t\t\t\ttype: LABEL_TYPE,\n\t\t\t\t\timportance: -2\n\t\t\t\t};\n\t\t\t\tif (options.addLabelAsSuffix === true) trace.push(labelEntry);\n\t\t\t\telse trace.splice(0, 0, labelEntry);\n\t\t\t}\n\t\t}\n\t\tif (linkerPath !== void 0 && linkerPath.length > 0) {\n\t\t\tconst stepLabels = linkerPath.map((step, i) => computeStepLabel(step, i, formatters)).filter((s) => !isNil(s));\n\t\t\tif (stepLabels.length > 0) {\n\t\t\t\tconst linkerText = isFunction(formatters?.linker) ? formatters.linker(stepLabels, spec, index) : `via ${stepLabels.join(\" > \")}`;\n\t\t\t\tif (!isNil(linkerText)) trace.push({\n\t\t\t\t\ttype: LINKER_TYPE,\n\t\t\t\t\tlabel: linkerText,\n\t\t\t\t\timportance: -10\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (qualifications !== void 0 && qualifications.forQueries !== void 0) {\n\t\t\tfor (const [anchorId, qs] of Object.entries(qualifications.forQueries)) {\n\t\t\t\tif (qs.length === 0) continue;\n\t\t\t\tconst anchorText = isFunction(formatters?.anchorQualification) ? formatters.anchorQualification(anchorId, qs, spec, index) : `[${anchorId}: ${formatQualifications(qs)}]`;\n\t\t\t\tif (isNil(anchorText)) continue;\n\t\t\t\ttrace.push({\n\t\t\t\t\ttype: `${ANCHOR_QUAL_TYPE_PREFIX}${anchorId}`,\n\t\t\t\t\tlabel: anchorText,\n\t\t\t\t\timportance: -11\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (qualifications.forHit !== void 0 && qualifications.forHit.length > 0) {\n\t\t\t\tconst hitText = isFunction(formatters?.hitQualification) ? formatters.hitQualification(qualifications.forHit, spec, index) : `[${formatQualifications(qualifications.forHit)}]`;\n\t\t\t\tif (!isNil(hitText)) trace.push({\n\t\t\t\t\ttype: HIT_QUAL_TYPE,\n\t\t\t\t\tlabel: hitText,\n\t\t\t\t\timportance: -12\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn { fullTrace: buildFullTrace(trace) };\n\t}\n\tfunction collectTypeStats(records) {\n\t\tconst importances = /* @__PURE__ */ new Map();\n\t\tconst countByType = /* @__PURE__ */ new Map();\n\t\tfor (const record of records) for (let i = 0; i < record.fullTrace.length; i++) {\n\t\t\tconst { fullType, importance: rawImportance } = record.fullTrace[i];\n\t\t\tconst importance = rawImportance ?? 0;\n\t\t\tconst distance = (record.fullTrace.length - i) * DISTANCE_PENALTY;\n\t\t\tcountByType.set(fullType, (countByType.get(fullType) ?? 0) + 1);\n\t\t\timportances.set(fullType, Math.max(importances.get(fullType) ?? Number.NEGATIVE_INFINITY, importance - distance));\n\t\t}\n\t\treturn {\n\t\t\timportances,\n\t\t\tcountByType\n\t\t};\n\t}\n\tfunction classifyTypes(stats, totalRecords) {\n\t\tconst sorted = [...stats.importances].sort(([, i1], [, i2]) => i2 - i1);\n\t\tconst mainTypes = [];\n\t\tconst secondaryTypes = [];\n\t\tfor (const [typeName] of sorted) if (typeName.endsWith(\"@1\") || stats.countByType.get(typeName) === totalRecords) mainTypes.push(typeName);\n\t\telse secondaryTypes.push(typeName);\n\t\treturn {\n\t\t\tmainTypes,\n\t\t\tsecondaryTypes\n\t\t};\n\t}\n\tfunction buildLabels(records, includedTypes, forceTraceElements, separator, force) {\n\t\tconst result = [];\n\t\tfor (const r of records) {\n\t\t\tconst traceParts = [];\n\t\t\tconst anchorParts = [];\n\t\t\tlet linkerLabel;\n\t\t\tlet hitLabel;\n\t\t\tfor (const ft of r.fullTrace) {\n\t\t\t\tif (!(includedTypes.has(ft.fullType) || forceTraceElements?.has(ft.type))) continue;\n\t\t\t\tif (ft.type === LINKER_TYPE) linkerLabel = ft.label;\n\t\t\t\telse if (ft.type === HIT_QUAL_TYPE) hitLabel = ft.label;\n\t\t\t\telse if (isAnchorQualType(ft.type)) anchorParts.push(ft.label);\n\t\t\t\telse traceParts.push(ft.label);\n\t\t\t}\n\t\t\tif (traceParts.length === 0 && anchorParts.length === 0 && linkerLabel === void 0 && hitLabel === void 0) {\n\t\t\t\tif (!force) return void 0;\n\t\t\t\tresult.push(\"Unlabeled\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet label = traceParts.join(separator);\n\t\t\tconst append = (part) => {\n\t\t\t\tlabel = label.length === 0 ? part : `${label} ${part}`;\n\t\t\t};\n\t\t\tif (linkerLabel !== void 0) append(linkerLabel);\n\t\t\tfor (const a of anchorParts) append(a);\n\t\t\tif (hitLabel !== void 0) append(hitLabel);\n\t\t\tresult.push(label);\n\t\t}\n\t\treturn result;\n\t}\n\tfunction countUniqueLabels(result) {\n\t\tif (result === void 0) return 0;\n\t\treturn new Set(result).size;\n\t}\n\tfunction minimizeTypeSet(typeSet, records, stats, forceTraceElements, forcedSet, separator) {\n\t\tconst initialResult = buildLabels(records, typeSet, forceTraceElements, separator, false);\n\t\tif (initialResult === void 0) return typeSet;\n\t\tconst targetCardinality = countUniqueLabels(initialResult);\n\t\tconst result = new Set(typeSet);\n\t\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\t\tfor (const typeToRemove of removable) {\n\t\t\tconst candidate = new Set(result);\n\t\t\tcandidate.delete(typeToRemove);\n\t\t\tconst candidateResult = buildLabels(records, candidate, forceTraceElements, separator, false);\n\t\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) >= targetCardinality) result.delete(typeToRemove);\n\t\t}\n\t\treturn result;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/util/label.js\n\t/** @deprecated Use deriveDistinctLabels */\n\tfunction deriveLabels(values, getSpec, options = {}) {\n\t\treturn deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({\n\t\t\tvalue: values[i],\n\t\t\tlabel\n\t\t}));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js\n\tconst PCD_PREFIX = \"PColumnData/\";\n\tconst RT_RESOURCE_MAP = PCD_PREFIX + \"ResourceMap\";\n\tconst RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + \"Partitioned/ResourceMap\";\n\tconst RT_JSON_PARTITIONED = PCD_PREFIX + \"JsonPartitioned\";\n\tconst RT_BINARY_PARTITIONED = PCD_PREFIX + \"BinaryPartitioned\";\n\tconst RT_PARQUET_PARTITIONED = PCD_PREFIX + \"ParquetPartitioned\";\n\tconst PCD_SUP_PREFIX = PCD_PREFIX + \"Partitioned/\";\n\tconst RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"JsonPartitioned\";\n\tconst RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"BinaryPartitioned\";\n\tconst RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"ParquetPartitioned\";\n\tconst removeIndexSuffix = (keyStr) => {\n\t\tif (keyStr.endsWith(\".index\")) return {\n\t\t\tbaseKey: keyStr.substring(0, keyStr.length - 6),\n\t\t\ttype: \"index\"\n\t\t};\n\t\telse if (keyStr.endsWith(\".values\")) return {\n\t\t\tbaseKey: keyStr.substring(0, keyStr.length - 7),\n\t\t\ttype: \"values\"\n\t\t};\n\t\telse throw new Error(`key must ends on .index/.values for binary p-column, got: ${keyStr}`);\n\t};\n\t/** Returns a list of all partition keys appeared in the p-column */\n\tfunction getPartitionKeysList(acc) {\n\t\tif (!acc) return void 0;\n\t\tconst rt = acc.resourceType.name;\n\t\tconst meta = acc.getDataAsJson();\n\t\tconst data = [];\n\t\tlet keyLength = 0;\n\t\tswitch (rt) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\t\tkeyLength = meta[\"keyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"partitionKeyLength\"] + meta[\"keyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_JSON_PARTITIONED:\n\t\t\tcase RT_BINARY_PARTITIONED:\n\t\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"partitionKeyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"superPartitionKeyLength\"] + meta[\"partitionKeyLength\"];\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch (rt) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\tcase RT_JSON_PARTITIONED:\n\t\t\tcase RT_BINARY_PARTITIONED:\n\t\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\t\tfor (let keyStr of acc.listInputFields()) {\n\t\t\t\t\tif (rt === \"PColumnData/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\t\tconst key = [...JSON.parse(keyStr)];\n\t\t\t\t\tdata.push(key);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst keyPrefix = [...JSON.parse(supKeyStr)];\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value !== void 0) for (let keyStr of value.listInputFields()) {\n\t\t\t\t\t\tif (rt === \"PColumnData/Partitioned/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\t\tdata.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn {\n\t\t\tdata,\n\t\t\tkeyLength\n\t\t};\n\t}\n\tfunction getUniquePartitionKeysForDataEntries(list) {\n\t\tif (list.type !== \"JsonPartitioned\" && list.type !== \"BinaryPartitioned\" && list.type !== \"ParquetPartitioned\") throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${list.type}`);\n\t\tconst { parts, partitionKeyLength } = list;\n\t\tconst result = [];\n\t\tfor (let i = 0; i < partitionKeyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\t\tfor (const part of parts) {\n\t\t\tconst key = part.key;\n\t\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\t\tfor (let i = 0; i < partitionKeyLength; ++i) result[i].add(key[i]);\n\t\t}\n\t\treturn result.map((s) => Array.from(s.values()));\n\t}\n\tfunction getUniquePartitionKeys(acc) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (isDataInfoEntries(acc)) return getUniquePartitionKeysForDataEntries(acc);\n\t\tconst list = getPartitionKeysList(acc);\n\t\tif (!list) return void 0;\n\t\tconst { data, keyLength } = list;\n\t\tconst result = [];\n\t\tfor (let i = 0; i < keyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\t\tfor (const l of data) {\n\t\t\tif (l.length !== keyLength) throw new Error(\"key length does not match partition length\");\n\t\t\tfor (let i = 0; i < keyLength; ++i) result[i].add(l[i]);\n\t\t}\n\t\treturn result.map((s) => Array.from(s.values()));\n\t}\n\t/**\n\t* Parses the PColumn data from a TreeNodeAccessor into a DataInfoEntries structure.\n\t* Returns undefined if any required data is missing.\n\t* Throws error on validation failures.\n\t*\n\t* @param acc - The TreeNodeAccessor containing PColumn data\n\t* @param keyPrefix - Optional key prefix for recursive calls\n\t* @returns DataInfoEntries representation of the PColumn data, or undefined if incomplete\n\t*/\n\tfunction parsePColumnData(acc, keyPrefix = []) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (!acc.getIsReadyOrError()) return void 0;\n\t\tconst resourceType = acc.resourceType.name;\n\t\tconst meta = acc.getDataAsJson();\n\t\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\t\tswitch (resourceType) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED: throw new Error(`Only data columns are supported, got: ${resourceType}`);\n\t\t\tcase RT_JSON_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_BINARY_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tconst baseKeys = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst suffix = removeIndexSuffix(keyStr);\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tlet entry = baseKeys.get(suffix.baseKey);\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\tentry = {};\n\t\t\t\t\t\tbaseKeys.set(suffix.baseKey, entry);\n\t\t\t\t\t}\n\t\t\t\t\tif (suffix.type === \"index\") entry.index = value;\n\t\t\t\t\telse entry.values = value;\n\t\t\t\t}\n\t\t\t\tfor (const [baseKeyStr, entry] of baseKeys.entries()) {\n\t\t\t\t\tif (!entry.index || !entry.values) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(baseKeyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\tindex: entry.index,\n\t\t\t\t\t\t\tvalues: entry.values\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_PARQUET_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_JSON_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"JsonPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"BinaryPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"ParquetPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unknown resource type: ${resourceType}`);\n\t\t}\n\t}\n\t/**\n\t* Converts or parses the input into DataInfoEntries format.\n\t\n\t* @param acc - The input data, which can be TreeNodeAccessor, DataInfoEntries, DataInfo, or undefined.\n\t* @returns The data in DataInfoEntries format, or undefined if the input was undefined or data is not ready.\n\t*/\n\tfunction convertOrParsePColumnData(acc) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (isDataInfoEntries(acc)) return acc;\n\t\tif (isDataInfo(acc)) return dataInfoToEntries(acc);\n\t\tif (acc instanceof TreeNodeAccessor) return parsePColumnData(acc);\n\t\tthrow new Error(`Unexpected input type: ${typeof acc}`);\n\t}\n\tfunction isPColumnReady(c) {\n\t\tconst isValues = (d) => Array.isArray(d);\n\t\tconst isAccessor = (d) => d instanceof TreeNodeAccessor;\n\t\tlet ready = true;\n\t\tconst data = typeof c.data === \"function\" ? c.data() : c.data;\n\t\tif (data == null) return false;\n\t\telse if (isAccessor(data)) ready &&= data.getIsReadyOrError();\n\t\telse if (isDataInfo(data)) visitDataInfo(data, (v) => ready &&= v.getIsReadyOrError());\n\t\telse if (!isValues(data)) throw Error(`unsupported column data type: ${data}`);\n\t\treturn ready;\n\t}\n\tfunction allPColumnsReady(columns) {\n\t\treturn columns.every(isPColumnReady);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js\n\tfunction isPColumnValues(value) {\n\t\tif (!Array.isArray(value)) return false;\n\t\tif (value.length === 0) return true;\n\t\tconst first = value[0];\n\t\treturn typeof first === \"object\" && first !== null && \"key\" in first && \"val\" in first;\n\t}\n\t/**\n\t* A simple implementation of {@link ColumnProvider} backed by a pre-defined array of columns.\n\t*/\n\tvar ArrayColumnProvider$1 = class {\n\t\tconstructor(columns) {\n\t\t\tthis.columns = columns;\n\t\t}\n\t\tselectColumns(selectors) {\n\t\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\t\treturn this.columns.filter((column) => predicate(column.spec));\n\t\t}\n\t};\n\tfunction splitFiltersToExtraTrace(splitFilters) {\n\t\tif (splitFilters === void 0) return void 0;\n\t\treturn splitFilters.map((filter) => ({\n\t\t\ttype: `split:${canonicalizeAxisId(filter.axisId)}`,\n\t\t\tlabel: filter.label,\n\t\t\timportance: 1e6\n\t\t}));\n\t}\n\tfunction splitFiltersToAxisFilter(splitFilters) {\n\t\tif (!splitFilters) return void 0;\n\t\treturn splitFilters.map((filter) => [filter.axisIdx, filter.value]);\n\t}\n\tfunction fallbackIdDeriver(originalId, axisFilters) {\n\t\tif (!axisFilters || axisFilters.length === 0) return originalId;\n\t\treturn (0, import_canonicalize.default)({\n\t\t\tid: originalId,\n\t\t\taxisFilters: [...axisFilters].sort((a, b) => a[0] - b[0])\n\t\t});\n\t}\n\t/** Checks if a selector object uses any anchor properties */\n\tfunction hasAnchors(selector) {\n\t\tif (!selector || typeof selector !== \"object\") return false;\n\t\tconst potentialAnchored = selector;\n\t\tconst hasAnchorValues = (obj) => obj && typeof obj === \"object\" && Object.values(obj).some((v) => typeof v === \"object\" && v !== null && \"anchor\" in v);\n\t\tconst domainHasAnchors = hasAnchorValues(potentialAnchored[\"domain\"]);\n\t\tconst contextDomainHasAnchors = hasAnchorValues(potentialAnchored[\"contextDomain\"]);\n\t\tconst axesHaveAnchors = potentialAnchored[\"axes\"] && Array.isArray(potentialAnchored[\"axes\"]) && potentialAnchored[\"axes\"].some((a) => typeof a === \"object\" && a !== null && \"anchor\" in a);\n\t\treturn !!potentialAnchored[\"domainAnchor\"] || !!potentialAnchored[\"contextDomainAnchor\"] || domainHasAnchors || contextDomainHasAnchors || axesHaveAnchors;\n\t}\n\t/**\n\t* Derives the indices of axes marked for splitting based on the selector.\n\t* Throws an error if splitting is requested alongside `partialAxesMatch`.\n\t*/\n\tfunction getSplitAxisIndices(selector) {\n\t\tif (typeof selector !== \"object\" || !(\"axes\" in selector) || selector.axes === void 0) return [];\n\t\tconst splitIndices = selector.axes.map((axis, index) => typeof axis === \"object\" && \"split\" in axis && axis.split === true ? index : -1).filter((index) => index !== -1);\n\t\tif (splitIndices.length > 0 && selector.partialAxesMatch !== void 0) throw new Error(\"Axis splitting is not supported when `partialAxesMatch` is defined.\");\n\t\tsplitIndices.sort((a, b) => a - b);\n\t\treturn splitIndices;\n\t}\n\tvar PColumnCollection = class {\n\t\tdefaultProviderStore = [];\n\t\tproviders = [new ArrayColumnProvider$1(this.defaultProviderStore)];\n\t\taxisLabelProviders = [];\n\t\tconstructor() {}\n\t\taddColumnProvider(provider) {\n\t\t\tthis.providers.push(provider);\n\t\t\treturn this;\n\t\t}\n\t\taddAxisLabelProvider(provider) {\n\t\t\tthis.axisLabelProviders.push(provider);\n\t\t\treturn this;\n\t\t}\n\t\taddColumns(columns) {\n\t\t\tthis.defaultProviderStore.push(...columns);\n\t\t\treturn this;\n\t\t}\n\t\taddColumn(column) {\n\t\t\tthis.defaultProviderStore.push(column);\n\t\t\treturn this;\n\t\t}\n\t\t/** Fetches labels for a given axis from the registered providers */\n\t\tfindLabels(axis) {\n\t\t\tfor (const provider of this.axisLabelProviders) {\n\t\t\t\tconst labels = provider.findLabels(axis);\n\t\t\t\tif (labels) return labels;\n\t\t\t}\n\t\t}\n\t\tgetUniversalEntries(predicateOrSelectors, opts) {\n\t\t\tconst { anchorCtx, labelOps: rawLabelOps, dontWaitAllData = false, overrideLabelAnnotation = false, exclude, enrichByLinkers = false } = opts ?? {};\n\t\t\tconst labelOps = {\n\t\t\t\t...overrideLabelAnnotation && rawLabelOps?.includeNativeLabel !== false ? { includeNativeLabel: true } : {},\n\t\t\t\t...rawLabelOps\n\t\t\t};\n\t\t\tlet excludePredicate = () => false;\n\t\t\tif (exclude) {\n\t\t\t\tconst excludePredicartes = (Array.isArray(exclude) ? exclude : [exclude]).map((selector) => {\n\t\t\t\t\tif (hasAnchors(selector)) {\n\t\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\t\treturn legacyColumnSelectorsToPredicate(resolveAnchors(anchorCtx.anchors, selector, opts));\n\t\t\t\t\t} else return legacyColumnSelectorsToPredicate(selector);\n\t\t\t\t});\n\t\t\t\texcludePredicate = (spec) => excludePredicartes.some((predicate) => predicate(spec));\n\t\t\t}\n\t\t\tconst selectorsArray = typeof predicateOrSelectors === \"function\" ? [predicateOrSelectors] : Array.isArray(predicateOrSelectors) ? predicateOrSelectors : [predicateOrSelectors];\n\t\t\tconst intermediateResults = [];\n\t\t\tconst selectedNativeIds = /* @__PURE__ */ new Set();\n\t\t\tfor (const rawSelector of selectorsArray) {\n\t\t\t\tconst usesAnchors = hasAnchors(rawSelector);\n\t\t\t\tlet currentSelector;\n\t\t\t\tif (usesAnchors) {\n\t\t\t\t\tif (!anchorCtx) throw new Error(\"Anchored selectors require an AnchoredIdDeriver to be provided in options.\");\n\t\t\t\t\tcurrentSelector = resolveAnchors(anchorCtx.anchors, rawSelector, opts);\n\t\t\t\t} else currentSelector = rawSelector;\n\t\t\t\tconst selectedIds = /* @__PURE__ */ new Set();\n\t\t\t\tconst selectedColumns = [];\n\t\t\t\tfor (const provider of this.providers) {\n\t\t\t\t\tconst providerColumns = provider.selectColumns(currentSelector);\n\t\t\t\t\tfor (const col of providerColumns) {\n\t\t\t\t\t\tif (excludePredicate(col.spec)) continue;\n\t\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\t\tconst nativeId = deriveNativeId(col.spec);\n\t\t\t\t\t\tif (selectedNativeIds.has(nativeId)) continue;\n\t\t\t\t\t\tselectedIds.add(col.id);\n\t\t\t\t\t\tselectedNativeIds.add(nativeId);\n\t\t\t\t\t\tselectedColumns.push(col);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectedColumns.length === 0) continue;\n\t\t\t\tconst splitAxisIdxs = getSplitAxisIndices(rawSelector);\n\t\t\t\tconst needsSplitting = splitAxisIdxs.length > 0;\n\t\t\t\tfor (const column of selectedColumns) {\n\t\t\t\t\tif (!isPColumnSpec(column.spec)) continue;\n\t\t\t\t\tconst originalSpec = column.spec;\n\t\t\t\t\tif (needsSplitting) {\n\t\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\t\tconst dataEntries = convertOrParsePColumnData(column.data);\n\t\t\t\t\t\tif (!dataEntries) {\n\t\t\t\t\t\t\tif (dontWaitAllData) continue;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\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\t\tconst uniqueKeys = getUniquePartitionKeys(dataEntries);\n\t\t\t\t\t\tconst maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n\t\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\t\tconst axesLabels = splitAxisIdxs.map((idx) => this.findLabels(getAxisId(originalSpec.axesSpec[idx])));\n\t\t\t\t\t\tconst keyCombinations = [];\n\t\t\t\t\t\tconst generateCombinations = (currentCombo, sAxisIdx) => {\n\t\t\t\t\t\t\tif (sAxisIdx >= splitAxisIdxs.length) {\n\t\t\t\t\t\t\t\tkeyCombinations.push([...currentCombo]);\n\t\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\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst axisIdx = splitAxisIdxs[sAxisIdx];\n\t\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\t\tconst axisValues = uniqueKeys[axisIdx];\n\t\t\t\t\t\t\tif (!axisValues || axisValues.length === 0) {\n\t\t\t\t\t\t\t\tkeyCombinations.length = 0;\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const val of axisValues) {\n\t\t\t\t\t\t\t\tcurrentCombo.push(val);\n\t\t\t\t\t\t\t\tgenerateCombinations(currentCombo, sAxisIdx + 1);\n\t\t\t\t\t\t\t\tcurrentCombo.pop();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tgenerateCombinations([], 0);\n\t\t\t\t\t\tif (keyCombinations.length === 0) continue;\n\t\t\t\t\t\tconst newAxesSpec = [...originalSpec.axesSpec];\n\t\t\t\t\t\tconst splitAxisOriginalIdxs = splitAxisIdxs.map((idx) => idx);\n\t\t\t\t\t\tfor (let i = splitAxisIdxs.length - 1; i >= 0; i--) newAxesSpec.splice(splitAxisIdxs[i], 1);\n\t\t\t\t\t\tconst adjustedSpec = {\n\t\t\t\t\t\t\t...originalSpec,\n\t\t\t\t\t\t\taxesSpec: newAxesSpec\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const keyCombo of keyCombinations) {\n\t\t\t\t\t\t\tconst splitFilters = keyCombo.map((value, sAxisIdx) => {\n\t\t\t\t\t\t\t\tconst axisIdx = splitAxisOriginalIdxs[sAxisIdx];\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\taxisIdx,\n\t\t\t\t\t\t\t\t\taxisId: getAxisId(originalSpec.axesSpec[axisIdx]),\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tlabel: axesLabels[sAxisIdx]?.[value] ?? String(value)\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tintermediateResults.push({\n\t\t\t\t\t\t\t\ttype: \"split\",\n\t\t\t\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\t\t\t\tadjustedSpec,\n\t\t\t\t\t\t\t\tdataEntries,\n\t\t\t\t\t\t\t\taxisFilters: splitFilters\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else intermediateResults.push({\n\t\t\t\t\t\ttype: \"direct\",\n\t\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\t\tadjustedSpec: originalSpec\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (intermediateResults.length === 0) return [];\n\t\t\tconst labeledResults = deriveLabels(intermediateResults, (entry) => ({\n\t\t\t\tspec: entry.spec,\n\t\t\t\textraTrace: entry.type === \"split\" ? splitFiltersToExtraTrace(entry.axisFilters) : void 0\n\t\t\t}), labelOps);\n\t\t\tconst result = [];\n\t\t\tfor (const { value: entry, label } of labeledResults) {\n\t\t\t\tconst { originalColumn, spec: originalSpec } = entry;\n\t\t\t\tconst axisFiltersTuple = splitFiltersToAxisFilter(entry.type === \"split\" ? entry.axisFilters : void 0);\n\t\t\t\tlet finalId;\n\t\t\t\tif (anchorCtx) finalId = anchorCtx.deriveS(originalSpec, axisFiltersTuple);\n\t\t\t\telse finalId = fallbackIdDeriver(originalColumn.id, axisFiltersTuple);\n\t\t\t\tlet finalSpec = { ...entry.adjustedSpec };\n\t\t\t\tif (overrideLabelAnnotation) finalSpec = {\n\t\t\t\t\t...finalSpec,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...finalSpec.annotations,\n\t\t\t\t\t\t[Annotation.Label]: label\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tresult.push({\n\t\t\t\t\tid: finalId,\n\t\t\t\t\tspec: finalSpec,\n\t\t\t\t\tdata: () => entry.type === \"split\" ? entriesToDataInfo(filterDataInfoEntries(entry.dataEntries, axisFiltersTuple)) : entry.originalColumn.data,\n\t\t\t\t\tlabel\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst ids = new Set(result.map((entry) => entry.id));\n\t\t\tif (enrichByLinkers && anchorCtx) {\n\t\t\t\tconst linkers = result.filter((entry) => isLinkerColumn(entry.spec));\n\t\t\t\tif (linkers.length === 0) return result;\n\t\t\t\tconst anchorAxes = Object.values(anchorCtx.anchors).flatMap((anchor) => anchor.axesSpec);\n\t\t\t\tconst linkerMap = LinkerMap.fromColumns(linkers.map(getColumnIdAndSpec));\n\t\t\t\tfunction matchAxisIdFn(linkerKeyId, sourceAxisId) {\n\t\t\t\t\treturn matchAxisId(linkerKeyId, sourceAxisId) || matchAxisId(sourceAxisId, linkerKeyId);\n\t\t\t\t}\n\t\t\t\tconst availableByLinkersAxes = linkerMap.getReachableByLinkersAxesFromAxes(anchorAxes, matchAxisIdFn);\n\t\t\t\tconst availableByLinkersColumns = this.getUniversalEntries((spec) => !isLinkerColumn(spec) && spec.axesSpec.some((columnAxisSpec) => {\n\t\t\t\t\tconst columnAxisId = getAxisId(columnAxisSpec);\n\t\t\t\t\treturn availableByLinkersAxes.some((axis) => matchAxisIdFn(getAxisId(axis), columnAxisId));\n\t\t\t\t}), {\n\t\t\t\t\tanchorCtx,\n\t\t\t\t\tlabelOps,\n\t\t\t\t\tdontWaitAllData,\n\t\t\t\t\toverrideLabelAnnotation,\n\t\t\t\t\texclude\n\t\t\t\t});\n\t\t\t\tif (availableByLinkersColumns) result.push(...availableByLinkersColumns.filter((entry) => !ids.has(entry.id)));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tgetColumns(predicateOrSelectors, opts) {\n\t\t\tconst entries = this.getUniversalEntries(predicateOrSelectors, {\n\t\t\t\toverrideLabelAnnotation: true,\n\t\t\t\t...opts\n\t\t\t});\n\t\t\tif (!entries) return void 0;\n\t\t\tconst columns = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst data = entry.data();\n\t\t\t\tif (!data) {\n\t\t\t\t\tif (opts?.dontWaitAllData) continue;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcolumns.push({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tspec: entry.spec,\n\t\t\t\t\tdata\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn columns;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/services/block_services.js\n\t/**\n\t* Services required by all V3 blocks by default.\n\t* Edit this when a new service should be available to all blocks.\n\t*\n\t* Standalone module to avoid circular dependencies between block_model.ts\n\t* and service type resolution.\n\t*/\n\tconst BLOCK_SERVICE_FLAGS = {\n\t\trequiresPFrameSpec: true,\n\t\trequiresPFrame: true,\n\t\trequiresDialog: true\n\t};\n\tresolveRequiredServices(BLOCK_SERVICE_FLAGS);\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/services/service_bridge.js\n\t/**\n\t* Builds a ServiceProxy from a ServiceDispatch.\n\t* Each service method call is forwarded to dispatch.callServiceMethod.\n\t*/\n\tfunction createServiceProxy(dispatch) {\n\t\treturn ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/services/get_services.js\n\tconst cachedServices = /* @__PURE__ */ new WeakMap();\n\tfunction getService(name) {\n\t\tconst ctx = getCfgRenderCtx();\n\t\tconst map = cachedServices.has(ctx) ? cachedServices.get(ctx) : (() => {\n\t\t\tcachedServices.set(ctx, /* @__PURE__ */ new Map());\n\t\t\treturn cachedServices.get(ctx);\n\t\t})();\n\t\treturn map.has(name) ? map.get(name) : (() => {\n\t\t\tmap.set(name, createServiceProxy(ctx)(name));\n\t\t\treturn map.get(name);\n\t\t})();\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js\n\tfunction patchInSetFilters(filters) {\n\t\tconst inSetToOrEqual = (predicate) => {\n\t\t\tif (predicate.operator !== \"InSet\") return predicate;\n\t\t\treturn {\n\t\t\t\toperator: \"Or\",\n\t\t\t\toperands: predicate.references.map((reference) => ({\n\t\t\t\t\toperator: \"Equal\",\n\t\t\t\t\treference\n\t\t\t\t}))\n\t\t\t};\n\t\t};\n\t\tconst mapSingleValuePredicate = (filter, cb) => {\n\t\t\tswitch (filter.operator) {\n\t\t\t\tcase \"And\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t\t};\n\t\t\t\tcase \"Or\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t\t};\n\t\t\t\tcase \"Not\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperand: mapSingleValuePredicate(filter.operand, cb)\n\t\t\t\t};\n\t\t\t\tdefault: return cb(filter);\n\t\t\t}\n\t\t};\n\t\tconst mapFilter = (filter, cb) => {\n\t\t\treturn {\n\t\t\t\t...filter,\n\t\t\t\tpredicate: mapSingleValuePredicate(filter.predicate, cb)\n\t\t\t};\n\t\t};\n\t\treturn filters.map((filter) => mapFilter(filter, inSetToOrEqual));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/render/api.js\n\t/**\n\t* Helper function to match domain objects\n\t* @param query Optional domain to match against\n\t* @param target Optional domain to match\n\t* @returns true if domains match, false otherwise\n\t*/\n\tfunction matchDomain(query, target) {\n\t\tif (query === void 0) return target === void 0;\n\t\tif (target === void 0) return true;\n\t\tfor (const k in target) if (query[k] !== target[k]) return false;\n\t\treturn true;\n\t}\n\t/**\n\t* Transforms PColumn data into the internal representation expected by the platform\n\t* @param data Data from a PColumn to transform\n\t* @returns Transformed data compatible with platform API\n\t*/\n\tfunction transformPColumnData(data) {\n\t\treturn mapPObjectData(data, (d) => {\n\t\t\tif (d instanceof TreeNodeAccessor) return d.handle;\n\t\t\telse if (isDataInfo(d)) return mapDataInfo(d, (accessor) => accessor.handle);\n\t\t\telse return d ?? [];\n\t\t});\n\t}\n\tvar ResultPool = class {\n\t\tctx = getCfgRenderCtx();\n\t\t/**\n\t\t* @deprecated use getOptions()\n\t\t*/\n\t\tcalculateOptions(predicate) {\n\t\t\treturn this.ctx.calculateOptions(predicate);\n\t\t}\n\t\tgetOptions(predicateOrSelector, opts) {\n\t\t\tconst predicate = typeof predicateOrSelector === \"function\" ? predicateOrSelector : legacyColumnSelectorsToPredicate(predicateOrSelector);\n\t\t\tconst filtered = this.getSpecs().entries.filter((s) => predicate(s.obj));\n\t\t\tlet labelOps = {};\n\t\t\tlet refsWithEnrichments = false;\n\t\t\tif (typeof opts !== \"undefined\") {\n\t\t\t\tif (typeof opts === \"function\") labelOps = opts;\n\t\t\t\telse if (typeof opts === \"object\") if (\"includeNativeLabel\" in opts || \"separator\" in opts || \"addLabelAsSuffix\" in opts) labelOps = opts;\n\t\t\t\telse {\n\t\t\t\t\topts = opts;\n\t\t\t\t\tlabelOps = opts.label ?? {};\n\t\t\t\t\trefsWithEnrichments = opts.refsWithEnrichments ?? false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof labelOps === \"object\") return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(({ value: { ref }, label }) => ({\n\t\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\t\tlabel\n\t\t\t}));\n\t\t\telse return filtered.map(({ ref, obj }) => ({\n\t\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\t\tlabel: labelOps(obj, ref)\n\t\t\t}));\n\t\t}\n\t\tresolveAnchorCtx(anchorsOrCtx) {\n\t\t\tif (anchorsOrCtx instanceof AnchoredIdDeriver) return anchorsOrCtx;\n\t\t\tconst resolvedAnchors = {};\n\t\t\tfor (const [key, value] of Object.entries(anchorsOrCtx)) if (isPlRef(value)) {\n\t\t\t\tconst resolvedSpec = this.getPColumnSpecByRef(value);\n\t\t\t\tif (!resolvedSpec) return void 0;\n\t\t\t\tresolvedAnchors[key] = resolvedSpec;\n\t\t\t} else resolvedAnchors[key] = value;\n\t\t\treturn new AnchoredIdDeriver(resolvedAnchors);\n\t\t}\n\t\t/**\n\t\t* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.\n\t\t*\n\t\t* @param anchorsOrCtx - Anchor context for column selection (same as in getCanonicalOptions)\n\t\t* @param predicateOrSelectors - Predicate or selectors for filtering columns (same as in getCanonicalOptions)\n\t\t* @param opts - Optional configuration for label generation and data waiting\n\t\t* @returns A PFrameHandle for the created PFrame, or undefined if any required data is missing\n\t\t*/\n\t\tgetAnchoredPColumns(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\t\tif (!anchorCtx) return void 0;\n\t\t\treturn new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getColumns(predicateOrSelectors, {\n\t\t\t\t...opts,\n\t\t\t\tanchorCtx\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Calculates anchored identifier options for columns matching a given predicate and returns their\n\t\t* canonicalized representations.\n\t\t*\n\t\t* This function filters column specifications from the result pool that match the provided predicate,\n\t\t* creates a standardized AnchorCtx from the provided anchors, and generates a list of label-value\n\t\t* pairs for UI components (like dropdowns).\n\t\t*\n\t\t* @param anchorsOrCtx - Either:\n\t\t* - An existing AnchorCtx instance\n\t\t* - A record mapping anchor IDs to PColumnSpec objects\n\t\t* - A record mapping anchor IDs to PlRef objects (which will be resolved to PColumnSpec)\n\t\t* @param predicateOrSelectors - Either:\n\t\t* - A predicate function that takes a PColumnSpec and returns a boolean.\n\t\t* Only specs that return true will be included.\n\t\t* - An APColumnSelector object for declarative filtering, which will be\n\t\t* resolved against the provided anchors and matched using matchPColumn.\n\t\t* - An array of APColumnSelector objects - columns matching ANY selector\n\t\t* in the array will be included (OR operation).\n\t\t* @param opts - Optional configuration for label generation:\n\t\t* - labelOps: Optional configuration for label generation:\n\t\t* - includeNativeLabel: Whether to include native column labels\n\t\t* - separator: String to use between label parts (defaults to \" / \")\n\t\t* - addLabelAsSuffix: Whether to add labels as suffix instead of prefix\n\t\t* - dontWaitAllData: Whether to skip columns that don't have all data (if not set, will return undefined,\n\t\t* if at least one column that requires splitting is missing data)\n\t\t* @returns An array of objects with `label` (display text) and `value` (anchored ID string) properties,\n\t\t* or undefined if any PlRef resolution fails.\n\t\t*/\n\t\tgetCanonicalOptions(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\t\tif (!anchorCtx) return void 0;\n\t\t\tconst entries = new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(predicateOrSelectors, {\n\t\t\t\t...opts,\n\t\t\t\tanchorCtx\n\t\t\t});\n\t\t\tif (!entries) return void 0;\n\t\t\treturn entries.map((item) => ({\n\t\t\t\tvalue: item.id,\n\t\t\t\tlabel: item.label\n\t\t\t}));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getData()\n\t\t*/\n\t\tgetDataFromResultPool() {\n\t\t\treturn this.getData();\n\t\t}\n\t\tgetData() {\n\t\t\tconst result = this.ctx.getDataFromResultPool();\n\t\t\treturn {\n\t\t\t\tisComplete: result.isComplete,\n\t\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\t\tref: e.ref,\n\t\t\t\t\tobj: {\n\t\t\t\t\t\t...e.obj,\n\t\t\t\t\t\tdata: new TreeNodeAccessor(e.obj.data, [e.ref.blockId, e.ref.name])\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* @deprecated use getDataWithErrors()\n\t\t*/\n\t\tgetDataWithErrorsFromResultPool() {\n\t\t\treturn this.getDataWithErrors();\n\t\t}\n\t\tgetDataWithErrors() {\n\t\t\tconst result = this.ctx.getDataWithErrorsFromResultPool();\n\t\t\treturn {\n\t\t\t\tisComplete: result.isComplete,\n\t\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\t\tref: e.ref,\n\t\t\t\t\tobj: {\n\t\t\t\t\t\t...e.obj,\n\t\t\t\t\t\tdata: mapValueInVOE(e.obj.data, (handle) => new TreeNodeAccessor(handle, [e.ref.blockId, e.ref.name]))\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* @deprecated use getSpecs()\n\t\t*/\n\t\tgetSpecsFromResultPool() {\n\t\t\treturn this.getSpecs();\n\t\t}\n\t\tgetSpecs() {\n\t\t\treturn this.ctx.getSpecsFromResultPool();\n\t\t}\n\t\t/**\n\t\t* @param ref a Ref\n\t\t* @returns data associated with the ref\n\t\t*/\n\t\tgetDataByRef(ref) {\n\t\t\tif (typeof this.ctx.getDataFromResultPoolByRef === \"undefined\") return this.getData().entries.find((f) => f.ref.blockId === ref.blockId && f.ref.name === ref.name)?.obj;\n\t\t\tconst data = this.ctx.getDataFromResultPoolByRef(ref.blockId, ref.name);\n\t\t\tif (!data) return void 0;\n\t\t\treturn mapPObjectData(data, (handle) => new TreeNodeAccessor(handle, [ref.blockId, ref.name]));\n\t\t}\n\t\t/**\n\t\t* Returns data associated with the ref ensuring that it is a p-column.\n\t\t* @param ref a Ref\n\t\t* @returns p-column associated with the ref\n\t\t*/\n\t\tgetPColumnByRef(ref) {\n\t\t\tconst data = this.getDataByRef(ref);\n\t\t\tif (!data) return void 0;\n\t\t\treturn ensurePColumn(data);\n\t\t}\n\t\t/**\n\t\t* Returns spec associated with the ref ensuring that it is a p-column spec.\n\t\t* @param ref a Ref\n\t\t* @returns p-column spec associated with the ref\n\t\t*/\n\t\tgetPColumnSpecByRef(ref) {\n\t\t\tconst spec = this.getSpecByRef(ref);\n\t\t\tif (!spec) return void 0;\n\t\t\tif (!isPColumnSpec(spec)) throw new Error(`not a PColumn spec (kind = ${spec.kind})`);\n\t\t\treturn spec;\n\t\t}\n\t\t/**\n\t\t* @param ref a Ref\n\t\t* @returns object spec associated with the ref\n\t\t*/\n\t\tgetSpecByRef(ref) {\n\t\t\treturn this.ctx.getSpecFromResultPoolByRef(ref.blockId, ref.name);\n\t\t}\n\t\t/**\n\t\t* @param spec object specification\n\t\t* @returns array of data objects with compatible specs\n\t\t* @deprecated delete this method after Jan 1, 2025\n\t\t*/\n\t\tfindDataWithCompatibleSpec(spec) {\n\t\t\tconst result = [];\n\t\t\tout: for (const data of this.getData().entries) {\n\t\t\t\tif (!isPColumnSpec(data.obj.spec)) continue;\n\t\t\t\tconst oth = data.obj.spec;\n\t\t\t\tif (spec.name !== oth.name) continue;\n\t\t\t\tif (spec.valueType !== oth.valueType) continue;\n\t\t\t\tif (spec.axesSpec.length !== oth.axesSpec.length) continue;\n\t\t\t\tif (!matchDomain(spec.domain, oth.domain)) continue;\n\t\t\t\tif (!matchDomain(spec.contextDomain, oth.contextDomain)) continue;\n\t\t\t\tfor (let i = 0; i < spec.axesSpec.length; ++i) {\n\t\t\t\t\tconst qAx = spec.axesSpec[i];\n\t\t\t\t\tconst tAx = oth.axesSpec[i];\n\t\t\t\t\tif (qAx.name !== tAx.name) continue out;\n\t\t\t\t\tif (qAx.type !== tAx.type) continue out;\n\t\t\t\t\tif (!matchDomain(qAx.domain, tAx.domain)) continue out;\n\t\t\t\t\tif (!matchDomain(qAx.contextDomain, tAx.contextDomain)) continue out;\n\t\t\t\t}\n\t\t\t\tresult.push(data.obj);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t/**\n\t\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\t* @returns a map of axis value => label\n\t\t*/\n\t\tfindLabels(axis) {\n\t\t\tconst dataPool = this.getData();\n\t\t\tfor (const column of dataPool.entries) {\n\t\t\t\tif (!isPColumn(column.obj)) continue;\n\t\t\t\tconst spec = column.obj.spec;\n\t\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\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\t\treturn Object.fromEntries(Object.entries(column.obj.data.getDataAsJson().data).map((e) => [JSON.parse(e[0])[0], e[1]]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Selects columns based on the provided selectors, returning PColumn objects\n\t\t* with lazily loaded data.\n\t\t*\n\t\t* @param selectors - A predicate function, a single selector, or an array of selectors.\n\t\t* @returns An array of PColumn objects matching the selectors. Data is loaded on first access.\n\t\t*/\n\t\tselectColumns(selectors) {\n\t\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\t\treturn this.getSpecs().entries.filter(({ obj: spec }) => {\n\t\t\t\tif (!isPColumnSpec(spec)) return false;\n\t\t\t\treturn predicate(spec);\n\t\t\t}).map(({ ref, obj: spec }) => {\n\t\t\t\tconst pcolumnSpec = spec;\n\t\t\t\tlet _cachedData = null;\n\t\t\t\tconst self = this;\n\t\t\t\treturn {\n\t\t\t\t\tid: (0, import_canonicalize.default)(ref),\n\t\t\t\t\tspec: pcolumnSpec,\n\t\t\t\t\tget data() {\n\t\t\t\t\t\tif (_cachedData !== null) return _cachedData;\n\t\t\t\t\t\t_cachedData = self.getPColumnByRef(ref)?.data;\n\t\t\t\t\t\treturn _cachedData;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Find labels data for a given axis id of a p-column.\n\t\t* @returns a map of axis value => label\n\t\t*/\n\t\tfindLabelsForColumnAxis(column, axisIdx) {\n\t\t\tconst labels = this.findLabels(column.axesSpec[axisIdx]);\n\t\t\tif (!labels) return void 0;\n\t\t\tconst axisKeys = readAnnotation(column, `pl7.app/axisKeys/${axisIdx}`);\n\t\t\tif (axisKeys !== void 0) {\n\t\t\t\tconst keys = JSON.parse(axisKeys);\n\t\t\t\treturn Object.fromEntries(keys.map((key) => {\n\t\t\t\t\treturn [key, labels[key] ?? \"Unlabelled\"];\n\t\t\t\t}));\n\t\t\t} else return labels;\n\t\t}\n\t};\n\t/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) */\n\tvar RenderCtxBase = class {\n\t\tctx;\n\t\tconstructor() {\n\t\t\tthis.ctx = getCfgRenderCtx();\n\t\t}\n\t\tdataCache;\n\t\tget data() {\n\t\t\tif (this.dataCache === void 0) {\n\t\t\t\tconst raw = this.ctx.data;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.dataCache = { v: value ? JSON.parse(value) : {} };\n\t\t\t}\n\t\t\treturn this.dataCache.v;\n\t\t}\n\t\tactiveArgsCache;\n\t\t/**\n\t\t* Returns args snapshot the block was executed for (i.e. when \"Run\" button was pressed).\n\t\t* Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.\n\t\t* */\n\t\tget activeArgs() {\n\t\t\tif (this.activeArgsCache === void 0) {\n\t\t\t\tconst raw = this.ctx.activeArgs;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.activeArgsCache = { v: value ? JSON.parse(value) : void 0 };\n\t\t\t}\n\t\t\treturn this.activeArgsCache.v;\n\t\t}\n\t\tgetService(name) {\n\t\t\treturn getService(name);\n\t\t}\n\t\tgetNamedAccessor(name) {\n\t\t\treturn ifDef(this.ctx.getAccessorHandleByName(name), (accessor) => new TreeNodeAccessor(accessor, [name]));\n\t\t}\n\t\tget prerun() {\n\t\t\treturn this.getNamedAccessor(StagingAccessorName);\n\t\t}\n\t\tget outputs() {\n\t\t\treturn this.getNamedAccessor(MainAccessorName);\n\t\t}\n\t\tresultPool = new ResultPool();\n\t\t/**\n\t\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\t* @returns a map of axis value => label\n\t\t* @deprecated Use resultPool.findLabels instead\n\t\t*/\n\t\tfindLabels(axis) {\n\t\t\treturn this.resultPool.findLabels(axis);\n\t\t}\n\t\tverifyInlineAndExplicitColumnsSupport(columns) {\n\t\t\tconst hasInlineColumns = columns.some((c) => !(c.data instanceof TreeNodeAccessor) || isDataInfo(c.data));\n\t\t\tconst inlineColumnsSupport = this.ctx.featureFlags?.inlineColumnsSupport === true;\n\t\t\tif (hasInlineColumns && !inlineColumnsSupport) throw Error(`Inline or explicit columns not supported`);\n\t\t}\n\t\tpatchPTableDef(def) {\n\t\t\tif (!this.ctx.featureFlags?.pTablePartitionFiltersSupport) def = {\n\t\t\t\t...def,\n\t\t\t\tpartitionFilters: [],\n\t\t\t\tfilters: [...def.partitionFilters, ...def.filters]\n\t\t\t};\n\t\t\tif (!this.ctx.featureFlags?.pFrameInSetFilterSupport) def = {\n\t\t\t\t...def,\n\t\t\t\tpartitionFilters: patchInSetFilters(def.partitionFilters),\n\t\t\t\tfilters: patchInSetFilters(def.filters)\n\t\t\t};\n\t\t\treturn def;\n\t\t}\n\t\tcreatePFrame(def) {\n\t\t\treturn this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));\n\t\t}\n\t\tcreatePTable(def) {\n\t\t\tlet rawDef;\n\t\t\tif (\"columns\" in def) rawDef = this.patchPTableDef({\n\t\t\t\tsrc: {\n\t\t\t\t\ttype: \"full\",\n\t\t\t\t\tentries: def.columns.map((c) => ({\n\t\t\t\t\t\ttype: \"column\",\n\t\t\t\t\t\tcolumn: c\n\t\t\t\t\t}))\n\t\t\t\t},\n\t\t\t\tpartitionFilters: def.filters ?? [],\n\t\t\t\tfilters: [],\n\t\t\t\tsorting: def.sorting ?? []\n\t\t\t});\n\t\t\telse rawDef = this.patchPTableDef(def);\n\t\t\tconst columns = extractAllColumns(rawDef.src);\n\t\t\tthis.verifyInlineAndExplicitColumnsSupport(columns);\n\t\t\tif (!allPColumnsReady(columns)) return void 0;\n\t\t\treturn this.ctx.createPTable(mapPTableDef(rawDef, (po) => transformPColumnData(po)));\n\t\t}\n\t\tcreatePTableV2(def) {\n\t\t\treturn this.ctx.createPTableV2(mapPTableDefV2(def, (po) => transformPColumnData(po)));\n\t\t}\n\t\t/** @deprecated scheduled for removal from SDK */\n\t\tgetBlockLabel(blockId) {\n\t\t\treturn this.ctx.getBlockLabel(blockId);\n\t\t}\n\t\tgetCurrentUnstableMarker() {\n\t\t\treturn this.ctx.getCurrentUnstableMarker();\n\t\t}\n\t\tlogInfo(msg) {\n\t\t\tthis.ctx.logInfo(msg);\n\t\t}\n\t\tlogWarn(msg) {\n\t\t\tthis.ctx.logWarn(msg);\n\t\t}\n\t\tlogError(msg) {\n\t\t\tthis.ctx.logError(msg);\n\t\t}\n\t};\n\t/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) for v3+ blocks */\n\tvar BlockRenderCtx = class extends RenderCtxBase {\n\t\targsCache;\n\t\tget args() {\n\t\t\tif (this.argsCache === void 0) {\n\t\t\t\tconst raw = this.ctx.args;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.argsCache = { v: value === void 0 ? void 0 : JSON.parse(value) };\n\t\t\t}\n\t\t\treturn this.argsCache.v;\n\t\t}\n\t};\n\t/**\n\t* Render context for plugin output functions.\n\t* Reads plugin data from blockStorage and derives params from pre-wrapped input callbacks.\n\t*\n\t* Parameterized on the factory-like phantom F so that getPluginData returns\n\t* InferFactoryData<F> directly — no casts needed for the data getter.\n\t*\n\t* @typeParam F - PluginFactoryLike phantom carrying data/params/outputs types\n\t*/\n\tvar PluginRenderCtx = class extends RenderCtxBase {\n\t\thandle;\n\t\twrappedInputs;\n\t\tconstructor(handle, wrappedInputs) {\n\t\t\tsuper();\n\t\t\tthis.handle = handle;\n\t\t\tthis.wrappedInputs = wrappedInputs;\n\t\t}\n\t\tpluginDataCache;\n\t\t/** Plugin's persistent data from blockStorage.__plugins.{pluginId}.__data */\n\t\tget data() {\n\t\t\tif (this.pluginDataCache === void 0) this.pluginDataCache = { v: getPluginData(parseJson(this.ctx.blockStorage()), this.handle) };\n\t\t\treturn this.pluginDataCache.v;\n\t\t}\n\t\tparamsCache;\n\t\t/** Params derived from block context via pre-wrapped input callbacks */\n\t\tget params() {\n\t\t\tif (this.paramsCache === void 0) {\n\t\t\t\tconst result = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(this.wrappedInputs)) result[key] = fn();\n\t\t\t\tthis.paramsCache = { v: result };\n\t\t\t}\n\t\t\treturn this.paramsCache.v;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/version.js\n\tconst PlatformaSDKVersion = \"1.75.5\";\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/bconfig/types.js\n\tfunction isConfigLambda(cfgOrFh) {\n\t\treturn cfgOrFh.__renderLambda === true;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js\n\tfunction downgradeCfgOrLambda(data) {\n\t\tif (data === void 0) return void 0;\n\t\tif (isConfigLambda(data)) return data.handle;\n\t\treturn data;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/plugin_model.js\n\t/** Symbol for internal plugin model creation — not accessible to external consumers */\n\tconst CREATE_PLUGIN_MODEL = Symbol(\"createPluginModel\");\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js\n\t/**\n\t* BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().\n\t*\n\t* Provides pure functions for storage operations (migration, initialization,\n\t* args derivation, updates, debug views). Each function takes its dependencies\n\t* explicitly as parameters.\n\t*\n\t* @module block_storage_callbacks\n\t* @internal\n\t*/\n\t/**\n\t* Normalizes raw storage data and extracts state.\n\t* Handles all formats:\n\t* - New BlockStorage format (has discriminator)\n\t* - Legacy V1/V2 format ({ args, uiState })\n\t* - Raw V3 state (any other format)\n\t*\n\t* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n\t* @returns Object with normalized storage and extracted state\n\t*/\n\tfunction normalizeStorage(rawStorage) {\n\t\tif (rawStorage === void 0 || rawStorage === null) return {\n\t\t\tstorage: createBlockStorage({}),\n\t\t\tdata: {}\n\t\t};\n\t\tlet parsed = rawStorage;\n\t\tif (typeof rawStorage === \"string\") try {\n\t\t\tparsed = JSON.parse(rawStorage);\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\tstorage: createBlockStorage(rawStorage),\n\t\t\t\tdata: rawStorage\n\t\t\t};\n\t\t}\n\t\tif (isBlockStorage(parsed)) {\n\t\t\tconst storage = normalizeBlockStorage(parsed);\n\t\t\treturn {\n\t\t\t\tstorage,\n\t\t\t\tdata: getStorageData(storage)\n\t\t\t};\n\t\t}\n\t\tif (isLegacyModelV1ApiFormat(parsed)) return {\n\t\t\tstorage: createBlockStorage(parsed),\n\t\t\tdata: parsed\n\t\t};\n\t\treturn {\n\t\t\tstorage: createBlockStorage(parsed),\n\t\t\tdata: parsed\n\t\t};\n\t}\n\t/**\n\t* Applies a state update to existing storage.\n\t* Used when setData is called from the frontend.\n\t*\n\t* @param currentStorageJson - Current storage as JSON string (must be defined)\n\t* @param payload - Update payload with operation type and value\n\t* @returns Updated storage as StringifiedJson<BlockStorage>\n\t*/\n\tfunction applyStorageUpdate(currentStorageJson, payload) {\n\t\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\t\treturn stringifyJson(updateStorageData(currentStorage, payload));\n\t}\n\t/**\n\t* Checks if data is in legacy Model API v1 format.\n\t* Legacy format has { args, uiState? } at top level without the BlockStorage discriminator.\n\t*/\n\tfunction isLegacyModelV1ApiFormat(data) {\n\t\tif (data === null || typeof data !== \"object\") return false;\n\t\tif (isBlockStorage(data)) return false;\n\t\treturn \"args\" in data;\n\t}\n\t/**\n\t* Gets storage debug view from raw storage data.\n\t* Returns structured debug info about the storage state.\n\t*\n\t* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n\t* @returns JSON string with storage debug view\n\t*/\n\tfunction getStorageDebugView(rawStorage) {\n\t\tconst { storage } = normalizeStorage(rawStorage);\n\t\treturn stringifyJson({\n\t\t\tdataVersion: storage.__dataVersion,\n\t\t\tdata: storage.__data\n\t\t});\n\t}\n\t/**\n\t* Runs storage migration using the provided hooks.\n\t* This is the main entry point for the middle layer to trigger migrations.\n\t*\n\t* @param currentStorageJson - Current storage as JSON string (or undefined)\n\t* @param hooks - Migration dependencies (block/plugin data migration and creation functions)\n\t* @returns MigrationResult\n\t*/\n\tfunction migrateStorage(currentStorageJson, hooks) {\n\t\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\t\tconst newPluginRegistry = hooks.getPluginRegistry();\n\t\tconst migrationResult = migrateBlockStorage(currentStorage, {\n\t\t\tmigrateBlockData: hooks.migrateBlockData,\n\t\t\tmigratePluginData: hooks.migratePluginData,\n\t\t\tnewPluginRegistry,\n\t\t\tcreatePluginData: hooks.createPluginData\n\t\t});\n\t\tif (!migrationResult.success) return { error: `Migration failed at '${migrationResult.failedAt}': ${migrationResult.error}` };\n\t\tconst oldVersion = currentStorage.__dataVersion;\n\t\tconst newVersion = migrationResult.storage.__dataVersion;\n\t\tconst info = oldVersion === newVersion ? `No migration needed (${oldVersion})` : `Migrated ${oldVersion} -> ${newVersion}`;\n\t\treturn {\n\t\t\tnewStorageJson: stringifyJson(migrationResult.storage),\n\t\t\tinfo\n\t\t};\n\t}\n\t/**\n\t* Creates complete initial storage (block data + all plugin data) atomically.\n\t*\n\t* @param hooks - Dependencies for creating initial block and plugin data\n\t* @returns Initial storage as branded JSON string\n\t* @throws If initialDataFn or createPluginData throws\n\t*/\n\tfunction createInitialStorage(hooks) {\n\t\tconst blockDefault = hooks.getDefaultBlockData();\n\t\tconst pluginRegistry = hooks.getPluginRegistry();\n\t\tconst plugins = {};\n\t\tfor (const handle of Object.keys(pluginRegistry)) {\n\t\t\tconst initial = hooks.createPluginData(handle);\n\t\t\tplugins[handle] = {\n\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t__data: initial.data\n\t\t\t};\n\t\t}\n\t\treturn stringifyJson({\n\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t__dataVersion: blockDefault.version,\n\t\t\t__data: blockDefault.data,\n\t\t\t__pluginRegistry: pluginRegistry,\n\t\t\t__plugins: plugins\n\t\t});\n\t}\n\t/**\n\t* Derives args from storage using the provided args function.\n\t* This extracts data from storage and passes it to the block's args() function.\n\t*\n\t* @param storageJson - Storage as JSON string\n\t* @param argsFunction - The block's args derivation function\n\t* @returns ArgsDeriveResult with derived args or error\n\t*/\n\tfunction deriveArgsFromStorage(storageJson, argsFunction) {\n\t\tconst { data } = normalizeStorage(storageJson);\n\t\ttry {\n\t\t\treturn { value: argsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `args() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t}\n\t/**\n\t* Derives prerunArgs from storage.\n\t* Uses prerunArgsFunction if provided, otherwise falls back to argsFunction.\n\t*\n\t* @param storageJson - Storage as JSON string\n\t* @param argsFunction - The block's args derivation function (fallback)\n\t* @param prerunArgsFunction - Optional prerun args derivation function\n\t* @returns ArgsDeriveResult with derived prerunArgs or error\n\t*/\n\tfunction derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction) {\n\t\tconst { data } = normalizeStorage(storageJson);\n\t\tif (prerunArgsFunction) try {\n\t\t\treturn { value: prerunArgsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `prerunArgs() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t\ttry {\n\t\t\treturn { value: argsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `args() threw (fallback): ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/block_model.js\n\t/**\n\t* Merges two feature flag objects with type-aware logic:\n\t* - `supports*` (boolean): OR — `true` if either side is `true`\n\t* - `requires*` (numeric): MAX — take the higher version requirement\n\t*/\n\tfunction mergeFeatureFlags(base, override) {\n\t\tconst result = { ...base };\n\t\tfor (const [key, value] of Object.entries(override)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst existing = result[key];\n\t\t\tif (typeof value === \"boolean\") result[key] = typeof existing === \"boolean\" && existing || value;\n\t\t\telse if (typeof value === \"number\") result[key] = Math.max(typeof existing === \"number\" ? existing : 0, value);\n\t\t}\n\t\treturn result;\n\t}\n\t/** Main entry point that each block should use in it's \"config\" module. Don't forget\n\t* to call {@link done()} at the end of configuration. Value returned by this builder must be\n\t* exported as constant with name \"platforma\" from the \"config\" module.\n\t* API version is 3 (for UI) and 2 (for model) */\n\tvar BlockModelV3 = class BlockModelV3 {\n\t\tconstructor(config) {\n\t\t\tthis.config = config;\n\t\t}\n\t\tstatic FEATURE_FLAGS = {\n\t\t\tsupportsLazyState: true,\n\t\t\tsupportsPframeQueryRanking: true,\n\t\t\trequiresUIAPIVersion: 3,\n\t\t\trequiresModelAPIVersion: 2,\n\t\t\trequiresCreatePTable: 2,\n\t\t\trequiresPFramesVersion: REQUIRES_PFRAMES_VERSION,\n\t\t\t...BLOCK_SERVICE_FLAGS\n\t\t};\n\t\t/** @deprecated Use FEATURE_FLAGS */\n\t\tstatic INITIAL_BLOCK_FEATURE_FLAGS = BlockModelV3.FEATURE_FLAGS;\n\t\t/**\n\t\t* Creates a new BlockModelV3 builder with the specified data model.\n\t\t*\n\t\t* @example\n\t\t* const dataModel = new DataModelBuilder()\n\t\t* .from<BlockData>(\"v1\")\n\t\t* .init(() => ({ numbers: [], labels: [] }));\n\t\t*\n\t\t* BlockModelV3.create(dataModel)\n\t\t* .args((data) => ({ numbers: data.numbers }))\n\t\t* .sections(() => [{ type: 'link', href: '/', label: 'Main' }])\n\t\t* .done();\n\t\t*\n\t\t* @param dataModel The data model that defines initial data and migrations\n\t\t*/\n\t\tstatic create(dataModel) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\trenderingMode: \"Heavy\",\n\t\t\t\tdataModel,\n\t\t\t\toutputs: {},\n\t\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"sections\",\n\t\t\t\t\tlambda: () => []\n\t\t\t\t}, true),\n\t\t\t\ttitle: void 0,\n\t\t\t\tsubtitle: void 0,\n\t\t\t\ttags: void 0,\n\t\t\t\tenrichmentTargets: void 0,\n\t\t\t\tfeatureFlags: { ...BlockModelV3.FEATURE_FLAGS },\n\t\t\t\targsFunction: void 0,\n\t\t\t\tprerunArgsFunction: void 0,\n\t\t\t\tplugins: {}\n\t\t\t});\n\t\t}\n\t\toutput(key, cfgOrRf, flags = {}) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\toutputs: {\n\t\t\t\t\t...this.config.outputs,\n\t\t\t\t\t[key]: createAndRegisterRenderLambda({\n\t\t\t\t\t\thandle: `block-output#${key}`,\n\t\t\t\t\t\tlambda: () => cfgOrRf(new BlockRenderCtx()),\n\t\t\t\t\t\t...flags\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/** Shortcut for {@link output} with retentive flag set to true. */\n\t\tretentiveOutput(key, rf) {\n\t\t\treturn this.output(key, rf, { retentive: true });\n\t\t}\n\t\t/** Shortcut for {@link output} with withStatus flag set to true. */\n\t\toutputWithStatus(key, rf) {\n\t\t\treturn this.output(key, rf, { withStatus: true });\n\t\t}\n\t\t/**\n\t\t* Sets a function to derive block args from data.\n\t\t* This is called during setData to compute the args that will be used for block execution.\n\t\t*\n\t\t* @example\n\t\t* .args<BlockArgs>((data) => ({ numbers: data.numbers }))\n\t\t*\n\t\t* @example\n\t\t* .args<BlockArgs>((data) => {\n\t\t* if (data.numbers.length === 0) throw new Error('Numbers required'); // block not ready\n\t\t* return { numbers: data.numbers };\n\t\t* })\n\t\t*/\n\t\targs(lambda) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\targsFunction: lambda\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Sets a function to derive pre-run args from data (optional).\n\t\t* This is called during setData to compute the args that will be used for staging/pre-run phase.\n\t\t*\n\t\t* If not defined, defaults to using the args() function result.\n\t\t* If defined, uses its return value for the staging / prerun phase.\n\t\t*\n\t\t* The staging / prerun phase runs only if currentPrerunArgs differs from the executed\n\t\t* version of prerunArgs (same comparison logic as currentArgs vs prodArgs).\n\t\t*\n\t\t* @example\n\t\t* .prerunArgs((data) => ({ numbers: data.numbers }))\n\t\t*\n\t\t* @example\n\t\t* .prerunArgs((data) => {\n\t\t* // Return undefined to skip staging for this block\n\t\t* if (!data.isReady) return undefined;\n\t\t* return { numbers: data.numbers };\n\t\t* })\n\t\t*/\n\t\tprerunArgs(fn) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tprerunArgsFunction: fn\n\t\t\t});\n\t\t}\n\t\t/** Sets the lambda to generate list of sections in the left block overviews panel. */\n\t\tsections(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"sections\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t}, true)\n\t\t\t});\n\t\t}\n\t\t/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */\n\t\ttitle(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\ttitle: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"title\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\tsubtitle(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tsubtitle: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"subtitle\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\ttags(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\ttags: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"tags\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\t/** Sets or overrides feature flags for the block. */\n\t\twithFeatureFlags(flags) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tfeatureFlags: {\n\t\t\t\t\t...this.config.featureFlags,\n\t\t\t\t\t...flags\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.\n\t\t* Influences dependency graph construction.\n\t\t*/\n\t\tenriches(lambda) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tenrichmentTargets: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"enrichmentTargets\",\n\t\t\t\t\tlambda\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\tplugin(instance, params) {\n\t\t\tconst pluginId = instance.id;\n\t\t\tconst plugin = instance[CREATE_PLUGIN_MODEL]();\n\t\t\tconst resolvedParams = params ?? {};\n\t\t\tif (pluginId in this.config.plugins) throw new Error(`Plugin '${pluginId}' already registered`);\n\t\t\tconst registered = {\n\t\t\t\tmodel: plugin,\n\t\t\t\tinputs: resolvedParams\n\t\t\t};\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tplugins: {\n\t\t\t\t\t...this.config.plugins,\n\t\t\t\t\t[pluginId]: registered\n\t\t\t\t},\n\t\t\t\tfeatureFlags: mergeFeatureFlags(this.config.featureFlags, plugin.featureFlags ?? {})\n\t\t\t});\n\t\t}\n\t\t/** Renders all provided block settings into a pre-configured platforma API\n\t\t* instance, that can be used in frontend to interact with block data, and\n\t\t* other features provided by the platforma to the block.\n\t\t*\n\t\t* Type-level check: if there are unconsumed transfers (from `.transfer()` calls\n\t\t* in the migration chain), this method requires an impossible `never` argument,\n\t\t* producing a compile error. Register all transferred plugins via `.plugin(instance)`\n\t\t* before calling `.done()`.\n\t\t*/\n\t\tdone(..._) {\n\t\t\tif (this.config.argsFunction === void 0) throw new Error(\"Args rendering function not set.\");\n\t\t\tconst apiVersion = 3;\n\t\t\tconst { plugins } = this.config;\n\t\t\tconst pluginRegistry = {};\n\t\t\tconst pluginHandles = Object.keys(plugins);\n\t\t\tfor (const handle of pluginHandles) pluginRegistry[handle] = plugins[handle].model.name;\n\t\t\tconst { dataModel, argsFunction, prerunArgsFunction } = this.config;\n\t\t\tfunction getPlugin(handle) {\n\t\t\t\tconst plugin = plugins[handle];\n\t\t\t\tif (!plugin) throw new Error(`Plugin model not found for '${handle}'`);\n\t\t\t\treturn plugin;\n\t\t\t}\n\t\t\tregisterFacadeCallbacks({\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageApplyUpdate]: applyStorageUpdate,\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageDebugView]: getStorageDebugView,\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageMigrate]: (currentStorageJson) => migrateStorage(currentStorageJson, {\n\t\t\t\t\tmigrateBlockData: (v) => dataModel.migrate(v),\n\t\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\t\tmigratePluginData: (handle, v) => getPlugin(handle).model.dataModel.migrate(v),\n\t\t\t\t\tcreatePluginData: (handle, transfer) => {\n\t\t\t\t\t\tif (transfer) return transfer;\n\t\t\t\t\t\treturn getPlugin(handle).model.getDefaultData();\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageInitial]: () => createInitialStorage({\n\t\t\t\t\tgetDefaultBlockData: () => dataModel.getDefaultData(),\n\t\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\t\tcreatePluginData: (handle) => getPlugin(handle).model.getDefaultData()\n\t\t\t\t}),\n\t\t\t\t[BlockStorageFacadeCallbacks.ArgsDerive]: (storageJson) => deriveArgsFromStorage(storageJson, argsFunction),\n\t\t\t\t[BlockStorageFacadeCallbacks.PrerunArgsDerive]: (storageJson) => derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction)\n\t\t\t});\n\t\t\tconst pluginOutputs = {};\n\t\t\tfor (const handle of pluginHandles) {\n\t\t\t\tconst { model, inputs } = plugins[handle];\n\t\t\t\tconst wrappedInputs = {};\n\t\t\t\tfor (const [paramKey, paramFn] of Object.entries(inputs)) wrappedInputs[paramKey] = () => paramFn(new BlockRenderCtx());\n\t\t\t\tconst outputs = model.outputs;\n\t\t\t\tconst { outputFlags } = model;\n\t\t\t\tfor (const [outputKey, outputFn] of Object.entries(outputs)) {\n\t\t\t\t\tconst key = pluginOutputKey(handle, outputKey);\n\t\t\t\t\tpluginOutputs[key] = createAndRegisterRenderLambda({\n\t\t\t\t\t\thandle: key,\n\t\t\t\t\t\tlambda: () => outputFn(new PluginRenderCtx(handle, wrappedInputs)),\n\t\t\t\t\t\twithStatus: outputFlags[outputKey]?.withStatus\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst allOutputs = {\n\t\t\t\t...this.config.outputs,\n\t\t\t\t...pluginOutputs\n\t\t\t};\n\t\t\tglobalThis.platformaApiVersion = apiVersion;\n\t\t\tif (!isInUI()) return { config: {\n\t\t\t\tv4: {\n\t\t\t\t\tconfigVersion: 4,\n\t\t\t\t\tmodelAPIVersion: 2,\n\t\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\t\trenderingMode: this.config.renderingMode,\n\t\t\t\t\tsections: this.config.sections,\n\t\t\t\t\ttitle: this.config.title,\n\t\t\t\t\tsubtitle: this.config.subtitle,\n\t\t\t\t\ttags: this.config.tags,\n\t\t\t\t\toutputs: allOutputs,\n\t\t\t\t\tenrichmentTargets: this.config.enrichmentTargets,\n\t\t\t\t\tfeatureFlags: this.config.featureFlags,\n\t\t\t\t\tblockLifecycleCallbacks: { ...BlockStorageFacadeHandles }\n\t\t\t\t},\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\toutputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)]))\n\t\t\t} };\n\t\t\telse return {\n\t\t\t\t...getPlatformaInstance({\n\t\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\t\tapiVersion\n\t\t\t\t}),\n\t\t\t\tblockModelInfo: {\n\t\t\t\t\toutputs: Object.fromEntries(Object.entries(allOutputs).map(([key, value]) => [key, { withStatus: Boolean(isConfigLambda(value) && value.withStatus) }])),\n\t\t\t\t\tpluginIds: pluginHandles,\n\t\t\t\t\tfeatureFlags: this.config.featureFlags\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js\n\t/** Create id for column copy with added keys in axes domains */\n\tconst colId = (id, domains, contextDomains) => {\n\t\tlet wid = id.toString();\n\t\tdomains?.forEach((domain) => {\n\t\t\tif (domain) for (const [k, v] of Object.entries(domain)) {\n\t\t\t\twid += k;\n\t\t\t\twid += v;\n\t\t\t}\n\t\t});\n\t\tcontextDomains?.forEach((contextDomain) => {\n\t\t\tif (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {\n\t\t\t\twid += k;\n\t\t\t\twid += v;\n\t\t\t}\n\t\t});\n\t\treturn wid;\n\t};\n\t/** All combinations with 1 key from each list */\n\tfunction getKeysCombinations(idsLists) {\n\t\tif (!idsLists.length) return [];\n\t\tlet result = [[]];\n\t\tidsLists.forEach((list) => {\n\t\t\tconst nextResult = [];\n\t\t\tlist.forEach((key) => {\n\t\t\t\tnextResult.push(...result.map((resultItem) => [...resultItem, key]));\n\t\t\t});\n\t\t\tresult = nextResult;\n\t\t});\n\t\treturn result;\n\t}\n\tfunction getAvailableWithLinkersAxes(linkerColumns, blockAxes) {\n\t\tconst availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));\n\t\treturn new Map(availableAxes.map((axisSpec) => {\n\t\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t\t}));\n\t}\n\t/** Add columns with fully compatible axes created from partial compatible ones */\n\tfunction enrichCompatible(blockAxes, columns) {\n\t\treturn columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));\n\t}\n\tfunction getAdditionalColumnsForColumn(blockAxes, column) {\n\t\tconst columnAxesIds = column.spec.axesSpec.map(getAxisId);\n\t\tif (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];\n\t\tconst secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {\n\t\t\tconst result = [];\n\t\t\tfor (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);\n\t\t\treturn result;\n\t\t}));\n\t\tconst allAddedDomainValues = /* @__PURE__ */ new Set();\n\t\tconst addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();\n\t\tconst addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {\n\t\t\tconst addedSet = /* @__PURE__ */ new Set();\n\t\t\tidsList.map((axisId, idx) => {\n\t\t\t\tconst d1 = column.spec.axesSpec[idx].domain;\n\t\t\t\tconst d2 = axisId.domain;\n\t\t\t\tObject.entries(d2 ?? {}).forEach(([key, value]) => {\n\t\t\t\t\tif (d1?.[key] === void 0) {\n\t\t\t\t\t\tconst item = JSON.stringify([key, value]);\n\t\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst cd1 = column.spec.axesSpec[idx].contextDomain;\n\t\t\t\tconst cd2 = axisId.contextDomain;\n\t\t\t\tObject.entries(cd2 ?? {}).forEach(([key, value]) => {\n\t\t\t\t\tif (cd1?.[key] === void 0) {\n\t\t\t\t\t\tconst item = JSON.stringify([\"ctx:\" + key, value]);\n\t\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn {\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});\n\t\t\treturn addedSet;\n\t\t});\n\t\t[...allAddedDomainValues].forEach((addedPart) => {\n\t\t\tif (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);\n\t\t});\n\t\treturn [column, ...secondaryIdsVariants.map((idsList, idx) => {\n\t\t\tconst id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));\n\t\t\tconst label = readAnnotation(column.spec, Annotation.Label) ?? \"\";\n\t\t\tconst labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(\" / \");\n\t\t\tconst annotations = {\n\t\t\t\t...column.spec.annotations,\n\t\t\t\t[Annotation.Graph.IsVirtual]: stringifyJson(true)\n\t\t\t};\n\t\t\tif (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + \" / \" + labelDomainPart : label + labelDomainPart;\n\t\t\treturn {\n\t\t\t\t...column,\n\t\t\t\tid,\n\t\t\t\tspec: {\n\t\t\t\t\t...column.spec,\n\t\t\t\t\taxesSpec: idsList.map((axisId, idx) => ({\n\t\t\t\t\t\t...axisId,\n\t\t\t\t\t\tannotations: column.spec.axesSpec[idx].annotations\n\t\t\t\t\t})),\n\t\t\t\t\tannotations\n\t\t\t\t}\n\t\t\t};\n\t\t})];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js\n\tfunction getAllRelatedColumns(ctx, predicate) {\n\t\tconst columns = new PColumnCollection();\n\t\tcolumns.addColumnProvider(ctx.resultPool);\n\t\tconst allColumns = columns.getColumns(predicate, {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? [];\n\t\treturn enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {\n\t\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t\t})), allColumns);\n\t}\n\tfunction getRelatedColumns(ctx, { columns: rootColumns, predicate }) {\n\t\tconst columns = new PColumnCollection();\n\t\tcolumns.addColumnProvider(ctx.resultPool);\n\t\tcolumns.addColumns(rootColumns);\n\t\tconst blockAxes = /* @__PURE__ */ new Map();\n\t\tconst allAxes = /* @__PURE__ */ new Map();\n\t\tfor (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\t\tconst aid = getAxisId(spec);\n\t\t\tblockAxes.set(canonicalizeJson(aid), spec);\n\t\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t\t}\n\t\tconst availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);\n\t\tfor (const item of availableWithLinkersAxes) {\n\t\t\tblockAxes.set(...item);\n\t\t\tallAxes.set(...item);\n\t\t}\n\t\tconst blockAxesArr = Array.from(blockAxes.values());\n\t\tlet compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\t\tfor (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\t\tconst aid = getAxisId(spec);\n\t\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t\t}\n\t\tconst allAxesArr = Array.from(allAxes.values());\n\t\tcompatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\t\tconst compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => isLabelColumn(column.spec));\n\t\treturn enrichCompatible(blockAxes, [...compatibleWithoutLabels, ...compatibleLabels]);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js\n\tfunction isHiddenFromGraphColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n\t}\n\tfunction isHiddenFromUIColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.HideDataFromUi);\n\t}\n\t/**\n\tThe aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n\t(including linker columns and all label columns).\n\tBlock’s columns are added to pframe as is.\n\tOther columns are added basing on set of axes of block’s columns, considering available with linker columns.\n\tCompatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n\tresult pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n\tamong existing ones).\n\tIn requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n\tof partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n\tand modified label (with added domain values in case if more than one copy with different domains exist).\n\t*/\n\tfunction createPFrameForGraphs(ctx, blockColumns) {\n\t\tconst suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n\t\tif (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n\t\treturn ctx.createPFrame(getRelatedColumns(ctx, {\n\t\t\tcolumns: blockColumns,\n\t\t\tpredicate: suitableSpec\n\t\t}));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns/column_selector.js\n\tfunction normalizeStringMatchers(input) {\n\t\tif (typeof input === \"string\") return [{\n\t\t\ttype: \"regex\",\n\t\t\tvalue: input\n\t\t}];\n\t\tif (!Array.isArray(input)) return [input];\n\t\treturn input.map((v) => typeof v === \"string\" ? {\n\t\t\ttype: \"regex\",\n\t\t\tvalue: v\n\t\t} : v);\n\t}\n\tfunction normalizeRecord(input) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(input)) result[key] = normalizeStringMatchers(value);\n\t\treturn result;\n\t}\n\tfunction normalizeTypes(input) {\n\t\treturn Array.isArray(input) ? input : [input];\n\t}\n\tfunction convertRelaxedAxisSelectorToMultiAxisSelector(input) {\n\t\tconst result = {};\n\t\tif (input.name !== void 0) result.name = normalizeStringMatchers(input.name);\n\t\tif (input.type !== void 0) result.type = normalizeTypes(input.type);\n\t\tif (input.domain !== void 0) result.domain = normalizeRecord(input.domain);\n\t\tif (input.contextDomain !== void 0) result.contextDomain = normalizeRecord(input.contextDomain);\n\t\tif (input.annotations !== void 0) result.annotations = normalizeRecord(input.annotations);\n\t\treturn result;\n\t}\n\tfunction convertRelaxedColumnSelectorToMultiColumnSelector(input) {\n\t\tconst result = {};\n\t\tif (input.name !== void 0) result.name = normalizeStringMatchers(input.name);\n\t\tif (input.type !== void 0) result.type = normalizeTypes(input.type);\n\t\tif (input.domain !== void 0) result.domain = normalizeRecord(input.domain);\n\t\tif (input.contextDomain !== void 0) result.contextDomain = normalizeRecord(input.contextDomain);\n\t\tif (input.annotations !== void 0) result.annotations = normalizeRecord(input.annotations);\n\t\tif (input.axes !== void 0) result.axes = input.axes.map(convertRelaxedAxisSelectorToMultiAxisSelector);\n\t\tif (input.partialAxesMatch !== void 0) result.partialAxesMatch = input.partialAxesMatch;\n\t\treturn result;\n\t}\n\tfunction convertColumnSelectorToMultiColumnSelector(input) {\n\t\treturn (Array.isArray(input) ? input : [input]).map(convertRelaxedColumnSelectorToMultiColumnSelector);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns/column_snapshot_provider.js\n\t/**\n\t* Simple provider wrapping an array of PColumns.\n\t* Always complete, data status always 'ready'.\n\t*/\n\tvar ArrayColumnProvider = class {\n\t\tcolumns;\n\t\tconstructor(columns) {\n\t\t\tthis.columns = columns.map((col) => ({\n\t\t\t\tid: col.id,\n\t\t\t\tspec: col.spec,\n\t\t\t\tdata: { get: () => col.data },\n\t\t\t\tdataStatus: this.getStatus(col.data)\n\t\t\t}));\n\t\t}\n\t\tgetAllColumns() {\n\t\t\treturn this.columns;\n\t\t}\n\t\tisColumnListComplete() {\n\t\t\treturn true;\n\t\t}\n\t\tgetStatus(d) {\n\t\t\tif (d == null) return \"absent\";\n\t\t\tif (typeof d === \"function\") return this.getStatus(d());\n\t\t\tif (d instanceof TreeNodeAccessor) {\n\t\t\t\tif (d.getIsReadyOrError()) return \"ready\";\n\t\t\t\tif (d.getIsFinal()) return \"absent\";\n\t\t\t\treturn \"computing\";\n\t\t\t}\n\t\t\tif (isDataInfo(d)) {\n\t\t\t\tlet ready = true;\n\t\t\t\tlet final = true;\n\t\t\t\tvisitDataInfo(d, (v) => {\n\t\t\t\t\tready &&= v.getIsReadyOrError();\n\t\t\t\t\tfinal &&= v.getIsFinal();\n\t\t\t\t});\n\t\t\t\tif (ready) return \"ready\";\n\t\t\t\tif (final) return \"absent\";\n\t\t\t\treturn \"computing\";\n\t\t\t}\n\t\t\treturn \"ready\";\n\t\t}\n\t};\n\t/**\n\t* Provider wrapping an array of ColumnSnapshots.\n\t* Always complete. Data status taken from each snapshot.\n\t*/\n\tvar SnapshotColumnProvider = class {\n\t\tconstructor(snapshots) {\n\t\t\tthis.snapshots = snapshots;\n\t\t}\n\t\tgetAllColumns() {\n\t\t\treturn this.snapshots;\n\t\t}\n\t\tisColumnListComplete() {\n\t\t\treturn true;\n\t\t}\n\t};\n\t/**\n\t* Provider wrapping a TreeNodeAccessor (output/prerun resolve result).\n\t* Detects data status from accessor readiness state.\n\t*/\n\tvar OutputColumnProvider = class {\n\t\tconstructor(accessor, opts) {\n\t\t\tthis.accessor = accessor;\n\t\t\tthis.opts = opts;\n\t\t}\n\t\tgetAllColumns() {\n\t\t\treturn this.getColumns();\n\t\t}\n\t\tisColumnListComplete() {\n\t\t\treturn this.accessor.getInputsLocked();\n\t\t}\n\t\tgetColumns() {\n\t\t\tconst pColumns = this.accessor.getPColumns();\n\t\t\tif (pColumns === void 0) return [];\n\t\t\tconst isFinal = this.accessor.getIsFinal();\n\t\t\tconst allowAbsence = this.opts?.allowPermanentAbsence === true;\n\t\t\treturn pColumns.map((col) => {\n\t\t\t\tconst dataAccessor = col.data;\n\t\t\t\tconst isReady = dataAccessor.getIsReadyOrError();\n\t\t\t\tlet dataStatus;\n\t\t\t\tif (isReady) dataStatus = \"ready\";\n\t\t\t\telse if (allowAbsence && isFinal) dataStatus = \"absent\";\n\t\t\t\telse dataStatus = \"computing\";\n\t\t\t\treturn {\n\t\t\t\t\tid: col.id,\n\t\t\t\t\tspec: col.spec,\n\t\t\t\t\tdataStatus,\n\t\t\t\t\tdata: { get: () => isReady ? dataAccessor : void 0 }\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t};\n\t/** Checks if a value is a ColumnSnapshotProvider (duck-typing). */\n\tfunction isColumnSnapshotProvider(source) {\n\t\treturn typeof source === \"object\" && source !== null && \"getAllColumns\" in source && \"isColumnListComplete\" in source && typeof source.getAllColumns === \"function\" && typeof source.isColumnListComplete === \"function\";\n\t}\n\t/** Checks if a value looks like a PColumn (has id, spec, data). */\n\tfunction isPColumnArray(source) {\n\t\tif (!Array.isArray(source)) return false;\n\t\tif (source.length === 0) return true;\n\t\tconst first = source[0];\n\t\treturn \"id\" in first && \"spec\" in first && \"data\" in first && !(\"dataStatus\" in first);\n\t}\n\t/** Checks if a value looks like a ColumnSnapshot array. */\n\tfunction isColumnSnapshotArray(source) {\n\t\tif (!Array.isArray(source)) return false;\n\t\tif (source.length === 0) return true;\n\t\tconst first = source[0];\n\t\treturn \"id\" in first && \"spec\" in first && \"dataStatus\" in first;\n\t}\n\t/**\n\t* Normalize any ColumnSource into a ColumnSnapshotProvider.\n\t* - ColumnSnapshotProvider → returned as-is\n\t* - ColumnSnapshot<PObjectId>[] → wrapped in SnapshotColumnProvider\n\t* - PColumn[] → wrapped in ArrayColumnProvider\n\t*/\n\tfunction toColumnSnapshotProvider(source) {\n\t\tif (isColumnSnapshotProvider(source)) return source;\n\t\tif (isColumnSnapshotArray(source)) return new SnapshotColumnProvider(source);\n\t\tif (isPColumnArray(source)) return new ArrayColumnProvider(source);\n\t\tthrow new Error(\"Unknown ColumnSource type\");\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns/column_collection_builder.js\n\t/**\n\t* Mutable builder that accumulates column sources, then produces\n\t* a ColumnCollection (plain) or AnchoredColumnCollection (with anchors).\n\t*\n\t* Each output lambda creates its own builder — a constraint of the\n\t* computable framework where each output tracks its own dependencies.\n\t*/\n\tvar ColumnCollectionBuilder = class {\n\t\tproviders = [];\n\t\tconstructor(specDriver = getService(\"pframeSpec\")) {\n\t\t\tthis.specDriver = specDriver;\n\t\t}\n\t\t/**\n\t\t* Register a column source. Sources added first take precedence for dedup.\n\t\t* Does NOT accept undefined — if a source isn't available yet,\n\t\t* the caller should return undefined from the output lambda.\n\t\t*/\n\t\taddSource(source) {\n\t\t\tif (source instanceof TreeNodeAccessor) {\n\t\t\t\tconst columns = source.getPColumns();\n\t\t\t\tif (columns) this.providers.push(new ArrayColumnProvider(columns));\n\t\t\t} else this.providers.push(toColumnSnapshotProvider(source));\n\t\t\treturn this;\n\t\t}\n\t\taddSources(sources) {\n\t\t\tfor (const source of sources) this.addSource(source);\n\t\t\treturn this;\n\t\t}\n\t\tbuild(options) {\n\t\t\tconst allowPartial = options?.allowPartialColumnList === true;\n\t\t\tif (!this.providers.every((p) => p.isColumnListComplete()) && !allowPartial) return void 0;\n\t\t\tconst columns = collectColumns(this.providers);\n\t\t\tif (options !== void 0 && \"anchors\" in options) return new AnchoredColumnCollectionImpl(this.specDriver, {\n\t\t\t\tanchors: options.anchors,\n\t\t\t\tcolumns\n\t\t\t});\n\t\t\telse return new ColumnCollectionImpl(this.specDriver, { columns });\n\t\t}\n\t};\n\tvar ColumnCollectionImpl = class {\n\t\tcolumns;\n\t\tspecFrameEntry;\n\t\tconstructor(specDriver, options) {\n\t\t\tthis.specDriver = specDriver;\n\t\t\tthis.columns = new Map(options.columns.map((col) => [col.id, col]));\n\t\t\tthis.specFrameEntry = this.specDriver.createSpecFrame(Object.fromEntries(options.columns.map((col) => [col.id, col.spec])));\n\t\t}\n\t\tdispose() {\n\t\t\tthis.specFrameEntry.unref();\n\t\t}\n\t\t[Symbol.dispose]() {\n\t\t\tthis.dispose();\n\t\t}\n\t\tfindColumns(options) {\n\t\t\tconst includeColumns = options?.include ? toMultiColumnSelectors(options.include) : void 0;\n\t\t\tconst excludeColumns = options?.exclude ? toMultiColumnSelectors(options.exclude) : void 0;\n\t\t\treturn this.specDriver.discoverColumns(this.specFrameEntry.key, {\n\t\t\t\tincludeColumns,\n\t\t\t\texcludeColumns,\n\t\t\t\taxes: [],\n\t\t\t\tmaxHops: 0,\n\t\t\t\tconstraints: matchingModeToConstraints(\"enrichment\")\n\t\t\t}).hits.map((hit) => this.columns.get(hit.hit.columnId)).filter((col) => col !== void 0);\n\t\t}\n\t};\n\tvar AnchoredColumnCollectionImpl = class {\n\t\tanchorsMap;\n\t\tcolumnsMap;\n\t\tspecFrameEntry;\n\t\tconstructor(specDriver, options) {\n\t\t\tthis.specDriver = specDriver;\n\t\t\tthis.specFrameEntry = this.specDriver.createSpecFrame(Object.fromEntries(options.columns.map((col) => [col.id, col.spec])));\n\t\t\tthis.columnsMap = new Map(options.columns.map((col) => [col.id, col]));\n\t\t\tthis.anchorsMap = resolveAnchorMap(options.anchors, options.columns, this.specDriver.discoverColumns.bind(this.specDriver, this.specFrameEntry.key));\n\t\t}\n\t\tdispose() {\n\t\t\tthis.specFrameEntry.unref();\n\t\t}\n\t\t[Symbol.dispose]() {\n\t\t\tthis.dispose();\n\t\t}\n\t\tgetAnchors() {\n\t\t\treturn this.anchorsMap;\n\t\t}\n\t\tfindColumns(options) {\n\t\t\tconst constraints = matchingModeToConstraints(options?.mode ?? \"enrichment\");\n\t\t\tconst includeColumns = options?.include ? toMultiColumnSelectors(options.include) : void 0;\n\t\t\tconst excludeColumns = options?.exclude ? toMultiColumnSelectors(options.exclude) : void 0;\n\t\t\tconst anchors = Array.from(this.anchorsMap.values());\n\t\t\tconst byColumn = this.specDriver.discoverColumns(this.specFrameEntry.key, {\n\t\t\t\tincludeColumns,\n\t\t\t\texcludeColumns,\n\t\t\t\tconstraints,\n\t\t\t\tmaxHops: options?.maxHops ?? 4,\n\t\t\t\taxes: anchors.map((anchor) => ({\n\t\t\t\t\taxesSpec: anchor.spec.axesSpec,\n\t\t\t\t\tqualifications: []\n\t\t\t\t}))\n\t\t\t}).hits.reduce((acc, hit) => {\n\t\t\t\tconst origId = hit.hit.columnId;\n\t\t\t\tconst col = this.columnsMap.get(origId) ?? throwError(`Column with id ${origId} not found in collection`);\n\t\t\t\tconst path = hit.path.map((step) => {\n\t\t\t\t\tif (step.type !== \"linker\") throw new Error(`Unexpected discover-columns step type: ${step.type}`);\n\t\t\t\t\treturn { linker: this.columnsMap.get(step.linker.columnId) ?? throwError(`Linker column with id ${step.linker.columnId} not found in collection`) };\n\t\t\t\t});\n\t\t\t\tconst variants = hit.mappingVariants.map((v) => ({\n\t\t\t\t\tpath,\n\t\t\t\t\tqualifications: remapFromIdxToId(v.qualifications, anchors)\n\t\t\t\t}));\n\t\t\t\tconst existing = acc.get(origId);\n\t\t\t\treturn acc.set(origId, existing === void 0 ? {\n\t\t\t\t\tcolumn: col,\n\t\t\t\t\tvariants\n\t\t\t\t} : {\n\t\t\t\t\t...existing,\n\t\t\t\t\tvariants: [...existing.variants, ...variants]\n\t\t\t\t});\n\t\t\t}, /* @__PURE__ */ new Map());\n\t\t\treturn Array.from(byColumn.values());\n\t\t}\n\t\tfindColumnVariants(options) {\n\t\t\treturn this.findColumns(options).flatMap((match) => match.variants.map((variant) => ({\n\t\t\t\tcolumn: match.column,\n\t\t\t\tpath: variant.path,\n\t\t\t\tqualifications: variant.qualifications\n\t\t\t})));\n\t\t}\n\t};\n\t/**\n\t* Collect all columns from all providers, dedup by NativePObjectId.\n\t* First source wins.\n\t*/\n\tfunction collectColumns(providers) {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tconst result = [];\n\t\tfor (const provider of providers) {\n\t\t\tconst columns = provider.getAllColumns();\n\t\t\tfor (const col of columns) {\n\t\t\t\tconst nativeId = deriveNativeId(col.spec);\n\t\t\t\tif (seen.has(nativeId)) continue;\n\t\t\t\tseen.add(nativeId);\n\t\t\t\tresult.push(col);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\t/** Normalize ColumnSelector (relaxed, single or array) to MultiColumnSelector[]. */\n\tfunction toMultiColumnSelectors(input) {\n\t\treturn convertColumnSelectorToMultiColumnSelector(input);\n\t}\n\t/**\n\t* Resolve each anchor entry to a ColumnSnapshot from the collected columns.\n\t* - PObjectId (string): looked up by id in the collected columns\n\t* - PColumnSpec: matched by deriveNativeId against collected columns\n\t* - RelaxedColumnSelector: resolved via discoverColumns in \"exact\" mode;\n\t* must match exactly one column\n\t* Throws on unresolved, ambiguous, or duplicated matches. Requires at least one\n\t* anchor to resolve.\n\t*/\n\tfunction resolveAnchorMap(anchors, columns, discoverColumns) {\n\t\tconst result = /* @__PURE__ */ new Map();\n\t\tconst resovedIds = /* @__PURE__ */ new Set();\n\t\tconst getDuplicateError = (key) => `Anchor \"${key}\": selector matched a column that was already matched by another anchor; please refine the selector to match a different column`;\n\t\tfor (const [name, anchor] of Object.entries(anchors)) if (typeof anchor === \"string\") {\n\t\t\tconst found = columns.find((col) => col.id === anchor) ?? throwError(`Anchor \"${name}\": column with id \"${anchor}\" not found in sources`);\n\t\t\tif (resovedIds.has(found.id)) throwError(getDuplicateError(name));\n\t\t\tresult.set(name, found);\n\t\t\tresovedIds.add(found.id);\n\t\t} else if (\"kind\" in anchor) {\n\t\t\tif (!isPColumnSpec(anchor)) throwError(`Anchor \"${name}\": invalid PColumnSpec`);\n\t\t\tconst nativeId = deriveNativeId(anchor);\n\t\t\tconst found = columns.find((col) => deriveNativeId(col.spec) === nativeId) ?? throwError(`Anchor \"${name}\": no column matching spec found in sources`);\n\t\t\tif (resovedIds.has(found.id)) throwError(getDuplicateError(name));\n\t\t\tresult.set(name, found);\n\t\t\tresovedIds.add(found.id);\n\t\t} else {\n\t\t\tconst matched = discoverColumns({\n\t\t\t\tincludeColumns: toMultiColumnSelectors(anchor),\n\t\t\t\texcludeColumns: void 0,\n\t\t\t\taxes: [],\n\t\t\t\tmaxHops: 0,\n\t\t\t\tconstraints: matchingModeToConstraints(\"related\")\n\t\t\t});\n\t\t\tif (matched.hits.length === 0) throwError(`Anchor \"${name}\": no columns matched selector`);\n\t\t\tif (matched.hits.length > 1) throwError(`Anchor \"${name}\": selector is ambiguous and matched multiple columns; please refine the selector to match exactly one column`);\n\t\t\tif (resovedIds.has(matched.hits[0].hit.columnId)) throwError(getDuplicateError(name));\n\t\t\tconst id = matched.hits[0].hit.columnId;\n\t\t\tconst snap = columns.find((col) => col.id === id) ?? throwError(`Anchor \"${name}\": matched column with id \"${id}\" not found in sources`);\n\t\t\tresult.set(name, snap);\n\t\t\tresovedIds.add(snap.id);\n\t\t}\n\t\tif (resovedIds.size === 0) throwError(\"At least one anchor must be resolved to a valid column\");\n\t\treturn result;\n\t}\n\tfunction remapFromIdxToId(qualifications, anchors) {\n\t\tconst forQueries = qualifications.forQueries.reduce((acc, qs, i) => anchors[i] && qs.length > 0 ? acc.set(anchors[i].id, qs) : acc, /* @__PURE__ */ new Map());\n\t\treturn {\n\t\t\tforQueries: forQueries.size > 0 ? Object.fromEntries(forQueries) : void 0,\n\t\t\tforHit: qualifications.forHit.length > 0 ? qualifications.forHit : void 0\n\t\t};\n\t}\n\tfunction matchingModeToConstraints(mode) {\n\t\tswitch (mode) {\n\t\t\tcase \"enrichment\": return {\n\t\t\t\tallowFloatingSourceAxes: true,\n\t\t\t\tallowFloatingHitAxes: false,\n\t\t\t\tallowSourceQualifications: true,\n\t\t\t\tallowHitQualifications: true\n\t\t\t};\n\t\t\tcase \"related\": return {\n\t\t\t\tallowFloatingSourceAxes: true,\n\t\t\t\tallowFloatingHitAxes: true,\n\t\t\t\tallowSourceQualifications: true,\n\t\t\t\tallowHitQualifications: true\n\t\t\t};\n\t\t\tcase \"exact\": return {\n\t\t\t\tallowFloatingSourceAxes: false,\n\t\t\t\tallowFloatingHitAxes: false,\n\t\t\t\tallowSourceQualifications: false,\n\t\t\t\tallowHitQualifications: false\n\t\t\t};\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns/ctx_column_sources.js\n\t/**\n\t* Collect ColumnSnapshotProviders from `outputs`, `prerun`, and\n\t* `resultPool` in that order. Dedup keeps the first occurrence per\n\t* `NativePObjectId`, so a block re-publishing its own columns keeps\n\t* the `outputs`-rooted canonical id instead of the result-pool variant.\n\t*/\n\tfunction collectCtxColumnSnapshotProviders(ctx) {\n\t\tconst providers = [];\n\t\tconst outputs = ctx.outputs;\n\t\tif (outputs) providers.push(...collectPFrameProviders(outputs));\n\t\tconst prerun = ctx.prerun;\n\t\tif (prerun) providers.push(...collectPFrameProviders(prerun));\n\t\tproviders.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));\n\t\treturn providers;\n\t}\n\t/**\n\t* Adapter wrapping ResultPool into the new ColumnSnapshotProvider interface.\n\t*\n\t* - `isColumnListComplete()` always returns true — the result pool\n\t* is a stable snapshot within a single render cycle.\n\t* - Data status is derived from the underlying TreeNodeAccessor:\n\t* ready (getIsReadyOrError), computing, or absent (no data resource).\n\t*/\n\tvar ResultPoolColumnSnapshotProvider = class {\n\t\tconstructor(pool) {\n\t\t\tthis.pool = pool;\n\t\t}\n\t\tgetAllColumns() {\n\t\t\treturn this.pool.selectColumns(() => true).map((col) => toSnapshot(col.id, col.spec, col.data));\n\t\t}\n\t\tisColumnListComplete() {\n\t\t\treturn true;\n\t\t}\n\t};\n\tfunction toSnapshot(id, spec, accessor) {\n\t\tif (accessor === void 0) return {\n\t\t\tid,\n\t\t\tspec,\n\t\t\tdataStatus: \"absent\",\n\t\t\tdata: void 0\n\t\t};\n\t\tconst isReady = accessor.getIsReadyOrError();\n\t\treturn {\n\t\t\tid,\n\t\t\tspec,\n\t\t\tdataStatus: isReady ? \"ready\" : \"computing\",\n\t\t\tdata: { get: () => isReady ? accessor : void 0 }\n\t\t};\n\t}\n\t/**\n\t* Recursively walk the output tree starting from `accessor`.\n\t* - If a node's resourceType is PFrame → wrap it as OutputColumnProvider.\n\t* - If a node's resourceType is StdMap/std/map → recurse into its output fields.\n\t* - Otherwise → skip (leaf of unknown type).\n\t*/\n\tfunction collectPFrameProviders(accessor) {\n\t\tconst out = [];\n\t\twalkTree(accessor, out);\n\t\treturn out;\n\t}\n\tfunction walkTree(node, out) {\n\t\tconst typeName = node.resourceType.name;\n\t\tif (typeName === ResourceTypeName.PFrame) {\n\t\t\tout.push(new OutputColumnProvider(node));\n\t\t\treturn;\n\t\t}\n\t\tif (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) for (const field of node.listInputFields()) {\n\t\t\tconst child = node.resolve(field);\n\t\t\tif (child) walkTree(child, out);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/filters/traverse.js\n\t/**\n\t* Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.\n\t*\n\t* Entries with `{ type: undefined }` inside `and`/`or` arrays are skipped\n\t* (these represent unfilled filter slots in the UI).\n\t*\n\t* Traversal order:\n\t* 1. Recurse into child filters (`and`/`or`/`not`)\n\t* 2. Apply the corresponding visitor callback with already-traversed children\n\t* 3. For leaf nodes, call `leaf` directly\n\t*/\n\tfunction traverseFilterSpec(filter, visitor) {\n\t\treturn traverseFilterSpecImpl(filter, visitor);\n\t}\n\t/** Internal implementation with simple generics for clean recursion. */\n\tfunction traverseFilterSpecImpl(filter, visitor) {\n\t\tswitch (filter.type) {\n\t\t\tcase \"and\": return visitor.and(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\t\tcase \"or\": return visitor.or(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\t\tcase \"not\": return visitor.not(traverseFilterSpecImpl(filter.filter, visitor));\n\t\t\tdefault: return visitor.leaf(filter);\n\t\t}\n\t}\n\t/** Collects all column references (`column` and `rhs` fields) from filter leaves. */\n\tfunction collectFilterSpecColumns(filter) {\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: (leaf) => {\n\t\t\t\tconst cols = [];\n\t\t\t\tif (\"column\" in leaf && leaf.column !== void 0) cols.push(leaf.column);\n\t\t\t\tif (\"rhs\" in leaf && leaf.rhs !== void 0) cols.push(leaf.rhs);\n\t\t\t\treturn cols;\n\t\t\t},\n\t\t\tand: (results) => results.flat(),\n\t\t\tor: (results) => results.flat(),\n\t\t\tnot: (result) => result\n\t\t});\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js\n\t/** Parses a CanonicalizedJson<PTableColumnId> string into a SpecQueryExpression reference. */\n\tfunction resolveColumnRef(columnStr) {\n\t\tconst parsed = JSON.parse(columnStr);\n\t\treturn parsed.type === \"axis\" ? {\n\t\t\ttype: \"axisRef\",\n\t\t\tvalue: parsed.id\n\t\t} : {\n\t\t\ttype: \"columnRef\",\n\t\t\tvalue: parsed.id\n\t\t};\n\t}\n\t/** Converts a FilterSpec tree into a SpecQueryExpression. */\n\tfunction filterSpecToSpecQueryExpr(filter) {\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: leafToSpecQueryExpr,\n\t\t\tand: (inputs) => {\n\t\t\t\tif (inputs.length === 0) throw new Error(\"AND filter requires at least one operand\");\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"and\",\n\t\t\t\t\tinput: inputs\n\t\t\t\t};\n\t\t\t},\n\t\t\tor: (inputs) => {\n\t\t\t\tif (inputs.length === 0) throw new Error(\"OR filter requires at least one operand\");\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"or\",\n\t\t\t\t\tinput: inputs\n\t\t\t\t};\n\t\t\t},\n\t\t\tnot: (input) => ({\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput\n\t\t\t})\n\t\t});\n\t}\n\tfunction leafToSpecQueryExpr(filter) {\n\t\tswitch (filter.type) {\n\t\t\tcase \"patternEquals\": return {\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\tcase \"patternNotEquals\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"stringEquals\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\t\tvalue: filter.value,\n\t\t\t\t\tcaseInsensitive: false\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"patternContainSubsequence\": return {\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\tcase \"patternNotContainSubsequence\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"stringContains\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\t\tvalue: filter.value,\n\t\t\t\t\tcaseInsensitive: false\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"patternMatchesRegularExpression\": return {\n\t\t\t\ttype: \"stringRegex\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value\n\t\t\t};\n\t\t\tcase \"patternFuzzyContainSubsequence\": return {\n\t\t\t\ttype: \"stringContainsFuzzy\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value,\n\t\t\t\tmaxEdits: filter.maxEdits ?? 1,\n\t\t\t\tcaseInsensitive: false,\n\t\t\t\tsubstitutionsOnly: filter.substitutionsOnly ?? false,\n\t\t\t\twildcard: filter.wildcard ?? null\n\t\t\t};\n\t\t\tcase \"equal\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"eq\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"notEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ne\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"lessThan\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"lt\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"greaterThan\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"gt\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"lessThanOrEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"le\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"greaterThanOrEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ge\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"equalToColumn\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"eq\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: resolveColumnRef(filter.rhs)\n\t\t\t};\n\t\t\tcase \"lessThanColumn\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"lt\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"lt\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"greaterThanColumn\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"gt\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"gt\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"lessThanColumnOrEqual\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"le\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"le\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"greaterThanColumnOrEqual\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"ge\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"ge\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"inSet\": return {\n\t\t\t\ttype: \"isIn\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tset: filter.value\n\t\t\t};\n\t\t\tcase \"notInSet\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"isIn\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\t\tset: filter.value\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"isNA\": return {\n\t\t\t\ttype: \"isNull\",\n\t\t\t\tinput: resolveColumnRef(filter.column)\n\t\t\t};\n\t\t\tcase \"isNotNA\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"isNull\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column)\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"ifNa\": return {\n\t\t\t\ttype: \"ifNull\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\treplacement: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.replacement\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"topN\":\n\t\t\tcase \"bottomN\": throw new Error(`Filter type \"${filter.type}\" is not supported in query expressions`);\n\t\t\tcase void 0: throw new Error(\"Filter type is undefined\");\n\t\t\tdefault: assertNever(filter);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs\n\tfunction isArrayLike(value) {\n\t\treturn value != null && typeof value !== \"function\" && isLength(value.length);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs\n\tfunction isArguments(value) {\n\t\treturn value !== null && typeof value === \"object\" && getTag(value) === \"[object Arguments]\";\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs\n\tfunction isPrototype(value) {\n\t\tconst constructor = value?.constructor;\n\t\treturn value === (typeof constructor === \"function\" ? constructor.prototype : Object.prototype);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs\n\tfunction isTypedArray(x) {\n\t\treturn isTypedArray$1(x);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs\n\tfunction isEmpty(value) {\n\t\tif (value == null) return true;\n\t\tif (isArrayLike(value)) {\n\t\t\tif (typeof value.splice !== \"function\" && typeof value !== \"string\" && (typeof Buffer === \"undefined\" || !Buffer.isBuffer(value)) && !isTypedArray(value) && !isArguments(value)) return false;\n\t\t\treturn value.length === 0;\n\t\t}\n\t\tif (typeof value === \"object\") {\n\t\t\tif (value instanceof Map || value instanceof Set) return value.size === 0;\n\t\t\tconst keys = Object.keys(value);\n\t\t\tif (isPrototype(value)) return keys.filter((x) => x !== \"constructor\").length === 0;\n\t\t\treturn keys.length === 0;\n\t\t}\n\t\treturn true;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/filters/distill.js\n\t/**\n\t* Strips non-FilterSpec metadata (whitelist approach) and removes\n\t* unfilled leaves (type is undefined or any required field is undefined).\n\t*/\n\tfunction distillFilterSpec(filter) {\n\t\tif (filter == null) return null;\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: (leaf) => {\n\t\t\t\tconst distilled = distillLeaf(leaf);\n\t\t\t\treturn isFilledLeaf(distilled) ? distilled : null;\n\t\t\t},\n\t\t\tand: (results) => {\n\t\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\t\ttype: \"and\",\n\t\t\t\t\tfilters: filtered\n\t\t\t\t};\n\t\t\t},\n\t\t\tor: (results) => {\n\t\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\t\ttype: \"or\",\n\t\t\t\t\tfilters: filtered\n\t\t\t\t};\n\t\t\t},\n\t\t\tnot: (result) => result === null ? null : {\n\t\t\t\ttype: \"not\",\n\t\t\t\tfilter: result\n\t\t\t}\n\t\t});\n\t}\n\tfunction distillLeaf(node) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(node)) if (KNOWN_LEAF_KEYS.has(key)) result[key] = value;\n\t\treturn result;\n\t}\n\t/** Returns true if the leaf is filled — type is defined and every required field per-type is filled. */\n\tfunction isFilledLeaf(node) {\n\t\tif (isNil$1(node.type)) return false;\n\t\tconst required = REQUIRED_KEYS_BY_TYPE[node.type];\n\t\tconst record = node;\n\t\treturn required.every((key) => isFilledValue(record[key]));\n\t}\n\t/**\n\t* Returns true if the value is considered \"filled\":\n\t* - primitives (number, boolean): always true\n\t* - string: non-empty after trim\n\t* - array: non-empty AND every item is filled\n\t* - plain object: non-empty AND every field value is filled\n\t* - null/undefined: false\n\t*/\n\tfunction isFilledValue(value) {\n\t\tif (isNil$1(value)) return false;\n\t\tswitch (typeof value) {\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\": return true;\n\t\t\tcase \"string\": return value.trim() !== \"\";\n\t\t\tdefault:\n\t\t\t\tif (isEmpty(value)) return false;\n\t\t\t\tif (Array.isArray(value)) return value.every(isFilledValue);\n\t\t\t\treturn Object.values(value).every(isFilledValue);\n\t\t}\n\t}\n\tconst KNOWN_LEAF_KEYS = new Set([\n\t\t\"n\",\n\t\t\"x\",\n\t\t\"rhs\",\n\t\t\"type\",\n\t\t\"value\",\n\t\t\"column\",\n\t\t\"minDiff\",\n\t\t\"maxEdits\",\n\t\t\"wildcard\",\n\t\t\"replacement\",\n\t\t\"substitutionsOnly\"\n\t]);\n\t/** Required fields per leaf type. Optional fields (e.g. minDiff, maxEdits) excluded. */\n\tconst REQUIRED_KEYS_BY_TYPE = {\n\t\tisNA: [\"column\"],\n\t\tisNotNA: [\"column\"],\n\t\tifNa: [\"column\", \"replacement\"],\n\t\tpatternEquals: [\"column\", \"value\"],\n\t\tpatternNotEquals: [\"column\", \"value\"],\n\t\tpatternContainSubsequence: [\"column\", \"value\"],\n\t\tpatternNotContainSubsequence: [\"column\", \"value\"],\n\t\tpatternMatchesRegularExpression: [\"column\", \"value\"],\n\t\tpatternFuzzyContainSubsequence: [\"column\", \"value\"],\n\t\tinSet: [\"column\", \"value\"],\n\t\tnotInSet: [\"column\", \"value\"],\n\t\ttopN: [\"column\", \"n\"],\n\t\tbottomN: [\"column\", \"n\"],\n\t\tequal: [\"column\", \"x\"],\n\t\tnotEqual: [\"column\", \"x\"],\n\t\tlessThan: [\"column\", \"x\"],\n\t\tgreaterThan: [\"column\", \"x\"],\n\t\tlessThanOrEqual: [\"column\", \"x\"],\n\t\tgreaterThanOrEqual: [\"column\", \"x\"],\n\t\tequalToColumn: [\"column\", \"rhs\"],\n\t\tlessThanColumn: [\"column\", \"rhs\"],\n\t\tgreaterThanColumn: [\"column\", \"rhs\"],\n\t\tlessThanColumnOrEqual: [\"column\", \"rhs\"],\n\t\tgreaterThanColumnOrEqual: [\"column\", \"rhs\"]\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js\n\t/** Upgrade PlDataTableStateV2 to the latest version */\n\tfunction upgradePlDataTableStateV2(state) {\n\t\tif (!state) return createPlDataTableStateV2();\n\t\tif (!(\"version\" in state)) state = createPlDataTableStateV2();\n\t\tif (state.version === 2) state = {\n\t\t\tversion: 3,\n\t\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tfiltersState: []\n\t\t\t})),\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t\tif (state.version === 3) state = createPlDataTableStateV2();\n\t\tif (state.version === 4) state = migrateV4toV6(state);\n\t\tif (state.version === 5) state = migrateV5toV6(state);\n\t\treturn state;\n\t}\n\t/** Migrate v5 to v6: unwrap `{source, labeled}` colIds in gridState. */\n\tfunction migrateV5toV6(state) {\n\t\treturn {\n\t\t\tversion: 6,\n\t\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tgridState: unwrapV5GridState(entry.gridState)\n\t\t\t})),\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t}\n\t/** Convert v5 wrapped colId JSON to bare PTableColumnSpec JSON, taking `.source`.\n\t* gridState colIds may include the row-number sentinel (a JSON-stringified\n\t* literal, not a wrapped spec) — those pass through unchanged. */\n\tfunction unwrapV5ColId(json) {\n\t\tconst parsed = parseJsonSafely(json);\n\t\treturn !isNil(parsed) && typeof parsed === \"object\" && \"source\" in parsed ? canonicalizeJson(parsed.source) : json;\n\t}\n\tfunction unwrapV5GridState(gridState) {\n\t\tconst unwrapAs = (json) => unwrapV5ColId(json);\n\t\treturn {\n\t\t\tcolumnOrder: gridState.columnOrder ? { orderedColIds: gridState.columnOrder.orderedColIds.map(unwrapAs) } : void 0,\n\t\t\tsort: gridState.sort ? { sortModel: gridState.sort.sortModel.map((s) => ({\n\t\t\t\tcolId: unwrapAs(s.colId),\n\t\t\t\tsort: s.sort\n\t\t\t})) } : void 0,\n\t\t\tcolumnVisibility: gridState.columnVisibility ? { hiddenColIds: gridState.columnVisibility.hiddenColIds.map(unwrapAs) } : void 0\n\t\t};\n\t}\n\t/** Migrate v4 state to v6: convert per-column filters to tree-based format (skips v5). */\n\tfunction migrateV4toV6(state) {\n\t\tlet idCounter = 0;\n\t\tconst nextId = () => ++idCounter;\n\t\tconst migratedCache = state.stateCache.map((entry) => {\n\t\t\tconst leaves = [];\n\t\t\tfor (const f of entry.filtersState) if (f.filter !== null && !f.filter.disabled) {\n\t\t\t\tconst column = canonicalizeJson(f.id);\n\t\t\t\tleaves.push(migrateTableFilter(column, f.filter.value, nextId));\n\t\t\t}\n\t\t\tconst filtersState = leaves.length > 0 ? {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: leaves\n\t\t\t} : null;\n\t\t\treturn {\n\t\t\t\tsourceId: entry.sourceId,\n\t\t\t\tgridState: entry.gridState,\n\t\t\t\tsheetsState: entry.sheetsState,\n\t\t\t\tfiltersState,\n\t\t\t\tdefaultFiltersState: null\n\t\t\t};\n\t\t});\n\t\tconst oldSourceId = state.pTableParams.sourceId;\n\t\tconst currentCache = oldSourceId ? migratedCache.find((e) => e.sourceId === oldSourceId) : void 0;\n\t\treturn {\n\t\t\tversion: 6,\n\t\t\tstateCache: migratedCache,\n\t\t\tpTableParams: currentCache && oldSourceId ? {\n\t\t\t\tsourceId: oldSourceId,\n\t\t\t\thiddenColIds: state.pTableParams.hiddenColIds?.map((id) => ({\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tid\n\t\t\t\t})) ?? null,\n\t\t\t\tfilters: distillFilterSpec(currentCache.filtersState),\n\t\t\t\tdefaultFilters: null,\n\t\t\t\tsorting: state.pTableParams.sorting\n\t\t\t} : createDefaultPTableParams()\n\t\t};\n\t}\n\t/** Migrate a single per-column PlTableFilter to a tree-based FilterSpec node */\n\tfunction migrateTableFilter(column, filter, nextId) {\n\t\tconst id = nextId();\n\t\tswitch (filter.type) {\n\t\t\tcase \"isNA\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"isNA\",\n\t\t\t\tcolumn\n\t\t\t};\n\t\t\tcase \"isNotNA\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"isNotNA\",\n\t\t\t\tcolumn\n\t\t\t};\n\t\t\tcase \"number_equals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"equal\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_notEquals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"notEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_greaterThan\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"greaterThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_greaterThanOrEqualTo\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_lessThan\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"lessThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_lessThanOrEqualTo\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"lessThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_between\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: [filter.includeLowerBound ? {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.lowerBound\n\t\t\t\t} : {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"greaterThan\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.lowerBound\n\t\t\t\t}, filter.includeUpperBound ? {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"lessThanOrEqual\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.upperBound\n\t\t\t\t} : {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"lessThan\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.upperBound\n\t\t\t\t}]\n\t\t\t};\n\t\t\tcase \"string_equals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternEquals\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_notEquals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternNotEquals\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_contains\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_doesNotContain\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternNotContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_matches\": return {\n\t\t\t\tid,\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\tcase \"string_doesNotMatch\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"not\",\n\t\t\t\tfilter: {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"patternMatchesRegularExpression\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tvalue: filter.reference\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"string_containsFuzzyMatch\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternFuzzyContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference,\n\t\t\t\tmaxEdits: filter.maxEdits,\n\t\t\t\tsubstitutionsOnly: filter.substitutionsOnly,\n\t\t\t\t...filter.wildcard !== void 0 ? { wildcard: filter.wildcard } : {}\n\t\t\t};\n\t\t}\n\t}\n\tfunction createDefaultPTableParams() {\n\t\treturn {\n\t\t\tsourceId: null,\n\t\t\thiddenColIds: null,\n\t\t\tfilters: null,\n\t\t\tdefaultFilters: null,\n\t\t\tsorting: []\n\t\t};\n\t}\n\tfunction createPlDataTableStateV2() {\n\t\treturn {\n\t\t\tversion: 6,\n\t\t\tstateCache: [],\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_tooltips.js\n\t/** Format tooltip strings for each entry. Returns `undefined` when nothing useful. */\n\tfunction deriveDistinctTooltips(entries) {\n\t\treturn entries.map(formatTooltip);\n\t}\n\tfunction formatTooltip(entry) {\n\t\tconst sections = [];\n\t\tconst header = formatHeader(entry);\n\t\tif (header !== void 0) sections.push(header);\n\t\tconst origin = formatOriginPath(entry);\n\t\tif (origin !== void 0) sections.push(origin);\n\t\tconst anchors = formatAnchors(entry.qualifications);\n\t\tif (anchors !== void 0) sections.push(anchors);\n\t\tconst hit = formatHit(entry.qualifications);\n\t\tif (hit !== void 0) sections.push(hit);\n\t\tif (sections.length <= 1) return void 0;\n\t\treturn sections.join(\"\\n\\n\");\n\t}\n\tconst BULLET_1 = \" • \";\n\tfunction formatHeader(entry) {\n\t\tconst lines = [];\n\t\tif (entry.variantCount !== void 0 && entry.variantCount > 1) lines.push(`Variant: ${entry.variantIndex ?? \"?\"} of ${entry.variantCount}`);\n\t\treturn lines.join(\"\\n\");\n\t}\n\tfunction formatOriginPath(entry) {\n\t\tconst path = entry.linkerPath ?? [];\n\t\tif (path.length === 0) return void 0;\n\t\tconst lines = [\"Origin path\"];\n\t\tpath.forEach((step, i) => {\n\t\t\tconst label = readAnnotation(step.linker.spec, Annotation.LinkLabel) ?? readAnnotation(step.linker.spec, Annotation.Label) ?? step.linker.spec.name;\n\t\t\tlines.push(`${BULLET_1}linker ${i + 1}: ${label}`);\n\t\t});\n\t\tconst hitName = readAnnotation(entry.spec, Annotation.Label) ?? entry.spec.name;\n\t\tlines.push(`${BULLET_1}hit column: ${hitName}`);\n\t\treturn lines.join(\"\\n\");\n\t}\n\tfunction formatAnchors(q) {\n\t\tif (isNil(q)) return void 0;\n\t\tif (isNil(q.forQueries)) return void 0;\n\t\tconst ids = Object.keys(q.forQueries);\n\t\tif (ids.length === 0) return void 0;\n\t\tconst lines = [];\n\t\tfor (const id of ids) {\n\t\t\tconst item = q.forQueries[id];\n\t\t\tif (item.length === 0) continue;\n\t\t\tconst rendered = formatAxisQualifications(item);\n\t\t\tlines.push(`${BULLET_1}${id}${rendered !== void 0 ? ` ${rendered}` : \"\"}`);\n\t\t}\n\t\treturn lines.length > 0 ? [\"Anchors (bound via this variant)\"].concat(lines).join(\"\\n\") : void 0;\n\t}\n\tfunction formatHit(q) {\n\t\tif (isNil(q) || isNil(q.forHit) || q.forHit.length === 0) return void 0;\n\t\tconst rendered = formatAxisQualifications(q.forHit);\n\t\tif (rendered === void 0) return void 0;\n\t\treturn [\"Hit column qualifications\", `${BULLET_1}${rendered}`].join(\"\\n\");\n\t}\n\tfunction formatAxisQualifications(qs) {\n\t\tif (qs.length === 0) return void 0;\n\t\treturn qs.map(formatQualification).join(\"; \");\n\t}\n\tfunction formatQualification(q) {\n\t\tconst axisName = typeof q.axis === \"string\" ? q.axis : q.axis.name ?? JSON.stringify(q.axis);\n\t\tconst entries = Object.entries(q.contextDomain);\n\t\tif (entries.length === 0) return axisName;\n\t\treturn `${axisName} context: ${entries.map(([k, v]) => `${k}=${v}`).join(\", \")}`;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js\n\t/** Check if column should be omitted from the table */\n\tfunction isColumnHidden(spec) {\n\t\treturn readAnnotation(spec, Annotation.Table.Visibility) === \"hidden\";\n\t}\n\t/** Check if column is hidden by default */\n\tfunction isColumnOptional(spec) {\n\t\treturn readAnnotation(spec, Annotation.Table.Visibility) === \"optional\";\n\t}\n\t/** Get effective visibility for a column. Rule map lookup first, then annotation fallback. */\n\tfunction getEffectiveVisibility(col, visibilityByColId) {\n\t\tconst rule = visibilityByColId?.get(col.id);\n\t\tif (rule !== void 0) return rule.visibility;\n\t\tif (isColumnHidden(col.spec)) return \"hidden\";\n\t\tif (isColumnOptional(col.spec)) return \"optional\";\n\t}\n\t/** Get ordering priority for a column. Rule map lookup first, then annotation fallback. */\n\tfunction getOrderPriority(col, orderByColId) {\n\t\tconst rule = orderByColId?.get(col.id);\n\t\tif (rule !== void 0) return rule.priority;\n\t\tconst annotation = Number(readAnnotation(col.spec, Annotation.Table.OrderPriority));\n\t\treturn isNaN(annotation) ? void 0 : annotation;\n\t}\n\t/**\n\t* Evaluate display rules against a set of columns and return a map of `colId → winning rule`\n\t* (first-match-wins, preserving original rule order).\n\t*\n\t* Predicate-based rules (`ColumnMatcher`) are evaluated directly on the spec.\n\t* Selector-based rules (`ColumnSelector`) are matched via `PFrameSpecDriver.discoverColumns`\n\t* using the same engine as `ColumnCollection.findColumns` — no client-side matcher.\n\t*/\n\tfunction evaluateRules(rules, columns, pframeSpec) {\n\t\tconst result = /* @__PURE__ */ new Map();\n\t\tif (rules.length === 0 || columns.length === 0) return result;\n\t\tconst hasSelectorRules = rules.some((rule) => typeof rule.match !== \"function\");\n\t\tconst selectorHitsByRule = /* @__PURE__ */ new Map();\n\t\tif (hasSelectorRules) {\n\t\t\tconst pColumns = dedupeById(columns).map((c) => ({\n\t\t\t\tid: c.id,\n\t\t\t\tspec: c.spec,\n\t\t\t\tdata: void 0\n\t\t\t}));\n\t\t\tconst collection = new ColumnCollectionBuilder(pframeSpec).addSource(new ArrayColumnProvider(pColumns)).build();\n\t\t\tif (collection === void 0) return result;\n\t\t\ttry {\n\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\tif (typeof rule.match === \"function\") continue;\n\t\t\t\t\tconst hits = collection.findColumns({ include: rule.match });\n\t\t\t\t\tselectorHitsByRule.set(rule, new Set(hits.map((h) => h.id)));\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tcollection.dispose();\n\t\t\t}\n\t\t}\n\t\tfor (const col of columns) for (const rule of rules) if (typeof rule.match === \"function\" ? rule.match(col.spec) : selectorHitsByRule.get(rule)?.has(col.id) ?? false) {\n\t\t\tresult.set(col.id, rule);\n\t\t\tbreak;\n\t\t}\n\t\treturn result;\n\t}\n\tfunction dedupeById(columns) {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tconst result = [];\n\t\tfor (const col of columns) {\n\t\t\tif (seen.has(col.id)) continue;\n\t\t\tseen.add(col.id);\n\t\t\tresult.push(col);\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Writes derived labels into column and axis annotations.\n\t* Returns new column objects with modified specs — original columns are not mutated.\n\t*\n\t* For each column: writes derived label into Annotation.Label (if present in derivedLabels).\n\t* For each axis in column specs: writes derived axis label into AxisSpec annotations.\n\t*/\n\tfunction withLabelAnnotations(derivedLabels, columns) {\n\t\tif (derivedLabels === void 0) return columns;\n\t\treturn columns.map((col) => {\n\t\t\tconst colLabel = derivedLabels[col.id];\n\t\t\treturn {\n\t\t\t\t...col,\n\t\t\t\tspec: {\n\t\t\t\t\t...col.spec,\n\t\t\t\t\t...isNil(colLabel) ? {} : { annotations: {\n\t\t\t\t\t\t...col.spec.annotations,\n\t\t\t\t\t\t[Annotation.Label]: colLabel\n\t\t\t\t\t} },\n\t\t\t\t\taxesSpec: col.spec.axesSpec.map((axis) => {\n\t\t\t\t\t\tconst label = derivedLabels[canonicalizeAxisId(axis)];\n\t\t\t\t\t\treturn isNil(label) ? axis : {\n\t\t\t\t\t\t\t...axis,\n\t\t\t\t\t\t\tannotations: {\n\t\t\t\t\t\t\t\t...axis.annotations,\n\t\t\t\t\t\t\t\t[Annotation.Label]: label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\tfunction withDataStatusAnnotations(columns) {\n\t\treturn columns.map((col) => {\n\t\t\treturn {\n\t\t\t\t...col,\n\t\t\t\tspec: {\n\t\t\t\t\t...col.spec,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...col.spec.annotations,\n\t\t\t\t\t\t[Annotation.DataStatus]: col.dataStatus\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Writes effective display properties (OrderPriority, Visibility) from precomputed rule maps\n\t* into column annotations. Returns new column objects — originals are not mutated.\n\t*/\n\tfunction withTableVisualAnnotations(visibilityByColId, orderByColId, columns) {\n\t\tif (visibilityByColId === void 0 && orderByColId === void 0) return columns;\n\t\treturn columns.map((col) => {\n\t\t\tconst annotations = { ...col.spec.annotations };\n\t\t\tconst visibility = getEffectiveVisibility(col, visibilityByColId);\n\t\t\tif (!isNil(visibility)) annotations[Annotation.Table.Visibility] = visibility;\n\t\t\tconst orderPriority = getOrderPriority(col, orderByColId);\n\t\t\tif (!isNil(orderPriority)) annotations[Annotation.Table.OrderPriority] = String(orderPriority);\n\t\t\treturn {\n\t\t\t\t...col,\n\t\t\t\tspec: {\n\t\t\t\t\t...col.spec,\n\t\t\t\t\tannotations\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Writes derived info annotations into column annotations.\n\t* Columns without an info entry are passed through unchanged.\n\t*/\n\tfunction withInfoAnnotations(infoById, columns) {\n\t\tif (isNil(infoById)) return columns;\n\t\treturn columns.map((col) => {\n\t\t\tconst info = infoById[col.id];\n\t\t\tif (isNil(info)) return col;\n\t\t\treturn {\n\t\t\t\t...col,\n\t\t\t\tspec: {\n\t\t\t\t\t...col.spec,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...col.spec.annotations,\n\t\t\t\t\t\t[Annotation.Table.Info]: info\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\tfunction withHidenAxesAnnotations(columns) {\n\t\treturn columns.map((col) => ({\n\t\t\t...col,\n\t\t\tspec: {\n\t\t\t\t...col.spec,\n\t\t\t\taxesSpec: col.spec.axesSpec.map((axis) => ({\n\t\t\t\t\t...axis,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...axis.annotations,\n\t\t\t\t\t\t[Annotation.Table.Visibility]: \"hidden\"\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t}\n\t\t}));\n\t}\n\t/** Derive labels for all table elements: columns via deriveDistinctLabels, axes from label columns. */\n\tfunction deriveAllLabels(options) {\n\t\tconst { columns, deriveLabelsOptions } = options;\n\t\treturn deriveDistinctLabels(columns.map((c) => ({\n\t\t\tspec: c.spec,\n\t\t\tlinkerPath: c.linkerPath?.map((step) => ({ spec: step.linker.spec })),\n\t\t\tqualifications: c.qualifications\n\t\t})), deriveLabelsOptions).reduce((acc, label, index) => (acc[columns[index].id] = label, acc), {});\n\t}\n\t/** Derive origin tooltips for columns whose qualifications or linker path carry info. */\n\tfunction deriveAllTooltips(options) {\n\t\tconst { columns } = options;\n\t\tconst variantCountByOriginal = columns.reduce((acc, c) => {\n\t\t\treturn acc.set(getField(c, \"originalId\") ?? c.id, (acc.get(c.originalId ?? c.id) ?? 0) + 1);\n\t\t}, /* @__PURE__ */ new Map());\n\t\tconst { entries } = columns.reduce(({ entries, variantSeen }, c) => {\n\t\t\tconst id = getField(c, \"originalId\") ?? c.id;\n\t\t\tconst variantCount = variantCountByOriginal.get(id);\n\t\t\tconst variantIndex = (variantSeen.set(id, (variantSeen.get(id) ?? 0) + 1), variantSeen.get(id));\n\t\t\tentries.push({\n\t\t\t\tspec: c.spec,\n\t\t\t\tlinkerPath: c.linkerPath,\n\t\t\t\tqualifications: c.qualifications,\n\t\t\t\tvariantIndex,\n\t\t\t\tvariantCount\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tentries,\n\t\t\t\tvariantSeen\n\t\t\t};\n\t\t}, {\n\t\t\tentries: [],\n\t\t\tvariantSeen: /* @__PURE__ */ new Map()\n\t\t});\n\t\tconst tooltips = deriveDistinctTooltips(entries);\n\t\treturn Object.fromEntries(tooltips.flatMap((t, i) => isNil(t) ? [] : [[columns[i].id, t]]));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js\n\tfunction createPTableDefV3(params) {\n\t\tlet query = {\n\t\t\ttype: params.primaryJoinType === \"inner\" ? \"innerJoin\" : \"fullJoin\",\n\t\t\tentries: params.primary.map((a) => toLeaf(a.column, []))\n\t\t};\n\t\tif (params.secondary.length > 0) query = {\n\t\t\ttype: \"outerJoin\",\n\t\t\tprimary: {\n\t\t\t\tentry: query,\n\t\t\t\tqualifications: params.secondary.flatMap((g) => params.primary.flatMap((p) => g.primaryQualifications?.[p.column.id] ?? []))\n\t\t\t},\n\t\t\tsecondary: params.secondary.flatMap((g) => g.entries.map((e) => toJoinEntry(e)))\n\t\t};\n\t\tif (!isNil(params.filters)) {\n\t\t\tconst nonEmpty = distillFilterSpec(params.filters);\n\t\t\tif (!isNil(nonEmpty)) {\n\t\t\t\tconst pridicate = filterSpecToSpecQueryExpr(nonEmpty);\n\t\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\t\tquery = {\n\t\t\t\t\ttype: \"filter\",\n\t\t\t\t\tinput: query,\n\t\t\t\t\tpredicate: pridicate\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (!isNil(params.sorting) && params.sorting.length > 0) query = {\n\t\t\ttype: \"sort\",\n\t\t\tinput: query,\n\t\t\tsortBy: params.sorting.map((s) => ({\n\t\t\t\texpression: columnIdToExpr(s.column),\n\t\t\t\tascending: s.ascending,\n\t\t\t\tnullsFirst: !s.naAndAbsentAreLeastValues\n\t\t\t}))\n\t\t};\n\t\treturn { query };\n\t}\n\tfunction columnIdToExpr(col) {\n\t\treturn col.type === \"axis\" ? {\n\t\t\ttype: \"axisRef\",\n\t\t\tvalue: col.id\n\t\t} : {\n\t\t\ttype: \"columnRef\",\n\t\t\tvalue: col.id\n\t\t};\n\t}\n\tfunction toLeaf(col, qs) {\n\t\treturn {\n\t\t\tentry: {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: col\n\t\t\t},\n\t\t\tqualifications: qs\n\t\t};\n\t}\n\tfunction toJoinEntry(e) {\n\t\tconst qs = e.qualifications ?? [];\n\t\tif (isNil(e.linkers) || e.linkers.length === 0) return toLeaf(e.column, qs);\n\t\treturn {\n\t\t\t...e.linkers.reduceRight((inner, linker) => ({\n\t\t\t\tentry: {\n\t\t\t\t\ttype: \"linkerJoin\",\n\t\t\t\t\tlinker: { column: linker },\n\t\t\t\t\tsecondary: [inner]\n\t\t\t\t},\n\t\t\t\tqualifications: []\n\t\t\t}), toLeaf(e.column, [])),\n\t\t\tqualifications: qs\n\t\t};\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js\n\t/** Discover columns from sources/anchors and normalize into a flat TableColumnVariant list. */\n\tfunction discoverTableColumnSnaphots(ctx, options) {\n\t\tconst resolvedOptions = {\n\t\t\t...options,\n\t\t\tanchors: resolveAnchors$1(ctx, options.anchors)\n\t\t};\n\t\tconst providers = resolveProviders(ctx, resolvedOptions.sources);\n\t\tif (providers.length === 0) return void 0;\n\t\tconst collection = new ColumnCollectionBuilder(ctx.getService(\"pframeSpec\")).addSources(providers).build(resolvedOptions);\n\t\tif (collection === void 0) return void 0;\n\t\ttry {\n\t\t\treturn mapToTableColumnVariants(collection.findColumnVariants(resolvedOptions.selector), collection.getAnchors());\n\t\t} finally {\n\t\t\tcollection.dispose();\n\t\t}\n\t}\n\t/**\n\t* Discover label columns matching the axes of the given value columns from\n\t* ctx providers. Returns label snapshots wrapped as direct TableColumnVariants\n\t* (path: [], empty qualifications, isPrimary: false).\n\t*/\n\tfunction discoverLabelColumnVariants(ctx, columns) {\n\t\tif (columns.length === 0) return [];\n\t\tconst collection = new ColumnCollectionBuilder(ctx.getService(\"pframeSpec\")).addSources(collectCtxColumnSnapshotProviders(ctx)).addSource(columns.map((c) => c.column)).build({\n\t\t\tallowPartialColumnList: true,\n\t\t\tanchors: Object.fromEntries(columns.filter((col) => (col.path?.length ?? 0) === 0 && col.isPrimary).map((col, i) => [`anchor_${i}`, col.column.spec]))\n\t\t});\n\t\ttry {\n\t\t\tconst axes = columns.flatMap((col) => col.column.spec.axesSpec);\n\t\t\treturn collection.findColumnVariants({\n\t\t\t\tinclude: axes.map((a) => ({\n\t\t\t\t\tname: {\n\t\t\t\t\t\ttype: \"exact\",\n\t\t\t\t\t\tvalue: PColumnName.Label\n\t\t\t\t\t},\n\t\t\t\t\taxes: [{ name: {\n\t\t\t\t\t\ttype: \"exact\",\n\t\t\t\t\t\tvalue: a.name\n\t\t\t\t\t} }]\n\t\t\t\t})),\n\t\t\t\tmaxHops: columns.reduce((acc, c) => Math.max(acc, c.path?.length ?? 0), 0)\n\t\t\t}).map((variant) => ({\n\t\t\t\t...variant,\n\t\t\t\tcolumn: {\n\t\t\t\t\t...variant.column,\n\t\t\t\t\tid: createDiscoveredPColumnId({\n\t\t\t\t\t\tcolumn: variant.column.id,\n\t\t\t\t\t\tpath: variant.path?.map((p) => ({\n\t\t\t\t\t\t\ttype: \"linker\",\n\t\t\t\t\t\t\tcolumn: p.linker.id\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcolumnQualifications: variant.qualifications?.forHit,\n\t\t\t\t\t\tqueriesQualifications: variant.qualifications?.forQueries\n\t\t\t\t\t}),\n\t\t\t\t\toriginalId: variant.column.id\n\t\t\t\t}\n\t\t\t}));\n\t\t} finally {\n\t\t\tcollection.dispose();\n\t\t}\n\t}\n\t/** Resolve PlRef values in anchors to PColumnSpec via the result pool. */\n\tfunction resolveAnchors$1(ctx, anchors) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(anchors)) if (isPlRef(value)) result[key] = ctx.resultPool.getPColumnSpecByRef(value) ?? throwError(`Anchor ${key} with ref ${JSON.stringify(value)} could not be resolved to a PColumnSpec`);\n\t\telse result[key] = value;\n\t\treturn result;\n\t}\n\t/** Resolve column snapshot providers from explicit sources or context. */\n\tfunction resolveProviders(ctx, sources) {\n\t\treturn sources !== void 0 ? sources.map(toColumnSnapshotProvider) : collectCtxColumnSnapshotProviders(ctx);\n\t}\n\t/** Map column variants into TableColumnVariant list with anchor-derived isPrimary flag. */\n\tfunction mapToTableColumnVariants(variants, anchors) {\n\t\tconst columnIdToAnchorName = new Map(Array.from(anchors.entries(), ([key, { id }]) => [id, key]));\n\t\treturn variants.map((variant) => {\n\t\t\tconst snap = variant.column;\n\t\t\tconst isPrimary = columnIdToAnchorName.get(snap.id) !== void 0;\n\t\t\treturn {\n\t\t\t\tcolumn: {\n\t\t\t\t\tid: createDiscoveredPColumnId({\n\t\t\t\t\t\tcolumn: snap.id,\n\t\t\t\t\t\tpath: variant.path?.map((p) => ({\n\t\t\t\t\t\t\ttype: \"linker\",\n\t\t\t\t\t\t\tcolumn: p.linker.id\n\t\t\t\t\t\t})),\n\t\t\t\t\t\tcolumnQualifications: variant.qualifications?.forHit,\n\t\t\t\t\t\tqueriesQualifications: variant.qualifications?.forQueries\n\t\t\t\t\t}),\n\t\t\t\t\tspec: snap.spec,\n\t\t\t\t\tdata: snap.data,\n\t\t\t\t\tdataStatus: snap.dataStatus\n\t\t\t\t},\n\t\t\t\tpath: variant.path,\n\t\t\t\tqualifications: variant.qualifications,\n\t\t\t\toriginalId: snap.id,\n\t\t\t\tisPrimary\n\t\t\t};\n\t\t});\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js\n\tfunction createPlDataTableV3(ctx, options) {\n\t\tconst pframeSpec = ctx.getService(\"pframeSpec\");\n\t\tconst state = upgradePlDataTableStateV2(options.tableState);\n\t\tconst primaryJoinType = options.primaryJoinType ?? \"full\";\n\t\tconst discovered = isPlainObject(options.columns) ? discoverTableColumnSnaphots(ctx, options.columns) : isNil$1(options.columns) ? options.columns : uniqueBy([...options.columns, ...discoverLabelColumnVariants(ctx, options.columns)], (c) => c.column.id);\n\t\tif (isNil$1(discovered) || discovered.length === 0) return void 0;\n\t\tconst splited = splitDiscoveredColumns(discovered);\n\t\tconst derivedLabels = deriveAllLabels({\n\t\t\tcolumns: discovered.map((dc) => ({\n\t\t\t\tid: dc.column.id,\n\t\t\t\tspec: dc.column.spec,\n\t\t\t\tlinkerPath: dc.path,\n\t\t\t\tqualifications: dc.qualifications\n\t\t\t})).filter((v) => !isColumnHidden(v.spec)),\n\t\t\tderiveLabelsOptions: {\n\t\t\t\tincludeNativeLabel: true,\n\t\t\t\t...options.labelsOptions\n\t\t\t}\n\t\t});\n\t\tconst derivedTooltips = deriveAllTooltips({ columns: discovered.map((dc) => ({\n\t\t\tid: dc.column.id,\n\t\t\toriginalId: getField(dc, \"originalId\"),\n\t\t\tspec: dc.column.spec,\n\t\t\tlinkerPath: dc.path,\n\t\t\tqualifications: dc.qualifications\n\t\t})) });\n\t\tconst annotated = annotateColumnGroups({\n\t\t\tpframeSpec,\n\t\t\t...splited,\n\t\t\tderivedLabels,\n\t\t\tderivedTooltips,\n\t\t\tdisplayOptions: options.displayOptions\n\t\t});\n\t\tconst primarySnapshots = annotated.direct.filter((c) => c.isPrimary);\n\t\tconst secondarySnapshots = annotated.direct.filter((c) => !c.isPrimary);\n\t\tif (primarySnapshots.length === 0) return void 0;\n\t\tconst columnIsAvailable = createColumnValidationById([...annotated.direct.map((v) => v.column), ...annotated.linked.flatMap((lc) => [...(lc.path ?? []).map((s) => s.linker), lc.column])]);\n\t\tconst remapedDefaultFilters = remapFilterColumnIds(options.filters, discovered);\n\t\tconst filters = filterFilters(concatFilters(state.pTableParams.filters, state.pTableParams.defaultFilters ?? remapedDefaultFilters), columnIsAvailable);\n\t\tconst sorting = filterSorting(resolveSorting(state.pTableParams.sorting, remapSortingColumnIds(options.sorting, discovered)), columnIsAvailable);\n\t\tconst primaryEntries = primarySnapshots.map((v) => ({ column: resolveSnapshot(v.column) }));\n\t\tconst fullDef = createPTableDefV3({\n\t\t\tprimaryJoinType,\n\t\t\tprimary: primaryEntries,\n\t\t\tsecondary: buildSecondaryGroups(secondarySnapshots, annotated.linked),\n\t\t\tfilters,\n\t\t\tsorting\n\t\t});\n\t\tconst fullHandle = ctx.createPTableV2(fullDef);\n\t\tconst pframeHandle = ctx.createPFrame([\n\t\t\t...annotated.direct.map((v) => resolveSnapshot(v.column)),\n\t\t\t...annotated.linked.map((v) => resolveSnapshot(v.column)),\n\t\t\t...collectLinkerSnapshots(annotated.linked).map(resolveSnapshot)\n\t\t]);\n\t\tconst hiddenSpecs = state.pTableParams.hiddenColIds;\n\t\tconst visible = buildVisibleColumns(annotated, computeHiddenColumns([...annotated.direct, ...annotated.linked].map((v) => v.column), sorting, filters, hiddenSpecs));\n\t\tconst visibleDef = createPTableDefV3({\n\t\t\tprimaryJoinType,\n\t\t\tprimary: primaryEntries,\n\t\t\tsecondary: buildSecondaryGroups(visible.direct.filter((c) => !c.isPrimary), visible.linked),\n\t\t\tfilters,\n\t\t\tsorting\n\t\t});\n\t\tconst visibleHandle = ctx.createPTableV2(visibleDef);\n\t\treturn {\n\t\t\tsourceId: state.pTableParams.sourceId,\n\t\t\tfullTableHandle: fullHandle,\n\t\t\tfullPframeHandle: pframeHandle,\n\t\t\tvisibleTableHandle: visibleHandle,\n\t\t\tdefaultFilters: remapedDefaultFilters\n\t\t};\n\t}\n\t/** Split discovered columns into direct (no linker path) and linked (with linker path). */\n\tfunction splitDiscoveredColumns(columns) {\n\t\treturn {\n\t\t\tdirect: columns.filter((dc) => (dc.path?.length ?? 0) === 0),\n\t\t\tlinked: columns.filter((dc) => (dc.path?.length ?? 0) > 0)\n\t\t};\n\t}\n\t/** All linker snapshots across the given linked columns, deduped by id. */\n\tfunction collectLinkerSnapshots(linked) {\n\t\treturn uniqueBy(linked.flatMap((lc) => (lc.path ?? []).map((s) => s.linker)), (c) => c.id);\n\t}\n\t/**\n\t* Annotate all column groups with derived labels and display-rule annotations.\n\t* Evaluates `displayOptions` rules against all discovered columns (direct,\n\t* linked, labels, linkers) and writes the winning visibility/priority into\n\t* column annotations via `withTableVisualAnnotations`.\n\t*/\n\tfunction annotateColumnGroups(params) {\n\t\tconst { direct, linked, derivedLabels, derivedTooltips, displayOptions, pframeSpec } = params;\n\t\tconst allColumnsForRules = [\n\t\t\t...direct.map((v) => v.column),\n\t\t\t...linked.map((v) => v.column),\n\t\t\t...collectLinkerSnapshots(linked)\n\t\t];\n\t\tconst visibilityByColId = evaluateRules(displayOptions?.visibility ?? [], allColumnsForRules, pframeSpec);\n\t\tconst orderByColId = evaluateRules(displayOptions?.ordering ?? [], allColumnsForRules, pframeSpec);\n\t\treturn {\n\t\t\tdirect: liftToVariantColumns(direct, flow((cols) => withDataStatusAnnotations(cols), (cols) => withLabelAnnotations(derivedLabels, cols), (cols) => withInfoAnnotations(derivedTooltips, cols), (cols) => withTableVisualAnnotations(visibilityByColId, orderByColId, cols))),\n\t\t\tlinked: liftToVariantColumns(linked, flow((cols) => withDataStatusAnnotations(cols), (cols) => withHidenAxesAnnotations(cols), (cols) => withLabelAnnotations(derivedLabels, cols), (cols) => withInfoAnnotations(derivedTooltips, cols), (cols) => withTableVisualAnnotations(visibilityByColId, orderByColId, cols))).map((lc) => ({\n\t\t\t\t...lc,\n\t\t\t\tpath: annotateLinkerPath(derivedLabels, lc.path)\n\t\t\t}))\n\t\t};\n\t}\n\t/** Lift a snapshot-array transform so it runs on the inner `column` of each variant. */\n\tfunction liftToVariantColumns(variants, fn) {\n\t\tconst cols = fn(variants.map((v) => v.column));\n\t\tif (cols.length !== variants.length) throw new Error(`liftToVariantColumns: fn must preserve array length (got ${cols.length}, expected ${variants.length})`);\n\t\treturn variants.map((v, i) => ({\n\t\t\t...v,\n\t\t\tcolumn: cols[i]\n\t\t}));\n\t}\n\tfunction annotateLinkerPath(derivedLabels, path) {\n\t\tif (isNil$1(path) || path.length === 0) return path;\n\t\tconst annotatedLinkers = withHidenAxesAnnotations(withLabelAnnotations(derivedLabels, path.map((s) => s.linker)));\n\t\treturn path.map((s, i) => ({\n\t\t\t...s,\n\t\t\tlinker: annotatedLinkers[i]\n\t\t}));\n\t}\n\t/** Build an index of all valid column IDs (axes + columns) for filter/sorting validation. */\n\tfunction createColumnValidationById(fullColumns) {\n\t\tconst allIds = [...uniqueBy(fullColumns.flatMap((c) => c.spec.axesSpec.map(getAxisId)), (a) => canonicalizeJson(a)).map((a) => ({\n\t\t\ttype: \"axis\",\n\t\t\tid: a\n\t\t})), ...fullColumns.map((c) => ({\n\t\t\ttype: \"column\",\n\t\t\tid: c.id\n\t\t}))];\n\t\tconst validIdSet = new Set(allIds.map((c) => canonicalizeJson(c)));\n\t\treturn (id) => {\n\t\t\treturn validIdSet.has(id);\n\t\t};\n\t}\n\t/** Drop filter leaves whose column references are not available in the table. */\n\tfunction filterFilters(filters, isValidColumnId) {\n\t\tif (isNil$1(filters)) return filters;\n\t\tconst isLeafValid = (leaf) => {\n\t\t\tif (leaf.type === void 0) return true;\n\t\t\tif (\"column\" in leaf && !isValidColumnId(leaf.column)) return false;\n\t\t\tif (\"rhs\" in leaf && !isValidColumnId(leaf.rhs)) return false;\n\t\t\treturn true;\n\t\t};\n\t\tconst prune = (node) => {\n\t\t\tif (node.type === \"and\" || node.type === \"or\") {\n\t\t\t\tconst kept = node.filters.map((f) => prune(f)).filter((f) => !isNil$1(f));\n\t\t\t\treturn {\n\t\t\t\t\ttype: node.type,\n\t\t\t\t\tfilters: kept\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (node.type === \"not\") {\n\t\t\t\tconst inner = prune(node.filter);\n\t\t\t\treturn isNil$1(inner) ? void 0 : {\n\t\t\t\t\ttype: \"not\",\n\t\t\t\t\tfilter: inner\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn isLeafValid(node) ? node : void 0;\n\t\t};\n\t\treturn prune(filters);\n\t}\n\t/** Merge two filter trees into one AND-combined tree. Returns the non-nil one if the other is nil. */\n\tfunction concatFilters(a, b) {\n\t\tif (isNil$1(a)) return b;\n\t\tif (isNil$1(b)) return a;\n\t\treturn {\n\t\t\t...a,\n\t\t\tfilters: [...a.filters, ...b.filters]\n\t\t};\n\t}\n\t/** Pick user sorting from state if non-empty, otherwise fall back to options default. */\n\tfunction resolveSorting(userSorting, defaultSorting) {\n\t\treturn (isEmpty(userSorting) ? defaultSorting : userSorting) ?? [];\n\t}\n\t/** Drop sorting entries whose column is not available in the table. */\n\tfunction filterSorting(sorting, isValidColumnId) {\n\t\treturn sorting.filter((s) => isValidColumnId(canonicalizeJson(s.column)));\n\t}\n\tfunction buildSecondaryGroups(direct, linked) {\n\t\treturn [...direct.map((c) => ({\n\t\t\tentries: [{\n\t\t\t\tcolumn: resolveSnapshot(c.column),\n\t\t\t\tqualifications: c.qualifications?.forHit\n\t\t\t}],\n\t\t\tprimaryQualifications: c.qualifications?.forQueries\n\t\t})), ...linked.map((lc) => ({\n\t\t\tentries: [{\n\t\t\t\tcolumn: resolveSnapshot(lc.column),\n\t\t\t\tlinkers: lc.path?.map((s) => resolveSnapshot(s.linker)),\n\t\t\t\tqualifications: lc.qualifications?.forHit\n\t\t\t}],\n\t\t\tprimaryQualifications: lc.qualifications?.forQueries\n\t\t}))];\n\t}\n\t/** Determine which columns should be hidden based on state or optional-column defaults. */\n\tfunction computeHiddenColumns(columns, sorting, filters, hiddenSpecs) {\n\t\tconst alwaysHidden = columns.filter((c) => isColumnHidden(c.spec)).map((c) => c.id);\n\t\tconst optionalHidden = !isNil$1(hiddenSpecs) ? hiddenSpecs.filter((s) => s.type === \"column\").map((s) => s.id) : columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);\n\t\tconst initial = [...alwaysHidden, ...optionalHidden];\n\t\tconst preserved = collectPreservedColumnIds(sorting, filters);\n\t\treturn new Set(initial.filter((id) => !preserved.has(id)));\n\t}\n\t/** Collect IDs of columns that must remain visible (sorted, filtered). */\n\tfunction collectPreservedColumnIds(sorting, filters) {\n\t\tconst sortedIds = (sorting ?? []).map((s) => s.column).filter((c) => c.type === \"column\").map((c) => c.id);\n\t\tconst filterIds = !isNil$1(filters) ? collectFilterSpecColumns(filters).flatMap((c) => {\n\t\t\tconst obj = parseJson(c);\n\t\t\treturn obj.type === \"column\" ? [obj.id] : [];\n\t\t}) : [];\n\t\treturn new Set([...sortedIds, ...filterIds]);\n\t}\n\t/** Filter annotated columns to only visible ones, re-matching label columns for the visible subset. */\n\tfunction buildVisibleColumns(annotated, hiddenColumns) {\n\t\treturn {\n\t\t\tdirect: annotated.direct.filter((c) => !hiddenColumns.has(c.column.id)),\n\t\t\tlinked: annotated.linked.filter((c) => !hiddenColumns.has(c.column.id))\n\t\t};\n\t}\n\t/** Resolve a ColumnSnapshot to a PColumn with lazily-evaluated data. */\n\tfunction resolveSnapshot(snap) {\n\t\treturn {\n\t\t\tid: snap.id,\n\t\t\tspec: snap.spec,\n\t\t\tdata: snap.data?.get()\n\t\t};\n\t}\n\t/** Remap column references in sorting entries. */\n\tfunction remapSortingColumnIds(sorting, columns) {\n\t\treturn sorting?.flatMap((s) => {\n\t\t\tif (s.column.type === \"axis\") return [s];\n\t\t\tconst id = s.column.id;\n\t\t\tconst column = columns.find((c) => (getField(c, \"originalId\") ?? c.column.id) === id);\n\t\t\tif (column === void 0) return [];\n\t\t\treturn [{\n\t\t\t\t...s,\n\t\t\t\tcolumn: {\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tid: column.column.id\n\t\t\t\t}\n\t\t\t}];\n\t\t});\n\t}\n\t/** Remap column references in a filter tree. */\n\tfunction remapFilterColumnIds(filters, columns) {\n\t\tif (isNil$1(filters)) return filters;\n\t\tconst map = (tableColumnId) => {\n\t\t\tconst parsed = parseJson(tableColumnId);\n\t\t\tif (parsed.type === \"axis\") return tableColumnId;\n\t\t\tconst originalId = parsed.id;\n\t\t\treturn canonicalizeJson({\n\t\t\t\ttype: \"column\",\n\t\t\t\tid: (columns.find((c) => (getField(c, \"originalId\") ?? c.column.id) === originalId) ?? throwError(`Column ID \"${parsed.id}\" in filters does not match any discovered column`)).column.id\n\t\t\t});\n\t\t};\n\t\treturn traverseFilterSpec(filters, {\n\t\t\tleaf: (leaf) => {\n\t\t\t\tif (leaf.type === void 0) return leaf;\n\t\t\t\tconst result = { ...leaf };\n\t\t\t\tif (\"column\" in result) result.column = map(result.column);\n\t\t\t\tif (\"rhs\" in result) result.rhs = map(result.rhs);\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tand: (results) => ({\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: results\n\t\t\t}),\n\t\t\tor: (results) => ({\n\t\t\t\ttype: \"or\",\n\t\t\t\tfilters: results\n\t\t\t}),\n\t\t\tnot: (result) => ({\n\t\t\t\ttype: \"not\",\n\t\t\t\tfilter: result\n\t\t\t})\n\t\t});\n\t}\n\t(/* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t\texports = module.exports = stringify;\n\t\texports.getSerialize = serializer;\n\t\tfunction stringify(obj, replacer, spaces, cycleReplacer) {\n\t\t\treturn JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);\n\t\t}\n\t\tfunction serializer(replacer, cycleReplacer) {\n\t\t\tvar stack = [], keys = [];\n\t\t\tif (cycleReplacer == null) cycleReplacer = function(key, value) {\n\t\t\t\tif (stack[0] === value) return \"[Circular ~]\";\n\t\t\t\treturn \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n\t\t\t};\n\t\t\treturn function(key, value) {\n\t\t\t\tif (stack.length > 0) {\n\t\t\t\t\tvar thisPos = stack.indexOf(this);\n\t\t\t\t\t~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n\t\t\t\t\t~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n\t\t\t\t\tif (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value);\n\t\t\t\t} else stack.push(value);\n\t\t\t\treturn replacer == null ? value : replacer.call(this, key, value);\n\t\t\t};\n\t\t}\n\t})))();\n\tconst PlErrorLike = objectType({\n\t\ttype: literalType(\"PlError\"),\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tfullMessage: stringType().optional(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorLike).optional(),\n\t\terrors: lazyType(() => ErrorLike.array()).optional()\n\t});\n\tconst ErrorLike = unionType([objectType({\n\t\ttype: literalType(\"StandardError\"),\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorLike).optional(),\n\t\terrors: lazyType(() => ErrorLike.array()).optional()\n\t}), PlErrorLike]);\n\tconst ErrorShape = objectType({\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tfullMessage: stringType().optional(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorShape).optional(),\n\t\terrors: lazyType(() => ErrorShape.array()).optional()\n\t});\n\t//#endregion\n\t//#region src/dataModel.ts\n\tconst DEFAULT_SCATTER_STATE = {\n\t\ttitle: \"Property Relationships\",\n\t\ttemplate: \"dots\",\n\t\tcurrentTab: null\n\t};\n\tconst DEFAULT_HISTOGRAM_STATE = {\n\t\ttitle: \"Property Distribution\",\n\t\ttemplate: \"bins\",\n\t\tcurrentTab: null,\n\t\tlayersSettings: { bins: { fillColor: \"#99e099\" } }\n\t};\n\tconst blockDataModel = new DataModelBuilder().from(\"Ver_2026_04_28\").migrate(\"Ver_2026_05_05\", (v1) => ({\n\t\t...v1,\n\t\tgraphStateScatter: { ...DEFAULT_SCATTER_STATE },\n\t\tgraphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }\n\t})).init(() => ({\n\t\ttableState: createPlDataTableStateV2(),\n\t\tgraphStateScatter: { ...DEFAULT_SCATTER_STATE },\n\t\tgraphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }\n\t}));\n\t//#endregion\n\t//#region src/index.ts\n\tconst inputAnchorSpecs = [\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t}\n\t];\n\tconst platforma$1 = BlockModelV3.create(blockDataModel).args((data) => {\n\t\tif (data.inputAnchor === void 0) throw new Error(\"Select an input dataset\");\n\t\treturn { inputAnchor: data.inputAnchor };\n\t}).output(\"inputOptions\", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs)).output(\"inputSpec\", (ctx) => ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : void 0).output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson()).output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false).output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle()).outputWithStatus(\"propertiesTable\", (ctx) => {\n\t\tif (ctx.data.inputAnchor === void 0) return void 0;\n\t\tconst ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (ownCols === void 0) return void 0;\n\t\tconst info = ctx.outputs?.resolve(\"info\")?.getDataAsJson();\n\t\tif (info === void 0) return void 0;\n\t\tconst tier = info.coverageTier;\n\t\tconst sources = [new ArrayColumnProvider(ctx.resultPool.selectColumns((spec) => !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\"))), new ArrayColumnProvider(ownCols)];\n\t\treturn createPlDataTableV3(ctx, {\n\t\t\ttableState: ctx.data.tableState,\n\t\t\tcolumns: {\n\t\t\t\tsources,\n\t\t\t\tanchors: { main: ctx.data.inputAnchor },\n\t\t\t\tselector: { mode: \"enrichment\" }\n\t\t\t},\n\t\t\tdisplayOptions: { visibility: [{\n\t\t\t\tmatch: (spec) => {\n\t\t\t\t\tif (spec.domain?.[\"pl7.app/vdj/scClonotypeChain/index\"] === \"secondary\") return false;\n\t\t\t\t\tif (spec.domain?.[\"pl7.app/alphabet\"] !== \"aminoacid\") return false;\n\t\t\t\t\tconst isVdj = spec.name === \"pl7.app/vdj/sequence\";\n\t\t\t\t\tconst isUniversal = spec.name === \"pl7.app/sequence\";\n\t\t\t\t\tif (!isVdj && !isUniversal) return false;\n\t\t\t\t\tconst feature = isVdj ? spec.domain?.[\"pl7.app/vdj/feature\"] : spec.domain?.[\"pl7.app/feature\"];\n\t\t\t\t\tif (tier === \"peptide\") return isUniversal && feature === \"peptide\";\n\t\t\t\t\tconst chain = spec.domain?.[\"pl7.app/vdj/scClonotypeChain\"];\n\t\t\t\t\tif (chain !== void 0 && chain !== \"A\") return false;\n\t\t\t\t\tif (tier === \"full_chain\") return feature === \"VDJRegion\" || feature === \"VDJRegionInFrame\";\n\t\t\t\t\tif (tier === \"cdr3_only\" || tier === \"partial\") return feature === \"CDR3\";\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\tvisibility: \"default\"\n\t\t\t}, {\n\t\t\t\tmatch: (spec) => !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\") && spec.annotations?.[\"pl7.app/isLinkerColumn\"] !== \"true\" && spec.annotations?.[\"pl7.app/isOutput\"] !== \"true\",\n\t\t\t\tvisibility: \"optional\"\n\t\t\t}] }\n\t\t});\n\t}).outputWithStatus(\"propertiesPfHandle\", (ctx) => {\n\t\tconst allPCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (allPCols === void 0) return void 0;\n\t\tconst pCols = allPCols.filter((c) => c.spec.name !== \"pl7.app/aaFraction\");\n\t\tconst inputAnchor = ctx.data.inputAnchor;\n\t\tconst upstreamMeta = inputAnchor !== void 0 ? (ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [{ axes: [{\n\t\t\tanchor: \"main\",\n\t\t\tidx: 0\n\t\t}] }, { axes: [{\n\t\t\tanchor: \"main\",\n\t\t\tidx: 1\n\t\t}] }]) ?? []).filter((c) => !c.spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\")) : [];\n\t\treturn createPFrameForGraphs(ctx, [...pCols, ...upstreamMeta]);\n\t}).output(\"propertiesPfCols\", (ctx) => {\n\t\tconst pCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (pCols === void 0) return void 0;\n\t\treturn pCols.map((c) => ({\n\t\t\tcolumnId: c.id,\n\t\t\tspec: c.spec\n\t\t}));\n\t}).title(() => \"Sequence Properties\").subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\").sections(() => [\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/\",\n\t\t\tlabel: \"Main\"\n\t\t},\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/scatter\",\n\t\t\tlabel: \"Property Relationships\"\n\t\t},\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/histogram\",\n\t\t\tlabel: \"Property Distribution\"\n\t\t}\n\t]).done();\n\t//#endregion\n\texports.blockDataModel = blockDataModel;\n\texports.platforma = platforma$1;\n});\n\n//# sourceMappingURL=bundle.js.map"}}
1
+ {"v4":{"configVersion":4,"modelAPIVersion":2,"sdkVersion":"1.77.0","renderingMode":"Heavy","sections":{"__renderLambda":true,"handle":"sections"},"title":{"__renderLambda":true,"handle":"title"},"subtitle":{"__renderLambda":true,"handle":"subtitle"},"outputs":{"inputOptions":{"__renderLambda":true,"handle":"block-output#inputOptions"},"inputSpec":{"__renderLambda":true,"handle":"block-output#inputSpec"},"info":{"__renderLambda":true,"handle":"block-output#info"},"isRunning":{"__renderLambda":true,"handle":"block-output#isRunning"},"processingLog":{"__renderLambda":true,"handle":"block-output#processingLog"},"propertiesTable":{"__renderLambda":true,"handle":"block-output#propertiesTable","withStatus":true},"propertiesPfHandle":{"__renderLambda":true,"handle":"block-output#propertiesPfHandle","withStatus":true},"propertiesPfCols":{"__renderLambda":true,"handle":"block-output#propertiesPfCols"}},"featureFlags":{"supportsLazyState":true,"supportsPframeQueryRanking":true,"requiresUIAPIVersion":3,"requiresModelAPIVersion":2,"requiresCreatePTable":2,"requiresPFramesVersion":1001031,"requiresPFrameSpec":true,"requiresPFrame":true,"requiresDialog":true},"blockLifecycleCallbacks":{"__pl_storage_applyUpdate":{"__renderLambda":true,"handle":"__pl_storage_applyUpdate"},"__pl_storage_debugView":{"__renderLambda":true,"handle":"__pl_storage_debugView"},"__pl_storage_migrate":{"__renderLambda":true,"handle":"__pl_storage_migrate"},"__pl_args_derive":{"__renderLambda":true,"handle":"__pl_args_derive"},"__pl_prerunArgs_derive":{"__renderLambda":true,"handle":"__pl_prerunArgs_derive"},"__pl_storage_initial":{"__renderLambda":true,"handle":"__pl_storage_initial"}}},"sdkVersion":"1.77.0","renderingMode":"Heavy","sections":{"__renderLambda":true,"handle":"sections"},"outputs":{"inputOptions":"block-output#inputOptions","inputSpec":"block-output#inputSpec","info":"block-output#info","isRunning":"block-output#isRunning","processingLog":"block-output#processingLog","propertiesTable":"block-output#propertiesTable","propertiesPfHandle":"block-output#propertiesPfHandle","propertiesPfCols":"block-output#propertiesPfCols"},"code":{"type":"plain","content":"(function(global, factory) {\n\ttypeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([\"exports\"], factory) : (global = typeof globalThis !== \"undefined\" ? globalThis : global || self, factory(global[\"block-model\"] = {}));\n})(this, function(exports) {\n\tObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n\t//#region \\0rolldown/runtime.js\n\tvar __create = Object.create;\n\tvar __defProp = Object.defineProperty;\n\tvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n\tvar __getOwnPropNames = Object.getOwnPropertyNames;\n\tvar __getProtoOf = Object.getPrototypeOf;\n\tvar __hasOwnProp = Object.prototype.hasOwnProperty;\n\tvar __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);\n\tvar __copyProps = (to, from, except, desc) => {\n\t\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t});\n\t\t}\n\t\treturn to;\n\t};\n\tvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target, mod));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/plugin_handle.js\n\tconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\t/** Construct the output key for a plugin output in the block outputs map. */\n\tfunction pluginOutputKey(handle, outputKey) {\n\t\treturn `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/block_storage.js\n\t/**\n\t* Discriminator key for BlockStorage format detection.\n\t* This unique hash-based key identifies data as BlockStorage vs legacy formats.\n\t*/\n\tconst BLOCK_STORAGE_KEY = \"__pl_a7f3e2b9__\";\n\t/**\n\t* Default data version for new blocks without migrations.\n\t* Unique identifier ensures blocks are created via DataModel API.\n\t*/\n\tconst DATA_MODEL_LEGACY_VERSION = \"__pl_v1_d4e8f2a1__\";\n\t/**\n\t* Type guard to check if a value is a valid BlockStorage object.\n\t* Checks for the discriminator key and valid schema version.\n\t*/\n\tfunction isBlockStorage(value) {\n\t\tif (value === null || typeof value !== \"object\") return false;\n\t\treturn value[BLOCK_STORAGE_KEY] === \"v1\";\n\t}\n\t/**\n\t* Creates a BlockStorage with the given initial data\n\t*\n\t* @param initialData - The initial data value (defaults to empty object)\n\t* @param version - The initial data version key (defaults to DATA_MODEL_LEGACY_VERSION)\n\t* @returns A new BlockStorage instance with discriminator key\n\t*/\n\tfunction createBlockStorage(initialData = {}, version = DATA_MODEL_LEGACY_VERSION) {\n\t\treturn {\n\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t__dataVersion: version,\n\t\t\t__data: initialData,\n\t\t\t__pluginRegistry: {},\n\t\t\t__plugins: {}\n\t\t};\n\t}\n\t/**\n\t* Normalizes raw storage data to BlockStorage format.\n\t* If the input is already a BlockStorage, returns it as-is (with defaults for missing fields).\n\t* If the input is legacy format (raw state), wraps it in BlockStorage structure.\n\t*\n\t* @param raw - Raw storage data (may be legacy format or BlockStorage)\n\t* @returns Normalized BlockStorage\n\t*/\n\tfunction normalizeBlockStorage(raw) {\n\t\tif (isBlockStorage(raw)) {\n\t\t\tconst storage = raw;\n\t\t\treturn {\n\t\t\t\t...storage,\n\t\t\t\t__dataVersion: typeof storage.__dataVersion === \"number\" ? DATA_MODEL_LEGACY_VERSION : storage.__dataVersion,\n\t\t\t\t__pluginRegistry: storage.__pluginRegistry ?? {},\n\t\t\t\t__plugins: storage.__plugins ?? {}\n\t\t\t};\n\t\t}\n\t\treturn createBlockStorage(raw);\n\t}\n\t/**\n\t* Gets the data from BlockStorage\n\t*\n\t* @param storage - The BlockStorage instance\n\t* @returns The data value\n\t*/\n\tfunction getStorageData(storage) {\n\t\treturn storage.__data;\n\t}\n\t/**\n\t* Updates the data in BlockStorage (immutable)\n\t*\n\t* @param storage - The current BlockStorage\n\t* @param payload - The update payload with operation and value\n\t* @returns A new BlockStorage with updated data\n\t*/\n\tfunction updateStorageData(storage, payload) {\n\t\tswitch (payload.operation) {\n\t\t\tcase \"update-block-data\": return {\n\t\t\t\t...storage,\n\t\t\t\t__data: payload.value\n\t\t\t};\n\t\t\tcase \"update-plugin-data\": {\n\t\t\t\tconst { pluginId, value } = payload;\n\t\t\t\tconst currentPlugins = storage.__plugins ?? {};\n\t\t\t\tconst version = currentPlugins[pluginId]?.__dataVersion ?? \"__pl_v1_d4e8f2a1__\";\n\t\t\t\treturn {\n\t\t\t\t\t...storage,\n\t\t\t\t\t__plugins: {\n\t\t\t\t\t\t...currentPlugins,\n\t\t\t\t\t\t[pluginId]: {\n\t\t\t\t\t\t\t__dataVersion: version,\n\t\t\t\t\t\t\t__data: value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unknown storage operation: ${payload.operation}`);\n\t\t}\n\t}\n\t/**\n\t* Performs atomic migration of block storage including block data and all plugins.\n\t*\n\t* Migration is atomic: either everything succeeds and a new storage is returned,\n\t* or an error is returned and the original storage is completely untouched.\n\t*\n\t* Migration steps:\n\t* 1. Migrate block data\n\t* 2. For each plugin in newPluginRegistry:\n\t* - If plugin exists with same name: migrate its data\n\t* - Otherwise (new or type changed): create with initial data\n\t* Plugins not in newPluginRegistry are dropped.\n\t*\n\t* If any step throws, migration fails and original storage is preserved.\n\t* User can then choose to:\n\t* - Abort: keep original storage, don't update block\n\t* - Reset: call createBlockStorage() to start fresh\n\t*\n\t* @param storage - The original storage (will not be modified)\n\t* @param config - Migration configuration\n\t* @returns Migration result - either success with new storage, or failure with error info\n\t*\n\t* @example\n\t* const result = migrateBlockStorage(storage, {\n\t* migrateBlockData: (versioned) => blockDataModel.migrate(versioned),\n\t* migratePluginData: (pluginId, versioned) => getPluginModel(pluginId).migrate(versioned),\n\t* newPluginRegistry: { table1: 'dataTable' as PluginName },\n\t* createPluginData: (pluginId) => getPluginModel(pluginId).getDefaultData(),\n\t* });\n\t*\n\t* if (result.success) {\n\t* commitStorage(result.storage);\n\t* } else {\n\t* const userChoice = await askUser(`Migration failed: ${result.error}. Reset data?`);\n\t* if (userChoice === 'reset') {\n\t* commitStorage(createBlockStorage(initialData, currentVersion));\n\t* }\n\t* // else: abort, keep original\n\t* }\n\t*/\n\tfunction migrateBlockStorage(storage, config) {\n\t\tconst { migrateBlockData, migratePluginData, newPluginRegistry, createPluginData } = config;\n\t\tlet migratedData;\n\t\tlet newVersion;\n\t\tlet transfers;\n\t\ttry {\n\t\t\tconst result = migrateBlockData({\n\t\t\t\tversion: storage.__dataVersion,\n\t\t\t\tdata: storage.__data\n\t\t\t});\n\t\t\tmigratedData = result.data;\n\t\t\tnewVersion = result.version;\n\t\t\ttransfers = result.transfers;\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: \"block\"\n\t\t\t};\n\t\t}\n\t\tconst oldPlugins = storage.__plugins ?? {};\n\t\tconst oldRegistry = storage.__pluginRegistry ?? {};\n\t\tconst newPlugins = {};\n\t\tfor (const [key, pluginName] of Object.entries(newPluginRegistry)) {\n\t\t\tconst handle = key;\n\t\t\tconst existingEntry = oldPlugins[handle];\n\t\t\tconst existingName = oldRegistry[handle];\n\t\t\ttry {\n\t\t\t\tif (existingEntry && existingName === pluginName) {\n\t\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\t\tversion: existingEntry.__dataVersion,\n\t\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t\t});\n\t\t\t\t\tif (migrated) newPlugins[handle] = {\n\t\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t\t__data: migrated.data\n\t\t\t\t\t};\n\t\t\t\t} else if (existingEntry) {\n\t\t\t\t\tlet recovered = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst migrated = migratePluginData(handle, {\n\t\t\t\t\t\t\tversion: DATA_MODEL_LEGACY_VERSION,\n\t\t\t\t\t\t\tdata: existingEntry.__data\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (migrated) {\n\t\t\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t\t\t__dataVersion: migrated.version,\n\t\t\t\t\t\t\t\t__data: migrated.data\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\trecovered = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (recoverError) {\n\t\t\t\t\t\tif (!isDataUnrecoverableError(recoverError)) throw recoverError;\n\t\t\t\t\t}\n\t\t\t\t\tif (!recovered) {\n\t\t\t\t\t\tconst transfer = transfers[handle];\n\t\t\t\t\t\tconst initial = createPluginData(handle, transfer);\n\t\t\t\t\t\tnewPlugins[handle] = {\n\t\t\t\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t\t\t\t__data: initial.data\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\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} catch (error) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tfailedAt: handle\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tstorage: {\n\t\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t\t__dataVersion: newVersion,\n\t\t\t\t__data: migratedData,\n\t\t\t\t__pluginRegistry: newPluginRegistry,\n\t\t\t\t__plugins: newPlugins\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Gets plugin-specific data from block storage.\n\t* Accepts raw storage (any format) and normalizes internally.\n\t*\n\t* When called with a typed PluginHandle<F>, the return type is automatically\n\t* inferred from the factory's phantom `__types.data` field.\n\t*\n\t* @param rawStorage - Raw block storage (may be legacy format or BlockStorage)\n\t* @param handle - The plugin handle (branded plugin instance id)\n\t* @returns The plugin data, typed via factory inference\n\t* @throws If plugin is not found in storage\n\t*/\n\tfunction getPluginData(rawStorage, handle) {\n\t\tconst pluginEntry = normalizeBlockStorage(rawStorage).__plugins?.[handle];\n\t\tif (!pluginEntry) throw new Error(`Plugin '${handle}' not found in block storage`);\n\t\treturn pluginEntry.__data;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/block_migrations.js\n\t/** Create a DataVersioned wrapper with correct shape */\n\tfunction makeVersionedData(version, data) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tdata\n\t\t};\n\t}\n\t/** Thrown by recover() to signal unrecoverable data. */\n\tvar DataUnrecoverableError = class extends Error {\n\t\tname = \"DataUnrecoverableError\";\n\t\tconstructor(dataVersion) {\n\t\t\tsuper(`Unknown version '${dataVersion}'`);\n\t\t}\n\t};\n\tfunction isDataUnrecoverableError(error) {\n\t\treturn error instanceof Error && error.name === \"DataUnrecoverableError\";\n\t}\n\t/**\n\t* Default recover function for unknown versions.\n\t* Use as fallback at the end of custom recover functions.\n\t*\n\t* @example\n\t* .recover((version, data) => {\n\t* if (version === 'legacy') {\n\t* return transformLegacyData(data);\n\t* }\n\t* return defaultRecover(version, data);\n\t* })\n\t*/\n\tconst defaultRecover = (version, _data) => {\n\t\tthrow new DataUnrecoverableError(version);\n\t};\n\t/** Symbol for internal builder creation method */\n\tconst FROM_BUILDER = Symbol(\"fromBuilder\");\n\t/**\n\t* Abstract base for both migration chain types.\n\t* Holds shared state, buildStep() helper, and init().\n\t* migrate() cannot be shared due to a TypeScript limitation: when the base class\n\t* migrate() return type is abstract, subclasses cannot narrow it without losing type safety.\n\t* Each subclass therefore owns its migrate() with the correct concrete return type.\n\t*\n\t* @internal\n\t*/\n\tvar MigrationChainBase = class {\n\t\tversionChain;\n\t\tmigrationSteps;\n\t\ttransferSteps;\n\t\tconstructor(state) {\n\t\t\tthis.versionChain = state.versionChain;\n\t\t\tthis.migrationSteps = state.steps;\n\t\t\tthis.transferSteps = state.transferSteps ?? [];\n\t\t}\n\t\t/** Appends a migration step and returns the new versionChain and steps arrays. */\n\t\tbuildStep(nextVersion, fn) {\n\t\t\tif (this.versionChain.includes(nextVersion)) throw new Error(`Duplicate version '${nextVersion}' in migration chain`);\n\t\t\tconst step = {\n\t\t\t\tfromVersion: this.versionChain[this.versionChain.length - 1],\n\t\t\t\ttoVersion: nextVersion,\n\t\t\t\tmigrate: fn\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tversionChain: [...this.versionChain, nextVersion],\n\t\t\t\tsteps: [...this.migrationSteps, step]\n\t\t\t};\n\t\t}\n\t\t/** Validates uniqueness and records a TransferStep. */\n\t\tbuildTransfer(target, extract) {\n\t\t\tif (this.transferSteps.some((t) => t.pluginId === target.id)) throw new Error(`Duplicate transfer for plugin '${target.id}'`);\n\t\t\tconst entry = {\n\t\t\t\tpluginId: target.id,\n\t\t\t\tbeforeStepIndex: this.migrationSteps.length,\n\t\t\t\textract,\n\t\t\t\ttargetVersion: target.transferVersion\n\t\t\t};\n\t\t\treturn { transferSteps: [...this.transferSteps, entry] };\n\t\t}\n\t\t/** Returns recover-specific fields for DataModel construction. Overridden by WithRecover. */\n\t\trecoverState() {\n\t\t\treturn {};\n\t\t}\n\t\t/**\n\t\t* Finalize the DataModel with initial data factory.\n\t\t*\n\t\t* @param initialData - Factory function returning the initial state\n\t\t* @returns Finalized DataModel instance\n\t\t*/\n\t\tinit(initialData) {\n\t\t\treturn DataModel[FROM_BUILDER]({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\tinitialDataFn: initialData,\n\t\t\t\t...this.recoverState()\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Migration chain after recover() or upgradeLegacy() has been called.\n\t* Further migrate() and transfer() calls are allowed; recover() and upgradeLegacy() are not\n\t* (enforced by type — no such methods on this class).\n\t*\n\t* @typeParam Current - Data type at the current point in the chain\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelMigrationChainWithRecover = class DataModelMigrationChainWithRecover extends MigrationChainBase {\n\t\trecoverFn;\n\t\trecoverFromIndex;\n\t\t/** @internal */\n\t\tconstructor(state) {\n\t\t\tsuper(state);\n\t\t\tthis.recoverFn = state.recoverFn;\n\t\t\tthis.recoverFromIndex = state.recoverFromIndex;\n\t\t}\n\t\trecoverState() {\n\t\t\treturn {\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Add a migration step. Same semantics as on the base chain.\n\t\t* recover() and upgradeLegacy() are not available — one has already been called.\n\t\t*/\n\t\tmigrate(nextVersion, fn) {\n\t\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Extract data at the current chain position for seeding a new plugin.\n\t\t* The extract function's return type must match the plugin's transfer data type.\n\t\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t\t*/\n\t\ttransfer(target, extract) {\n\t\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps,\n\t\t\t\trecoverFn: this.recoverFn,\n\t\t\t\trecoverFromIndex: this.recoverFromIndex\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Migration chain builder.\n\t* Each migrate() call advances the current data type. recover() can be called once\n\t* at any point — it removes itself from the returned chain so it cannot be called again.\n\t* Duplicate version keys throw at runtime.\n\t*\n\t* @typeParam Current - Data type at the current point in the migration chain\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelMigrationChain = class DataModelMigrationChain extends MigrationChainBase {\n\t\t/** @internal */\n\t\tconstructor({ versionChain, steps = [], transferSteps = [] }) {\n\t\t\tsuper({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Add a migration step transforming data from the current version to the next.\n\t\t*\n\t\t* @typeParam Next - Data type of the next version\n\t\t* @param nextVersion - Version key to migrate to (must be unique in the chain)\n\t\t* @param fn - Migration function\n\t\t* @returns Builder with the next version as current\n\t\t*\n\t\t* @example\n\t\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n\t\t*/\n\t\tmigrate(nextVersion, fn) {\n\t\t\tconst { versionChain, steps } = this.buildStep(nextVersion, fn);\n\t\t\treturn new DataModelMigrationChain({\n\t\t\t\tversionChain,\n\t\t\t\tsteps,\n\t\t\t\ttransferSteps: this.transferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Extract data at the current chain position for seeding a new plugin.\n\t\t* The extract function's return type must match the plugin's transfer data type.\n\t\t* Duplicate plugin IDs are rejected at both type and runtime level.\n\t\t*\n\t\t* Calling .transfer() on DataModelInitialChain returns DataModelMigrationChain,\n\t\t* which removes .upgradeLegacy() from the chain (preventing a problematic combination).\n\t\t*\n\t\t* @example\n\t\t* .from<V1>(\"v1\")\n\t\t* .transfer(tablePlugin, (v1) => ({ state: v1.tableState }))\n\t\t* .migrate<V2>(\"v2\", ({ tableState: _, ...rest }) => rest)\n\t\t*/\n\t\ttransfer(target, extract) {\n\t\t\tconst { transferSteps } = this.buildTransfer(target, extract);\n\t\t\treturn new DataModelMigrationChain({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Set a recovery handler for unknown or legacy versions.\n\t\t*\n\t\t* The recover function is called when data has a version not in the migration chain.\n\t\t* It must return data of the type at this point in the chain (Current). Any migrate()\n\t\t* steps added after recover() will then run on the recovered data.\n\t\t*\n\t\t* Can only be called once — the returned chain has no recover() method.\n\t\t*\n\t\t* @param fn - Recovery function returning Current (the type at this chain position)\n\t\t* @returns Builder with migrate() and init() but without recover()\n\t\t*\n\t\t* @example\n\t\t* // Recover between migrations — recovered data goes through v3 migration\n\t\t* new DataModelBuilder<V1>(\"v1\")\n\t\t* .migrate<V2>(\"v2\", (v1) => ({ ...v1, label: \"\" }))\n\t\t* .recover((version, data) => {\n\t\t* if (version === 'legacy') return transformLegacy(data); // returns V2\n\t\t* return defaultRecover(version, data);\n\t\t* })\n\t\t* .migrate<V3>(\"v3\", (v2) => ({ ...v2, description: \"\" }))\n\t\t* .init(() => ({ count: 0, label: \"\", description: \"\" }));\n\t\t*/\n\t\trecover(fn) {\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: this.versionChain,\n\t\t\t\tsteps: this.migrationSteps,\n\t\t\t\ttransferSteps: this.transferSteps,\n\t\t\t\trecoverFn: fn,\n\t\t\t\trecoverFromIndex: this.migrationSteps.length\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Initial migration chain returned by `.from()`.\n\t* Extends DataModelMigrationChain with `upgradeLegacy()` — available only before\n\t* any `.migrate()` calls, since legacy data always arrives at the initial version.\n\t*\n\t* @typeParam Current - Data type at the initial version\n\t* @typeParam Transfers - Accumulated transfer types keyed by plugin ID\n\t* @internal\n\t*/\n\tvar DataModelInitialChain = class extends DataModelMigrationChain {\n\t\t/**\n\t\t* Handle legacy V1 model state ({ args, uiState }) when upgrading a block from\n\t\t* BlockModel V1 to BlockModelV3.\n\t\t*\n\t\t* When a V1 block is upgraded, its stored state `{ args, uiState }` is normalized\n\t\t* to the internal default version. This method inserts a migration step from that\n\t\t* internal version to the version specified in `.from()`, using the provided typed\n\t\t* callback to transform the legacy shape. Non-legacy data passes through unchanged.\n\t\t*\n\t\t* Must be called right after `.from()` — not available after `.migrate()` calls.\n\t\t* Any `.migrate()` steps added after `upgradeLegacy()` will run on the transformed result.\n\t\t*\n\t\t* Can only be called once — the returned chain has no upgradeLegacy() method.\n\t\t* Mutually exclusive with recover().\n\t\t*\n\t\t* @typeParam Args - Type of the legacy block args\n\t\t* @typeParam UiState - Type of the legacy block uiState\n\t\t* @param fn - Typed transform from { args, uiState } to Current\n\t\t* @returns Builder with migrate() and init() but without recover() or upgradeLegacy()\n\t\t*\n\t\t* @example\n\t\t* type OldArgs = { inputFile: string; threshold: number };\n\t\t* type OldUiState = { selectedTab: string };\n\t\t* type BlockData = { inputFile: string; threshold: number; selectedTab: string };\n\t\t*\n\t\t* const dataModel = new DataModelBuilder()\n\t\t* .from<BlockData>(\"v1\")\n\t\t* .upgradeLegacy<OldArgs, OldUiState>(({ args, uiState }) => ({\n\t\t* inputFile: args.inputFile,\n\t\t* threshold: args.threshold,\n\t\t* selectedTab: uiState.selectedTab,\n\t\t* }))\n\t\t* .init(() => ({ inputFile: '', threshold: 0, selectedTab: 'main' }));\n\t\t*/\n\t\tupgradeLegacy(fn) {\n\t\t\tconst wrappedFn = (data) => {\n\t\t\t\tif (data !== null && typeof data === \"object\" && \"args\" in data) return fn(data);\n\t\t\t\treturn data;\n\t\t\t};\n\t\t\tconst step = {\n\t\t\t\tfromVersion: DATA_MODEL_LEGACY_VERSION,\n\t\t\t\ttoVersion: this.versionChain[0],\n\t\t\t\tmigrate: wrappedFn\n\t\t\t};\n\t\t\treturn new DataModelMigrationChainWithRecover({\n\t\t\t\tversionChain: [DATA_MODEL_LEGACY_VERSION, ...this.versionChain],\n\t\t\t\tsteps: [step, ...this.migrationSteps],\n\t\t\t\ttransferSteps: this.transferSteps.map((t) => ({\n\t\t\t\t\t...t,\n\t\t\t\t\tbeforeStepIndex: t.beforeStepIndex + 1\n\t\t\t\t}))\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* Builder entry point for creating DataModel with type-safe migrations.\n\t*\n\t* @example\n\t* // Simple (no migrations):\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockData>(\"v1\")\n\t* .init(() => ({ numbers: [] }));\n\t*\n\t* @example\n\t* // With migrations:\n\t* const dataModel = new DataModelBuilder()\n\t* .from<BlockDataV1>(\"v1\")\n\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }))\n\t* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n\t* .init(() => ({ numbers: [], labels: [], description: '' }));\n\t*\n\t* @example\n\t* // With recover() between migrations — recovered data goes through remaining migrations:\n\t* const dataModelChain = new DataModelBuilder()\n\t* .from<BlockDataV1>(\"v1\")\n\t* .migrate<BlockDataV2>(\"v2\", (v1) => ({ ...v1, labels: [] }));\n\t*\n\t* // recover() placed before the v3 migration: recovered data goes through v3\n\t* const dataModel = dataModelChain\n\t* .recover((version, data) => {\n\t* if (version === 'legacy' && isLegacyData(data)) return transformLegacy(data); // returns V2\n\t* return defaultRecover(version, data);\n\t* })\n\t* .migrate<BlockDataV3>(\"v3\", (v2) => ({ ...v2, description: '' }))\n\t* .init(() => ({ numbers: [], labels: [], description: '' }));\n\t*\n\t* @example\n\t* // With upgradeLegacy() — typed upgrade from BlockModel V1 state:\n\t* type OldArgs = { inputFile: string };\n\t* type OldUiState = { selectedTab: string };\n\t* type BlockData = { inputFile: string; 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* selectedTab: uiState.selectedTab,\n\t* }))\n\t* .init(() => ({ inputFile: '', selectedTab: 'main' }));\n\t*/\n\tvar DataModelBuilder = class {\n\t\t/**\n\t\t* Start the migration chain with the given initial data type and version key.\n\t\t*\n\t\t* @typeParam T - Data type for the initial version\n\t\t* @param initialVersion - Version key string (e.g. \"v1\")\n\t\t* @returns Migration chain builder\n\t\t*/\n\t\tfrom(initialVersion) {\n\t\t\treturn new DataModelInitialChain({ versionChain: [initialVersion] });\n\t\t}\n\t};\n\t/**\n\t* DataModel defines the block's data structure, initial values, and migrations.\n\t* Used by BlockModelV3 to manage data state.\n\t*\n\t* Use `new DataModelBuilder()` to create a DataModel.\n\t*\n\t* @example\n\t* // With recover() between migrations:\n\t* // Recovered data (V2) goes through the v2→v3 migration automatically.\n\t* const dataModel = new DataModelBuilder()\n\t* .from<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\tvar DataModel = class DataModel {\n\t\t/** Latest version key — O(1) access for the common \"already current\" check. */\n\t\tlatestVersion;\n\t\t/** Maps each known version key to the index of the first step to run from it. O(1) lookup. */\n\t\tstepsByFromVersion;\n\t\tsteps;\n\t\ttransferSteps;\n\t\tinitialDataFn;\n\t\trecoverFn;\n\t\trecoverFromIndex;\n\t\tconstructor({ versionChain, steps, transferSteps = [], initialDataFn, recoverFn = defaultRecover, recoverFromIndex }) {\n\t\t\tif (versionChain.length === 0) throw new Error(\"DataModel requires at least one version key\");\n\t\t\tthis.latestVersion = versionChain[versionChain.length - 1];\n\t\t\tthis.stepsByFromVersion = new Map(versionChain.map((v, i) => [v, i]));\n\t\t\tthis.steps = steps;\n\t\t\tthis.transferSteps = transferSteps;\n\t\t\tthis.initialDataFn = initialDataFn;\n\t\t\tthis.recoverFn = recoverFn;\n\t\t\tthis.recoverFromIndex = recoverFromIndex ?? steps.length;\n\t\t}\n\t\t/**\n\t\t* Internal method for creating DataModel from builder.\n\t\t* Uses Symbol key to prevent external access.\n\t\t* @internal\n\t\t*/\n\t\tstatic [FROM_BUILDER](state) {\n\t\t\treturn new DataModel(state);\n\t\t}\n\t\t/**\n\t\t* The latest (current) version key in the migration chain.\n\t\t*/\n\t\tget version() {\n\t\t\treturn this.latestVersion;\n\t\t}\n\t\t/**\n\t\t* Get a fresh copy of the initial data.\n\t\t*/\n\t\tinitialData() {\n\t\t\treturn this.initialDataFn();\n\t\t}\n\t\t/**\n\t\t* Get initial data wrapped with current version.\n\t\t* Used when creating new blocks or resetting to defaults.\n\t\t*/\n\t\tgetDefaultData() {\n\t\t\treturn makeVersionedData(this.latestVersion, this.initialDataFn());\n\t\t}\n\t\trecoverFrom(data, version) {\n\t\t\tlet currentData = this.recoverFn(version, data);\n\t\t\tfor (let i = this.recoverFromIndex; i < this.steps.length; i++) currentData = this.steps[i].migrate(currentData);\n\t\t\treturn {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata: currentData\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Migrate versioned data from any version to the latest.\n\t\t* Collects transfer extractions at their designated chain positions.\n\t\t*\n\t\t* - If version is in chain, applies needed migrations (O(1) lookup)\n\t\t* - If version is unknown, attempts recovery; falls back to initial data\n\t\t* - If a migration step fails, throws so the caller can preserve original data\n\t\t*\n\t\t* Transfers only fire during normal step-by-step migration:\n\t\t* - Recovery path: returns empty transfers\n\t\t* - Fast-path (already at latest): returns empty transfers\n\t\t*\n\t\t* @param versioned - Data with version tag\n\t\t* @returns Migrated data at the latest version with transfer record\n\t\t* @throws If a migration step from a known version fails\n\t\t*/\n\t\tmigrate(versioned) {\n\t\t\tconst { version: fromVersion, data } = versioned;\n\t\t\tif (fromVersion === this.latestVersion) return {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata,\n\t\t\t\ttransfers: {}\n\t\t\t};\n\t\t\tconst startIndex = this.stepsByFromVersion.get(fromVersion);\n\t\t\tif (startIndex === void 0) try {\n\t\t\t\treturn {\n\t\t\t\t\t...this.recoverFrom(data, fromVersion),\n\t\t\t\t\ttransfers: {}\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\treturn {\n\t\t\t\t\t...this.getDefaultData(),\n\t\t\t\t\ttransfers: {}\n\t\t\t\t};\n\t\t\t}\n\t\t\tlet currentData = data;\n\t\t\tconst transfers = {};\n\t\t\tfor (let i = startIndex; i < this.steps.length; i++) {\n\t\t\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex === i) transfers[t.pluginId] = {\n\t\t\t\t\tversion: t.targetVersion,\n\t\t\t\t\tdata: t.extract(currentData)\n\t\t\t\t};\n\t\t\t\tcurrentData = this.steps[i].migrate(currentData);\n\t\t\t}\n\t\t\tfor (const t of this.transferSteps) if (t.beforeStepIndex >= this.steps.length && t.beforeStepIndex >= startIndex) 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\treturn {\n\t\t\t\tversion: this.latestVersion,\n\t\t\t\tdata: currentData,\n\t\t\t\ttransfers\n\t\t\t};\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/internal.js\n\t/** Utility code helping to identify whether the code is running in actual UI environment */\n\tfunction isInUI() {\n\t\treturn typeof globalThis.getPlatforma !== \"undefined\" || typeof globalThis.platforma !== \"undefined\";\n\t}\n\t/** Utility code helping to retrieve a platforma instance form the environment */\n\tfunction getPlatformaInstance(config) {\n\t\tif (config && typeof globalThis.getPlatforma === \"function\") return globalThis.getPlatforma(config);\n\t\telse if (typeof globalThis.platforma !== \"undefined\") return globalThis.platforma;\n\t\telse throw new Error(\"Can't get platforma instance.\");\n\t}\n\tfunction tryGetCfgRenderCtx() {\n\t\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\t\telse return void 0;\n\t}\n\tfunction getCfgRenderCtx() {\n\t\tif (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n\t\telse throw new Error(\"Not in config rendering context\");\n\t}\n\tfunction tryRegisterCallback(key, callback) {\n\t\tconst ctx = tryGetCfgRenderCtx();\n\t\tif (ctx === void 0) return false;\n\t\tif (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n\t\tctx.callbackRegistry[key] = callback;\n\t\treturn true;\n\t}\n\t/**\n\t* Registers a callback, replacing any existing callback with the same key.\n\t* Use this for callbacks that have a default value but can be overridden.\n\t*\n\t* @param key - The callback registry key\n\t* @param callback - The callback function to register\n\t* @returns true if registered, false if not in render context\n\t*/\n\tfunction replaceCallback(key, callback) {\n\t\tconst ctx = tryGetCfgRenderCtx();\n\t\tif (ctx === void 0) return false;\n\t\tctx.callbackRegistry[key] = callback;\n\t\treturn true;\n\t}\n\t/** Creates a ConfigRenderLambda descriptor without registering a callback. */\n\tfunction createRenderLambda(opts) {\n\t\tconst { handle, ...flags } = opts;\n\t\treturn {\n\t\t\t__renderLambda: true,\n\t\t\thandle,\n\t\t\t...flags\n\t\t};\n\t}\n\t/** Registers a callback and returns a ConfigRenderLambda descriptor. */\n\tfunction createAndRegisterRenderLambda(opts, replace) {\n\t\tconst { handle, lambda, ...flags } = opts;\n\t\tif (replace) replaceCallback(handle, lambda);\n\t\telse tryRegisterCallback(handle, lambda);\n\t\treturn createRenderLambda({\n\t\t\thandle,\n\t\t\t...flags\n\t\t});\n\t}\n\tconst futureResolves = /* @__PURE__ */ new Map();\n\tfunction registerFutureAwait(handle, onResolve) {\n\t\tif (!(handle in getCfgRenderCtx().callbackRegistry)) {\n\t\t\tgetCfgRenderCtx().callbackRegistry[handle] = (value) => {\n\t\t\t\tfor (const res of futureResolves.get(handle)) res(value);\n\t\t\t};\n\t\t\tfutureResolves.set(handle, []);\n\t\t}\n\t\tfutureResolves.get(handle).push(onResolve);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/block_storage_facade.js\n\t/**\n\t* All facade callback names as constants.\n\t* These are the source of truth - the interface is derived from these.\n\t*\n\t* IMPORTANT: When adding a new callback:\n\t* 1. Add the constant here\n\t* 2. Add the callback signature to FacadeCallbackTypes below\n\t* 3. The BlockStorageFacade type will automatically include it\n\t*/\n\tconst BlockStorageFacadeCallbacks = {\n\t\tStorageApplyUpdate: \"__pl_storage_applyUpdate\",\n\t\tStorageDebugView: \"__pl_storage_debugView\",\n\t\tStorageMigrate: \"__pl_storage_migrate\",\n\t\tArgsDerive: \"__pl_args_derive\",\n\t\tPrerunArgsDerive: \"__pl_prerunArgs_derive\",\n\t\tStorageInitial: \"__pl_storage_initial\"\n\t};\n\t/**\n\t* Creates a map of lambda handles from a callbacks constant object.\n\t* Keys are the callback string values (e.g., '__pl_storage_applyUpdate').\n\t*/\n\tfunction createFacadeHandles(callbacks) {\n\t\treturn Object.fromEntries(Object.values(callbacks).map((handle) => [handle, createRenderLambda({ handle })]));\n\t}\n\t/**\n\t* Lambda handles for facade callbacks.\n\t* Used by the middle layer to invoke callbacks via executeSingleLambda().\n\t*/\n\tconst BlockStorageFacadeHandles = createFacadeHandles(BlockStorageFacadeCallbacks);\n\t/** Register all facade callbacks at once. Ensures all required callbacks are provided. */\n\tfunction registerFacadeCallbacks(callbacks) {\n\t\tfor (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/config/actions.js\n\tfunction getFromCfg(variable) {\n\t\treturn {\n\t\t\ttype: \"GetFromCtx\",\n\t\t\tvariable\n\t\t};\n\t}\n\tgetFromCfg(\"$args\");\n\tgetFromCfg(\"$it\");\n\tgetFromCfg(\"$prod\");\n\tgetFromCfg(\"$staging\");\n\tgetFromCfg(\"$ui\");\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/future.js\n\tvar FutureRef = class FutureRef {\n\t\tisResolved = false;\n\t\tresolvedValue;\n\t\tconstructor(handle, postProcess = (v) => v) {\n\t\t\tthis.handle = handle;\n\t\t\tthis.postProcess = postProcess;\n\t\t\tregisterFutureAwait(handle, (value) => {\n\t\t\t\tthis.resolvedValue = postProcess(value);\n\t\t\t\tthis.isResolved = true;\n\t\t\t});\n\t\t}\n\t\tmap(mapping) {\n\t\t\treturn new FutureRef(this.handle, (v) => mapping(this.postProcess(v)));\n\t\t}\n\t\tmapDefined(mapping) {\n\t\t\treturn new FutureRef(this.handle, (v) => {\n\t\t\t\tconst vv = this.postProcess(v);\n\t\t\t\treturn vv ? mapping(vv) : void 0;\n\t\t\t});\n\t\t}\n\t\ttoJSON() {\n\t\t\treturn this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js\n\tvar util;\n\t(function(util) {\n\t\tutil.assertEqual = (_) => {};\n\t\tfunction assertIs(_arg) {}\n\t\tutil.assertIs = assertIs;\n\t\tfunction assertNever(_x) {\n\t\t\tthrow new Error();\n\t\t}\n\t\tutil.assertNever = assertNever;\n\t\tutil.arrayToEnum = (items) => {\n\t\t\tconst obj = {};\n\t\t\tfor (const item of items) obj[item] = item;\n\t\t\treturn obj;\n\t\t};\n\t\tutil.getValidEnumValues = (obj) => {\n\t\t\tconst validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n\t\t\tconst filtered = {};\n\t\t\tfor (const k of validKeys) filtered[k] = obj[k];\n\t\t\treturn util.objectValues(filtered);\n\t\t};\n\t\tutil.objectValues = (obj) => {\n\t\t\treturn util.objectKeys(obj).map(function(e) {\n\t\t\t\treturn obj[e];\n\t\t\t});\n\t\t};\n\t\tutil.objectKeys = typeof Object.keys === \"function\" ? (obj) => Object.keys(obj) : (object) => {\n\t\t\tconst keys = [];\n\t\t\tfor (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) keys.push(key);\n\t\t\treturn keys;\n\t\t};\n\t\tutil.find = (arr, checker) => {\n\t\t\tfor (const item of arr) if (checker(item)) return item;\n\t\t};\n\t\tutil.isInteger = typeof Number.isInteger === \"function\" ? (val) => Number.isInteger(val) : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n\t\tfunction joinValues(array, separator = \" | \") {\n\t\t\treturn array.map((val) => typeof val === \"string\" ? `'${val}'` : val).join(separator);\n\t\t}\n\t\tutil.joinValues = joinValues;\n\t\tutil.jsonStringifyReplacer = (_, value) => {\n\t\t\tif (typeof value === \"bigint\") return value.toString();\n\t\t\treturn value;\n\t\t};\n\t})(util || (util = {}));\n\tvar objectUtil;\n\t(function(objectUtil) {\n\t\tobjectUtil.mergeShapes = (first, second) => {\n\t\t\treturn {\n\t\t\t\t...first,\n\t\t\t\t...second\n\t\t\t};\n\t\t};\n\t})(objectUtil || (objectUtil = {}));\n\tconst ZodParsedType = util.arrayToEnum([\n\t\t\"string\",\n\t\t\"nan\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"float\",\n\t\t\"boolean\",\n\t\t\"date\",\n\t\t\"bigint\",\n\t\t\"symbol\",\n\t\t\"function\",\n\t\t\"undefined\",\n\t\t\"null\",\n\t\t\"array\",\n\t\t\"object\",\n\t\t\"unknown\",\n\t\t\"promise\",\n\t\t\"void\",\n\t\t\"never\",\n\t\t\"map\",\n\t\t\"set\"\n\t]);\n\tconst getParsedType = (data) => {\n\t\tswitch (typeof data) {\n\t\t\tcase \"undefined\": return ZodParsedType.undefined;\n\t\t\tcase \"string\": return ZodParsedType.string;\n\t\t\tcase \"number\": return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n\t\t\tcase \"boolean\": return ZodParsedType.boolean;\n\t\t\tcase \"function\": return ZodParsedType.function;\n\t\t\tcase \"bigint\": return ZodParsedType.bigint;\n\t\t\tcase \"symbol\": return ZodParsedType.symbol;\n\t\t\tcase \"object\":\n\t\t\t\tif (Array.isArray(data)) return ZodParsedType.array;\n\t\t\t\tif (data === null) return ZodParsedType.null;\n\t\t\t\tif (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") return ZodParsedType.promise;\n\t\t\t\tif (typeof Map !== \"undefined\" && data instanceof Map) return ZodParsedType.map;\n\t\t\t\tif (typeof Set !== \"undefined\" && data instanceof Set) return ZodParsedType.set;\n\t\t\t\tif (typeof Date !== \"undefined\" && data instanceof Date) return ZodParsedType.date;\n\t\t\t\treturn ZodParsedType.object;\n\t\t\tdefault: return ZodParsedType.unknown;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js\n\tconst ZodIssueCode = util.arrayToEnum([\n\t\t\"invalid_type\",\n\t\t\"invalid_literal\",\n\t\t\"custom\",\n\t\t\"invalid_union\",\n\t\t\"invalid_union_discriminator\",\n\t\t\"invalid_enum_value\",\n\t\t\"unrecognized_keys\",\n\t\t\"invalid_arguments\",\n\t\t\"invalid_return_type\",\n\t\t\"invalid_date\",\n\t\t\"invalid_string\",\n\t\t\"too_small\",\n\t\t\"too_big\",\n\t\t\"invalid_intersection_types\",\n\t\t\"not_multiple_of\",\n\t\t\"not_finite\"\n\t]);\n\tvar ZodError = class ZodError extends Error {\n\t\tget errors() {\n\t\t\treturn this.issues;\n\t\t}\n\t\tconstructor(issues) {\n\t\t\tsuper();\n\t\t\tthis.issues = [];\n\t\t\tthis.addIssue = (sub) => {\n\t\t\t\tthis.issues = [...this.issues, sub];\n\t\t\t};\n\t\t\tthis.addIssues = (subs = []) => {\n\t\t\t\tthis.issues = [...this.issues, ...subs];\n\t\t\t};\n\t\t\tconst actualProto = new.target.prototype;\n\t\t\tif (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto);\n\t\t\telse this.__proto__ = actualProto;\n\t\t\tthis.name = \"ZodError\";\n\t\t\tthis.issues = issues;\n\t\t}\n\t\tformat(_mapper) {\n\t\t\tconst mapper = _mapper || function(issue) {\n\t\t\t\treturn issue.message;\n\t\t\t};\n\t\t\tconst fieldErrors = { _errors: [] };\n\t\t\tconst processError = (error) => {\n\t\t\t\tfor (const issue of error.issues) if (issue.code === \"invalid_union\") issue.unionErrors.map(processError);\n\t\t\t\telse if (issue.code === \"invalid_return_type\") processError(issue.returnTypeError);\n\t\t\t\telse if (issue.code === \"invalid_arguments\") processError(issue.argumentsError);\n\t\t\t\telse if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));\n\t\t\t\telse {\n\t\t\t\t\tlet curr = fieldErrors;\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\twhile (i < issue.path.length) {\n\t\t\t\t\t\tconst el = issue.path[i];\n\t\t\t\t\t\tif (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurr[el] = curr[el] || { _errors: [] };\n\t\t\t\t\t\t\tcurr[el]._errors.push(mapper(issue));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurr = curr[el];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tprocessError(this);\n\t\t\treturn fieldErrors;\n\t\t}\n\t\tstatic assert(value) {\n\t\t\tif (!(value instanceof ZodError)) throw new Error(`Not a ZodError: ${value}`);\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.message;\n\t\t}\n\t\tget message() {\n\t\t\treturn JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n\t\t}\n\t\tget isEmpty() {\n\t\t\treturn this.issues.length === 0;\n\t\t}\n\t\tflatten(mapper = (issue) => issue.message) {\n\t\t\tconst fieldErrors = {};\n\t\t\tconst formErrors = [];\n\t\t\tfor (const sub of this.issues) if (sub.path.length > 0) {\n\t\t\t\tconst firstEl = sub.path[0];\n\t\t\t\tfieldErrors[firstEl] = fieldErrors[firstEl] || [];\n\t\t\t\tfieldErrors[firstEl].push(mapper(sub));\n\t\t\t} else formErrors.push(mapper(sub));\n\t\t\treturn {\n\t\t\t\tformErrors,\n\t\t\t\tfieldErrors\n\t\t\t};\n\t\t}\n\t\tget formErrors() {\n\t\t\treturn this.flatten();\n\t\t}\n\t};\n\tZodError.create = (issues) => {\n\t\treturn new ZodError(issues);\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js\n\tconst errorMap = (issue, _ctx) => {\n\t\tlet message;\n\t\tswitch (issue.code) {\n\t\t\tcase ZodIssueCode.invalid_type:\n\t\t\t\tif (issue.received === ZodParsedType.undefined) message = \"Required\";\n\t\t\t\telse message = `Expected ${issue.expected}, received ${issue.received}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_literal:\n\t\t\t\tmessage = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.unrecognized_keys:\n\t\t\t\tmessage = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_union:\n\t\t\t\tmessage = `Invalid input`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_union_discriminator:\n\t\t\t\tmessage = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_enum_value:\n\t\t\t\tmessage = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_arguments:\n\t\t\t\tmessage = `Invalid function arguments`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_return_type:\n\t\t\t\tmessage = `Invalid function return type`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_date:\n\t\t\t\tmessage = `Invalid date`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_string:\n\t\t\t\tif (typeof issue.validation === \"object\") if (\"includes\" in issue.validation) {\n\t\t\t\t\tmessage = `Invalid input: must include \"${issue.validation.includes}\"`;\n\t\t\t\t\tif (typeof issue.validation.position === \"number\") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n\t\t\t\t} else if (\"startsWith\" in issue.validation) message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n\t\t\t\telse if (\"endsWith\" in issue.validation) message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n\t\t\t\telse util.assertNever(issue.validation);\n\t\t\t\telse if (issue.validation !== \"regex\") message = `Invalid ${issue.validation}`;\n\t\t\t\telse message = \"Invalid\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.too_small:\n\t\t\t\tif (issue.type === \"array\") message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n\t\t\t\telse if (issue.type === \"string\") message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n\t\t\t\telse if (issue.type === \"number\") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n\t\t\t\telse if (issue.type === \"bigint\") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n\t\t\t\telse if (issue.type === \"date\") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n\t\t\t\telse message = \"Invalid input\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.too_big:\n\t\t\t\tif (issue.type === \"array\") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n\t\t\t\telse if (issue.type === \"string\") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n\t\t\t\telse if (issue.type === \"number\") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n\t\t\t\telse if (issue.type === \"bigint\") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n\t\t\t\telse if (issue.type === \"date\") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n\t\t\t\telse message = \"Invalid input\";\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.custom:\n\t\t\t\tmessage = `Invalid input`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.invalid_intersection_types:\n\t\t\t\tmessage = `Intersection results could not be merged`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.not_multiple_of:\n\t\t\t\tmessage = `Number must be a multiple of ${issue.multipleOf}`;\n\t\t\t\tbreak;\n\t\t\tcase ZodIssueCode.not_finite:\n\t\t\t\tmessage = \"Number must be finite\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmessage = _ctx.defaultError;\n\t\t\t\tutil.assertNever(issue);\n\t\t}\n\t\treturn { message };\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js\n\tlet overrideErrorMap = errorMap;\n\tfunction getErrorMap() {\n\t\treturn overrideErrorMap;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js\n\tconst makeIssue = (params) => {\n\t\tconst { data, path, errorMaps, issueData } = params;\n\t\tconst fullPath = [...path, ...issueData.path || []];\n\t\tconst fullIssue = {\n\t\t\t...issueData,\n\t\t\tpath: fullPath\n\t\t};\n\t\tif (issueData.message !== void 0) return {\n\t\t\t...issueData,\n\t\t\tpath: fullPath,\n\t\t\tmessage: issueData.message\n\t\t};\n\t\tlet errorMessage = \"\";\n\t\tconst maps = errorMaps.filter((m) => !!m).slice().reverse();\n\t\tfor (const map of maps) errorMessage = map(fullIssue, {\n\t\t\tdata,\n\t\t\tdefaultError: errorMessage\n\t\t}).message;\n\t\treturn {\n\t\t\t...issueData,\n\t\t\tpath: fullPath,\n\t\t\tmessage: errorMessage\n\t\t};\n\t};\n\tfunction addIssueToContext(ctx, issueData) {\n\t\tconst overrideMap = getErrorMap();\n\t\tconst issue = makeIssue({\n\t\t\tissueData,\n\t\t\tdata: ctx.data,\n\t\t\tpath: ctx.path,\n\t\t\terrorMaps: [\n\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\tctx.schemaErrorMap,\n\t\t\t\toverrideMap,\n\t\t\t\toverrideMap === errorMap ? void 0 : errorMap\n\t\t\t].filter((x) => !!x)\n\t\t});\n\t\tctx.common.issues.push(issue);\n\t}\n\tvar ParseStatus = class ParseStatus {\n\t\tconstructor() {\n\t\t\tthis.value = \"valid\";\n\t\t}\n\t\tdirty() {\n\t\t\tif (this.value === \"valid\") this.value = \"dirty\";\n\t\t}\n\t\tabort() {\n\t\t\tif (this.value !== \"aborted\") this.value = \"aborted\";\n\t\t}\n\t\tstatic mergeArray(status, results) {\n\t\t\tconst arrayValue = [];\n\t\t\tfor (const s of results) {\n\t\t\t\tif (s.status === \"aborted\") return INVALID;\n\t\t\t\tif (s.status === \"dirty\") status.dirty();\n\t\t\t\tarrayValue.push(s.value);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: arrayValue\n\t\t\t};\n\t\t}\n\t\tstatic async mergeObjectAsync(status, pairs) {\n\t\t\tconst syncPairs = [];\n\t\t\tfor (const pair of pairs) {\n\t\t\t\tconst key = await pair.key;\n\t\t\t\tconst value = await pair.value;\n\t\t\t\tsyncPairs.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 ParseStatus.mergeObjectSync(status, syncPairs);\n\t\t}\n\t\tstatic mergeObjectSync(status, pairs) {\n\t\t\tconst finalObject = {};\n\t\t\tfor (const pair of pairs) {\n\t\t\t\tconst { key, value } = pair;\n\t\t\t\tif (key.status === \"aborted\") return INVALID;\n\t\t\t\tif (value.status === \"aborted\") return INVALID;\n\t\t\t\tif (key.status === \"dirty\") status.dirty();\n\t\t\t\tif (value.status === \"dirty\") status.dirty();\n\t\t\t\tif (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) finalObject[key.value] = value.value;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: finalObject\n\t\t\t};\n\t\t}\n\t};\n\tconst INVALID = Object.freeze({ status: \"aborted\" });\n\tconst DIRTY = (value) => ({\n\t\tstatus: \"dirty\",\n\t\tvalue\n\t});\n\tconst OK = (value) => ({\n\t\tstatus: \"valid\",\n\t\tvalue\n\t});\n\tconst isAborted = (x) => x.status === \"aborted\";\n\tconst isDirty = (x) => x.status === \"dirty\";\n\tconst isValid = (x) => x.status === \"valid\";\n\tconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js\n\tvar errorUtil;\n\t(function(errorUtil) {\n\t\terrorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n\t\terrorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n\t})(errorUtil || (errorUtil = {}));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js\n\tvar ParseInputLazyPath = class {\n\t\tconstructor(parent, value, path, key) {\n\t\t\tthis._cachedPath = [];\n\t\t\tthis.parent = parent;\n\t\t\tthis.data = value;\n\t\t\tthis._path = path;\n\t\t\tthis._key = key;\n\t\t}\n\t\tget path() {\n\t\t\tif (!this._cachedPath.length) if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key);\n\t\t\telse this._cachedPath.push(...this._path, this._key);\n\t\t\treturn this._cachedPath;\n\t\t}\n\t};\n\tconst handleResult = (ctx, result) => {\n\t\tif (isValid(result)) return {\n\t\t\tsuccess: true,\n\t\t\tdata: result.value\n\t\t};\n\t\telse {\n\t\t\tif (!ctx.common.issues.length) throw new Error(\"Validation failed but no issues detected.\");\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tget error() {\n\t\t\t\t\tif (this._error) return this._error;\n\t\t\t\t\tconst error = new ZodError(ctx.common.issues);\n\t\t\t\t\tthis._error = error;\n\t\t\t\t\treturn this._error;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\tfunction processCreateParams(params) {\n\t\tif (!params) return {};\n\t\tconst { errorMap, invalid_type_error, required_error, description } = params;\n\t\tif (errorMap && (invalid_type_error || required_error)) throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n\t\tif (errorMap) return {\n\t\t\terrorMap,\n\t\t\tdescription\n\t\t};\n\t\tconst customMap = (iss, ctx) => {\n\t\t\tconst { message } = params;\n\t\t\tif (iss.code === \"invalid_enum_value\") return { message: message ?? ctx.defaultError };\n\t\t\tif (typeof ctx.data === \"undefined\") return { message: message ?? required_error ?? ctx.defaultError };\n\t\t\tif (iss.code !== \"invalid_type\") return { message: ctx.defaultError };\n\t\t\treturn { message: message ?? invalid_type_error ?? ctx.defaultError };\n\t\t};\n\t\treturn {\n\t\t\terrorMap: customMap,\n\t\t\tdescription\n\t\t};\n\t}\n\tvar ZodType = class {\n\t\tget description() {\n\t\t\treturn this._def.description;\n\t\t}\n\t\t_getType(input) {\n\t\t\treturn getParsedType(input.data);\n\t\t}\n\t\t_getOrReturnCtx(input, ctx) {\n\t\t\treturn ctx || {\n\t\t\t\tcommon: input.parent.common,\n\t\t\t\tdata: input.data,\n\t\t\t\tparsedType: getParsedType(input.data),\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tpath: input.path,\n\t\t\t\tparent: input.parent\n\t\t\t};\n\t\t}\n\t\t_processInputParams(input) {\n\t\t\treturn {\n\t\t\t\tstatus: new ParseStatus(),\n\t\t\t\tctx: {\n\t\t\t\t\tcommon: input.parent.common,\n\t\t\t\t\tdata: input.data,\n\t\t\t\t\tparsedType: getParsedType(input.data),\n\t\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\t\tpath: input.path,\n\t\t\t\t\tparent: input.parent\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t_parseSync(input) {\n\t\t\tconst result = this._parse(input);\n\t\t\tif (isAsync(result)) throw new Error(\"Synchronous parse encountered promise.\");\n\t\t\treturn result;\n\t\t}\n\t\t_parseAsync(input) {\n\t\t\tconst result = this._parse(input);\n\t\t\treturn Promise.resolve(result);\n\t\t}\n\t\tparse(data, params) {\n\t\t\tconst result = this.safeParse(data, params);\n\t\t\tif (result.success) return result.data;\n\t\t\tthrow result.error;\n\t\t}\n\t\tsafeParse(data, params) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: params?.async ?? false,\n\t\t\t\t\tcontextualErrorMap: params?.errorMap\n\t\t\t\t},\n\t\t\t\tpath: params?.path || [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\treturn handleResult(ctx, this._parseSync({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}));\n\t\t}\n\t\t\"~validate\"(data) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: !!this[\"~standard\"].async\n\t\t\t\t},\n\t\t\t\tpath: [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\tif (!this[\"~standard\"].async) try {\n\t\t\t\tconst result = this._parseSync({\n\t\t\t\t\tdata,\n\t\t\t\t\tpath: [],\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\treturn isValid(result) ? { value: result.value } : { issues: ctx.common.issues };\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.message?.toLowerCase()?.includes(\"encountered\")) this[\"~standard\"].async = true;\n\t\t\t\tctx.common = {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tasync: true\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn this._parseAsync({\n\t\t\t\tdata,\n\t\t\t\tpath: [],\n\t\t\t\tparent: ctx\n\t\t\t}).then((result) => isValid(result) ? { value: result.value } : { issues: ctx.common.issues });\n\t\t}\n\t\tasync parseAsync(data, params) {\n\t\t\tconst result = await this.safeParseAsync(data, params);\n\t\t\tif (result.success) return result.data;\n\t\t\tthrow result.error;\n\t\t}\n\t\tasync safeParseAsync(data, params) {\n\t\t\tconst ctx = {\n\t\t\t\tcommon: {\n\t\t\t\t\tissues: [],\n\t\t\t\t\tcontextualErrorMap: params?.errorMap,\n\t\t\t\t\tasync: true\n\t\t\t\t},\n\t\t\t\tpath: params?.path || [],\n\t\t\t\tschemaErrorMap: this._def.errorMap,\n\t\t\t\tparent: null,\n\t\t\t\tdata,\n\t\t\t\tparsedType: getParsedType(data)\n\t\t\t};\n\t\t\tconst maybeAsyncResult = this._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t\treturn handleResult(ctx, await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)));\n\t\t}\n\t\trefine(check, message) {\n\t\t\tconst getIssueProperties = (val) => {\n\t\t\t\tif (typeof message === \"string\" || typeof message === \"undefined\") return { message };\n\t\t\t\telse if (typeof message === \"function\") return message(val);\n\t\t\t\telse return message;\n\t\t\t};\n\t\t\treturn this._refinement((val, ctx) => {\n\t\t\t\tconst result = check(val);\n\t\t\t\tconst setError = () => ctx.addIssue({\n\t\t\t\t\tcode: ZodIssueCode.custom,\n\t\t\t\t\t...getIssueProperties(val)\n\t\t\t\t});\n\t\t\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) return result.then((data) => {\n\t\t\t\t\tif (!data) {\n\t\t\t\t\t\tsetError();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else return true;\n\t\t\t\t});\n\t\t\t\tif (!result) {\n\t\t\t\t\tsetError();\n\t\t\t\t\treturn false;\n\t\t\t\t} else return true;\n\t\t\t});\n\t\t}\n\t\trefinement(check, refinementData) {\n\t\t\treturn this._refinement((val, ctx) => {\n\t\t\t\tif (!check(val)) {\n\t\t\t\t\tctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n\t\t\t\t\treturn false;\n\t\t\t\t} else return true;\n\t\t\t});\n\t\t}\n\t\t_refinement(refinement) {\n\t\t\treturn new ZodEffects({\n\t\t\t\tschema: this,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t\teffect: {\n\t\t\t\t\ttype: \"refinement\",\n\t\t\t\t\trefinement\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsuperRefine(refinement) {\n\t\t\treturn this._refinement(refinement);\n\t\t}\n\t\tconstructor(def) {\n\t\t\t/** Alias of safeParseAsync */\n\t\t\tthis.spa = this.safeParseAsync;\n\t\t\tthis._def = def;\n\t\t\tthis.parse = this.parse.bind(this);\n\t\t\tthis.safeParse = this.safeParse.bind(this);\n\t\t\tthis.parseAsync = this.parseAsync.bind(this);\n\t\t\tthis.safeParseAsync = this.safeParseAsync.bind(this);\n\t\t\tthis.spa = this.spa.bind(this);\n\t\t\tthis.refine = this.refine.bind(this);\n\t\t\tthis.refinement = this.refinement.bind(this);\n\t\t\tthis.superRefine = this.superRefine.bind(this);\n\t\t\tthis.optional = this.optional.bind(this);\n\t\t\tthis.nullable = this.nullable.bind(this);\n\t\t\tthis.nullish = this.nullish.bind(this);\n\t\t\tthis.array = this.array.bind(this);\n\t\t\tthis.promise = this.promise.bind(this);\n\t\t\tthis.or = this.or.bind(this);\n\t\t\tthis.and = this.and.bind(this);\n\t\t\tthis.transform = this.transform.bind(this);\n\t\t\tthis.brand = this.brand.bind(this);\n\t\t\tthis.default = this.default.bind(this);\n\t\t\tthis.catch = this.catch.bind(this);\n\t\t\tthis.describe = this.describe.bind(this);\n\t\t\tthis.pipe = this.pipe.bind(this);\n\t\t\tthis.readonly = this.readonly.bind(this);\n\t\t\tthis.isNullable = this.isNullable.bind(this);\n\t\t\tthis.isOptional = this.isOptional.bind(this);\n\t\t\tthis[\"~standard\"] = {\n\t\t\t\tversion: 1,\n\t\t\t\tvendor: \"zod\",\n\t\t\t\tvalidate: (data) => this[\"~validate\"](data)\n\t\t\t};\n\t\t}\n\t\toptional() {\n\t\t\treturn ZodOptional.create(this, this._def);\n\t\t}\n\t\tnullable() {\n\t\t\treturn ZodNullable.create(this, this._def);\n\t\t}\n\t\tnullish() {\n\t\t\treturn this.nullable().optional();\n\t\t}\n\t\tarray() {\n\t\t\treturn ZodArray.create(this);\n\t\t}\n\t\tpromise() {\n\t\t\treturn ZodPromise.create(this, this._def);\n\t\t}\n\t\tor(option) {\n\t\t\treturn ZodUnion.create([this, option], this._def);\n\t\t}\n\t\tand(incoming) {\n\t\t\treturn ZodIntersection.create(this, incoming, this._def);\n\t\t}\n\t\ttransform(transform) {\n\t\t\treturn new ZodEffects({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tschema: this,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t\teffect: {\n\t\t\t\t\ttype: \"transform\",\n\t\t\t\t\ttransform\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tdefault(def) {\n\t\t\tconst defaultValueFunc = typeof def === \"function\" ? def : () => def;\n\t\t\treturn new ZodDefault({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tinnerType: this,\n\t\t\t\tdefaultValue: defaultValueFunc,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDefault\n\t\t\t});\n\t\t}\n\t\tbrand() {\n\t\t\treturn new ZodBranded({\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBranded,\n\t\t\t\ttype: this,\n\t\t\t\t...processCreateParams(this._def)\n\t\t\t});\n\t\t}\n\t\tcatch(def) {\n\t\t\tconst catchValueFunc = typeof def === \"function\" ? def : () => def;\n\t\t\treturn new ZodCatch({\n\t\t\t\t...processCreateParams(this._def),\n\t\t\t\tinnerType: this,\n\t\t\t\tcatchValue: catchValueFunc,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodCatch\n\t\t\t});\n\t\t}\n\t\tdescribe(description) {\n\t\t\tconst This = this.constructor;\n\t\t\treturn new This({\n\t\t\t\t...this._def,\n\t\t\t\tdescription\n\t\t\t});\n\t\t}\n\t\tpipe(target) {\n\t\t\treturn ZodPipeline.create(this, target);\n\t\t}\n\t\treadonly() {\n\t\t\treturn ZodReadonly.create(this);\n\t\t}\n\t\tisOptional() {\n\t\t\treturn this.safeParse(void 0).success;\n\t\t}\n\t\tisNullable() {\n\t\t\treturn this.safeParse(null).success;\n\t\t}\n\t};\n\tconst cuidRegex = /^c[^\\s-]{8,}$/i;\n\tconst cuid2Regex = /^[0-9a-z]+$/;\n\tconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n\tconst 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;\n\tconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\n\tconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n\tconst 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\tconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n\tconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\n\tlet emojiRegex;\n\tconst 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])$/;\n\tconst 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\tconst 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]))$/;\n\tconst 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\tconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n\tconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n\tconst 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])))`;\n\tconst dateRegex = new RegExp(`^${dateRegexSource}$`);\n\tfunction timeRegexSource(args) {\n\t\tlet secondsRegexSource = `[0-5]\\\\d`;\n\t\tif (args.precision) secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n\t\telse if (args.precision == null) secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n\t\tconst secondsQuantifier = args.precision ? \"+\" : \"?\";\n\t\treturn `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n\t}\n\tfunction timeRegex(args) {\n\t\treturn new RegExp(`^${timeRegexSource(args)}$`);\n\t}\n\tfunction datetimeRegex(args) {\n\t\tlet regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n\t\tconst opts = [];\n\t\topts.push(args.local ? `Z?` : `Z`);\n\t\tif (args.offset) opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n\t\tregex = `${regex}(${opts.join(\"|\")})`;\n\t\treturn new RegExp(`^${regex}$`);\n\t}\n\tfunction isValidIP(ip, version) {\n\t\tif ((version === \"v4\" || !version) && ipv4Regex.test(ip)) return true;\n\t\tif ((version === \"v6\" || !version) && ipv6Regex.test(ip)) return true;\n\t\treturn false;\n\t}\n\tfunction isValidJWT(jwt, alg) {\n\t\tif (!jwtRegex.test(jwt)) return false;\n\t\ttry {\n\t\t\tconst [header] = jwt.split(\".\");\n\t\t\tif (!header) return false;\n\t\t\tconst base64 = header.replace(/-/g, \"+\").replace(/_/g, \"/\").padEnd(header.length + (4 - header.length % 4) % 4, \"=\");\n\t\t\tconst decoded = JSON.parse(atob(base64));\n\t\t\tif (typeof decoded !== \"object\" || decoded === null) return false;\n\t\t\tif (\"typ\" in decoded && decoded?.typ !== \"JWT\") return false;\n\t\t\tif (!decoded.alg) return false;\n\t\t\tif (alg && decoded.alg !== alg) return false;\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfunction isValidCidr(ip, version) {\n\t\tif ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) return true;\n\t\tif ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) return true;\n\t\treturn false;\n\t}\n\tvar ZodString = class ZodString extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = String(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.string) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.string,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst status = new ParseStatus();\n\t\t\tlet ctx = void 0;\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (input.data.length < check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (input.data.length > check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"length\") {\n\t\t\t\tconst tooBig = input.data.length > check.value;\n\t\t\t\tconst tooSmall = input.data.length < check.value;\n\t\t\t\tif (tooBig || tooSmall) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\tif (tooBig) addIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\telse if (tooSmall) addIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"email\") {\n\t\t\t\tif (!emailRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"email\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"emoji\") {\n\t\t\t\tif (!emojiRegex) emojiRegex = new RegExp(_emojiRegex, \"u\");\n\t\t\t\tif (!emojiRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"emoji\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"uuid\") {\n\t\t\t\tif (!uuidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"uuid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"nanoid\") {\n\t\t\t\tif (!nanoidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"nanoid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cuid\") {\n\t\t\t\tif (!cuidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cuid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cuid2\") {\n\t\t\t\tif (!cuid2Regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cuid2\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"ulid\") {\n\t\t\t\tif (!ulidRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"ulid\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"url\") try {\n\t\t\t\tnew URL(input.data);\n\t\t\t} catch {\n\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tvalidation: \"url\",\n\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\tmessage: check.message\n\t\t\t\t});\n\t\t\t\tstatus.dirty();\n\t\t\t}\n\t\t\telse if (check.kind === \"regex\") {\n\t\t\t\tcheck.regex.lastIndex = 0;\n\t\t\t\tif (!check.regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"regex\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"trim\") input.data = input.data.trim();\n\t\t\telse if (check.kind === \"includes\") {\n\t\t\t\tif (!input.data.includes(check.value, check.position)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: {\n\t\t\t\t\t\t\tincludes: check.value,\n\t\t\t\t\t\t\tposition: check.position\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"toLowerCase\") input.data = input.data.toLowerCase();\n\t\t\telse if (check.kind === \"toUpperCase\") input.data = input.data.toUpperCase();\n\t\t\telse if (check.kind === \"startsWith\") {\n\t\t\t\tif (!input.data.startsWith(check.value)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: { startsWith: check.value },\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"endsWith\") {\n\t\t\t\tif (!input.data.endsWith(check.value)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: { endsWith: check.value },\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"datetime\") {\n\t\t\t\tif (!datetimeRegex(check).test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"datetime\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"date\") {\n\t\t\t\tif (!dateRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"date\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"time\") {\n\t\t\t\tif (!timeRegex(check).test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tvalidation: \"time\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"duration\") {\n\t\t\t\tif (!durationRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"duration\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"ip\") {\n\t\t\t\tif (!isValidIP(input.data, check.version)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"ip\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"jwt\") {\n\t\t\t\tif (!isValidJWT(input.data, check.alg)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"jwt\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"cidr\") {\n\t\t\t\tif (!isValidCidr(input.data, check.version)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"cidr\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"base64\") {\n\t\t\t\tif (!base64Regex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"base64\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"base64url\") {\n\t\t\t\tif (!base64urlRegex.test(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tvalidation: \"base64url\",\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\t_regex(regex, validation, message) {\n\t\t\treturn this.refinement((data) => regex.test(data), {\n\t\t\t\tvalidation,\n\t\t\t\tcode: ZodIssueCode.invalid_string,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\temail(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"email\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\turl(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"url\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\temoji(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"emoji\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tuuid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"uuid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tnanoid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"nanoid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tcuid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cuid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tcuid2(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cuid2\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tulid(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"ulid\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tbase64(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"base64\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tbase64url(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"base64url\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tjwt(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"jwt\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tip(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"ip\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tcidr(options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"cidr\",\n\t\t\t\t...errorUtil.errToObj(options)\n\t\t\t});\n\t\t}\n\t\tdatetime(options) {\n\t\t\tif (typeof options === \"string\") return this._addCheck({\n\t\t\t\tkind: \"datetime\",\n\t\t\t\tprecision: null,\n\t\t\t\toffset: false,\n\t\t\t\tlocal: false,\n\t\t\t\tmessage: options\n\t\t\t});\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"datetime\",\n\t\t\t\tprecision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n\t\t\t\toffset: options?.offset ?? false,\n\t\t\t\tlocal: options?.local ?? false,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tdate(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"date\",\n\t\t\t\tmessage\n\t\t\t});\n\t\t}\n\t\ttime(options) {\n\t\t\tif (typeof options === \"string\") return this._addCheck({\n\t\t\t\tkind: \"time\",\n\t\t\t\tprecision: null,\n\t\t\t\tmessage: options\n\t\t\t});\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"time\",\n\t\t\t\tprecision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tduration(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"duration\",\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tregex(regex, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"regex\",\n\t\t\t\tregex,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tincludes(value, options) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"includes\",\n\t\t\t\tvalue,\n\t\t\t\tposition: options?.position,\n\t\t\t\t...errorUtil.errToObj(options?.message)\n\t\t\t});\n\t\t}\n\t\tstartsWith(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"startsWith\",\n\t\t\t\tvalue,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tendsWith(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"endsWith\",\n\t\t\t\tvalue,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tmin(minLength, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: minLength,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tmax(maxLength, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: maxLength,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\tlength(len, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"length\",\n\t\t\t\tvalue: len,\n\t\t\t\t...errorUtil.errToObj(message)\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Equivalent to `.min(1)`\n\t\t*/\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, errorUtil.errToObj(message));\n\t\t}\n\t\ttrim() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"trim\" }]\n\t\t\t});\n\t\t}\n\t\ttoLowerCase() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"toLowerCase\" }]\n\t\t\t});\n\t\t}\n\t\ttoUpperCase() {\n\t\t\treturn new ZodString({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, { kind: \"toUpperCase\" }]\n\t\t\t});\n\t\t}\n\t\tget isDatetime() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n\t\t}\n\t\tget isDate() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"date\");\n\t\t}\n\t\tget isTime() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"time\");\n\t\t}\n\t\tget isDuration() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"duration\");\n\t\t}\n\t\tget isEmail() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"email\");\n\t\t}\n\t\tget isURL() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"url\");\n\t\t}\n\t\tget isEmoji() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n\t\t}\n\t\tget isUUID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n\t\t}\n\t\tget isNANOID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n\t\t}\n\t\tget isCUID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n\t\t}\n\t\tget isCUID2() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n\t\t}\n\t\tget isULID() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n\t\t}\n\t\tget isIP() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"ip\");\n\t\t}\n\t\tget isCIDR() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n\t\t}\n\t\tget isBase64() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"base64\");\n\t\t}\n\t\tget isBase64url() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n\t\t}\n\t\tget minLength() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxLength() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t};\n\tZodString.create = (params) => {\n\t\treturn new ZodString({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodString,\n\t\t\tcoerce: params?.coerce ?? false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction floatSafeRemainder(val, step) {\n\t\tconst valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n\t\tconst stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n\t\tconst decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n\t\treturn Number.parseInt(val.toFixed(decCount).replace(\".\", \"\")) % Number.parseInt(step.toFixed(decCount).replace(\".\", \"\")) / 10 ** decCount;\n\t}\n\tvar ZodNumber = class ZodNumber extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.min = this.gte;\n\t\t\tthis.max = this.lte;\n\t\t\tthis.step = this.multipleOf;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = Number(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.number) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.number,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tlet ctx = void 0;\n\t\t\tconst status = new ParseStatus();\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"int\") {\n\t\t\t\tif (!util.isInteger(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\t\texpected: \"integer\",\n\t\t\t\t\t\treceived: \"float\",\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"min\") {\n\t\t\t\tif (check.inclusive ? input.data < check.value : input.data <= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (check.inclusive ? input.data > check.value : input.data >= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"multipleOf\") {\n\t\t\t\tif (floatSafeRemainder(input.data, check.value) !== 0) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_multiple_of,\n\t\t\t\t\t\tmultipleOf: check.value,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"finite\") {\n\t\t\t\tif (!Number.isFinite(input.data)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_finite,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\tgte(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tgt(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tlte(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tlt(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tsetLimit(kind, value, inclusive, message) {\n\t\t\treturn new ZodNumber({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, {\n\t\t\t\t\tkind,\n\t\t\t\t\tvalue,\n\t\t\t\t\tinclusive,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodNumber({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tint(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"int\",\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: 0,\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmultipleOf(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"multipleOf\",\n\t\t\t\tvalue,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tfinite(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"finite\",\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tsafe(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tinclusive: true,\n\t\t\t\tvalue: Number.MIN_SAFE_INTEGER,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t})._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tinclusive: true,\n\t\t\t\tvalue: Number.MAX_SAFE_INTEGER,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minValue() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxValue() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\tget isInt() {\n\t\t\treturn !!this._def.checks.find((ch) => ch.kind === \"int\" || ch.kind === \"multipleOf\" && util.isInteger(ch.value));\n\t\t}\n\t\tget isFinite() {\n\t\t\tlet max = null;\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") return true;\n\t\t\telse if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t} else if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn Number.isFinite(min) && Number.isFinite(max);\n\t\t}\n\t};\n\tZodNumber.create = (params) => {\n\t\treturn new ZodNumber({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNumber,\n\t\t\tcoerce: params?.coerce || false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBigInt = class ZodBigInt extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.min = this.gte;\n\t\t\tthis.max = this.lte;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) try {\n\t\t\t\tinput.data = BigInt(input.data);\n\t\t\t} catch {\n\t\t\t\treturn this._getInvalidInput(input);\n\t\t\t}\n\t\t\tif (this._getType(input) !== ZodParsedType.bigint) return this._getInvalidInput(input);\n\t\t\tlet ctx = void 0;\n\t\t\tconst status = new ParseStatus();\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (check.inclusive ? input.data < check.value : input.data <= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\ttype: \"bigint\",\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (check.inclusive ? input.data > check.value : input.data >= check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\ttype: \"bigint\",\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\tinclusive: check.inclusive,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"multipleOf\") {\n\t\t\t\tif (input.data % check.value !== BigInt(0)) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.not_multiple_of,\n\t\t\t\t\t\tmultipleOf: check.value,\n\t\t\t\t\t\tmessage: check.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\t_getInvalidInput(input) {\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\taddIssueToContext(ctx, {\n\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\texpected: ZodParsedType.bigint,\n\t\t\t\treceived: ctx.parsedType\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t\tgte(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tgt(value, message) {\n\t\t\treturn this.setLimit(\"min\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tlte(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, true, errorUtil.toString(message));\n\t\t}\n\t\tlt(value, message) {\n\t\t\treturn this.setLimit(\"max\", value, false, errorUtil.toString(message));\n\t\t}\n\t\tsetLimit(kind, value, inclusive, message) {\n\t\t\treturn new ZodBigInt({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, {\n\t\t\t\t\tkind,\n\t\t\t\t\tvalue,\n\t\t\t\t\tinclusive,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodBigInt({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: false,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonpositive(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tnonnegative(message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: BigInt(0),\n\t\t\t\tinclusive: true,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmultipleOf(value, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"multipleOf\",\n\t\t\t\tvalue,\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minValue() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t\tget maxValue() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t};\n\tZodBigInt.create = (params) => {\n\t\treturn new ZodBigInt({\n\t\t\tchecks: [],\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBigInt,\n\t\t\tcoerce: params?.coerce ?? false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBoolean = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = Boolean(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.boolean) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.boolean,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodBoolean.create = (params) => {\n\t\treturn new ZodBoolean({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodBoolean,\n\t\t\tcoerce: params?.coerce || false,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodDate = class ZodDate extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._def.coerce) input.data = new Date(input.data);\n\t\t\tif (this._getType(input) !== ZodParsedType.date) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.date,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (Number.isNaN(input.data.getTime())) {\n\t\t\t\taddIssueToContext(this._getOrReturnCtx(input), { code: ZodIssueCode.invalid_date });\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst status = new ParseStatus();\n\t\t\tlet ctx = void 0;\n\t\t\tfor (const check of this._def.checks) if (check.kind === \"min\") {\n\t\t\t\tif (input.data.getTime() < check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tmessage: check.message,\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tminimum: check.value,\n\t\t\t\t\t\ttype: \"date\"\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"max\") {\n\t\t\t\tif (input.data.getTime() > check.value) {\n\t\t\t\t\tctx = this._getOrReturnCtx(input, ctx);\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmessage: check.message,\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmaximum: check.value,\n\t\t\t\t\t\ttype: \"date\"\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t} else util.assertNever(check);\n\t\t\treturn {\n\t\t\t\tstatus: status.value,\n\t\t\t\tvalue: new Date(input.data.getTime())\n\t\t\t};\n\t\t}\n\t\t_addCheck(check) {\n\t\t\treturn new ZodDate({\n\t\t\t\t...this._def,\n\t\t\t\tchecks: [...this._def.checks, check]\n\t\t\t});\n\t\t}\n\t\tmin(minDate, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"min\",\n\t\t\t\tvalue: minDate.getTime(),\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tmax(maxDate, message) {\n\t\t\treturn this._addCheck({\n\t\t\t\tkind: \"max\",\n\t\t\t\tvalue: maxDate.getTime(),\n\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t});\n\t\t}\n\t\tget minDate() {\n\t\t\tlet min = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"min\") {\n\t\t\t\tif (min === null || ch.value > min) min = ch.value;\n\t\t\t}\n\t\t\treturn min != null ? new Date(min) : null;\n\t\t}\n\t\tget maxDate() {\n\t\t\tlet max = null;\n\t\t\tfor (const ch of this._def.checks) if (ch.kind === \"max\") {\n\t\t\t\tif (max === null || ch.value < max) max = ch.value;\n\t\t\t}\n\t\t\treturn max != null ? new Date(max) : null;\n\t\t}\n\t};\n\tZodDate.create = (params) => {\n\t\treturn new ZodDate({\n\t\t\tchecks: [],\n\t\t\tcoerce: params?.coerce || false,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDate,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodSymbol = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.symbol) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.symbol,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodSymbol.create = (params) => {\n\t\treturn new ZodSymbol({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodSymbol,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUndefined = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.undefined) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.undefined,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodUndefined.create = (params) => {\n\t\treturn new ZodUndefined({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUndefined,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNull = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.null) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.null,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodNull.create = (params) => {\n\t\treturn new ZodNull({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNull,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodAny = class extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._any = true;\n\t\t}\n\t\t_parse(input) {\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodAny.create = (params) => {\n\t\treturn new ZodAny({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodAny,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUnknown = class extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._unknown = true;\n\t\t}\n\t\t_parse(input) {\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodUnknown.create = (params) => {\n\t\treturn new ZodUnknown({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUnknown,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNever = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\taddIssueToContext(ctx, {\n\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\texpected: ZodParsedType.never,\n\t\t\t\treceived: ctx.parsedType\n\t\t\t});\n\t\t\treturn INVALID;\n\t\t}\n\t};\n\tZodNever.create = (params) => {\n\t\treturn new ZodNever({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNever,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodVoid = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.undefined) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.void,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t};\n\tZodVoid.create = (params) => {\n\t\treturn new ZodVoid({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodVoid,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodArray = class ZodArray extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx, status } = this._processInputParams(input);\n\t\t\tconst def = this._def;\n\t\t\tif (ctx.parsedType !== ZodParsedType.array) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.array,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (def.exactLength !== null) {\n\t\t\t\tconst tooBig = ctx.data.length > def.exactLength.value;\n\t\t\t\tconst tooSmall = ctx.data.length < def.exactLength.value;\n\t\t\t\tif (tooBig || tooSmall) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: tooSmall ? def.exactLength.value : void 0,\n\t\t\t\t\t\tmaximum: tooBig ? def.exactLength.value : void 0,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t\tmessage: def.exactLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.minLength !== null) {\n\t\t\t\tif (ctx.data.length < def.minLength.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: def.minLength.value,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.minLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.maxLength !== null) {\n\t\t\t\tif (ctx.data.length > def.maxLength.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: def.maxLength.value,\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.maxLength.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.all([...ctx.data].map((item, i) => {\n\t\t\t\treturn def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n\t\t\t})).then((result) => {\n\t\t\t\treturn ParseStatus.mergeArray(status, result);\n\t\t\t});\n\t\t\tconst result = [...ctx.data].map((item, i) => {\n\t\t\t\treturn def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n\t\t\t});\n\t\t\treturn ParseStatus.mergeArray(status, result);\n\t\t}\n\t\tget element() {\n\t\t\treturn this._def.type;\n\t\t}\n\t\tmin(minLength, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\tminLength: {\n\t\t\t\t\tvalue: minLength,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tmax(maxLength, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\tmaxLength: {\n\t\t\t\t\tvalue: maxLength,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tlength(len, message) {\n\t\t\treturn new ZodArray({\n\t\t\t\t...this._def,\n\t\t\t\texactLength: {\n\t\t\t\t\tvalue: len,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, message);\n\t\t}\n\t};\n\tZodArray.create = (schema, params) => {\n\t\treturn new ZodArray({\n\t\t\ttype: schema,\n\t\t\tminLength: null,\n\t\t\tmaxLength: null,\n\t\t\texactLength: null,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodArray,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction deepPartialify(schema) {\n\t\tif (schema instanceof ZodObject) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key in schema.shape) {\n\t\t\t\tconst fieldSchema = schema.shape[key];\n\t\t\t\tnewShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...schema._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t} else if (schema instanceof ZodArray) return new ZodArray({\n\t\t\t...schema._def,\n\t\t\ttype: deepPartialify(schema.element)\n\t\t});\n\t\telse if (schema instanceof ZodOptional) return ZodOptional.create(deepPartialify(schema.unwrap()));\n\t\telse if (schema instanceof ZodNullable) return ZodNullable.create(deepPartialify(schema.unwrap()));\n\t\telse if (schema instanceof ZodTuple) return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n\t\telse return schema;\n\t}\n\tvar ZodObject = class ZodObject extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis._cached = null;\n\t\t\t/**\n\t\t\t* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n\t\t\t* If you want to pass through unknown properties, use `.passthrough()` instead.\n\t\t\t*/\n\t\t\tthis.nonstrict = this.passthrough;\n\t\t\t/**\n\t\t\t* @deprecated Use `.extend` instead\n\t\t\t* */\n\t\t\tthis.augment = this.extend;\n\t\t}\n\t\t_getCached() {\n\t\t\tif (this._cached !== null) return this._cached;\n\t\t\tconst shape = this._def.shape();\n\t\t\tconst keys = util.objectKeys(shape);\n\t\t\tthis._cached = {\n\t\t\t\tshape,\n\t\t\t\tkeys\n\t\t\t};\n\t\t\treturn this._cached;\n\t\t}\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.object) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst { shape, keys: shapeKeys } = this._getCached();\n\t\t\tconst extraKeys = [];\n\t\t\tif (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n\t\t\t\tfor (const key in ctx.data) if (!shapeKeys.includes(key)) extraKeys.push(key);\n\t\t\t}\n\t\t\tconst pairs = [];\n\t\t\tfor (const key of shapeKeys) {\n\t\t\t\tconst keyValidator = shape[key];\n\t\t\t\tconst value = ctx.data[key];\n\t\t\t\tpairs.push({\n\t\t\t\t\tkey: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: key\n\t\t\t\t\t},\n\t\t\t\t\tvalue: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n\t\t\t\t\talwaysSet: key in ctx.data\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._def.catchall instanceof ZodNever) {\n\t\t\t\tconst unknownKeys = this._def.unknownKeys;\n\t\t\t\tif (unknownKeys === \"passthrough\") for (const key of extraKeys) pairs.push({\n\t\t\t\t\tkey: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: key\n\t\t\t\t\t},\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\tvalue: ctx.data[key]\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\telse if (unknownKeys === \"strict\") {\n\t\t\t\t\tif (extraKeys.length > 0) {\n\t\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\t\tcode: ZodIssueCode.unrecognized_keys,\n\t\t\t\t\t\t\tkeys: extraKeys\n\t\t\t\t\t\t});\n\t\t\t\t\t\tstatus.dirty();\n\t\t\t\t\t}\n\t\t\t\t} else if (unknownKeys === \"strip\") {} else throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n\t\t\t} else {\n\t\t\t\tconst catchall = this._def.catchall;\n\t\t\t\tfor (const key of extraKeys) {\n\t\t\t\t\tconst value = ctx.data[key];\n\t\t\t\t\tpairs.push({\n\t\t\t\t\t\tkey: {\n\t\t\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\t\t\tvalue: key\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalue: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n\t\t\t\t\t\talwaysSet: key in ctx.data\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.resolve().then(async () => {\n\t\t\t\tconst syncPairs = [];\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tconst key = await pair.key;\n\t\t\t\t\tconst value = await pair.value;\n\t\t\t\t\tsyncPairs.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\talwaysSet: pair.alwaysSet\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn syncPairs;\n\t\t\t}).then((syncPairs) => {\n\t\t\t\treturn ParseStatus.mergeObjectSync(status, syncPairs);\n\t\t\t});\n\t\t\telse return ParseStatus.mergeObjectSync(status, pairs);\n\t\t}\n\t\tget shape() {\n\t\t\treturn this._def.shape();\n\t\t}\n\t\tstrict(message) {\n\t\t\terrorUtil.errToObj;\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"strict\",\n\t\t\t\t...message !== void 0 ? { errorMap: (issue, ctx) => {\n\t\t\t\t\tconst defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n\t\t\t\t\tif (issue.code === \"unrecognized_keys\") return { message: errorUtil.errToObj(message).message ?? defaultError };\n\t\t\t\t\treturn { message: defaultError };\n\t\t\t\t} } : {}\n\t\t\t});\n\t\t}\n\t\tstrip() {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"strip\"\n\t\t\t});\n\t\t}\n\t\tpassthrough() {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tunknownKeys: \"passthrough\"\n\t\t\t});\n\t\t}\n\t\textend(augmentation) {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => ({\n\t\t\t\t\t...this._def.shape(),\n\t\t\t\t\t...augmentation\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Prior to zod@1.0.12 there was a bug in the\n\t\t* inferred type of merged objects. Please\n\t\t* upgrade if you are experiencing issues.\n\t\t*/\n\t\tmerge(merging) {\n\t\t\treturn new ZodObject({\n\t\t\t\tunknownKeys: merging._def.unknownKeys,\n\t\t\t\tcatchall: merging._def.catchall,\n\t\t\t\tshape: () => ({\n\t\t\t\t\t...this._def.shape(),\n\t\t\t\t\t...merging._def.shape()\n\t\t\t\t}),\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject\n\t\t\t});\n\t\t}\n\t\tsetKey(key, schema) {\n\t\t\treturn this.augment({ [key]: schema });\n\t\t}\n\t\tcatchall(index) {\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tcatchall: index\n\t\t\t});\n\t\t}\n\t\tpick(mask) {\n\t\t\tconst shape = {};\n\t\t\tfor (const key of util.objectKeys(mask)) if (mask[key] && this.shape[key]) shape[key] = this.shape[key];\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => shape\n\t\t\t});\n\t\t}\n\t\tomit(mask) {\n\t\t\tconst shape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) if (!mask[key]) shape[key] = this.shape[key];\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => shape\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* @deprecated\n\t\t*/\n\t\tdeepPartial() {\n\t\t\treturn deepPartialify(this);\n\t\t}\n\t\tpartial(mask) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) {\n\t\t\t\tconst fieldSchema = this.shape[key];\n\t\t\t\tif (mask && !mask[key]) newShape[key] = fieldSchema;\n\t\t\t\telse newShape[key] = fieldSchema.optional();\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t}\n\t\trequired(mask) {\n\t\t\tconst newShape = {};\n\t\t\tfor (const key of util.objectKeys(this.shape)) if (mask && !mask[key]) newShape[key] = this.shape[key];\n\t\t\telse {\n\t\t\t\tlet newField = this.shape[key];\n\t\t\t\twhile (newField instanceof ZodOptional) newField = newField._def.innerType;\n\t\t\t\tnewShape[key] = newField;\n\t\t\t}\n\t\t\treturn new ZodObject({\n\t\t\t\t...this._def,\n\t\t\t\tshape: () => newShape\n\t\t\t});\n\t\t}\n\t\tkeyof() {\n\t\t\treturn createZodEnum(util.objectKeys(this.shape));\n\t\t}\n\t};\n\tZodObject.create = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape: () => shape,\n\t\t\tunknownKeys: \"strip\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.strictCreate = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape: () => shape,\n\t\t\tunknownKeys: \"strict\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.lazycreate = (shape, params) => {\n\t\treturn new ZodObject({\n\t\t\tshape,\n\t\t\tunknownKeys: \"strip\",\n\t\t\tcatchall: ZodNever.create(),\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodObject,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodUnion = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst options = this._def.options;\n\t\t\tfunction handleResults(results) {\n\t\t\t\tfor (const result of results) if (result.result.status === \"valid\") return result.result;\n\t\t\t\tfor (const result of results) if (result.result.status === \"dirty\") {\n\t\t\t\t\tctx.common.issues.push(...result.ctx.common.issues);\n\t\t\t\t\treturn result.result;\n\t\t\t\t}\n\t\t\t\tconst unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union,\n\t\t\t\t\tunionErrors\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.common.async) return Promise.all(options.map(async (option) => {\n\t\t\t\tconst childCtx = {\n\t\t\t\t\t...ctx,\n\t\t\t\t\tcommon: {\n\t\t\t\t\t\t...ctx.common,\n\t\t\t\t\t\tissues: []\n\t\t\t\t\t},\n\t\t\t\t\tparent: null\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tresult: await option._parseAsync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: childCtx\n\t\t\t\t\t}),\n\t\t\t\t\tctx: childCtx\n\t\t\t\t};\n\t\t\t})).then(handleResults);\n\t\t\telse {\n\t\t\t\tlet dirty = void 0;\n\t\t\t\tconst issues = [];\n\t\t\t\tfor (const option of options) {\n\t\t\t\t\tconst childCtx = {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t...ctx.common,\n\t\t\t\t\t\t\tissues: []\n\t\t\t\t\t\t},\n\t\t\t\t\t\tparent: null\n\t\t\t\t\t};\n\t\t\t\t\tconst result = option._parseSync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: childCtx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"valid\") return result;\n\t\t\t\t\telse if (result.status === \"dirty\" && !dirty) dirty = {\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tctx: childCtx\n\t\t\t\t\t};\n\t\t\t\t\tif (childCtx.common.issues.length) issues.push(childCtx.common.issues);\n\t\t\t\t}\n\t\t\t\tif (dirty) {\n\t\t\t\t\tctx.common.issues.push(...dirty.ctx.common.issues);\n\t\t\t\t\treturn dirty.result;\n\t\t\t\t}\n\t\t\t\tconst unionErrors = issues.map((issues) => new ZodError(issues));\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union,\n\t\t\t\t\tunionErrors\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.options;\n\t\t}\n\t};\n\tZodUnion.create = (types, params) => {\n\t\treturn new ZodUnion({\n\t\t\toptions: types,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodUnion,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tconst getDiscriminator = (type) => {\n\t\tif (type instanceof ZodLazy) return getDiscriminator(type.schema);\n\t\telse if (type instanceof ZodEffects) return getDiscriminator(type.innerType());\n\t\telse if (type instanceof ZodLiteral) return [type.value];\n\t\telse if (type instanceof ZodEnum) return type.options;\n\t\telse if (type instanceof ZodNativeEnum) return util.objectValues(type.enum);\n\t\telse if (type instanceof ZodDefault) return getDiscriminator(type._def.innerType);\n\t\telse if (type instanceof ZodUndefined) return [void 0];\n\t\telse if (type instanceof ZodNull) return [null];\n\t\telse if (type instanceof ZodOptional) return [void 0, ...getDiscriminator(type.unwrap())];\n\t\telse if (type instanceof ZodNullable) return [null, ...getDiscriminator(type.unwrap())];\n\t\telse if (type instanceof ZodBranded) return getDiscriminator(type.unwrap());\n\t\telse if (type instanceof ZodReadonly) return getDiscriminator(type.unwrap());\n\t\telse if (type instanceof ZodCatch) return getDiscriminator(type._def.innerType);\n\t\telse return [];\n\t};\n\tvar ZodDiscriminatedUnion = class ZodDiscriminatedUnion extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.object) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst discriminator = this.discriminator;\n\t\t\tconst discriminatorValue = ctx.data[discriminator];\n\t\t\tconst option = this.optionsMap.get(discriminatorValue);\n\t\t\tif (!option) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_union_discriminator,\n\t\t\t\t\toptions: Array.from(this.optionsMap.keys()),\n\t\t\t\t\tpath: [discriminator]\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.common.async) return option._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t\telse return option._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tget discriminator() {\n\t\t\treturn this._def.discriminator;\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.options;\n\t\t}\n\t\tget optionsMap() {\n\t\t\treturn this._def.optionsMap;\n\t\t}\n\t\t/**\n\t\t* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n\t\t* However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n\t\t* have a different value for each object in the union.\n\t\t* @param discriminator the name of the discriminator property\n\t\t* @param types an array of object schemas\n\t\t* @param params\n\t\t*/\n\t\tstatic create(discriminator, options, params) {\n\t\t\tconst optionsMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const type of options) {\n\t\t\t\tconst discriminatorValues = getDiscriminator(type.shape[discriminator]);\n\t\t\t\tif (!discriminatorValues.length) throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n\t\t\t\tfor (const value of discriminatorValues) {\n\t\t\t\t\tif (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n\t\t\t\t\toptionsMap.set(value, type);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ZodDiscriminatedUnion({\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n\t\t\t\tdiscriminator,\n\t\t\t\toptions,\n\t\t\t\toptionsMap,\n\t\t\t\t...processCreateParams(params)\n\t\t\t});\n\t\t}\n\t};\n\tfunction mergeValues(a, b) {\n\t\tconst aType = getParsedType(a);\n\t\tconst bType = getParsedType(b);\n\t\tif (a === b) return {\n\t\t\tvalid: true,\n\t\t\tdata: a\n\t\t};\n\t\telse if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n\t\t\tconst bKeys = util.objectKeys(b);\n\t\t\tconst sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n\t\t\tconst newObj = {\n\t\t\t\t...a,\n\t\t\t\t...b\n\t\t\t};\n\t\t\tfor (const key of sharedKeys) {\n\t\t\t\tconst sharedValue = mergeValues(a[key], b[key]);\n\t\t\t\tif (!sharedValue.valid) return { valid: false };\n\t\t\t\tnewObj[key] = sharedValue.data;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: newObj\n\t\t\t};\n\t\t} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n\t\t\tif (a.length !== b.length) return { valid: false };\n\t\t\tconst newArray = [];\n\t\t\tfor (let index = 0; index < a.length; index++) {\n\t\t\t\tconst itemA = a[index];\n\t\t\t\tconst itemB = b[index];\n\t\t\t\tconst sharedValue = mergeValues(itemA, itemB);\n\t\t\t\tif (!sharedValue.valid) return { valid: false };\n\t\t\t\tnewArray.push(sharedValue.data);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: newArray\n\t\t\t};\n\t\t} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) return {\n\t\t\tvalid: true,\n\t\t\tdata: a\n\t\t};\n\t\telse return { valid: false };\n\t}\n\tvar ZodIntersection = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst handleParsed = (parsedLeft, parsedRight) => {\n\t\t\t\tif (isAborted(parsedLeft) || isAborted(parsedRight)) return INVALID;\n\t\t\t\tconst merged = mergeValues(parsedLeft.value, parsedRight.value);\n\t\t\t\tif (!merged.valid) {\n\t\t\t\t\taddIssueToContext(ctx, { code: ZodIssueCode.invalid_intersection_types });\n\t\t\t\t\treturn INVALID;\n\t\t\t\t}\n\t\t\t\tif (isDirty(parsedLeft) || isDirty(parsedRight)) status.dirty();\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: merged.data\n\t\t\t\t};\n\t\t\t};\n\t\t\tif (ctx.common.async) return Promise.all([this._def.left._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}), this._def.right._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t})]).then(([left, right]) => handleParsed(left, right));\n\t\t\telse return handleParsed(this._def.left._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}), this._def.right._parseSync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}));\n\t\t}\n\t};\n\tZodIntersection.create = (left, right, params) => {\n\t\treturn new ZodIntersection({\n\t\t\tleft,\n\t\t\tright,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodIntersection,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodTuple = class ZodTuple extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.array) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.array,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (ctx.data.length < this._def.items.length) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\tminimum: this._def.items.length,\n\t\t\t\t\tinclusive: true,\n\t\t\t\t\texact: false,\n\t\t\t\t\ttype: \"array\"\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._def.rest && ctx.data.length > this._def.items.length) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\tmaximum: this._def.items.length,\n\t\t\t\t\tinclusive: true,\n\t\t\t\t\texact: false,\n\t\t\t\t\ttype: \"array\"\n\t\t\t\t});\n\t\t\t\tstatus.dirty();\n\t\t\t}\n\t\t\tconst items = [...ctx.data].map((item, itemIndex) => {\n\t\t\t\tconst schema = this._def.items[itemIndex] || this._def.rest;\n\t\t\t\tif (!schema) return null;\n\t\t\t\treturn schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n\t\t\t}).filter((x) => !!x);\n\t\t\tif (ctx.common.async) return Promise.all(items).then((results) => {\n\t\t\t\treturn ParseStatus.mergeArray(status, results);\n\t\t\t});\n\t\t\telse return ParseStatus.mergeArray(status, items);\n\t\t}\n\t\tget items() {\n\t\t\treturn this._def.items;\n\t\t}\n\t\trest(rest) {\n\t\t\treturn new ZodTuple({\n\t\t\t\t...this._def,\n\t\t\t\trest\n\t\t\t});\n\t\t}\n\t};\n\tZodTuple.create = (schemas, params) => {\n\t\tif (!Array.isArray(schemas)) throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n\t\treturn new ZodTuple({\n\t\t\titems: schemas,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodTuple,\n\t\t\trest: null,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodRecord = class ZodRecord extends ZodType {\n\t\tget keySchema() {\n\t\t\treturn this._def.keyType;\n\t\t}\n\t\tget valueSchema() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.object) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.object,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst pairs = [];\n\t\t\tconst keyType = this._def.keyType;\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tfor (const key in ctx.data) pairs.push({\n\t\t\t\tkey: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n\t\t\t\tvalue: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n\t\t\t\talwaysSet: key in ctx.data\n\t\t\t});\n\t\t\tif (ctx.common.async) return ParseStatus.mergeObjectAsync(status, pairs);\n\t\t\telse return ParseStatus.mergeObjectSync(status, pairs);\n\t\t}\n\t\tget element() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\tstatic create(first, second, third) {\n\t\t\tif (second instanceof ZodType) return new ZodRecord({\n\t\t\t\tkeyType: first,\n\t\t\t\tvalueType: second,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodRecord,\n\t\t\t\t...processCreateParams(third)\n\t\t\t});\n\t\t\treturn new ZodRecord({\n\t\t\t\tkeyType: ZodString.create(),\n\t\t\t\tvalueType: first,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodRecord,\n\t\t\t\t...processCreateParams(second)\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodMap = class extends ZodType {\n\t\tget keySchema() {\n\t\t\treturn this._def.keyType;\n\t\t}\n\t\tget valueSchema() {\n\t\t\treturn this._def.valueType;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.map) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.map,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst keyType = this._def.keyType;\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tconst pairs = [...ctx.data.entries()].map(([key, value], index) => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n\t\t\t\t\tvalue: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"]))\n\t\t\t\t};\n\t\t\t});\n\t\t\tif (ctx.common.async) {\n\t\t\t\tconst finalMap = /* @__PURE__ */ new Map();\n\t\t\t\treturn Promise.resolve().then(async () => {\n\t\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\t\tconst key = await pair.key;\n\t\t\t\t\t\tconst value = await pair.value;\n\t\t\t\t\t\tif (key.status === \"aborted\" || value.status === \"aborted\") return INVALID;\n\t\t\t\t\t\tif (key.status === \"dirty\" || value.status === \"dirty\") status.dirty();\n\t\t\t\t\t\tfinalMap.set(key.value, value.value);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\tvalue: finalMap\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst finalMap = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tconst key = pair.key;\n\t\t\t\t\tconst value = pair.value;\n\t\t\t\t\tif (key.status === \"aborted\" || value.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (key.status === \"dirty\" || value.status === \"dirty\") status.dirty();\n\t\t\t\t\tfinalMap.set(key.value, value.value);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: finalMap\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\tZodMap.create = (keyType, valueType, params) => {\n\t\treturn new ZodMap({\n\t\t\tvalueType,\n\t\t\tkeyType,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodMap,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodSet = class ZodSet extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.set) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.set,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tconst def = this._def;\n\t\t\tif (def.minSize !== null) {\n\t\t\t\tif (ctx.data.size < def.minSize.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_small,\n\t\t\t\t\t\tminimum: def.minSize.value,\n\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.minSize.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (def.maxSize !== null) {\n\t\t\t\tif (ctx.data.size > def.maxSize.value) {\n\t\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\t\tcode: ZodIssueCode.too_big,\n\t\t\t\t\t\tmaximum: def.maxSize.value,\n\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\texact: false,\n\t\t\t\t\t\tmessage: def.maxSize.message\n\t\t\t\t\t});\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst valueType = this._def.valueType;\n\t\t\tfunction finalizeSet(elements) {\n\t\t\t\tconst parsedSet = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const element of elements) {\n\t\t\t\t\tif (element.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (element.status === \"dirty\") status.dirty();\n\t\t\t\t\tparsedSet.add(element.value);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: parsedSet\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n\t\t\tif (ctx.common.async) return Promise.all(elements).then((elements) => finalizeSet(elements));\n\t\t\telse return finalizeSet(elements);\n\t\t}\n\t\tmin(minSize, message) {\n\t\t\treturn new ZodSet({\n\t\t\t\t...this._def,\n\t\t\t\tminSize: {\n\t\t\t\t\tvalue: minSize,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tmax(maxSize, message) {\n\t\t\treturn new ZodSet({\n\t\t\t\t...this._def,\n\t\t\t\tmaxSize: {\n\t\t\t\t\tvalue: maxSize,\n\t\t\t\t\tmessage: errorUtil.toString(message)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsize(size, message) {\n\t\t\treturn this.min(size, message).max(size, message);\n\t\t}\n\t\tnonempty(message) {\n\t\t\treturn this.min(1, message);\n\t\t}\n\t};\n\tZodSet.create = (valueType, params) => {\n\t\treturn new ZodSet({\n\t\t\tvalueType,\n\t\t\tminSize: null,\n\t\t\tmaxSize: null,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodSet,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodFunction = class ZodFunction extends ZodType {\n\t\tconstructor() {\n\t\t\tsuper(...arguments);\n\t\t\tthis.validate = this.implement;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.function) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.function,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tfunction makeArgsIssue(args, error) {\n\t\t\t\treturn makeIssue({\n\t\t\t\t\tdata: args,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMaps: [\n\t\t\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\t\t\tctx.schemaErrorMap,\n\t\t\t\t\t\tgetErrorMap(),\n\t\t\t\t\t\terrorMap\n\t\t\t\t\t].filter((x) => !!x),\n\t\t\t\t\tissueData: {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_arguments,\n\t\t\t\t\t\targumentsError: error\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction makeReturnsIssue(returns, error) {\n\t\t\t\treturn makeIssue({\n\t\t\t\t\tdata: returns,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMaps: [\n\t\t\t\t\t\tctx.common.contextualErrorMap,\n\t\t\t\t\t\tctx.schemaErrorMap,\n\t\t\t\t\t\tgetErrorMap(),\n\t\t\t\t\t\terrorMap\n\t\t\t\t\t].filter((x) => !!x),\n\t\t\t\t\tissueData: {\n\t\t\t\t\t\tcode: ZodIssueCode.invalid_return_type,\n\t\t\t\t\t\treturnTypeError: error\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst params = { errorMap: ctx.common.contextualErrorMap };\n\t\t\tconst fn = ctx.data;\n\t\t\tif (this._def.returns instanceof ZodPromise) {\n\t\t\t\tconst me = this;\n\t\t\t\treturn OK(async function(...args) {\n\t\t\t\t\tconst error = new ZodError([]);\n\t\t\t\t\tconst parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n\t\t\t\t\t\terror.addIssue(makeArgsIssue(args, e));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t\tconst result = await Reflect.apply(fn, this, parsedArgs);\n\t\t\t\t\treturn await me._def.returns._def.type.parseAsync(result, params).catch((e) => {\n\t\t\t\t\t\terror.addIssue(makeReturnsIssue(result, e));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst me = this;\n\t\t\t\treturn OK(function(...args) {\n\t\t\t\t\tconst parsedArgs = me._def.args.safeParse(args, params);\n\t\t\t\t\tif (!parsedArgs.success) throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n\t\t\t\t\tconst result = Reflect.apply(fn, this, parsedArgs.data);\n\t\t\t\t\tconst parsedReturns = me._def.returns.safeParse(result, params);\n\t\t\t\t\tif (!parsedReturns.success) throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n\t\t\t\t\treturn parsedReturns.data;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tparameters() {\n\t\t\treturn this._def.args;\n\t\t}\n\t\treturnType() {\n\t\t\treturn this._def.returns;\n\t\t}\n\t\targs(...items) {\n\t\t\treturn new ZodFunction({\n\t\t\t\t...this._def,\n\t\t\t\targs: ZodTuple.create(items).rest(ZodUnknown.create())\n\t\t\t});\n\t\t}\n\t\treturns(returnType) {\n\t\t\treturn new ZodFunction({\n\t\t\t\t...this._def,\n\t\t\t\treturns: returnType\n\t\t\t});\n\t\t}\n\t\timplement(func) {\n\t\t\treturn this.parse(func);\n\t\t}\n\t\tstrictImplement(func) {\n\t\t\treturn this.parse(func);\n\t\t}\n\t\tstatic create(args, returns, params) {\n\t\t\treturn new ZodFunction({\n\t\t\t\targs: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),\n\t\t\t\treturns: returns || ZodUnknown.create(),\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodFunction,\n\t\t\t\t...processCreateParams(params)\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodLazy = class extends ZodType {\n\t\tget schema() {\n\t\t\treturn this._def.getter();\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\treturn this._def.getter()._parse({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t};\n\tZodLazy.create = (getter, params) => {\n\t\treturn new ZodLazy({\n\t\t\tgetter,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodLazy,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodLiteral = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (input.data !== this._def.value) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_literal,\n\t\t\t\t\texpected: this._def.value\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t\tget value() {\n\t\t\treturn this._def.value;\n\t\t}\n\t};\n\tZodLiteral.create = (value, params) => {\n\t\treturn new ZodLiteral({\n\t\t\tvalue,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodLiteral,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tfunction createZodEnum(values, params) {\n\t\treturn new ZodEnum({\n\t\t\tvalues,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEnum,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t}\n\tvar ZodEnum = class ZodEnum extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (typeof input.data !== \"string\") {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\tconst expectedValues = this._def.values;\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\texpected: util.joinValues(expectedValues),\n\t\t\t\t\treceived: ctx.parsedType,\n\t\t\t\t\tcode: ZodIssueCode.invalid_type\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._cache) this._cache = new Set(this._def.values);\n\t\t\tif (!this._cache.has(input.data)) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\tconst expectedValues = this._def.values;\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_enum_value,\n\t\t\t\t\toptions: expectedValues\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t\tget options() {\n\t\t\treturn this._def.values;\n\t\t}\n\t\tget enum() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\tget Values() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\tget Enum() {\n\t\t\tconst enumValues = {};\n\t\t\tfor (const val of this._def.values) enumValues[val] = val;\n\t\t\treturn enumValues;\n\t\t}\n\t\textract(values, newDef = this._def) {\n\t\t\treturn ZodEnum.create(values, {\n\t\t\t\t...this._def,\n\t\t\t\t...newDef\n\t\t\t});\n\t\t}\n\t\texclude(values, newDef = this._def) {\n\t\t\treturn ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n\t\t\t\t...this._def,\n\t\t\t\t...newDef\n\t\t\t});\n\t\t}\n\t};\n\tZodEnum.create = createZodEnum;\n\tvar ZodNativeEnum = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst nativeEnumValues = util.getValidEnumValues(this._def.values);\n\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n\t\t\t\tconst expectedValues = util.objectValues(nativeEnumValues);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\texpected: util.joinValues(expectedValues),\n\t\t\t\t\treceived: ctx.parsedType,\n\t\t\t\t\tcode: ZodIssueCode.invalid_type\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\tif (!this._cache) this._cache = new Set(util.getValidEnumValues(this._def.values));\n\t\t\tif (!this._cache.has(input.data)) {\n\t\t\t\tconst expectedValues = util.objectValues(nativeEnumValues);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\treceived: ctx.data,\n\t\t\t\t\tcode: ZodIssueCode.invalid_enum_value,\n\t\t\t\t\toptions: expectedValues\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK(input.data);\n\t\t}\n\t\tget enum() {\n\t\t\treturn this._def.values;\n\t\t}\n\t};\n\tZodNativeEnum.create = (values, params) => {\n\t\treturn new ZodNativeEnum({\n\t\t\tvalues,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodPromise = class extends ZodType {\n\t\tunwrap() {\n\t\t\treturn this._def.type;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tif (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.promise,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn OK((ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data)).then((data) => {\n\t\t\t\treturn this._def.type.parseAsync(data, {\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\terrorMap: ctx.common.contextualErrorMap\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t};\n\tZodPromise.create = (schema, params) => {\n\t\treturn new ZodPromise({\n\t\t\ttype: schema,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodPromise,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodEffects = class extends ZodType {\n\t\tinnerType() {\n\t\t\treturn this._def.schema;\n\t\t}\n\t\tsourceType() {\n\t\t\treturn this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;\n\t\t}\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tconst effect = this._def.effect || null;\n\t\t\tconst checkCtx = {\n\t\t\t\taddIssue: (arg) => {\n\t\t\t\t\taddIssueToContext(ctx, arg);\n\t\t\t\t\tif (arg.fatal) status.abort();\n\t\t\t\t\telse status.dirty();\n\t\t\t\t},\n\t\t\t\tget path() {\n\t\t\t\t\treturn ctx.path;\n\t\t\t\t}\n\t\t\t};\n\t\t\tcheckCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n\t\t\tif (effect.type === \"preprocess\") {\n\t\t\t\tconst processed = effect.transform(ctx.data, checkCtx);\n\t\t\t\tif (ctx.common.async) return Promise.resolve(processed).then(async (processed) => {\n\t\t\t\t\tif (status.value === \"aborted\") return INVALID;\n\t\t\t\t\tconst result = await this._def.schema._parseAsync({\n\t\t\t\t\t\tdata: processed,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (result.status === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\tif (status.value === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\treturn result;\n\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tif (status.value === \"aborted\") return INVALID;\n\t\t\t\t\tconst result = this._def.schema._parseSync({\n\t\t\t\t\t\tdata: processed,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (result.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (result.status === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\tif (status.value === \"dirty\") return DIRTY(result.value);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (effect.type === \"refinement\") {\n\t\t\t\tconst executeRefinement = (acc) => {\n\t\t\t\t\tconst result = effect.refinement(acc, checkCtx);\n\t\t\t\t\tif (ctx.common.async) return Promise.resolve(result);\n\t\t\t\t\tif (result instanceof Promise) throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n\t\t\t\t\treturn acc;\n\t\t\t\t};\n\t\t\t\tif (ctx.common.async === false) {\n\t\t\t\t\tconst inner = this._def.schema._parseSync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (inner.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inner.status === \"dirty\") status.dirty();\n\t\t\t\t\texecuteRefinement(inner.value);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\tvalue: inner.value\n\t\t\t\t\t};\n\t\t\t\t} else return this._def.schema._parseAsync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t}).then((inner) => {\n\t\t\t\t\tif (inner.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inner.status === \"dirty\") status.dirty();\n\t\t\t\t\treturn executeRefinement(inner.value).then(() => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: status.value,\n\t\t\t\t\t\t\tvalue: inner.value\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (effect.type === \"transform\") if (ctx.common.async === false) {\n\t\t\t\tconst base = this._def.schema._parseSync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\tif (!isValid(base)) return INVALID;\n\t\t\t\tconst result = effect.transform(base.value, checkCtx);\n\t\t\t\tif (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n\t\t\t\treturn {\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t} else return this._def.schema._parseAsync({\n\t\t\t\tdata: ctx.data,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t}).then((base) => {\n\t\t\t\tif (!isValid(base)) return INVALID;\n\t\t\t\treturn Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n\t\t\t\t\tstatus: status.value,\n\t\t\t\t\tvalue: result\n\t\t\t\t}));\n\t\t\t});\n\t\t\tutil.assertNever(effect);\n\t\t}\n\t};\n\tZodEffects.create = (schema, effect, params) => {\n\t\treturn new ZodEffects({\n\t\t\tschema,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\teffect,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n\t\treturn new ZodEffects({\n\t\t\tschema,\n\t\t\teffect: {\n\t\t\t\ttype: \"preprocess\",\n\t\t\t\ttransform: preprocess\n\t\t\t},\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodEffects,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodOptional = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) === ZodParsedType.undefined) return OK(void 0);\n\t\t\treturn this._def.innerType._parse(input);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodOptional.create = (type, params) => {\n\t\treturn new ZodOptional({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodOptional,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNullable = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) === ZodParsedType.null) return OK(null);\n\t\t\treturn this._def.innerType._parse(input);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodNullable.create = (type, params) => {\n\t\treturn new ZodNullable({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNullable,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodDefault = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tlet data = ctx.data;\n\t\t\tif (ctx.parsedType === ZodParsedType.undefined) data = this._def.defaultValue();\n\t\t\treturn this._def.innerType._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tremoveDefault() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodDefault.create = (type, params) => {\n\t\treturn new ZodDefault({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodDefault,\n\t\t\tdefaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodCatch = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst newCtx = {\n\t\t\t\t...ctx,\n\t\t\t\tcommon: {\n\t\t\t\t\t...ctx.common,\n\t\t\t\t\tissues: []\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst result = this._def.innerType._parse({\n\t\t\t\tdata: newCtx.data,\n\t\t\t\tpath: newCtx.path,\n\t\t\t\tparent: { ...newCtx }\n\t\t\t});\n\t\t\tif (isAsync(result)) return result.then((result) => {\n\t\t\t\treturn {\n\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\tvalue: result.status === \"valid\" ? result.value : this._def.catchValue({\n\t\t\t\t\t\tget error() {\n\t\t\t\t\t\t\treturn new ZodError(newCtx.common.issues);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinput: newCtx.data\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t});\n\t\t\telse return {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: result.status === \"valid\" ? result.value : this._def.catchValue({\n\t\t\t\t\tget error() {\n\t\t\t\t\t\treturn new ZodError(newCtx.common.issues);\n\t\t\t\t\t},\n\t\t\t\t\tinput: newCtx.data\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\tremoveCatch() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodCatch.create = (type, params) => {\n\t\treturn new ZodCatch({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodCatch,\n\t\t\tcatchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodNaN = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tif (this._getType(input) !== ZodParsedType.nan) {\n\t\t\t\tconst ctx = this._getOrReturnCtx(input);\n\t\t\t\taddIssueToContext(ctx, {\n\t\t\t\t\tcode: ZodIssueCode.invalid_type,\n\t\t\t\t\texpected: ZodParsedType.nan,\n\t\t\t\t\treceived: ctx.parsedType\n\t\t\t\t});\n\t\t\t\treturn INVALID;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tvalue: input.data\n\t\t\t};\n\t\t}\n\t};\n\tZodNaN.create = (params) => {\n\t\treturn new ZodNaN({\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodNaN,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tvar ZodBranded = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { ctx } = this._processInputParams(input);\n\t\t\tconst data = ctx.data;\n\t\t\treturn this._def.type._parse({\n\t\t\t\tdata,\n\t\t\t\tpath: ctx.path,\n\t\t\t\tparent: ctx\n\t\t\t});\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.type;\n\t\t}\n\t};\n\tvar ZodPipeline = class ZodPipeline extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst { status, ctx } = this._processInputParams(input);\n\t\t\tif (ctx.common.async) {\n\t\t\t\tconst handleAsync = async () => {\n\t\t\t\t\tconst inResult = await this._def.in._parseAsync({\n\t\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t\tif (inResult.status === \"aborted\") return INVALID;\n\t\t\t\t\tif (inResult.status === \"dirty\") {\n\t\t\t\t\t\tstatus.dirty();\n\t\t\t\t\t\treturn DIRTY(inResult.value);\n\t\t\t\t\t} else return this._def.out._parseAsync({\n\t\t\t\t\t\tdata: inResult.value,\n\t\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\t\tparent: ctx\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\treturn handleAsync();\n\t\t\t} else {\n\t\t\t\tconst inResult = this._def.in._parseSync({\n\t\t\t\t\tdata: ctx.data,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t\tif (inResult.status === \"aborted\") return INVALID;\n\t\t\t\tif (inResult.status === \"dirty\") {\n\t\t\t\t\tstatus.dirty();\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: \"dirty\",\n\t\t\t\t\t\tvalue: inResult.value\n\t\t\t\t\t};\n\t\t\t\t} else return this._def.out._parseSync({\n\t\t\t\t\tdata: inResult.value,\n\t\t\t\t\tpath: ctx.path,\n\t\t\t\t\tparent: ctx\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tstatic create(a, b) {\n\t\t\treturn new ZodPipeline({\n\t\t\t\tin: a,\n\t\t\t\tout: b,\n\t\t\t\ttypeName: ZodFirstPartyTypeKind.ZodPipeline\n\t\t\t});\n\t\t}\n\t};\n\tvar ZodReadonly = class extends ZodType {\n\t\t_parse(input) {\n\t\t\tconst result = this._def.innerType._parse(input);\n\t\t\tconst freeze = (data) => {\n\t\t\t\tif (isValid(data)) data.value = Object.freeze(data.value);\n\t\t\t\treturn data;\n\t\t\t};\n\t\t\treturn isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n\t\t}\n\t\tunwrap() {\n\t\t\treturn this._def.innerType;\n\t\t}\n\t};\n\tZodReadonly.create = (type, params) => {\n\t\treturn new ZodReadonly({\n\t\t\tinnerType: type,\n\t\t\ttypeName: ZodFirstPartyTypeKind.ZodReadonly,\n\t\t\t...processCreateParams(params)\n\t\t});\n\t};\n\tZodObject.lazycreate;\n\tvar ZodFirstPartyTypeKind;\n\t(function(ZodFirstPartyTypeKind) {\n\t\tZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n\t\tZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n\t\tZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n\t\tZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n\t\tZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n\t\tZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n\t\tZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n\t\tZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n\t\tZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n\t\tZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n\t\tZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n\t\tZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n\t\tZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n\t\tZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n\t\tZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n\t\tZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n\t\tZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n\t\tZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n\t\tZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n\t\tZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n\t\tZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n\t\tZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n\t\tZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n\t\tZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n\t\tZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n\t\tZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n\t\tZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n\t\tZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n\t\tZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n\t\tZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n\t\tZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n\t\tZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n\t\tZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n\t\tZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n\t\tZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n\t\tZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n\t})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n\tconst stringType = ZodString.create;\n\tconst numberType = ZodNumber.create;\n\tZodNaN.create;\n\tZodBigInt.create;\n\tconst booleanType = ZodBoolean.create;\n\tZodDate.create;\n\tZodSymbol.create;\n\tZodUndefined.create;\n\tZodNull.create;\n\tZodAny.create;\n\tconst unknownType = ZodUnknown.create;\n\tZodNever.create;\n\tZodVoid.create;\n\tconst arrayType = ZodArray.create;\n\tconst objectType = ZodObject.create;\n\tZodObject.strictCreate;\n\tconst unionType = ZodUnion.create;\n\tZodDiscriminatedUnion.create;\n\tZodIntersection.create;\n\tZodTuple.create;\n\tconst recordType = ZodRecord.create;\n\tZodMap.create;\n\tZodSet.create;\n\tZodFunction.create;\n\tconst lazyType = ZodLazy.create;\n\tconst literalType = ZodLiteral.create;\n\tconst enumType = ZodEnum.create;\n\tZodNativeEnum.create;\n\tZodPromise.create;\n\tZodEffects.create;\n\tZodOptional.create;\n\tZodNullable.create;\n\tZodEffects.createWithPreprocess;\n\tZodPipeline.create;\n\tobjectType({\n\t\ttype: literalType(\"plain\"),\n\t\tcontent: stringType()\n\t});\n\tobjectType({\n\t\tfrom: numberType().min(0),\n\t\tto: numberType().min(1)\n\t});\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/util.js\n\tfunction assertNever(x) {\n\t\tthrow new Error(\"Unexpected object: \" + x);\n\t}\n\t/**\n\t* Return unique entries of the array by the provided id\n\t* For each id, the last entry is kept\n\t*/\n\tfunction uniqueBy(array, makeId) {\n\t\treturn [...new Map(array.map((e) => [makeId(e), e])).values()];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js\n\t/**\n\t* Type guard function that checks if the given value is a valid DataInfo.\n\t*\n\t* @param value - The value to check\n\t* @returns True if the value is a valid DataInfo, false otherwise\n\t*/\n\tfunction isDataInfo(value) {\n\t\tif (!value || typeof value !== \"object\") return false;\n\t\tconst data = value;\n\t\tif (!(\"type\" in data)) return false;\n\t\tswitch (data.type) {\n\t\t\tcase \"Json\": return typeof data.keyLength === \"number\" && data.data !== void 0 && typeof data.data === \"object\";\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && data.parts !== void 0 && typeof data.parts === \"object\";\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\tfunction mapDataInfo(dataInfo, mapFn) {\n\t\tif (dataInfo === void 0) return;\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": return dataInfo;\n\t\t\tcase \"JsonPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"BinaryPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, chunk] of Object.entries(dataInfo.parts)) newParts[key] = {\n\t\t\t\t\tindex: mapFn(chunk.index),\n\t\t\t\t\tvalues: mapFn(chunk.values)\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"ParquetPartitioned\": {\n\t\t\t\tconst newParts = {};\n\t\t\t\tfor (const [key, blob] of Object.entries(dataInfo.parts)) newParts[key] = mapFn(blob);\n\t\t\t\treturn {\n\t\t\t\t\t...dataInfo,\n\t\t\t\t\tparts: newParts\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* @param dataInfo - The source DataInfo object\n\t* @param cb - Callback, function that have access to every blob to visit them all\n\t* @returns Nothing\n\t*/\n\tfunction visitDataInfo(dataInfo, cb) {\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": break;\n\t\t\tcase \"JsonPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\t\tbreak;\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach((chunk) => {\n\t\t\t\t\tcb(chunk.index);\n\t\t\t\t\tcb(chunk.values);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"ParquetPartitioned\":\n\t\t\t\tObject.values(dataInfo.parts).forEach(cb);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t/**\n\t* Type guard function that checks if the given value is a valid DataInfoEntries.\n\t*\n\t* @param value - The value to check\n\t* @returns True if the value is a valid DataInfoEntries, false otherwise\n\t*/\n\tfunction isDataInfoEntries(value) {\n\t\tif (!value || typeof value !== \"object\") return false;\n\t\tconst data = value;\n\t\tif (!(\"type\" in data)) return false;\n\t\tswitch (data.type) {\n\t\t\tcase \"Json\": return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\t/**\n\t* Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n\t*\n\t* @template Blob - Type parameter representing the storage reference type\n\t* @param value - The value to check\n\t* @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n\t*/\n\tfunction isPartitionedDataInfoEntries(value) {\n\t\tif (!isDataInfoEntries(value)) return false;\n\t\tswitch (value.type) {\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": return true;\n\t\t\tdefault: return false;\n\t\t}\n\t}\n\t/**\n\t* Converts DataInfo to DataInfoEntries\n\t*\n\t* @param dataInfo - The record-based DataInfo object\n\t* @returns The equivalent entry-based DataInfoEntries object\n\t*/\n\tfunction dataInfoToEntries(dataInfo) {\n\t\tswitch (dataInfo.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfo.keyLength,\n\t\t\t\tdata: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: blob\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: chunk\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfo.partitionKeyLength,\n\t\t\t\tparts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: JSON.parse(keyStr),\n\t\t\t\t\t\tvalue: blob\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t};\n\t\t\tdefault: assertNever(dataInfo);\n\t\t}\n\t}\n\t/**\n\t* Converts DataInfoEntries to DataInfo\n\t*\n\t* @param dataInfoEntries - The entry-based DataInfoEntries object\n\t* @returns The equivalent record-based DataInfo object\n\t*/\n\tfunction entriesToDataInfo(dataInfoEntries) {\n\t\tswitch (dataInfoEntries.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfoEntries.keyLength,\n\t\t\t\tdata: Object.fromEntries(dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength,\n\t\t\t\tparts: Object.fromEntries(dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]))\n\t\t\t};\n\t\t\tdefault: assertNever(dataInfoEntries);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/errors.js\n\tvar ServiceError = class extends Error {\n\t\tname = \"ServiceError\";\n\t};\n\tvar ServiceInvalidIdError = class extends ServiceError {\n\t\tname = \"ServiceError.InvalidId\";\n\t};\n\tvar ServiceAlreadyRegisteredError = class extends ServiceError {\n\t\tname = \"ServiceError.AlreadyRegistered\";\n\t};\n\tfunction stringifyValue(value) {\n\t\tif (typeof value === \"string\") return `String value was thrown: ${value}`;\n\t\tif (value && typeof value === \"object\") try {\n\t\t\treturn `Plain object was thrown: ${JSON.stringify(value)}`;\n\t\t} catch (jsonError) {\n\t\t\treturn `Non-serializable object was thrown (JSON.stringify failed: ${jsonError instanceof Error ? jsonError.message : String(jsonError)}): ${String(value)}`;\n\t\t}\n\t\treturn String(`Non-Error value (${typeof value}) was thrown: ${value}`);\n\t}\n\tfunction ensureError(value) {\n\t\tif (value instanceof Error) return value;\n\t\treturn new Error(stringifyValue(value));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/json.js\n\tvar import_canonicalize = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t\tmodule.exports = function serialize(object) {\n\t\t\tif (typeof object === \"number\" && isNaN(object)) throw new Error(\"NaN is not allowed\");\n\t\t\tif (typeof object === \"number\" && !isFinite(object)) throw new Error(\"Infinity is not allowed\");\n\t\t\tif (object === null || typeof object !== \"object\") return JSON.stringify(object);\n\t\t\tif (object.toJSON instanceof Function) return serialize(object.toJSON());\n\t\t\tif (Array.isArray(object)) return `[${object.reduce((t, cv, ci) => {\n\t\t\t\treturn `${t}${ci === 0 ? \"\" : \",\"}${serialize(cv === void 0 || typeof cv === \"symbol\" ? null : cv)}`;\n\t\t\t}, \"\")}]`;\n\t\t\treturn `{${Object.keys(object).sort().reduce((t, cv) => {\n\t\t\t\tif (object[cv] === void 0 || typeof object[cv] === \"symbol\") return t;\n\t\t\t\treturn `${t}${t.length === 0 ? \"\" : \",\"}${serialize(cv)}:${serialize(object[cv])}`;\n\t\t\t}, \"\")}}`;\n\t\t};\n\t})))(), 1);\n\tfunction stringifyJson(value) {\n\t\treturn JSON.stringify(value);\n\t}\n\tfunction canonicalizeJson(value) {\n\t\treturn (0, import_canonicalize.default)(value);\n\t}\n\tfunction parseJson(value) {\n\t\treturn JSON.parse(value);\n\t}\n\tfunction parseJsonSafely(value, fallback) {\n\t\ttry {\n\t\t\treturn JSON.parse(value);\n\t\t} catch {\n\t\t\treturn fallback;\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js\n\tfunction readMetadata(metadata, key) {\n\t\treturn metadata?.[key];\n\t}\n\tfunction readMetadataJsonOrThrow(metadata, metadataJson, key, methodNameInError = \"readMetadataJsonOrThrow\") {\n\t\tconst json = readMetadata(metadata, key);\n\t\tif (json === void 0) return void 0;\n\t\tconst schema = metadataJson[key];\n\t\ttry {\n\t\t\tconst value = JSON.parse(json);\n\t\t\treturn schema.parse(value);\n\t\t} catch (error) {\n\t\t\tthrow new Error(`${methodNameInError} failed, key: ${String(key)}, value: ${json}, error: ${ensureError(error)}`);\n\t\t}\n\t}\n\tfunction readMetadataJson(metadata, metadataJson, key) {\n\t\ttry {\n\t\t\treturn readMetadataJsonOrThrow(metadata, metadataJson, key);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tconst Annotation = {\n\t\tAxisNature: \"pl7.app/axisNature\",\n\t\tAlphabet: \"pl7.app/alphabet\",\n\t\tDescription: \"pl7.app/description\",\n\t\tDataStatus: \"pl7.app/dataStatus\",\n\t\tDiscreteValues: \"pl7.app/discreteValues\",\n\t\tFormat: \"pl7.app/format\",\n\t\tGraph: {\n\t\t\tAxis: {\n\t\t\t\tHighCardinality: \"pl7.app/graph/axis/highCardinality\",\n\t\t\t\tLowerLimit: \"pl7.app/graph/axis/lowerLimit\",\n\t\t\t\tSymmetricRange: \"pl7.app/graph/axis/symmetricRange\",\n\t\t\t\tUpperLimit: \"pl7.app/graph/axis/upperLimit\"\n\t\t\t},\n\t\t\tIsDenseAxis: \"pl7.app/graph/isDenseAxis\",\n\t\t\tIsVirtual: \"pl7.app/graph/isVirtual\",\n\t\t\tPalette: \"pl7.app/graph/palette\",\n\t\t\tThresholds: \"pl7.app/graph/thresholds\",\n\t\t\tTreatAbsentValuesAs: \"pl7.app/graph/treatAbsentValuesAs\"\n\t\t},\n\t\tHideDataFromUi: \"pl7.app/hideDataFromUi\",\n\t\tHideDataFromGraphs: \"pl7.app/hideDataFromGraphs\",\n\t\tIsDiscreteFilter: \"pl7.app/isDiscreteFilter\",\n\t\tIsAnchor: \"pl7.app/isAnchor\",\n\t\tIsLinkerColumn: \"pl7.app/isLinkerColumn\",\n\t\tIsScore: \"pl7.app/isScore\",\n\t\tIsSubset: \"pl7.app/isSubset\",\n\t\tLabel: \"pl7.app/label\",\n\t\tLinkLabel: \"pl7.app/linkLabel\",\n\t\tMax: \"pl7.app/max\",\n\t\tMin: \"pl7.app/min\",\n\t\tMultipliesBy: \"pl7.app/multipliesBy\",\n\t\tParents: \"pl7.app/parents\",\n\t\tScore: {\n\t\t\tDefaultCutoff: \"pl7.app/score/defaultCutoff\",\n\t\t\tRankingOrder: \"pl7.app/score/rankingOrder\"\n\t\t},\n\t\tSequence: {\n\t\t\tAnnotation: { Mapping: \"pl7.app/sequence/annotation/mapping\" },\n\t\t\tIsAnnotation: \"pl7.app/sequence/isAnnotation\"\n\t\t},\n\t\tTable: {\n\t\t\tFontFamily: \"pl7.app/table/fontFamily\",\n\t\t\tOrderPriority: \"pl7.app/table/orderPriority\",\n\t\t\tVisibility: \"pl7.app/table/visibility\",\n\t\t\tInfo: \"pl7.app/table/info\"\n\t\t},\n\t\tTrace: \"pl7.app/trace\",\n\t\tVDJ: {\n\t\t\tIsAssemblingFeature: \"pl7.app/vdj/isAssemblingFeature\",\n\t\t\tIsMainSequence: \"pl7.app/vdj/isMainSequence\"\n\t\t}\n\t};\n\tconst TraceEntrySchema = objectType({\n\t\ttype: stringType(),\n\t\tlabel: stringType()\n\t}).catchall(unknownType());\n\tconst ValueTypeSchema = enumType([\n\t\t\"Int\",\n\t\t\"Long\",\n\t\t\"Float\",\n\t\t\"Double\",\n\t\t\"String\"\n\t]);\n\tconst AnnotationJson = {\n\t\t[Annotation.DiscreteValues]: arrayType(stringType()).or(arrayType(numberType())),\n\t\t[Annotation.Graph.Axis.HighCardinality]: booleanType(),\n\t\t[Annotation.Graph.Axis.LowerLimit]: numberType(),\n\t\t[Annotation.Graph.Axis.UpperLimit]: numberType(),\n\t\t[Annotation.Graph.Axis.SymmetricRange]: booleanType(),\n\t\t[Annotation.Graph.IsDenseAxis]: booleanType(),\n\t\t[Annotation.Graph.Palette]: objectType({\n\t\t\tmapping: recordType(numberType()),\n\t\t\tname: stringType()\n\t\t}),\n\t\t[Annotation.Graph.Thresholds]: arrayType(objectType({\n\t\t\tcolumnId: objectType({\n\t\t\t\tvalueType: ValueTypeSchema,\n\t\t\t\tname: stringType()\n\t\t\t}),\n\t\t\tvalue: numberType()\n\t\t})),\n\t\t[Annotation.Graph.TreatAbsentValuesAs]: numberType(),\n\t\t[Annotation.Graph.IsVirtual]: booleanType(),\n\t\t[Annotation.HideDataFromUi]: booleanType(),\n\t\t[Annotation.HideDataFromGraphs]: booleanType(),\n\t\t[Annotation.IsDiscreteFilter]: booleanType(),\n\t\t[Annotation.IsLinkerColumn]: booleanType(),\n\t\t[Annotation.IsSubset]: booleanType(),\n\t\t[Annotation.Max]: numberType(),\n\t\t[Annotation.Min]: numberType(),\n\t\t[Annotation.MultipliesBy]: arrayType(stringType()),\n\t\t[Annotation.Parents]: arrayType(stringType()),\n\t\t[Annotation.Sequence.Annotation.Mapping]: recordType(stringType(), stringType()),\n\t\t[Annotation.Sequence.IsAnnotation]: booleanType(),\n\t\t[Annotation.Table.OrderPriority]: numberType(),\n\t\t[Annotation.Trace]: arrayType(TraceEntrySchema),\n\t\t[Annotation.VDJ.IsAssemblingFeature]: booleanType()\n\t};\n\tfunction readAnnotation(spec, key) {\n\t\treturn readMetadata(spec?.annotations, key);\n\t}\n\tfunction readAnnotationJson(spec, key) {\n\t\treturn readMetadataJson(spec?.annotations, AnnotationJson, key);\n\t}\n\tfunction isLinkerColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.IsLinkerColumn);\n\t}\n\tfunction makeAxisTree(axis) {\n\t\treturn {\n\t\t\taxis,\n\t\t\tchildren: []\n\t\t};\n\t}\n\t/** Build tree by axis parents annotations */\n\tfunction getAxesTree(rootAxis) {\n\t\tconst root = makeAxisTree(rootAxis);\n\t\tlet nodesQ = [root];\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tfor (const node of nodesQ) {\n\t\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\t\tnextNodes.push(...node.children);\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn root;\n\t}\n\t/** Get array of axisSpecs from axisTree */\n\tfunction getArrayFromAxisTree(tree) {\n\t\tconst res = [tree.axis];\n\t\tlet nodesQ = [tree];\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tfor (const node of nodesQ) for (const parent of node.children) {\n\t\t\t\tres.push(parent.axis);\n\t\t\t\tnextNodes.push(parent);\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn res;\n\t}\n\tfunction canonicalizeAxisWithParents(axis) {\n\t\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t}\n\tfunction normalizingAxesComparator(axis1, axis2) {\n\t\tif (axis1.name !== axis2.name) return axis1.name < axis2.name ? 1 : -1;\n\t\tif (axis1.type !== axis2.type) return axis1.type < axis2.type ? 1 : -1;\n\t\tconst domain1 = canonicalizeJson(axis1.domain ?? {});\n\t\tconst domain2 = canonicalizeJson(axis2.domain ?? {});\n\t\tif (domain1 !== domain2) return domain1 < domain2 ? 1 : -1;\n\t\tconst contextDomain1 = canonicalizeJson(axis1.contextDomain ?? {});\n\t\tconst contextDomain2 = canonicalizeJson(axis2.contextDomain ?? {});\n\t\tif (contextDomain1 !== contextDomain2) return contextDomain1 < contextDomain2 ? 1 : -1;\n\t\tconst parents1 = canonicalizeAxisWithParents(axis1);\n\t\tconst parents2 = canonicalizeAxisWithParents(axis2);\n\t\tif (parents1 !== parents2) return parents1 < parents2 ? 1 : -1;\n\t\tconst annotation1 = canonicalizeJson(axis1.annotations ?? {});\n\t\tconst annotation2 = canonicalizeJson(axis2.annotations ?? {});\n\t\tif (annotation1 !== annotation2) return annotation1 < annotation2 ? 1 : -1;\n\t\treturn 0;\n\t}\n\tfunction parseParentsFromAnnotations(axis) {\n\t\tconst parentsList = readAnnotationJson(axis, Annotation.Parents);\n\t\tif (parentsList === void 0) return [];\n\t\treturn parentsList;\n\t}\n\tfunction sortParentsDeep(axisSpec) {\n\t\taxisSpec.parentAxesSpec.forEach(sortParentsDeep);\n\t\taxisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n\t}\n\tfunction hasCycleOfParents(axisSpec) {\n\t\tlet nodesQ = [makeAxisTree(axisSpec)];\n\t\tconst ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n\t\twhile (nodesQ.length) {\n\t\t\tconst nextNodes = [];\n\t\t\tconst levelIds = /* @__PURE__ */ new Set();\n\t\t\tfor (const node of nodesQ) {\n\t\t\t\tnode.children = node.axis.parentAxesSpec.map(makeAxisTree);\n\t\t\t\tfor (const child of node.children) {\n\t\t\t\t\tconst childId = canonicalizeJson(getAxisId(child.axis));\n\t\t\t\t\tif (!levelIds.has(childId)) {\n\t\t\t\t\t\tnextNodes.push(child);\n\t\t\t\t\t\tlevelIds.add(childId);\n\t\t\t\t\t\tif (ancestors.has(childId)) return true;\n\t\t\t\t\t\tancestors.add(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodesQ = nextNodes;\n\t\t}\n\t\treturn false;\n\t}\n\t/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\n\tfunction getNormalizedAxesList(axes) {\n\t\tif (!axes.length) return [];\n\t\tconst modifiedAxes = axes.map((axis) => {\n\t\t\tconst { parentAxes: _, ...copiedRest } = axis;\n\t\t\treturn {\n\t\t\t\t...copiedRest,\n\t\t\t\tannotations: { ...copiedRest.annotations },\n\t\t\t\tparentAxesSpec: []\n\t\t\t};\n\t\t});\n\t\taxes.forEach((axis, idx) => {\n\t\t\tconst modifiedAxis = modifiedAxes[idx];\n\t\t\tif (axis.parentAxes) modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n\t\t\telse {\n\t\t\t\tconst parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n\t\t\t\tmodifiedAxis.parentAxesSpec = parents.some((p) => p === void 0) ? [] : parents;\n\t\t\t}\n\t\t});\n\t\tif (modifiedAxes.some(hasCycleOfParents)) modifiedAxes.forEach((axis) => {\n\t\t\taxis.parentAxesSpec = [];\n\t\t});\n\t\telse modifiedAxes.forEach((axis) => {\n\t\t\tsortParentsDeep(axis);\n\t\t});\n\t\treturn modifiedAxes;\n\t}\n\tconst PColumnName = {\n\t\tLabel: \"pl7.app/label\",\n\t\tTable: { RowSelection: \"pl7.app/table/row-selection\" },\n\t\tVDJ: {\n\t\t\tLeadSelection: \"pl7.app/vdj/lead-selection\",\n\t\t\tRankingOrder: \"pl7.app/vdj/ranking-order\",\n\t\t\tSequence: \"pl7.app/vdj/sequence\"\n\t\t}\n\t};\n\tfunction isLabelColumn(column) {\n\t\treturn column.axesSpec.length === 1 && column.name === PColumnName.Label;\n\t}\n\t/** Get column id and spec from a column */\n\tfunction getColumnIdAndSpec(column) {\n\t\treturn {\n\t\t\tcolumnId: column.id,\n\t\t\tspec: column.spec\n\t\t};\n\t}\n\t/** Extracts axis ids from axis spec */\n\tfunction getAxisId(spec) {\n\t\tconst { type, name, domain, contextDomain } = spec;\n\t\tconst result = {\n\t\t\ttype,\n\t\t\tname\n\t\t};\n\t\tif (domain && Object.entries(domain).length > 0) Object.assign(result, { domain });\n\t\tif (contextDomain && Object.entries(contextDomain).length > 0) Object.assign(result, { contextDomain });\n\t\treturn result;\n\t}\n\t/** Extracts axes ids from axes spec array from column spec */\n\tfunction getAxesId(spec) {\n\t\treturn spec.map(getAxisId);\n\t}\n\t/** Canonicalizes axis id */\n\tfunction canonicalizeAxisId(id) {\n\t\treturn canonicalizeJson(getAxisId(id));\n\t}\n\t/** Returns true if all domains from query are found in target */\n\tfunction matchDomain$1(query, target) {\n\t\tif (query === void 0) return target === void 0;\n\t\tif (target === void 0) return true;\n\t\tfor (const k in target) if (query[k] !== target[k]) return false;\n\t\treturn true;\n\t}\n\t/** Returns whether \"match\" axis id is compatible with the \"query\" */\n\tfunction matchAxisId(query, target) {\n\t\treturn query.name === target.name && matchDomain$1(query.domain, target.domain) && matchDomain$1(query.contextDomain, target.contextDomain);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js\n\tconst BOOLEAN_TYPES = new Set([\n\t\t\"numericComparison\",\n\t\t\"stringEquals\",\n\t\t\"stringContains\",\n\t\t\"stringContainsFuzzy\",\n\t\t\"stringRegex\",\n\t\t\"isNull\",\n\t\t\"not\",\n\t\t\"and\",\n\t\t\"or\",\n\t\t\"isIn\"\n\t]);\n\tfunction isBooleanExpression(expr) {\n\t\treturn BOOLEAN_TYPES.has(expr.type);\n\t}\n\t/**\n\t* Recursively traverses a SpecQuery tree bottom-up, applying visitor callbacks.\n\t*\n\t* Traversal order:\n\t* 1. Recurse into child queries\n\t* 2. Apply `column` to transform column references in leaf nodes\n\t* 3. Apply `joinEntry` to each join entry (with inner query already traversed)\n\t* 4. Assemble node with transformed children\n\t* 5. Apply `node` to the assembled node\n\t*/\n\tfunction traverseQuerySpec(query, visitor) {\n\t\tconst traverseEntry = (entry) => {\n\t\t\tconst traversed = {\n\t\t\t\t...entry,\n\t\t\t\tentry: traverseQuerySpec(entry.entry, visitor)\n\t\t\t};\n\t\t\treturn visitor.joinEntry ? visitor.joinEntry(traversed) : traversed;\n\t\t};\n\t\tlet result;\n\t\tswitch (query.type) {\n\t\t\tcase \"column\":\n\t\t\t\tresult = {\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"sparseToDenseColumn\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tcolumn: visitor.column(query.column)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"inlineColumn\":\n\t\t\t\tresult = query;\n\t\t\t\tbreak;\n\t\t\tcase \"innerJoin\":\n\t\t\tcase \"fullJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tentries: query.entries.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"outerJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tprimary: traverseEntry(query.primary),\n\t\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"linkerJoin\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tlinker: {\n\t\t\t\t\t\t...query.linker,\n\t\t\t\t\t\tcolumn: visitor.column(query.linker.column)\n\t\t\t\t\t},\n\t\t\t\t\tsecondary: query.secondary.map(traverseEntry)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"filter\":\n\t\t\tcase \"sort\":\n\t\t\tcase \"sliceAxes\":\n\t\t\tcase \"transformColumns\":\n\t\t\t\tresult = {\n\t\t\t\t\t...query,\n\t\t\t\t\tinput: traverseQuerySpec(query.input, visitor)\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault: assertNever(query);\n\t\t}\n\t\treturn visitor.node ? visitor.node(result) : result;\n\t}\n\t/** Recursively maps all column references in a SpecQuery tree. */\n\tfunction mapSpecQueryColumns(query, cb) {\n\t\treturn traverseQuerySpec(query, { column: cb });\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js\n\tfunction mapPTableDef(def, cb) {\n\t\treturn {\n\t\t\t...def,\n\t\t\tsrc: mapJoinEntry(def.src, cb)\n\t\t};\n\t}\n\tfunction mapPTableDefV2(def, cb) {\n\t\treturn { query: mapSpecQueryColumns(def.query, cb) };\n\t}\n\tfunction mapJoinEntry(entry, cb) {\n\t\tswitch (entry.type) {\n\t\t\tcase \"column\": return {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: cb(entry.column)\n\t\t\t};\n\t\t\tcase \"slicedColumn\": return {\n\t\t\t\ttype: \"slicedColumn\",\n\t\t\t\tcolumn: cb(entry.column),\n\t\t\t\tnewId: entry.newId,\n\t\t\t\taxisFilters: entry.axisFilters\n\t\t\t};\n\t\t\tcase \"artificialColumn\": return {\n\t\t\t\ttype: \"artificialColumn\",\n\t\t\t\tcolumn: cb(entry.column),\n\t\t\t\tnewId: entry.newId,\n\t\t\t\taxesIndices: entry.axesIndices\n\t\t\t};\n\t\t\tcase \"inlineColumn\": return entry;\n\t\t\tcase \"inner\":\n\t\t\tcase \"full\": return {\n\t\t\t\ttype: entry.type,\n\t\t\t\tentries: entry.entries.map((col) => mapJoinEntry(col, cb))\n\t\t\t};\n\t\t\tcase \"outer\": return {\n\t\t\t\ttype: \"outer\",\n\t\t\t\tprimary: mapJoinEntry(entry.primary, cb),\n\t\t\t\tsecondary: entry.secondary.map((col) => mapJoinEntry(col, cb))\n\t\t\t};\n\t\t\tdefault: assertNever(entry);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.js\n\tfunction getPTableColumnId(spec) {\n\t\tswitch (spec.type) {\n\t\t\tcase \"axis\": return {\n\t\t\t\ttype: \"axis\",\n\t\t\t\tid: spec.id\n\t\t\t};\n\t\t\tcase \"column\": return {\n\t\t\t\ttype: \"column\",\n\t\t\t\tid: spec.id\n\t\t\t};\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js\n\t/**\n\t* Canonically serializes a {@link UniversalPColumnId} to a string.\n\t* @param id - The column identifier to serialize\n\t* @returns The canonically serialized string\n\t*/\n\tfunction stringifyColumnId(id) {\n\t\treturn (0, import_canonicalize.default)(id);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js\n\tfunction axisKey(axis) {\n\t\treturn (0, import_canonicalize.default)(getAxisId(axis));\n\t}\n\tfunction domainKey(key, value) {\n\t\treturn JSON.stringify([key, value]);\n\t}\n\t/**\n\t* Context for resolving and generating anchored references to columns and axes\n\t* Maintains maps of known domain values and axes that can be referenced by anchors\n\t*/\n\tvar AnchoredIdDeriver = class {\n\t\taxes = /* @__PURE__ */ new Map();\n\t\tdomains = /* @__PURE__ */ new Map();\n\t\tcontextDomains = /* @__PURE__ */ new Map();\n\t\t/**\n\t\t* Domain packs are used to group domain keys that can be anchored to the same anchor\n\t\t* This is used to optimize the lookup of domain anchors\n\t\t*/\n\t\tdomainPacks = [];\n\t\tcontextDomainPacks = [];\n\t\t/**\n\t\t* Maps domain packs to anchors\n\t\t*/\n\t\tdomainPackToAnchor = /* @__PURE__ */ new Map();\n\t\tcontextDomainPackToAnchor = /* @__PURE__ */ new Map();\n\t\t/**\n\t\t* Creates a new anchor context from a set of anchor column specifications\n\t\t* @param anchors Record of anchor column specifications indexed by anchor ID\n\t\t*/\n\t\tconstructor(anchors) {\n\t\t\tthis.anchors = anchors;\n\t\t\tconst anchorEntries = Object.entries(anchors);\n\t\t\tanchorEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\tfor (const [anchorId, spec] of anchorEntries) {\n\t\t\t\tfor (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {\n\t\t\t\t\tconst axis = spec.axesSpec[axisIdx];\n\t\t\t\t\tconst key = axisKey(axis);\n\t\t\t\t\tthis.axes.set(key, {\n\t\t\t\t\t\tanchor: anchorId,\n\t\t\t\t\t\tidx: axisIdx\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (spec.domain !== void 0) {\n\t\t\t\t\tconst domainEntries = Object.entries(spec.domain);\n\t\t\t\t\tdomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\t\tthis.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);\n\t\t\t\t\tthis.domainPacks.push(domainEntries.map(([dKey]) => dKey));\n\t\t\t\t\tfor (const [dKey, dValue] of domainEntries) {\n\t\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\t\tthis.domains.set(key, anchorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (spec.contextDomain !== void 0) {\n\t\t\t\t\tconst contextDomainEntries = Object.entries(spec.contextDomain);\n\t\t\t\t\tcontextDomainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\t\t\t\t\tthis.contextDomainPackToAnchor.set(JSON.stringify(contextDomainEntries), anchorId);\n\t\t\t\t\tthis.contextDomainPacks.push(contextDomainEntries.map(([dKey]) => dKey));\n\t\t\t\t\tfor (const [dKey, dValue] of contextDomainEntries) {\n\t\t\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\t\t\tthis.contextDomains.set(key, anchorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Implementation of derive method\n\t\t*/\n\t\tderive(spec, axisFilters) {\n\t\t\tconst result = {\n\t\t\t\tname: spec.name,\n\t\t\t\taxes: []\n\t\t\t};\n\t\t\tlet skipDomains = void 0;\n\t\t\tif (spec.domain !== void 0) outer: for (const domainPack of this.domainPacks) {\n\t\t\t\tconst dAnchor = [];\n\t\t\t\tfor (const domainKey of domainPack) {\n\t\t\t\t\tconst dValue = spec.domain[domainKey];\n\t\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\t\telse break outer;\n\t\t\t\t}\n\t\t\t\tconst domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\t\tif (domainAnchor !== void 0) {\n\t\t\t\t\tresult.domainAnchor = domainAnchor;\n\t\t\t\t\tskipDomains = new Set(domainPack);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {\n\t\t\t\tif (skipDomains !== void 0 && skipDomains.has(dKey)) continue;\n\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\tconst anchorId = this.domains.get(key);\n\t\t\t\tresult.domain ??= {};\n\t\t\t\tresult.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t\t}\n\t\t\tlet skipContextDomains = void 0;\n\t\t\tif (spec.contextDomain !== void 0) outer: for (const contextDomainPack of this.contextDomainPacks) {\n\t\t\t\tconst dAnchor = [];\n\t\t\t\tfor (const domainKey of contextDomainPack) {\n\t\t\t\t\tconst dValue = spec.contextDomain[domainKey];\n\t\t\t\t\tif (dValue !== void 0) dAnchor.push([domainKey, dValue]);\n\t\t\t\t\telse break outer;\n\t\t\t\t}\n\t\t\t\tconst contextDomainAnchor = this.contextDomainPackToAnchor.get(JSON.stringify(dAnchor));\n\t\t\t\tif (contextDomainAnchor !== void 0) {\n\t\t\t\t\tresult.contextDomainAnchor = contextDomainAnchor;\n\t\t\t\t\tskipContextDomains = new Set(contextDomainPack);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [dKey, dValue] of Object.entries(spec.contextDomain ?? {})) {\n\t\t\t\tif (skipContextDomains !== void 0 && skipContextDomains.has(dKey)) continue;\n\t\t\t\tconst key = domainKey(dKey, dValue);\n\t\t\t\tconst anchorId = this.contextDomains.get(key);\n\t\t\t\tresult.contextDomain ??= {};\n\t\t\t\tresult.contextDomain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n\t\t\t}\n\t\t\tresult.axes = spec.axesSpec.map((axis) => {\n\t\t\t\tconst key = axisKey(axis);\n\t\t\t\tconst anchorAxisRef = this.axes.get(key);\n\t\t\t\tif (anchorAxisRef === void 0) return getAxisId(axis);\n\t\t\t\telse return anchorAxisRef;\n\t\t\t});\n\t\t\tif (!axisFilters || axisFilters.length === 0) return result;\n\t\t\tconst resolvedFilters = [];\n\t\t\tfor (const filter of axisFilters) {\n\t\t\t\tconst [axisIdOrIndex, value] = filter;\n\t\t\t\tif (typeof axisIdOrIndex === \"number\") {\n\t\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\t\tresolvedFilters.push([axisIdOrIndex, value]);\n\t\t\t\t} else {\n\t\t\t\t\tconst axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);\n\t\t\t\t\tif (axisIndex === -1) throw new Error(`Axis with name \"${axisIdOrIndex}\" not found in the column specification`);\n\t\t\t\t\tresolvedFilters.push([axisIndex, value]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolvedFilters.sort((a, b) => a[0] - b[0]);\n\t\t\treturn {\n\t\t\t\tsource: result,\n\t\t\t\taxisFilters: resolvedFilters\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column\n\t\t* @param spec Column specification to anchor\n\t\t* @param axisFilters Optional axis filters to apply to the column\n\t\t* @returns A canonicalized string representation of the anchored column identifier\n\t\t*/\n\t\tderiveS(spec, axisFilters) {\n\t\t\treturn stringifyColumnId(this.derive(spec, axisFilters));\n\t\t}\n\t};\n\t/**\n\t* Resolves anchored references in a column matcher to create a non-anchored matcher.\n\t* Doing an opposite operation to {@link AnchorIdDeriver.derive()}.\n\t*\n\t* @param anchors - Record of anchor column specifications indexed by anchor id\n\t* @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved\n\t* @param options - Options for resolving anchors\n\t* @returns A non-anchored column matcher with all references resolved to actual values\n\t* @deprecated - This function by parent PColumnCollection\n\t*/\n\tfunction resolveAnchors(anchors, matcher, options) {\n\t\tconst result = { ...matcher };\n\t\tconst ignoreMissingDomains = options?.ignoreMissingDomains ?? false;\n\t\tif (result.domainAnchor !== void 0) {\n\t\t\tconst anchorSpec = anchors[result.domainAnchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.domainAnchor}\" not found`);\n\t\t\tresult.domain = {\n\t\t\t\t...anchorSpec.domain || {},\n\t\t\t\t...result.domain\n\t\t\t};\n\t\t\tdelete result.domainAnchor;\n\t\t}\n\t\tif (result.domain) {\n\t\t\tconst resolvedDomain = {};\n\t\t\tfor (const [key, value] of Object.entries(result.domain)) if (typeof value === \"string\") resolvedDomain[key] = value;\n\t\t\telse {\n\t\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for domain key \"${key}\"`);\n\t\t\t\tif (!anchorSpec.domain || anchorSpec.domain[key] === void 0) {\n\t\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresolvedDomain[key] = anchorSpec.domain[key];\n\t\t\t}\n\t\t\tresult.domain = resolvedDomain;\n\t\t}\n\t\tif (result.contextDomainAnchor !== void 0) {\n\t\t\tconst anchorSpec = anchors[result.contextDomainAnchor];\n\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${result.contextDomainAnchor}\" not found`);\n\t\t\tresult.contextDomain = {\n\t\t\t\t...anchorSpec.contextDomain || {},\n\t\t\t\t...result.contextDomain\n\t\t\t};\n\t\t\tdelete result.contextDomainAnchor;\n\t\t}\n\t\tif (result.contextDomain) {\n\t\t\tconst resolvedContextDomain = {};\n\t\t\tfor (const [key, value] of Object.entries(result.contextDomain)) if (typeof value === \"string\") resolvedContextDomain[key] = value;\n\t\t\telse {\n\t\t\t\tconst anchorSpec = anchors[value.anchor];\n\t\t\t\tif (!anchorSpec) throw new Error(`Anchor \"${value.anchor}\" not found for contextDomain key \"${key}\"`);\n\t\t\t\tif (!anchorSpec.contextDomain || anchorSpec.contextDomain[key] === void 0) {\n\t\t\t\t\tif (!ignoreMissingDomains) throw new Error(`Context domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresolvedContextDomain[key] = anchorSpec.contextDomain[key];\n\t\t\t}\n\t\t\tresult.contextDomain = resolvedContextDomain;\n\t\t}\n\t\tif (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));\n\t\treturn result;\n\t}\n\t/**\n\t* Resolves an anchored axis reference to a concrete AxisId\n\t*/\n\tfunction resolveAxisReference(anchors, axisRef) {\n\t\tif (!isAnchorAxisRef(axisRef)) return axisRef;\n\t\tconst anchorId = axisRef.anchor;\n\t\tconst anchorSpec = anchors[anchorId];\n\t\tif (!anchorSpec) throw new Error(`Anchor \"${anchorId}\" not found for axis reference`);\n\t\tif (\"idx\" in axisRef) {\n\t\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\t\treturn anchorSpec.axesSpec[axisRef.idx];\n\t\t} else if (\"name\" in axisRef) {\n\t\t\tconst matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);\n\t\t\tif (matches.length > 1) throw new Error(`Multiple axes with name \"${axisRef.name}\" found in anchor \"${anchorId}\"`);\n\t\t\tif (matches.length === 0) throw new Error(`Axis with name \"${axisRef.name}\" not found in anchor \"${anchorId}\"`);\n\t\t\treturn matches[0];\n\t\t} else if (\"id\" in axisRef) {\n\t\t\tconst matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));\n\t\t\tif (matches.length > 1) throw new Error(`Multiple matching axes found for matcher in anchor \"${anchorId}\"`);\n\t\t\tif (matches.length === 0) throw new Error(`No matching axis found for matcher in anchor \"${anchorId}\"`);\n\t\t\treturn matches[0];\n\t\t}\n\t\tthrow new Error(`Unsupported axis reference type`);\n\t}\n\t/**\n\t* Type guard to check if a value is an anchored axis reference\n\t*/\n\tfunction isAnchorAxisRef(value) {\n\t\treturn typeof value === \"object\" && \"anchor\" in value;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js\n\tfunction isPColumnSpec(spec) {\n\t\treturn spec.kind === \"PColumn\";\n\t}\n\tfunction isPColumn(obj) {\n\t\treturn isPColumnSpec(obj.spec);\n\t}\n\tfunction ensurePColumn(obj) {\n\t\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\t\treturn obj;\n\t}\n\tfunction mapPObjectData(pObj, cb) {\n\t\treturn pObj === void 0 ? void 0 : {\n\t\t\t...pObj,\n\t\t\tdata: cb(typeof pObj.data === \"function\" ? pObj.data() : pObj.data)\n\t\t};\n\t}\n\tfunction extractAllColumns(entry) {\n\t\tconst columns = /* @__PURE__ */ new Map();\n\t\tconst addAllColumns = (entry) => {\n\t\t\tswitch (entry.type) {\n\t\t\t\tcase \"column\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"slicedColumn\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"artificialColumn\":\n\t\t\t\t\tcolumns.set(entry.column.id, entry.column);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"inlineColumn\": return;\n\t\t\t\tcase \"full\":\n\t\t\t\tcase \"inner\":\n\t\t\t\t\tfor (const e of entry.entries) addAllColumns(e);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"outer\":\n\t\t\t\t\taddAllColumns(entry.primary);\n\t\t\t\t\tfor (const e of entry.secondary) addAllColumns(e);\n\t\t\t\t\treturn;\n\t\t\t\tdefault: assertNever(entry);\n\t\t\t}\n\t\t};\n\t\taddAllColumns(entry);\n\t\treturn [...columns.values()];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js\n\t/**\n\t* Determines if an axis ID matches an axis selector.\n\t*\n\t* @param selector - The selector with criteria to match against\n\t* @param axis - The AxisId to check against the selector\n\t* @returns true if the AxisId matches all specified criteria in the selector, false otherwise\n\t*/\n\tfunction matchAxis(selector, axis) {\n\t\tif (selector.name !== void 0 && selector.name !== axis.name) return false;\n\t\tif (selector.type !== void 0) {\n\t\t\tif (Array.isArray(selector.type)) {\n\t\t\t\tif (!selector.type.includes(axis.type)) return false;\n\t\t\t} else if (selector.type !== axis.type) return false;\n\t\t}\n\t\tif (selector.domain !== void 0) {\n\t\t\tconst axisDomain = axis.domain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.domain)) if (axisDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.contextDomain !== void 0) {\n\t\t\tconst axisContextDomain = axis.contextDomain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (axisContextDomain[key] !== value) return false;\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* Determines if a given PColumnSpec matches a selector.\n\t*\n\t* @param pcolumn - The PColumnSpec to check against the selector\n\t* @param selector - The selector criteria to match against\n\t* @returns true if the PColumnSpec matches all criteria in the selector, false otherwise\n\t*/\n\tfunction matchPColumn(pcolumn, selector) {\n\t\tif (selector.name !== void 0 && pcolumn.name !== selector.name) return false;\n\t\tif (selector.namePattern !== void 0 && !new RegExp(selector.namePattern).test(pcolumn.name)) return false;\n\t\tif (selector.type !== void 0) {\n\t\t\tif (Array.isArray(selector.type)) {\n\t\t\t\tif (!selector.type.includes(pcolumn.valueType)) return false;\n\t\t\t} else if (selector.type !== pcolumn.valueType) return false;\n\t\t}\n\t\tif (selector.domain !== void 0) {\n\t\t\tconst columnDomain = pcolumn.domain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.domain)) if (columnDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.contextDomain !== void 0) {\n\t\t\tconst columnContextDomain = pcolumn.contextDomain || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.contextDomain)) if (columnContextDomain[key] !== value) return false;\n\t\t}\n\t\tif (selector.axes !== void 0) {\n\t\t\tconst pcolumnAxes = pcolumn.axesSpec.map(getAxisId);\n\t\t\tif (selector.partialAxesMatch) {\n\t\t\t\tfor (const selectorAxis of selector.axes) if (!pcolumnAxes.some((columnAxis) => matchAxis(selectorAxis, columnAxis))) return false;\n\t\t\t} else {\n\t\t\t\tif (pcolumnAxes.length !== selector.axes.length) return false;\n\t\t\t\tfor (let i = 0; i < selector.axes.length; i++) if (!matchAxis(selector.axes[i], pcolumnAxes[i])) return false;\n\t\t\t}\n\t\t}\n\t\tif (selector.annotations !== void 0) {\n\t\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\t\tfor (const [key, value] of Object.entries(selector.annotations)) if (columnAnnotations[key] !== value) return false;\n\t\t}\n\t\tif (selector.annotationPatterns !== void 0) {\n\t\t\tconst columnAnnotations = pcolumn.annotations || {};\n\t\t\tfor (const [key, pattern] of Object.entries(selector.annotationPatterns)) {\n\t\t\t\tconst value = columnAnnotations[key];\n\t\t\t\tif (value === void 0 || !new RegExp(pattern).test(value)) return false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* Convert a predicate or array of selectors to a single predicate function\n\t* @param predicateOrSelectors - Either a function that takes a PColumnSpec and returns a boolean,\n\t* or an array of PColumnSelectors, or a single PColumnSelector\n\t* @returns A function that takes a PColumnSpec and returns a boolean\n\t*/\n\tfunction legacyColumnSelectorsToPredicate(predicateOrSelectors) {\n\t\tif (Array.isArray(predicateOrSelectors)) return (spec) => predicateOrSelectors.some((selector) => isPColumnSpec(spec) && matchPColumn(spec, selector));\n\t\telse return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js\n\tfunction deriveNativeId(spec) {\n\t\tconst result = {\n\t\t\tkind: spec.kind,\n\t\t\tname: spec.name\n\t\t};\n\t\tif (spec.domain !== void 0) result.domain = spec.domain;\n\t\tif (spec.contextDomain !== void 0) result.contextDomain = spec.contextDomain;\n\t\tif (isPColumnSpec(spec)) result.axesSpec = getAxesId(spec.axesSpec);\n\t\treturn (0, import_canonicalize.default)(result);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/utils.js\n\tfunction isNil$1(v) {\n\t\treturn v === null || v === void 0;\n\t}\n\tArray.isArray;\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/error.js\n\tfunction throwError(v) {\n\t\tif (typeof v === \"string\") throw new Error(v);\n\t\telse throw v;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/uniqId.js\n\tfunction createGetIncrementalId() {\n\t\tlet idx = 0n;\n\t\treturn () => idx++;\n\t}\n\tcreateGetIncrementalId();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js\n\tvar LinkerMap = class LinkerMap {\n\t\t/** Graph of linkers connected by axes (single or grouped by parents) */\n\t\tdata;\n\t\tconstructor(linkerMap) {\n\t\t\tthis.data = linkerMap;\n\t\t}\n\t\tget keys() {\n\t\t\treturn this.data.keys();\n\t\t}\n\t\tget keyAxesIds() {\n\t\t\treturn [...this.data.keys()].map(parseJson);\n\t\t}\n\t\tstatic fromColumns(columns) {\n\t\t\tconst result = /* @__PURE__ */ new Map();\n\t\t\tfor (const linker of columns.filter((l) => !!readAnnotationJson(l.spec, Annotation.IsLinkerColumn))) {\n\t\t\t\tconst groups = LinkerMap.getAxesGroups(getNormalizedAxesList(linker.spec.axesSpec));\n\t\t\t\tif (groups.length !== 2) continue;\n\t\t\t\tconst [left, right] = groups;\n\t\t\t\tconst leftKeyVariants = LinkerMap.getAxesRoots(left).map((axis) => {\n\t\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t\t});\n\t\t\t\tconst rightKeyVariants = LinkerMap.getAxesRoots(right).map((axis) => {\n\t\t\t\t\tconst axes = getArrayFromAxisTree(getAxesTree(axis));\n\t\t\t\t\treturn [canonicalizeJson(axes.map(getAxisId)), axes];\n\t\t\t\t});\n\t\t\t\tfor (const [keyLeft, spec] of leftKeyVariants) if (!result.has(keyLeft)) result.set(keyLeft, {\n\t\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t\t});\n\t\t\t\tfor (const [keyRight, spec] of rightKeyVariants) if (!result.has(keyRight)) result.set(keyRight, {\n\t\t\t\t\tkeyAxesSpec: spec,\n\t\t\t\t\tlinkWith: /* @__PURE__ */ new Map()\n\t\t\t\t});\n\t\t\t\tfor (const [keyRight] of rightKeyVariants) for (const [keyLeft] of leftKeyVariants) result.get(keyRight)?.linkWith.set(keyLeft, linker);\n\t\t\t}\n\t\t\treturn new this(result);\n\t\t}\n\t\t/** Get all available nodes of linker graphs if start from sourceAxesKeys */\n\t\tsearchAvailableAxesKeys(sourceAxesKeys) {\n\t\t\tconst startKeys = new Set(sourceAxesKeys);\n\t\t\tconst allAvailableKeys = /* @__PURE__ */ new Set();\n\t\t\tlet nextKeys = sourceAxesKeys;\n\t\t\twhile (nextKeys.length) {\n\t\t\t\tconst next = [];\n\t\t\t\tfor (const key of nextKeys) {\n\t\t\t\t\tconst node = this.data.get(key);\n\t\t\t\t\tif (!node) continue;\n\t\t\t\t\tfor (const availableKey of node.linkWith.keys()) if (!allAvailableKeys.has(availableKey) && !startKeys.has(availableKey)) {\n\t\t\t\t\t\tnext.push(availableKey);\n\t\t\t\t\t\tallAvailableKeys.add(availableKey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextKeys = next;\n\t\t\t}\n\t\t\treturn allAvailableKeys;\n\t\t}\n\t\t/** Get all linker columns that are necessary to reach endKey from startKey */\n\t\tsearchLinkerPath(startKey, endKey) {\n\t\t\tconst previous = {};\n\t\t\tlet nextIds = new Set([startKey]);\n\t\t\tconst visited = new Set([startKey]);\n\t\t\twhile (nextIds.size) {\n\t\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const nextId of nextIds) {\n\t\t\t\t\tconst node = this.data.get(nextId);\n\t\t\t\t\tif (!node) continue;\n\t\t\t\t\tfor (const availableId of node.linkWith.keys()) {\n\t\t\t\t\t\tprevious[availableId] = nextId;\n\t\t\t\t\t\tif (availableId === endKey) {\n\t\t\t\t\t\t\tconst ids = [];\n\t\t\t\t\t\t\tlet current = endKey;\n\t\t\t\t\t\t\twhile (previous[current] !== startKey) {\n\t\t\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\t\t\tcurrent = previous[current];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tids.push(current);\n\t\t\t\t\t\t\treturn ids.map((id) => this.data.get(previous[id]).linkWith.get(id));\n\t\t\t\t\t\t} else if (!visited.has(availableId)) {\n\t\t\t\t\t\t\tnext.add(availableId);\n\t\t\t\t\t\t\tvisited.add(availableId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextIds = next;\n\t\t\t}\n\t\t\treturn [];\n\t\t}\n\t\tgetLinkerColumnsForAxes({ from: sourceAxes, to: targetAxes, throwWhenNoLinkExists = true }) {\n\t\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\treturn Array.from(new Map(LinkerMap.getAxesRoots(targetAxes).map(LinkerMap.getLinkerKeyFromAxisSpec).flatMap((targetKey) => {\n\t\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\t\tif (!linkers.length && throwWhenNoLinkExists) throw Error(`Unable to find linker column for ${targetKey}`);\n\t\t\t\treturn linkers;\n\t\t\t})).values());\n\t\t}\n\t\t/** Get list of axisSpecs from keys of linker columns map */\n\t\tgetAxesListFromKeysList(keys) {\n\t\t\treturn Array.from(new Map(keys.flatMap((key) => this.data.get(key)?.keyAxesSpec ?? []).map((axis) => [canonicalizeJson(getAxisId(axis)), axis])).values());\n\t\t}\n\t\t/** Get axes of target axes that are impossible to be linked to source axes with current linker map */\n\t\tgetNonLinkableAxes(sourceAxes, targetAxes) {\n\t\t\tconst startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\tconst targetKeys = targetAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\treturn Array.from(new Map(targetAxes.filter((_targetAxis, idx) => {\n\t\t\t\tconst targetKey = targetKeys[idx];\n\t\t\t\treturn !startKeys.some((startKey) => this.searchLinkerPath(startKey, targetKey).length);\n\t\t\t}).flatMap((axis) => getArrayFromAxisTree(getAxesTree(axis)).map((axis) => [canonicalizeJson(getAxisId(axis)), axis]))).values());\n\t\t}\n\t\t/** Get all axes that can be connected to sourceAxes by linkers */\n\t\tgetReachableByLinkersAxesFromAxesNormalized(sourceAxes, matchAxisIdFn) {\n\t\t\tlet startKeys = [];\n\t\t\tif (matchAxisIdFn) {\n\t\t\t\tconst sourceAxisIdsGrouped = sourceAxes.map((axis) => getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t\t\t\tfor (const sourceAxisIdsGroup of sourceAxisIdsGrouped) {\n\t\t\t\t\tconst matched = this.keyAxesIds.find((keyIds) => keyIds.every((linkerKeyAxisId) => sourceAxisIdsGroup.find((sourceAxisId) => matchAxisIdFn(linkerKeyAxisId, sourceAxisId))));\n\t\t\t\t\tif (matched) startKeys.push(canonicalizeJson(matched));\n\t\t\t\t}\n\t\t\t} else startKeys = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);\n\t\t\tconst availableKeys = this.searchAvailableAxesKeys(startKeys);\n\t\t\treturn this.getAxesListFromKeysList([...availableKeys]);\n\t\t}\n\t\tgetReachableByLinkersAxesFromAxes(sourceAxes, matchAxisIdFn) {\n\t\t\treturn this.getReachableByLinkersAxesFromAxesNormalized(getNormalizedAxesList(sourceAxes), matchAxisIdFn);\n\t\t}\n\t\tstatic getLinkerKeyFromAxisSpec(axis) {\n\t\t\treturn canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n\t\t}\n\t\t/** Split array of axes into several arrays by parents: axes of one group are parents for each other.\n\t\tThere are no order inside every group. */\n\t\tstatic getAxesGroups(axesSpec) {\n\t\t\tswitch (axesSpec.length) {\n\t\t\t\tcase 0: return [];\n\t\t\t\tcase 1: return [[axesSpec[0]]];\n\t\t\t\tdefault: break;\n\t\t\t}\n\t\t\tconst axisKeys = axesSpec.map((spec) => canonicalizeJson(getAxisId(spec)));\n\t\t\tconst axisParentsIdxs = axesSpec.map((spec) => new Set(spec.parentAxesSpec.map((spec) => canonicalizeJson(getAxisId(spec))).map((el) => {\n\t\t\t\tconst idx = axisKeys.indexOf(el);\n\t\t\t\tif (idx === -1) throw new Error(`malformed axesSpec: ${JSON.stringify(axesSpec)}, unable to locate parent ${el}`);\n\t\t\t\treturn idx;\n\t\t\t})));\n\t\t\tconst allIdxs = [...axesSpec.keys()];\n\t\t\tconst groups = [];\n\t\t\tconst usedIdxs = /* @__PURE__ */ new Set();\n\t\t\tlet nextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\t\twhile (nextFreeEl !== void 0) {\n\t\t\t\tconst currentGroup = [nextFreeEl];\n\t\t\t\tusedIdxs.add(nextFreeEl);\n\t\t\t\tlet nextElsOfCurrentGroup = [nextFreeEl];\n\t\t\t\twhile (nextElsOfCurrentGroup.length) {\n\t\t\t\t\tconst next = /* @__PURE__ */ new Set();\n\t\t\t\t\tfor (const groupIdx of nextElsOfCurrentGroup) {\n\t\t\t\t\t\tconst groupElementParents = axisParentsIdxs[groupIdx];\n\t\t\t\t\t\tallIdxs.forEach((idx) => {\n\t\t\t\t\t\t\tif (idx === groupIdx || usedIdxs.has(idx)) return;\n\t\t\t\t\t\t\tif (axisParentsIdxs[idx].has(groupIdx) || groupElementParents.has(idx)) {\n\t\t\t\t\t\t\t\tcurrentGroup.push(idx);\n\t\t\t\t\t\t\t\tnext.add(idx);\n\t\t\t\t\t\t\t\tusedIdxs.add(idx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnextElsOfCurrentGroup = [...next];\n\t\t\t\t}\n\t\t\t\tgroups.push([...currentGroup]);\n\t\t\t\tnextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));\n\t\t\t}\n\t\t\treturn groups.map((group) => group.map((idx) => axesSpec[idx]));\n\t\t}\n\t\t/** Get all axes that are not parents of any other axis */\n\t\tstatic getAxesRoots(axes) {\n\t\t\tconst parentsSet = new Set(axes.flatMap((axis) => axis.parentAxesSpec).map((spec) => canonicalizeJson(getAxisId(spec))));\n\t\t\treturn axes.filter((axis) => !parentsSet.has(canonicalizeJson(getAxisId(axis))));\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/driver.js\n\tfunction assert() {}\n\tassert();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js\n\t/**\n\t* Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`\n\t* version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on\n\t* older desktop apps.\n\t*/\n\tconst REQUIRES_PFRAMES_VERSION = 1001031;\n\tstringType().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand(\"PlId\");\n\tobjectType({\n\t\t__isRef: literalType(true).describe(\"Crucial marker for the block dependency tree reconstruction\"),\n\t\tblockId: stringType().describe(\"Upstream block id\"),\n\t\tname: stringType().describe(\"Name of the output provided to the upstream block's output context\"),\n\t\trequireEnrichments: literalType(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\t}).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\t/**\n\t* Type guard to check if a value is a PlRef.\n\t*\n\t* @param value - The value to check.\n\t* @returns True if the value is a PlRef, false otherwise.\n\t*/\n\tfunction isPlRef(value) {\n\t\treturn typeof value === \"object\" && value !== null && \"__isRef\" in value && value.__isRef === true && \"blockId\" in value && \"name\" in value;\n\t}\n\t/**\n\t* Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n\t* requireEnrichments property.\n\t*\n\t* @param ref - The original PlRef object.\n\t* @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n\t* to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n\t* @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n\t*/\n\tfunction withEnrichments(ref, requireEnrichments = true) {\n\t\tif (requireEnrichments) return {\n\t\t\t...ref,\n\t\t\trequireEnrichments: true\n\t\t};\n\t\telse {\n\t\t\tconst { requireEnrichments: _, ...rest } = ref;\n\t\t\treturn rest;\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js\n\tfunction mapValueInVOE(voe, cb) {\n\t\treturn voe.ok ? {\n\t\t\tok: true,\n\t\t\tvalue: cb(voe.value)\n\t\t} : voe;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js\n\tconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\tconst { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {\n\t\tconst typeMap = /* @__PURE__ */ new Map();\n\t\tconst modelMethodsMap = /* @__PURE__ */ new Map();\n\t\tconst uiMethodsMap = /* @__PURE__ */ new Map();\n\t\treturn {\n\t\t\tservice() {\n\t\t\t\treturn (options) => {\n\t\t\t\t\tconst { name, type, modelMethods, uiMethods } = options;\n\t\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\t\tif (typeMap.has(name)) throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n\t\t\t\t\ttypeMap.set(name, type);\n\t\t\t\t\tmodelMethodsMap.set(name, modelMethods);\n\t\t\t\t\tuiMethodsMap.set(name, uiMethods);\n\t\t\t\t\treturn name;\n\t\t\t\t};\n\t\t\t},\n\t\t\tisNodeService(id) {\n\t\t\t\treturn typeMap.get(id) === \"node\";\n\t\t\t},\n\t\t\tisWasmService(id) {\n\t\t\t\treturn typeMap.get(id) === \"wasm\";\n\t\t\t},\n\t\t\tisMainService(id) {\n\t\t\t\treturn typeMap.get(id) === \"main\";\n\t\t\t},\n\t\t\tgetServiceKind(id) {\n\t\t\t\treturn typeMap.get(id);\n\t\t\t},\n\t\t\tgetServiceModelMethods(id) {\n\t\t\t\treturn modelMethodsMap.get(id) ?? [];\n\t\t\t},\n\t\t\tgetServiceUiMethods(id) {\n\t\t\t\treturn uiMethodsMap.get(id) ?? [];\n\t\t\t}\n\t\t};\n\t})();\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js\n\tconst Services = {\n\t\tPFrameSpec: service()({\n\t\t\ttype: \"wasm\",\n\t\t\tname: \"pframeSpec\",\n\t\t\tmodelMethods: [\n\t\t\t\t\"createSpecFrame\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"discoverColumns\",\n\t\t\t\t\"deleteColumn\",\n\t\t\t\t\"evaluateQuery\",\n\t\t\t\t\"buildQuery\",\n\t\t\t\t\"expandAxes\",\n\t\t\t\t\"collapseAxes\",\n\t\t\t\t\"findAxis\",\n\t\t\t\t\"findTableColumn\"\n\t\t\t],\n\t\t\tuiMethods: [\n\t\t\t\t\"createSpecFrame\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"discoverColumns\",\n\t\t\t\t\"deleteColumn\",\n\t\t\t\t\"evaluateQuery\",\n\t\t\t\t\"buildQuery\",\n\t\t\t\t\"expandAxes\",\n\t\t\t\t\"collapseAxes\",\n\t\t\t\t\"findAxis\",\n\t\t\t\t\"findTableColumn\"\n\t\t\t]\n\t\t}),\n\t\tPFrame: service()({\n\t\t\ttype: \"node\",\n\t\t\tname: \"pframe\",\n\t\t\tmodelMethods: [\n\t\t\t\t\"createPFrame\",\n\t\t\t\t\"createPTable\",\n\t\t\t\t\"createPTableV2\"\n\t\t\t],\n\t\t\tuiMethods: [\n\t\t\t\t\"findColumns\",\n\t\t\t\t\"getColumnSpec\",\n\t\t\t\t\"listColumns\",\n\t\t\t\t\"calculateTableData\",\n\t\t\t\t\"getUniqueValues\",\n\t\t\t\t\"getShape\",\n\t\t\t\t\"getSpec\",\n\t\t\t\t\"getData\",\n\t\t\t\t\"writePTableToFs\"\n\t\t\t]\n\t\t}),\n\t\tDialog: service()({\n\t\t\ttype: \"main\",\n\t\t\tname: \"dialog\",\n\t\t\tmodelMethods: [],\n\t\t\tuiMethods: [\"showSaveDialog\"]\n\t\t})\n\t};\n\tObject.keys(Services).map((key) => `requires${key}`);\n\t/**\n\t* Resolve which services are required by the given feature flags.\n\t* Accepts Record<string, unknown> so it works with both BlockCodeKnownFeatureFlags\n\t* (from middle layer) and Zod-parsed records (from preload).\n\t*/\n\tfunction resolveRequiredServices(flags) {\n\t\tif (!flags) return [];\n\t\treturn Object.keys(Services).filter((key) => flags[`requires${key}`] === true).map((key) => Services[key]);\n\t}\n\tObject.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.42.0/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js\n\tfunction buildMethodMap(pick) {\n\t\tconst result = {};\n\t\tfor (const id of Object.values(Services)) result[id] = [...pick(id)];\n\t\treturn result;\n\t}\n\tbuildMethodMap(getServiceUiMethods);\n\tbuildMethodMap(getServiceModelMethods);\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/accessor.js\n\tfunction ifDef(value, cb) {\n\t\treturn value === void 0 ? void 0 : cb(value);\n\t}\n\t/** Represent resource tree node accessor */\n\tvar TreeNodeAccessor = class TreeNodeAccessor {\n\t\tconstructor(handle, resolvePath) {\n\t\t\tthis.handle = handle;\n\t\t\tthis.resolvePath = resolvePath;\n\t\t}\n\t\tresolve(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Input\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveOutput(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Output\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveInput(...steps) {\n\t\t\tconst transformedSteps = steps.map((s) => ({\n\t\t\t\tassertFieldType: \"Input\",\n\t\t\t\t...typeof s === \"string\" ? { field: s } : s\n\t\t\t}));\n\t\t\treturn this.resolveWithCommon({}, ...transformedSteps);\n\t\t}\n\t\tresolveAny(...steps) {\n\t\t\treturn this.resolveWithCommon({}, ...steps);\n\t\t}\n\t\tresolveWithCommon(commonOptions, ...steps) {\n\t\t\tconst resolvePath = [...this.resolvePath, ...steps.map((step) => typeof step === \"string\" ? step : step.field)];\n\t\t\treturn ifDef(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps), (accessor) => new TreeNodeAccessor(accessor, resolvePath));\n\t\t}\n\t\tget resourceType() {\n\t\t\treturn getCfgRenderCtx().getResourceType(this.handle);\n\t\t}\n\t\tgetInputsLocked() {\n\t\t\treturn getCfgRenderCtx().getInputsLocked(this.handle);\n\t\t}\n\t\tgetOutputsLocked() {\n\t\t\treturn getCfgRenderCtx().getOutputsLocked(this.handle);\n\t\t}\n\t\tgetIsReadyOrError() {\n\t\t\treturn getCfgRenderCtx().getIsReadyOrError(this.handle);\n\t\t}\n\t\tgetIsFinal() {\n\t\t\treturn getCfgRenderCtx().getIsFinal(this.handle);\n\t\t}\n\t\tgetError() {\n\t\t\tconst resolvePath = [...this.resolvePath, \"error\"];\n\t\t\treturn ifDef(getCfgRenderCtx().getError(this.handle), (accsessor) => new TreeNodeAccessor(accsessor, resolvePath));\n\t\t}\n\t\tlistInputFields() {\n\t\t\treturn getCfgRenderCtx().listInputFields(this.handle);\n\t\t}\n\t\tlistOutputFields() {\n\t\t\treturn getCfgRenderCtx().listOutputFields(this.handle);\n\t\t}\n\t\tlistDynamicFields() {\n\t\t\treturn getCfgRenderCtx().listDynamicFields(this.handle);\n\t\t}\n\t\tgetKeyValueBase64(key) {\n\t\t\treturn getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n\t\t}\n\t\tgetKeyValueAsString(key) {\n\t\t\treturn getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n\t\t}\n\t\tgetKeyValueAsJson(key) {\n\t\t\tconst content = this.getKeyValueAsString(key);\n\t\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\t\treturn JSON.parse(content);\n\t\t}\n\t\tgetDataBase64() {\n\t\t\treturn getCfgRenderCtx().getDataBase64(this.handle);\n\t\t}\n\t\tgetDataAsString() {\n\t\t\treturn getCfgRenderCtx().getDataAsString(this.handle);\n\t\t}\n\t\tgetDataAsJson() {\n\t\t\tconst content = this.getDataAsString();\n\t\t\tif (content == void 0) throw new Error(\"Resource has no content.\");\n\t\t\treturn JSON.parse(content);\n\t\t}\n\t\t/**\n\t\t*\n\t\t*/\n\t\tgetPColumns(errorOnUnknownField = false, prefix = \"\") {\n\t\t\tconst result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n\t\t\tif (result === void 0) return void 0;\n\t\t\treturn Object.entries(result).map(([, obj]) => {\n\t\t\t\tif (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n\t\t\t\treturn obj;\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t*\n\t\t*/\n\t\tparsePObjectCollection(errorOnUnknownField = false, prefix = \"\") {\n\t\t\tconst pObjects = getCfgRenderCtx().parsePObjectCollection(this.handle, errorOnUnknownField, prefix, ...this.resolvePath);\n\t\t\tif (pObjects === void 0) return void 0;\n\t\t\tconst result = {};\n\t\t\tfor (const [key, value] of Object.entries(pObjects)) {\n\t\t\t\tconst resolvePath = [...this.resolvePath, key];\n\t\t\t\tresult[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tgetFileContentAsBase64(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));\n\t\t}\n\t\tgetFileContentAsString(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));\n\t\t}\n\t\tgetFileContentAsJson(range) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range)).mapDefined((v) => JSON.parse(v));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileContentAsBase64\n\t\t*/\n\t\tgetBlobContentAsBase64() {\n\t\t\treturn this.getFileContentAsBase64();\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileContentAsString\n\t\t*/\n\t\tgetBlobContentAsString() {\n\t\t\treturn this.getFileContentAsString();\n\t\t}\n\t\t/**\n\t\t* @returns downloaded file handle\n\t\t*/\n\t\tgetFileHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getFileHandle\n\t\t*/\n\t\tgetDownloadedBlobHandle() {\n\t\t\treturn this.getFileHandle();\n\t\t}\n\t\t/**\n\t\t* @returns downloaded file handle\n\t\t*/\n\t\tgetRemoteFileHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getRemoteFileHandle\n\t\t*/\n\t\tgetOnDemandBlobHandle() {\n\t\t\treturn this.getRemoteFileHandle();\n\t\t}\n\t\t/**\n\t\t* @returns the url to the extracted folder\n\t\t*/\n\t\textractArchiveAndGetURL(format) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));\n\t\t}\n\t\tgetImportProgress() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n\t\t}\n\t\tgetLastLogs(nLines) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n\t\t}\n\t\tgetProgressLog(patternToSearch) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n\t\t}\n\t\tgetProgressLogWithInfo(patternToSearch) {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));\n\t\t}\n\t\tgetLogHandle() {\n\t\t\treturn new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n\t\t}\n\t\tallFieldsResolved(fieldType = \"Input\") {\n\t\t\tswitch (fieldType) {\n\t\t\t\tcase \"Input\": return this.getInputsLocked() && this.listInputFields().every((field) => this.resolve({\n\t\t\t\t\tfield,\n\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t}) !== void 0);\n\t\t\t\tcase \"Output\": return this.getOutputsLocked() && this.listOutputFields().every((field) => this.resolve({\n\t\t\t\t\tfield,\n\t\t\t\t\tassertFieldType: \"Output\"\n\t\t\t\t}) !== void 0);\n\t\t\t}\n\t\t}\n\t\tmapFields(_mapping, _ops) {\n\t\t\tconst { fieldType, requireLocked, skipUnresolved } = {\n\t\t\t\tfieldType: \"Input\",\n\t\t\t\trequireLocked: true,\n\t\t\t\tskipUnresolved: false,\n\t\t\t\t..._ops\n\t\t\t};\n\t\t\tconst mapping = _mapping;\n\t\t\tif (requireLocked) {\n\t\t\t\tif (fieldType === \"Input\" && !this.getInputsLocked()) return void 0;\n\t\t\t\tif (fieldType === \"Output\" && !this.getOutputsLocked()) return void 0;\n\t\t\t}\n\t\t\tlet fieldEntries = (fieldType === \"Input\" ? this.listInputFields() : fieldType === \"Output\" ? this.listOutputFields() : this.listDynamicFields()).map((field) => [field, this.resolve({\n\t\t\t\tfield,\n\t\t\t\tassertFieldType: fieldType\n\t\t\t})]);\n\t\t\tif (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== void 0);\n\t\t\treturn fieldEntries.map(([name, value]) => mapping(name, value));\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/internal.js\n\tconst StagingAccessorName = \"staging\";\n\tconst MainAccessorName = \"main\";\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js\n\tfunction filterDataInfoEntries(dataInfoEntries, axisFilters) {\n\t\tconst sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\t\tconst { type } = dataInfoEntries;\n\t\tswitch (type) {\n\t\t\tcase \"Json\": {\n\t\t\t\tconst { keyLength } = dataInfoEntries;\n\t\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\t\tbreak;\n\t\t\t}\n\t\t\tcase \"JsonPartitioned\":\n\t\t\tcase \"BinaryPartitioned\":\n\t\t\tcase \"ParquetPartitioned\": {\n\t\t\t\tconst { partitionKeyLength } = dataInfoEntries;\n\t\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\t\tbreak;\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unsupported data info type: ${type}`);\n\t\t}\n\t\tconst keyMatchesFilters = (key) => {\n\t\t\tfor (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n\t\t\treturn true;\n\t\t};\n\t\tconst removeFilteredAxes = (key) => {\n\t\t\tconst newKey = [...key];\n\t\t\tfor (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\t\t\treturn newKey;\n\t\t};\n\t\tswitch (dataInfoEntries.type) {\n\t\t\tcase \"Json\": return {\n\t\t\t\ttype: \"Json\",\n\t\t\t\tkeyLength: dataInfoEntries.keyLength - axisFilters.length,\n\t\t\t\tdata: dataInfoEntries.data.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"JsonPartitioned\": return {\n\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"BinaryPartitioned\": return {\n\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t\tcase \"ParquetPartitioned\": return {\n\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\tpartitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n\t\t\t\tparts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({\n\t\t\t\t\tkey: removeFilteredAxes(entry.key),\n\t\t\t\t\tvalue: entry.value\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/function/identity.mjs\n\tfunction identity(x) {\n\t\treturn x;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs\n\tfunction isTypedArray$1(x) {\n\t\treturn ArrayBuffer.isView(x) && !(x instanceof DataView);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs\n\tfunction getTag(value) {\n\t\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\t\treturn Object.prototype.toString.call(value);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isFunction.mjs\n\tfunction isFunction(value) {\n\t\treturn typeof value === \"function\";\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isLength.mjs\n\tfunction isLength(value) {\n\t\treturn Number.isSafeInteger(value) && value >= 0;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isNil.mjs\n\tfunction isNil(x) {\n\t\treturn x == null;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js\n\tconst DISTANCE_PENALTY = .001;\n\tconst LABEL_TYPE = \"__LABEL__\";\n\tconst LABEL_TYPE_FULL = \"__LABEL__@1\";\n\tconst LINKER_TYPE = \"__LINKER__\";\n\tconst LINKER_TYPE_FULL = \"__LINKER__@1\";\n\tconst HIT_QUAL_TYPE = \"__HIT_QUAL__\";\n\tconst ANCHOR_QUAL_TYPE_PREFIX = \"__ANCHOR_QUAL__:\";\n\tfunction isAnchorQualType(t) {\n\t\treturn t.startsWith(ANCHOR_QUAL_TYPE_PREFIX);\n\t}\n\tfunction isSyntheticType(t) {\n\t\treturn t === LINKER_TYPE || t === HIT_QUAL_TYPE || isAnchorQualType(t);\n\t}\n\tfunction deriveDistinctLabels(values, options = {}) {\n\t\tconst forceTraceElements = options.forceTraceElements !== void 0 && options.forceTraceElements.length > 0 ? new Set(options.forceTraceElements) : void 0;\n\t\tconst separator = options.separator ?? \" / \";\n\t\tconst records = values.map((v, i) => enrichRecord(v, i, options));\n\t\tconst stats = collectTypeStats(records);\n\t\tconst hasAnySynthetic = records.some((r) => r.fullTrace.some((ft) => isSyntheticType(ft.type)));\n\t\tconst labelForced = (options.includeNativeLabel === true || hasAnySynthetic) && stats.countByType.has(LABEL_TYPE_FULL);\n\t\tconst linkerForced = stats.countByType.get(LINKER_TYPE_FULL) === values.length;\n\t\tconst forcedSet = /* @__PURE__ */ new Set();\n\t\tif (labelForced) forcedSet.add(LABEL_TYPE_FULL);\n\t\tif (linkerForced) forcedSet.add(LINKER_TYPE_FULL);\n\t\tconst { mainTypes, secondaryTypes } = classifyTypes(stats, values.length);\n\t\tconst build = (typeSet, force) => buildLabels(records, typeSet, forceTraceElements, separator, force);\n\t\tif (mainTypes.length === 0) {\n\t\t\tif (secondaryTypes.length !== 0) throw new Error(\"Non-empty secondary types list while main types list is empty.\");\n\t\t\treturn build(new Set([LABEL_TYPE_FULL]), true) ?? throwError(\"Failed to derive labels using native column labels\");\n\t\t}\n\t\tlet includedCount = 0;\n\t\tlet additionalType = -1;\n\t\twhile (includedCount < mainTypes.length) {\n\t\t\tconst currentSet = new Set(forcedSet);\n\t\t\tfor (let i = 0; i < includedCount; ++i) currentSet.add(mainTypes[i]);\n\t\t\tif (additionalType >= 0) currentSet.add(mainTypes[additionalType]);\n\t\t\tconst candidateResult = build(currentSet, false);\n\t\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) === values.length) {\n\t\t\t\tconst minimized = minimizeTypeSet(currentSet, records, stats, forceTraceElements, forcedSet, separator);\n\t\t\t\treturn dropRedundantLinkerSuffix(records, minimized, forceTraceElements, forcedSet, separator, build(minimized, false) ?? throwError(\"Failed to derive unique labels\"));\n\t\t\t}\n\t\t\tadditionalType++;\n\t\t\tif (additionalType >= mainTypes.length) {\n\t\t\t\tincludedCount++;\n\t\t\t\tadditionalType = includedCount;\n\t\t\t}\n\t\t}\n\t\tconst minimized = minimizeTypeSet(new Set([\n\t\t\t...forcedSet,\n\t\t\t...mainTypes,\n\t\t\t...secondaryTypes\n\t\t]), records, stats, forceTraceElements, forcedSet, separator);\n\t\treturn dropRedundantLinkerSuffix(records, minimized, forceTraceElements, forcedSet, separator, build(minimized, true) ?? throwError(\"Failed to derive unique labels\"));\n\t}\n\tfunction extractEntryParts(entry) {\n\t\tif (!(\"spec\" in entry && typeof entry.spec === \"object\")) return {\n\t\t\tspec: entry,\n\t\t\textraTrace: void 0,\n\t\t\tlinkerPath: void 0,\n\t\t\tqualifications: void 0\n\t\t};\n\t\treturn {\n\t\t\tspec: entry.spec,\n\t\t\textraTrace: entry.extraTrace,\n\t\t\tlinkerPath: entry.linkerPath,\n\t\t\tqualifications: entry.qualifications\n\t\t};\n\t}\n\tfunction formatQualification(q) {\n\t\tconst ctx = q.contextDomain ?? {};\n\t\tconst keys = Object.keys(ctx);\n\t\tif (keys.length === 0) return q.axis.name;\n\t\tconst pairs = keys.map((k) => `${k}=${ctx[k]}`).join(\", \");\n\t\treturn Object.prototype.hasOwnProperty.call(ctx, q.axis.name) ? pairs : `${q.axis.name} ${pairs}`;\n\t}\n\tfunction formatQualifications(qs) {\n\t\treturn qs.map(formatQualification).join(\"; \");\n\t}\n\tfunction computeStepLabel(step, stepIndex, formatters) {\n\t\tconst base = (readAnnotation(step.spec, Annotation.LinkLabel) ?? readAnnotation(step.spec, Annotation.Label))?.trim();\n\t\tif (isNil(base) || base.length === 0) return void 0;\n\t\tif (step.qualifications === void 0 || step.qualifications.length === 0) return base;\n\t\tconst qualText = isFunction(formatters?.linkerStepQualification) ? formatters.linkerStepQualification(step.qualifications, stepIndex, step.spec) : `[${formatQualifications(step.qualifications)}]`;\n\t\treturn isNil(qualText) ? base : `${base} ${qualText}`;\n\t}\n\tfunction buildFullTrace(trace) {\n\t\tconst result = [];\n\t\tconst occurrences = /* @__PURE__ */ new Map();\n\t\tfor (let i = trace.length - 1; i >= 0; --i) {\n\t\t\tconst entry = trace[i];\n\t\t\tconst occurrenceIndex = (occurrences.get(entry.type) ?? 0) + 1;\n\t\t\toccurrences.set(entry.type, occurrenceIndex);\n\t\t\tresult.push({\n\t\t\t\t...entry,\n\t\t\t\tfullType: `${entry.type}@${occurrenceIndex}`,\n\t\t\t\toccurrenceIndex\n\t\t\t});\n\t\t}\n\t\tresult.reverse();\n\t\treturn result;\n\t}\n\tfunction enrichRecord(value, index, options) {\n\t\tconst { spec, extraTrace, linkerPath, qualifications } = extractEntryParts(value);\n\t\tconst formatters = options.formatters;\n\t\tconst rawLabel = readAnnotation(spec, Annotation.Label);\n\t\tconst traceStr = readAnnotation(spec, Annotation.Trace);\n\t\tconst baseTrace = traceStr ? parseJson(traceStr) ?? [] : [];\n\t\tconst prefixExtra = extraTrace?.filter((e) => e.position === \"prefix\") ?? [];\n\t\tconst suffixExtra = extraTrace?.filter((e) => e.position !== \"prefix\") ?? [];\n\t\tconst trace = [\n\t\t\t...prefixExtra,\n\t\t\t...baseTrace,\n\t\t\t...suffixExtra\n\t\t];\n\t\tif (!isNil(rawLabel)) {\n\t\t\tconst label = isFunction(formatters?.native) ? formatters.native(rawLabel, spec, index) : rawLabel;\n\t\t\tif (!isNil(label)) {\n\t\t\t\tconst labelEntry = {\n\t\t\t\t\tlabel,\n\t\t\t\t\ttype: LABEL_TYPE,\n\t\t\t\t\timportance: -2\n\t\t\t\t};\n\t\t\t\tif (options.addLabelAsSuffix === true) trace.push(labelEntry);\n\t\t\t\telse trace.splice(0, 0, labelEntry);\n\t\t\t}\n\t\t}\n\t\tif (linkerPath !== void 0 && linkerPath.length > 0) {\n\t\t\tconst stepLabels = linkerPath.map((step, i) => computeStepLabel(step, i, formatters)).filter((s) => !isNil(s));\n\t\t\tif (stepLabels.length > 0) {\n\t\t\t\tconst linkerText = isFunction(formatters?.linker) ? formatters.linker(stepLabels, spec, index) : `via ${stepLabels.join(\" > \")}`;\n\t\t\t\tif (!isNil(linkerText)) trace.push({\n\t\t\t\t\ttype: LINKER_TYPE,\n\t\t\t\t\tlabel: linkerText,\n\t\t\t\t\timportance: -10\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (qualifications !== void 0 && qualifications.forQueries !== void 0) {\n\t\t\tfor (const [anchorId, qs] of Object.entries(qualifications.forQueries)) {\n\t\t\t\tif (qs.length === 0) continue;\n\t\t\t\tconst anchorText = isFunction(formatters?.anchorQualification) ? formatters.anchorQualification(anchorId, qs, spec, index) : `[${anchorId}: ${formatQualifications(qs)}]`;\n\t\t\t\tif (isNil(anchorText)) continue;\n\t\t\t\ttrace.push({\n\t\t\t\t\ttype: `${ANCHOR_QUAL_TYPE_PREFIX}${anchorId}`,\n\t\t\t\t\tlabel: anchorText,\n\t\t\t\t\timportance: -11\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (qualifications.forHit !== void 0 && qualifications.forHit.length > 0) {\n\t\t\t\tconst hitText = isFunction(formatters?.hitQualification) ? formatters.hitQualification(qualifications.forHit, spec, index) : `[${formatQualifications(qualifications.forHit)}]`;\n\t\t\t\tif (!isNil(hitText)) trace.push({\n\t\t\t\t\ttype: HIT_QUAL_TYPE,\n\t\t\t\t\tlabel: hitText,\n\t\t\t\t\timportance: -12\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn { fullTrace: buildFullTrace(trace) };\n\t}\n\tfunction collectTypeStats(records) {\n\t\tconst importances = /* @__PURE__ */ new Map();\n\t\tconst countByType = /* @__PURE__ */ new Map();\n\t\tfor (const record of records) for (let i = 0; i < record.fullTrace.length; i++) {\n\t\t\tconst { fullType, importance: rawImportance } = record.fullTrace[i];\n\t\t\tconst importance = rawImportance ?? 0;\n\t\t\tconst distance = (record.fullTrace.length - i) * DISTANCE_PENALTY;\n\t\t\tcountByType.set(fullType, (countByType.get(fullType) ?? 0) + 1);\n\t\t\timportances.set(fullType, Math.max(importances.get(fullType) ?? Number.NEGATIVE_INFINITY, importance - distance));\n\t\t}\n\t\treturn {\n\t\t\timportances,\n\t\t\tcountByType\n\t\t};\n\t}\n\tfunction classifyTypes(stats, totalRecords) {\n\t\tconst sorted = [...stats.importances].sort(([, i1], [, i2]) => i2 - i1);\n\t\tconst mainTypes = [];\n\t\tconst secondaryTypes = [];\n\t\tfor (const [typeName] of sorted) if (typeName.endsWith(\"@1\") || stats.countByType.get(typeName) === totalRecords) mainTypes.push(typeName);\n\t\telse secondaryTypes.push(typeName);\n\t\treturn {\n\t\t\tmainTypes,\n\t\t\tsecondaryTypes\n\t\t};\n\t}\n\tfunction renderRecordLabel(record, includedTypes, forceTraceElements, separator) {\n\t\tconst traceParts = [];\n\t\tconst anchorParts = [];\n\t\tlet linkerLabel;\n\t\tlet hitLabel;\n\t\tfor (const ft of record.fullTrace) {\n\t\t\tif (!(includedTypes.has(ft.fullType) || forceTraceElements?.has(ft.type))) continue;\n\t\t\tif (ft.type === LINKER_TYPE) linkerLabel = ft.label;\n\t\t\telse if (ft.type === HIT_QUAL_TYPE) hitLabel = ft.label;\n\t\t\telse if (isAnchorQualType(ft.type)) anchorParts.push(ft.label);\n\t\t\telse traceParts.push(ft.label);\n\t\t}\n\t\tif (traceParts.length === 0 && anchorParts.length === 0 && linkerLabel === void 0 && hitLabel === void 0) return void 0;\n\t\tlet label = traceParts.join(separator);\n\t\tconst append = (part) => {\n\t\t\tlabel = label.length === 0 ? part : `${label} ${part}`;\n\t\t};\n\t\tif (linkerLabel !== void 0) append(linkerLabel);\n\t\tfor (const a of anchorParts) append(a);\n\t\tif (hitLabel !== void 0) append(hitLabel);\n\t\treturn label;\n\t}\n\tfunction buildLabels(records, includedTypes, forceTraceElements, separator, force) {\n\t\tconst result = [];\n\t\tfor (const r of records) {\n\t\t\tconst rendered = renderRecordLabel(r, includedTypes, forceTraceElements, separator);\n\t\t\tif (rendered === void 0) {\n\t\t\t\tif (!force) return void 0;\n\t\t\t\tresult.push(\"Unlabeled\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult.push(rendered);\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Drop the \"via …\" linker suffix from records whose label is already unique without it.\n\t*\n\t* Global minimization may include `LINKER_TYPE_FULL` solely to resolve a collision between a\n\t* subset of records — but `buildLabels` then renders the suffix on every record that carries a\n\t* linker trace entry, including ones whose stem is already unique. We strip the suffix where it\n\t* isn't load-bearing while keeping the symmetric rendering required by `linkerForced` /\n\t* `forceTraceElements`.\n\t*\n\t* Rule: a record's linker suffix is redundant iff its stem (label rendered without LINKER) does\n\t* not appear anywhere else in the set.\n\t*/\n\tfunction dropRedundantLinkerSuffix(records, globalTypeSet, forceTraceElements, forcedSet, separator, labels) {\n\t\tif (!globalTypeSet.has(LINKER_TYPE_FULL)) return labels;\n\t\tif (forcedSet.has(LINKER_TYPE_FULL) || forceTraceElements?.has(LINKER_TYPE)) return labels;\n\t\tconst setWithoutLinker = new Set(globalTypeSet);\n\t\tsetWithoutLinker.delete(LINKER_TYPE_FULL);\n\t\tconst stems = records.map((r) => renderRecordLabel(r, setWithoutLinker, forceTraceElements, separator));\n\t\tconst stemOccurrences = /* @__PURE__ */ new Map();\n\t\tfor (const s of stems) if (s !== void 0) stemOccurrences.set(s, (stemOccurrences.get(s) ?? 0) + 1);\n\t\treturn labels.map((label, i) => {\n\t\t\tconst stem = stems[i];\n\t\t\tif (stem === void 0) return label;\n\t\t\treturn stemOccurrences.get(stem) === 1 ? stem : label;\n\t\t});\n\t}\n\tfunction countUniqueLabels(result) {\n\t\tif (result === void 0) return 0;\n\t\treturn new Set(result).size;\n\t}\n\tfunction minimizeTypeSet(typeSet, records, stats, forceTraceElements, forcedSet, separator) {\n\t\tconst initialResult = buildLabels(records, typeSet, forceTraceElements, separator, false);\n\t\tif (initialResult === void 0) return typeSet;\n\t\tconst targetCardinality = countUniqueLabels(initialResult);\n\t\tconst result = new Set(typeSet);\n\t\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\t\tfor (const typeToRemove of removable) {\n\t\t\tconst candidate = new Set(result);\n\t\t\tcandidate.delete(typeToRemove);\n\t\t\tconst candidateResult = buildLabels(records, candidate, forceTraceElements, separator, false);\n\t\t\tif (candidateResult !== void 0 && countUniqueLabels(candidateResult) >= targetCardinality) result.delete(typeToRemove);\n\t\t}\n\t\treturn result;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/util/label.js\n\t/** @deprecated Use deriveDistinctLabels */\n\tfunction deriveLabels(values, getSpec, options = {}) {\n\t\treturn deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({\n\t\t\tvalue: values[i],\n\t\t\tlabel\n\t\t}));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js\n\tconst PCD_PREFIX = \"PColumnData/\";\n\tconst RT_RESOURCE_MAP = PCD_PREFIX + \"ResourceMap\";\n\tconst RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + \"Partitioned/ResourceMap\";\n\tconst RT_JSON_PARTITIONED = PCD_PREFIX + \"JsonPartitioned\";\n\tconst RT_BINARY_PARTITIONED = PCD_PREFIX + \"BinaryPartitioned\";\n\tconst RT_PARQUET_PARTITIONED = PCD_PREFIX + \"ParquetPartitioned\";\n\tconst PCD_SUP_PREFIX = PCD_PREFIX + \"Partitioned/\";\n\tconst RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"JsonPartitioned\";\n\tconst RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"BinaryPartitioned\";\n\tconst RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + \"ParquetPartitioned\";\n\tconst removeIndexSuffix = (keyStr) => {\n\t\tif (keyStr.endsWith(\".index\")) return {\n\t\t\tbaseKey: keyStr.substring(0, keyStr.length - 6),\n\t\t\ttype: \"index\"\n\t\t};\n\t\telse if (keyStr.endsWith(\".values\")) return {\n\t\t\tbaseKey: keyStr.substring(0, keyStr.length - 7),\n\t\t\ttype: \"values\"\n\t\t};\n\t\telse throw new Error(`key must ends on .index/.values for binary p-column, got: ${keyStr}`);\n\t};\n\t/** Returns a list of all partition keys appeared in the p-column */\n\tfunction getPartitionKeysList(acc) {\n\t\tif (!acc) return void 0;\n\t\tconst rt = acc.resourceType.name;\n\t\tconst meta = acc.getDataAsJson();\n\t\tconst data = [];\n\t\tlet keyLength = 0;\n\t\tswitch (rt) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\t\tkeyLength = meta[\"keyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"partitionKeyLength\"] + meta[\"keyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_JSON_PARTITIONED:\n\t\t\tcase RT_BINARY_PARTITIONED:\n\t\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"partitionKeyLength\"];\n\t\t\t\tbreak;\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\t\tkeyLength = meta[\"superPartitionKeyLength\"] + meta[\"partitionKeyLength\"];\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch (rt) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\tcase RT_JSON_PARTITIONED:\n\t\t\tcase RT_BINARY_PARTITIONED:\n\t\t\tcase RT_PARQUET_PARTITIONED:\n\t\t\t\tfor (let keyStr of acc.listInputFields()) {\n\t\t\t\t\tif (rt === \"PColumnData/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\t\tconst key = [...JSON.parse(keyStr)];\n\t\t\t\t\tdata.push(key);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED:\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED:\n\t\t\tcase RT_JSON_SUPER_PARTITIONED:\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED:\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst keyPrefix = [...JSON.parse(supKeyStr)];\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value !== void 0) for (let keyStr of value.listInputFields()) {\n\t\t\t\t\t\tif (rt === \"PColumnData/Partitioned/BinaryPartitioned\") keyStr = removeIndexSuffix(keyStr).baseKey;\n\t\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\t\tdata.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn {\n\t\t\tdata,\n\t\t\tkeyLength\n\t\t};\n\t}\n\tfunction getUniquePartitionKeysForDataEntries(list) {\n\t\tif (list.type !== \"JsonPartitioned\" && list.type !== \"BinaryPartitioned\" && list.type !== \"ParquetPartitioned\") throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${list.type}`);\n\t\tconst { parts, partitionKeyLength } = list;\n\t\tconst result = [];\n\t\tfor (let i = 0; i < partitionKeyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\t\tfor (const part of parts) {\n\t\t\tconst key = part.key;\n\t\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\t\tfor (let i = 0; i < partitionKeyLength; ++i) result[i].add(key[i]);\n\t\t}\n\t\treturn result.map((s) => Array.from(s.values()));\n\t}\n\tfunction getUniquePartitionKeys(acc) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (isDataInfoEntries(acc)) return getUniquePartitionKeysForDataEntries(acc);\n\t\tconst list = getPartitionKeysList(acc);\n\t\tif (!list) return void 0;\n\t\tconst { data, keyLength } = list;\n\t\tconst result = [];\n\t\tfor (let i = 0; i < keyLength; ++i) result.push(/* @__PURE__ */ new Set());\n\t\tfor (const l of data) {\n\t\t\tif (l.length !== keyLength) throw new Error(\"key length does not match partition length\");\n\t\t\tfor (let i = 0; i < keyLength; ++i) result[i].add(l[i]);\n\t\t}\n\t\treturn result.map((s) => Array.from(s.values()));\n\t}\n\t/**\n\t* Parses the PColumn data from a TreeNodeAccessor into a DataInfoEntries structure.\n\t* Returns undefined if any required data is missing.\n\t* Throws error on validation failures.\n\t*\n\t* @param acc - The TreeNodeAccessor containing PColumn data\n\t* @param keyPrefix - Optional key prefix for recursive calls\n\t* @returns DataInfoEntries representation of the PColumn data, or undefined if incomplete\n\t*/\n\tfunction parsePColumnData(acc, keyPrefix = []) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (!acc.getIsReadyOrError()) return void 0;\n\t\tconst resourceType = acc.resourceType.name;\n\t\tconst meta = acc.getDataAsJson();\n\t\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\t\tswitch (resourceType) {\n\t\t\tcase RT_RESOURCE_MAP:\n\t\t\tcase RT_RESOURCE_MAP_PARTITIONED: throw new Error(`Only data columns are supported, got: ${resourceType}`);\n\t\t\tcase RT_JSON_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_BINARY_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tconst baseKeys = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst suffix = removeIndexSuffix(keyStr);\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tlet entry = baseKeys.get(suffix.baseKey);\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\tentry = {};\n\t\t\t\t\t\tbaseKeys.set(suffix.baseKey, entry);\n\t\t\t\t\t}\n\t\t\t\t\tif (suffix.type === \"index\") entry.index = value;\n\t\t\t\t\telse entry.values = value;\n\t\t\t\t}\n\t\t\t\tfor (const [baseKeyStr, entry] of baseKeys.entries()) {\n\t\t\t\t\tif (!entry.index || !entry.values) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(baseKeyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\tindex: entry.index,\n\t\t\t\t\t\t\tvalues: entry.values\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_PARQUET_PARTITIONED: {\n\t\t\t\tif (typeof meta?.partitionKeyLength !== \"number\") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const keyStr of acc.listInputFields()) {\n\t\t\t\t\tconst value = acc.resolve({\n\t\t\t\t\t\tfield: keyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (value === void 0) return void 0;\n\t\t\t\t\tconst key = [...keyPrefix, ...JSON.parse(keyStr)];\n\t\t\t\t\tparts.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\t\tpartitionKeyLength: meta.partitionKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_JSON_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"JsonPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"JsonPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_BINARY_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"BinaryPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"BinaryPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase RT_PARQUET_SUPER_PARTITIONED: {\n\t\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\t\tconst totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;\n\t\t\t\tconst parts = [];\n\t\t\t\tfor (const supKeyStr of acc.listInputFields()) {\n\t\t\t\t\tconst superPartition = acc.resolve({\n\t\t\t\t\t\tfield: supKeyStr,\n\t\t\t\t\t\tassertFieldType: \"Input\"\n\t\t\t\t\t});\n\t\t\t\t\tif (superPartition === void 0) return void 0;\n\t\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\t\tconst innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));\n\t\t\t\t\tif (innerResult === void 0) return void 0;\n\t\t\t\t\tif (innerResult.type !== \"ParquetPartitioned\") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);\n\t\t\t\t\tparts.push(...innerResult.parts);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"ParquetPartitioned\",\n\t\t\t\t\tpartitionKeyLength: totalKeyLength,\n\t\t\t\t\tparts\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unknown resource type: ${resourceType}`);\n\t\t}\n\t}\n\t/**\n\t* Converts or parses the input into DataInfoEntries format.\n\t\n\t* @param acc - The input data, which can be TreeNodeAccessor, DataInfoEntries, DataInfo, or undefined.\n\t* @returns The data in DataInfoEntries format, or undefined if the input was undefined or data is not ready.\n\t*/\n\tfunction convertOrParsePColumnData(acc) {\n\t\tif (acc === void 0) return void 0;\n\t\tif (isDataInfoEntries(acc)) return acc;\n\t\tif (isDataInfo(acc)) return dataInfoToEntries(acc);\n\t\tif (acc instanceof TreeNodeAccessor) return parsePColumnData(acc);\n\t\tthrow new Error(`Unexpected input type: ${typeof acc}`);\n\t}\n\tfunction isPColumnReady(c) {\n\t\tconst isValues = (d) => Array.isArray(d);\n\t\tconst isAccessor = (d) => d instanceof TreeNodeAccessor;\n\t\tlet ready = true;\n\t\tconst data = typeof c.data === \"function\" ? c.data() : c.data;\n\t\tif (data == null) return false;\n\t\telse if (isAccessor(data)) ready &&= data.getIsReadyOrError();\n\t\telse if (isDataInfo(data)) visitDataInfo(data, (v) => ready &&= v.getIsReadyOrError());\n\t\telse if (!isValues(data)) throw Error(`unsupported column data type: ${data}`);\n\t\treturn ready;\n\t}\n\tfunction allPColumnsReady(columns) {\n\t\treturn columns.every(isPColumnReady);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js\n\tfunction isPColumnValues(value) {\n\t\tif (!Array.isArray(value)) return false;\n\t\tif (value.length === 0) return true;\n\t\tconst first = value[0];\n\t\treturn typeof first === \"object\" && first !== null && \"key\" in first && \"val\" in first;\n\t}\n\t/**\n\t* A simple implementation of {@link ColumnProvider} backed by a pre-defined array of columns.\n\t*/\n\tvar ArrayColumnProvider = class {\n\t\tconstructor(columns) {\n\t\t\tthis.columns = columns;\n\t\t}\n\t\tselectColumns(selectors) {\n\t\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\t\treturn this.columns.filter((column) => predicate(column.spec));\n\t\t}\n\t};\n\tfunction splitFiltersToExtraTrace(splitFilters) {\n\t\tif (splitFilters === void 0) return void 0;\n\t\treturn splitFilters.map((filter) => ({\n\t\t\ttype: `split:${canonicalizeAxisId(filter.axisId)}`,\n\t\t\tlabel: filter.label,\n\t\t\timportance: 1e6\n\t\t}));\n\t}\n\tfunction splitFiltersToAxisFilter(splitFilters) {\n\t\tif (!splitFilters) return void 0;\n\t\treturn splitFilters.map((filter) => [filter.axisIdx, filter.value]);\n\t}\n\tfunction fallbackIdDeriver(originalId, axisFilters) {\n\t\tif (!axisFilters || axisFilters.length === 0) return originalId;\n\t\treturn (0, import_canonicalize.default)({\n\t\t\tid: originalId,\n\t\t\taxisFilters: [...axisFilters].sort((a, b) => a[0] - b[0])\n\t\t});\n\t}\n\t/** Checks if a selector object uses any anchor properties */\n\tfunction hasAnchors(selector) {\n\t\tif (!selector || typeof selector !== \"object\") return false;\n\t\tconst potentialAnchored = selector;\n\t\tconst hasAnchorValues = (obj) => obj && typeof obj === \"object\" && Object.values(obj).some((v) => typeof v === \"object\" && v !== null && \"anchor\" in v);\n\t\tconst domainHasAnchors = hasAnchorValues(potentialAnchored[\"domain\"]);\n\t\tconst contextDomainHasAnchors = hasAnchorValues(potentialAnchored[\"contextDomain\"]);\n\t\tconst axesHaveAnchors = potentialAnchored[\"axes\"] && Array.isArray(potentialAnchored[\"axes\"]) && potentialAnchored[\"axes\"].some((a) => typeof a === \"object\" && a !== null && \"anchor\" in a);\n\t\treturn !!potentialAnchored[\"domainAnchor\"] || !!potentialAnchored[\"contextDomainAnchor\"] || domainHasAnchors || contextDomainHasAnchors || axesHaveAnchors;\n\t}\n\t/**\n\t* Derives the indices of axes marked for splitting based on the selector.\n\t* Throws an error if splitting is requested alongside `partialAxesMatch`.\n\t*/\n\tfunction getSplitAxisIndices(selector) {\n\t\tif (typeof selector !== \"object\" || !(\"axes\" in selector) || selector.axes === void 0) return [];\n\t\tconst splitIndices = selector.axes.map((axis, index) => typeof axis === \"object\" && \"split\" in axis && axis.split === true ? index : -1).filter((index) => index !== -1);\n\t\tif (splitIndices.length > 0 && selector.partialAxesMatch !== void 0) throw new Error(\"Axis splitting is not supported when `partialAxesMatch` is defined.\");\n\t\tsplitIndices.sort((a, b) => a - b);\n\t\treturn splitIndices;\n\t}\n\tvar PColumnCollection = class {\n\t\tdefaultProviderStore = [];\n\t\tproviders = [new ArrayColumnProvider(this.defaultProviderStore)];\n\t\taxisLabelProviders = [];\n\t\tconstructor() {}\n\t\taddColumnProvider(provider) {\n\t\t\tthis.providers.push(provider);\n\t\t\treturn this;\n\t\t}\n\t\taddAxisLabelProvider(provider) {\n\t\t\tthis.axisLabelProviders.push(provider);\n\t\t\treturn this;\n\t\t}\n\t\taddColumns(columns) {\n\t\t\tthis.defaultProviderStore.push(...columns);\n\t\t\treturn this;\n\t\t}\n\t\taddColumn(column) {\n\t\t\tthis.defaultProviderStore.push(column);\n\t\t\treturn this;\n\t\t}\n\t\t/** Fetches labels for a given axis from the registered providers */\n\t\tfindLabels(axis) {\n\t\t\tfor (const provider of this.axisLabelProviders) {\n\t\t\t\tconst labels = provider.findLabels(axis);\n\t\t\t\tif (labels) return labels;\n\t\t\t}\n\t\t}\n\t\tgetUniversalEntries(predicateOrSelectors, opts) {\n\t\t\tconst { anchorCtx, labelOps: rawLabelOps, dontWaitAllData = false, overrideLabelAnnotation = false, exclude, enrichByLinkers = false } = opts ?? {};\n\t\t\tconst labelOps = {\n\t\t\t\t...overrideLabelAnnotation && rawLabelOps?.includeNativeLabel !== false ? { includeNativeLabel: true } : {},\n\t\t\t\t...rawLabelOps\n\t\t\t};\n\t\t\tlet excludePredicate = () => false;\n\t\t\tif (exclude) {\n\t\t\t\tconst excludePredicartes = (Array.isArray(exclude) ? exclude : [exclude]).map((selector) => {\n\t\t\t\t\tif (hasAnchors(selector)) {\n\t\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\t\treturn legacyColumnSelectorsToPredicate(resolveAnchors(anchorCtx.anchors, selector, opts));\n\t\t\t\t\t} else return legacyColumnSelectorsToPredicate(selector);\n\t\t\t\t});\n\t\t\t\texcludePredicate = (spec) => excludePredicartes.some((predicate) => predicate(spec));\n\t\t\t}\n\t\t\tconst selectorsArray = typeof predicateOrSelectors === \"function\" ? [predicateOrSelectors] : Array.isArray(predicateOrSelectors) ? predicateOrSelectors : [predicateOrSelectors];\n\t\t\tconst intermediateResults = [];\n\t\t\tconst selectedNativeIds = /* @__PURE__ */ new Set();\n\t\t\tfor (const rawSelector of selectorsArray) {\n\t\t\t\tconst usesAnchors = hasAnchors(rawSelector);\n\t\t\t\tlet currentSelector;\n\t\t\t\tif (usesAnchors) {\n\t\t\t\t\tif (!anchorCtx) throw new Error(\"Anchored selectors require an AnchoredIdDeriver to be provided in options.\");\n\t\t\t\t\tcurrentSelector = resolveAnchors(anchorCtx.anchors, rawSelector, opts);\n\t\t\t\t} else currentSelector = rawSelector;\n\t\t\t\tconst selectedIds = /* @__PURE__ */ new Set();\n\t\t\t\tconst selectedColumns = [];\n\t\t\t\tfor (const provider of this.providers) {\n\t\t\t\t\tconst providerColumns = provider.selectColumns(currentSelector);\n\t\t\t\t\tfor (const col of providerColumns) {\n\t\t\t\t\t\tif (excludePredicate(col.spec)) continue;\n\t\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\t\tconst nativeId = deriveNativeId(col.spec);\n\t\t\t\t\t\tif (selectedNativeIds.has(nativeId)) continue;\n\t\t\t\t\t\tselectedIds.add(col.id);\n\t\t\t\t\t\tselectedNativeIds.add(nativeId);\n\t\t\t\t\t\tselectedColumns.push(col);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectedColumns.length === 0) continue;\n\t\t\t\tconst splitAxisIdxs = getSplitAxisIndices(rawSelector);\n\t\t\t\tconst needsSplitting = splitAxisIdxs.length > 0;\n\t\t\t\tfor (const column of selectedColumns) {\n\t\t\t\t\tif (!isPColumnSpec(column.spec)) continue;\n\t\t\t\t\tconst originalSpec = column.spec;\n\t\t\t\t\tif (needsSplitting) {\n\t\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\t\tconst dataEntries = convertOrParsePColumnData(column.data);\n\t\t\t\t\t\tif (!dataEntries) {\n\t\t\t\t\t\t\tif (dontWaitAllData) continue;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\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\t\tconst uniqueKeys = getUniquePartitionKeys(dataEntries);\n\t\t\t\t\t\tconst maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n\t\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\t\tconst axesLabels = splitAxisIdxs.map((idx) => this.findLabels(getAxisId(originalSpec.axesSpec[idx])));\n\t\t\t\t\t\tconst keyCombinations = [];\n\t\t\t\t\t\tconst generateCombinations = (currentCombo, sAxisIdx) => {\n\t\t\t\t\t\t\tif (sAxisIdx >= splitAxisIdxs.length) {\n\t\t\t\t\t\t\t\tkeyCombinations.push([...currentCombo]);\n\t\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\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst axisIdx = splitAxisIdxs[sAxisIdx];\n\t\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\t\tconst axisValues = uniqueKeys[axisIdx];\n\t\t\t\t\t\t\tif (!axisValues || axisValues.length === 0) {\n\t\t\t\t\t\t\t\tkeyCombinations.length = 0;\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const val of axisValues) {\n\t\t\t\t\t\t\t\tcurrentCombo.push(val);\n\t\t\t\t\t\t\t\tgenerateCombinations(currentCombo, sAxisIdx + 1);\n\t\t\t\t\t\t\t\tcurrentCombo.pop();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tgenerateCombinations([], 0);\n\t\t\t\t\t\tif (keyCombinations.length === 0) continue;\n\t\t\t\t\t\tconst newAxesSpec = [...originalSpec.axesSpec];\n\t\t\t\t\t\tconst splitAxisOriginalIdxs = splitAxisIdxs.map((idx) => idx);\n\t\t\t\t\t\tfor (let i = splitAxisIdxs.length - 1; i >= 0; i--) newAxesSpec.splice(splitAxisIdxs[i], 1);\n\t\t\t\t\t\tconst adjustedSpec = {\n\t\t\t\t\t\t\t...originalSpec,\n\t\t\t\t\t\t\taxesSpec: newAxesSpec\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const keyCombo of keyCombinations) {\n\t\t\t\t\t\t\tconst splitFilters = keyCombo.map((value, sAxisIdx) => {\n\t\t\t\t\t\t\t\tconst axisIdx = splitAxisOriginalIdxs[sAxisIdx];\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\taxisIdx,\n\t\t\t\t\t\t\t\t\taxisId: getAxisId(originalSpec.axesSpec[axisIdx]),\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tlabel: axesLabels[sAxisIdx]?.[value] ?? String(value)\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tintermediateResults.push({\n\t\t\t\t\t\t\t\ttype: \"split\",\n\t\t\t\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\t\t\t\tadjustedSpec,\n\t\t\t\t\t\t\t\tdataEntries,\n\t\t\t\t\t\t\t\taxisFilters: splitFilters\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else intermediateResults.push({\n\t\t\t\t\t\ttype: \"direct\",\n\t\t\t\t\t\toriginalColumn: column,\n\t\t\t\t\t\tspec: originalSpec,\n\t\t\t\t\t\tadjustedSpec: originalSpec\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (intermediateResults.length === 0) return [];\n\t\t\tconst labeledResults = deriveLabels(intermediateResults, (entry) => ({\n\t\t\t\tspec: entry.spec,\n\t\t\t\textraTrace: entry.type === \"split\" ? splitFiltersToExtraTrace(entry.axisFilters) : void 0\n\t\t\t}), labelOps);\n\t\t\tconst result = [];\n\t\t\tfor (const { value: entry, label } of labeledResults) {\n\t\t\t\tconst { originalColumn, spec: originalSpec } = entry;\n\t\t\t\tconst axisFiltersTuple = splitFiltersToAxisFilter(entry.type === \"split\" ? entry.axisFilters : void 0);\n\t\t\t\tlet finalId;\n\t\t\t\tif (anchorCtx) finalId = anchorCtx.deriveS(originalSpec, axisFiltersTuple);\n\t\t\t\telse finalId = fallbackIdDeriver(originalColumn.id, axisFiltersTuple);\n\t\t\t\tlet finalSpec = { ...entry.adjustedSpec };\n\t\t\t\tif (overrideLabelAnnotation) finalSpec = {\n\t\t\t\t\t...finalSpec,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...finalSpec.annotations,\n\t\t\t\t\t\t[Annotation.Label]: label\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tresult.push({\n\t\t\t\t\tid: finalId,\n\t\t\t\t\tspec: finalSpec,\n\t\t\t\t\tdata: () => entry.type === \"split\" ? entriesToDataInfo(filterDataInfoEntries(entry.dataEntries, axisFiltersTuple)) : entry.originalColumn.data,\n\t\t\t\t\tlabel\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst ids = new Set(result.map((entry) => entry.id));\n\t\t\tif (enrichByLinkers && anchorCtx) {\n\t\t\t\tconst linkers = result.filter((entry) => isLinkerColumn(entry.spec));\n\t\t\t\tif (linkers.length === 0) return result;\n\t\t\t\tconst anchorAxes = Object.values(anchorCtx.anchors).flatMap((anchor) => anchor.axesSpec);\n\t\t\t\tconst linkerMap = LinkerMap.fromColumns(linkers.map(getColumnIdAndSpec));\n\t\t\t\tfunction matchAxisIdFn(linkerKeyId, sourceAxisId) {\n\t\t\t\t\treturn matchAxisId(linkerKeyId, sourceAxisId) || matchAxisId(sourceAxisId, linkerKeyId);\n\t\t\t\t}\n\t\t\t\tconst availableByLinkersAxes = linkerMap.getReachableByLinkersAxesFromAxes(anchorAxes, matchAxisIdFn);\n\t\t\t\tconst availableByLinkersColumns = this.getUniversalEntries((spec) => !isLinkerColumn(spec) && spec.axesSpec.some((columnAxisSpec) => {\n\t\t\t\t\tconst columnAxisId = getAxisId(columnAxisSpec);\n\t\t\t\t\treturn availableByLinkersAxes.some((axis) => matchAxisIdFn(getAxisId(axis), columnAxisId));\n\t\t\t\t}), {\n\t\t\t\t\tanchorCtx,\n\t\t\t\t\tlabelOps,\n\t\t\t\t\tdontWaitAllData,\n\t\t\t\t\toverrideLabelAnnotation,\n\t\t\t\t\texclude\n\t\t\t\t});\n\t\t\t\tif (availableByLinkersColumns) result.push(...availableByLinkersColumns.filter((entry) => !ids.has(entry.id)));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tgetColumns(predicateOrSelectors, opts) {\n\t\t\tconst entries = this.getUniversalEntries(predicateOrSelectors, {\n\t\t\t\toverrideLabelAnnotation: true,\n\t\t\t\t...opts\n\t\t\t});\n\t\t\tif (!entries) return void 0;\n\t\t\tconst columns = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst data = entry.data();\n\t\t\t\tif (!data) {\n\t\t\t\t\tif (opts?.dontWaitAllData) continue;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcolumns.push({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tspec: entry.spec,\n\t\t\t\t\tdata\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn columns;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/services/block_services.js\n\t/**\n\t* Services required by all V3 blocks by default.\n\t* Edit this when a new service should be available to all blocks.\n\t*\n\t* Standalone module to avoid circular dependencies between block_model.ts\n\t* and service type resolution.\n\t*/\n\tconst BLOCK_SERVICE_FLAGS = {\n\t\trequiresPFrameSpec: true,\n\t\trequiresPFrame: true,\n\t\trequiresDialog: true\n\t};\n\tresolveRequiredServices(BLOCK_SERVICE_FLAGS);\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/services/service_bridge.js\n\t/**\n\t* Builds a ServiceProxy from a ServiceDispatch.\n\t* Each service method call is forwarded to dispatch.callServiceMethod.\n\t*/\n\tfunction createServiceProxy(dispatch) {\n\t\treturn ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/services/get_services.js\n\tconst cachedServices = /* @__PURE__ */ new WeakMap();\n\tfunction getService(name) {\n\t\tconst ctx = getCfgRenderCtx();\n\t\tconst map = cachedServices.has(ctx) ? cachedServices.get(ctx) : (() => {\n\t\t\tcachedServices.set(ctx, /* @__PURE__ */ new Map());\n\t\t\treturn cachedServices.get(ctx);\n\t\t})();\n\t\treturn map.has(name) ? map.get(name) : (() => {\n\t\t\tmap.set(name, createServiceProxy(ctx)(name));\n\t\t\treturn map.get(name);\n\t\t})();\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js\n\tfunction patchInSetFilters(filters) {\n\t\tconst inSetToOrEqual = (predicate) => {\n\t\t\tif (predicate.operator !== \"InSet\") return predicate;\n\t\t\treturn {\n\t\t\t\toperator: \"Or\",\n\t\t\t\toperands: predicate.references.map((reference) => ({\n\t\t\t\t\toperator: \"Equal\",\n\t\t\t\t\treference\n\t\t\t\t}))\n\t\t\t};\n\t\t};\n\t\tconst mapSingleValuePredicate = (filter, cb) => {\n\t\t\tswitch (filter.operator) {\n\t\t\t\tcase \"And\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t\t};\n\t\t\t\tcase \"Or\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb))\n\t\t\t\t};\n\t\t\t\tcase \"Not\": return {\n\t\t\t\t\t...filter,\n\t\t\t\t\toperand: mapSingleValuePredicate(filter.operand, cb)\n\t\t\t\t};\n\t\t\t\tdefault: return cb(filter);\n\t\t\t}\n\t\t};\n\t\tconst mapFilter = (filter, cb) => {\n\t\t\treturn {\n\t\t\t\t...filter,\n\t\t\t\tpredicate: mapSingleValuePredicate(filter.predicate, cb)\n\t\t\t};\n\t\t};\n\t\treturn filters.map((filter) => mapFilter(filter, inSetToOrEqual));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/render/api.js\n\t/**\n\t* Helper function to match domain objects\n\t* @param query Optional domain to match against\n\t* @param target Optional domain to match\n\t* @returns true if domains match, false otherwise\n\t*/\n\tfunction matchDomain(query, target) {\n\t\tif (query === void 0) return target === void 0;\n\t\tif (target === void 0) return true;\n\t\tfor (const k in target) if (query[k] !== target[k]) return false;\n\t\treturn true;\n\t}\n\t/**\n\t* Transforms PColumn data into the internal representation expected by the platform\n\t* @param data Data from a PColumn to transform\n\t* @returns Transformed data compatible with platform API\n\t*/\n\tfunction transformPColumnData(data) {\n\t\treturn mapPObjectData(data, (d) => {\n\t\t\tif (d instanceof TreeNodeAccessor) return d.handle;\n\t\t\telse if (isDataInfo(d)) return mapDataInfo(d, (accessor) => accessor.handle);\n\t\t\telse return d ?? [];\n\t\t});\n\t}\n\tvar ResultPool = class {\n\t\tctx = getCfgRenderCtx();\n\t\t/**\n\t\t* @deprecated use getOptions()\n\t\t*/\n\t\tcalculateOptions(predicate) {\n\t\t\treturn this.ctx.calculateOptions(predicate);\n\t\t}\n\t\tgetOptions(predicateOrSelector, opts) {\n\t\t\tconst predicate = typeof predicateOrSelector === \"function\" ? predicateOrSelector : legacyColumnSelectorsToPredicate(predicateOrSelector);\n\t\t\tconst filtered = this.getSpecs().entries.filter((s) => predicate(s.obj));\n\t\t\tlet labelOps = {};\n\t\t\tlet refsWithEnrichments = false;\n\t\t\tif (typeof opts !== \"undefined\") {\n\t\t\t\tif (typeof opts === \"function\") labelOps = opts;\n\t\t\t\telse if (typeof opts === \"object\") if (\"includeNativeLabel\" in opts || \"separator\" in opts || \"addLabelAsSuffix\" in opts) labelOps = opts;\n\t\t\t\telse {\n\t\t\t\t\topts = opts;\n\t\t\t\t\tlabelOps = opts.label ?? {};\n\t\t\t\t\trefsWithEnrichments = opts.refsWithEnrichments ?? false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof labelOps === \"object\") return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(({ value: { ref }, label }) => ({\n\t\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\t\tlabel\n\t\t\t}));\n\t\t\telse return filtered.map(({ ref, obj }) => ({\n\t\t\t\tref: withEnrichments(ref, refsWithEnrichments),\n\t\t\t\tlabel: labelOps(obj, ref)\n\t\t\t}));\n\t\t}\n\t\tresolveAnchorCtx(anchorsOrCtx) {\n\t\t\tif (anchorsOrCtx instanceof AnchoredIdDeriver) return anchorsOrCtx;\n\t\t\tconst resolvedAnchors = {};\n\t\t\tfor (const [key, value] of Object.entries(anchorsOrCtx)) if (isPlRef(value)) {\n\t\t\t\tconst resolvedSpec = this.getPColumnSpecByRef(value);\n\t\t\t\tif (!resolvedSpec) return void 0;\n\t\t\t\tresolvedAnchors[key] = resolvedSpec;\n\t\t\t} else resolvedAnchors[key] = value;\n\t\t\treturn new AnchoredIdDeriver(resolvedAnchors);\n\t\t}\n\t\t/**\n\t\t* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.\n\t\t*\n\t\t* @param anchorsOrCtx - Anchor context for column selection (same as in getCanonicalOptions)\n\t\t* @param predicateOrSelectors - Predicate or selectors for filtering columns (same as in getCanonicalOptions)\n\t\t* @param opts - Optional configuration for label generation and data waiting\n\t\t* @returns A PFrameHandle for the created PFrame, or undefined if any required data is missing\n\t\t*/\n\t\tgetAnchoredPColumns(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\t\tif (!anchorCtx) return void 0;\n\t\t\treturn new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getColumns(predicateOrSelectors, {\n\t\t\t\t...opts,\n\t\t\t\tanchorCtx\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Calculates anchored identifier options for columns matching a given predicate and returns their\n\t\t* canonicalized representations.\n\t\t*\n\t\t* This function filters column specifications from the result pool that match the provided predicate,\n\t\t* creates a standardized AnchorCtx from the provided anchors, and generates a list of label-value\n\t\t* pairs for UI components (like dropdowns).\n\t\t*\n\t\t* @param anchorsOrCtx - Either:\n\t\t* - An existing AnchorCtx instance\n\t\t* - A record mapping anchor IDs to PColumnSpec objects\n\t\t* - A record mapping anchor IDs to PlRef objects (which will be resolved to PColumnSpec)\n\t\t* @param predicateOrSelectors - Either:\n\t\t* - A predicate function that takes a PColumnSpec and returns a boolean.\n\t\t* Only specs that return true will be included.\n\t\t* - An APColumnSelector object for declarative filtering, which will be\n\t\t* resolved against the provided anchors and matched using matchPColumn.\n\t\t* - An array of APColumnSelector objects - columns matching ANY selector\n\t\t* in the array will be included (OR operation).\n\t\t* @param opts - Optional configuration for label generation:\n\t\t* - labelOps: Optional configuration for label generation:\n\t\t* - includeNativeLabel: Whether to include native column labels\n\t\t* - separator: String to use between label parts (defaults to \" / \")\n\t\t* - addLabelAsSuffix: Whether to add labels as suffix instead of prefix\n\t\t* - dontWaitAllData: Whether to skip columns that don't have all data (if not set, will return undefined,\n\t\t* if at least one column that requires splitting is missing data)\n\t\t* @returns An array of objects with `label` (display text) and `value` (anchored ID string) properties,\n\t\t* or undefined if any PlRef resolution fails.\n\t\t*/\n\t\tgetCanonicalOptions(anchorsOrCtx, predicateOrSelectors, opts) {\n\t\t\tconst anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);\n\t\t\tif (!anchorCtx) return void 0;\n\t\t\tconst entries = new PColumnCollection().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(predicateOrSelectors, {\n\t\t\t\t...opts,\n\t\t\t\tanchorCtx\n\t\t\t});\n\t\t\tif (!entries) return void 0;\n\t\t\treturn entries.map((item) => ({\n\t\t\t\tvalue: item.id,\n\t\t\t\tlabel: item.label\n\t\t\t}));\n\t\t}\n\t\t/**\n\t\t* @deprecated use getData()\n\t\t*/\n\t\tgetDataFromResultPool() {\n\t\t\treturn this.getData();\n\t\t}\n\t\tgetData() {\n\t\t\tconst result = this.ctx.getDataFromResultPool();\n\t\t\treturn {\n\t\t\t\tisComplete: result.isComplete,\n\t\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\t\tref: e.ref,\n\t\t\t\t\tobj: {\n\t\t\t\t\t\t...e.obj,\n\t\t\t\t\t\tdata: new TreeNodeAccessor(e.obj.data, [e.ref.blockId, e.ref.name])\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* @deprecated use getDataWithErrors()\n\t\t*/\n\t\tgetDataWithErrorsFromResultPool() {\n\t\t\treturn this.getDataWithErrors();\n\t\t}\n\t\tgetDataWithErrors() {\n\t\t\tconst result = this.ctx.getDataWithErrorsFromResultPool();\n\t\t\treturn {\n\t\t\t\tisComplete: result.isComplete,\n\t\t\t\tentries: result.entries.map((e) => ({\n\t\t\t\t\tref: e.ref,\n\t\t\t\t\tobj: {\n\t\t\t\t\t\t...e.obj,\n\t\t\t\t\t\tdata: mapValueInVOE(e.obj.data, (handle) => new TreeNodeAccessor(handle, [e.ref.blockId, e.ref.name]))\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* @deprecated use getSpecs()\n\t\t*/\n\t\tgetSpecsFromResultPool() {\n\t\t\treturn this.getSpecs();\n\t\t}\n\t\tgetSpecs() {\n\t\t\treturn this.ctx.getSpecsFromResultPool();\n\t\t}\n\t\t/**\n\t\t* @param ref a Ref\n\t\t* @returns data associated with the ref\n\t\t*/\n\t\tgetDataByRef(ref) {\n\t\t\tif (typeof this.ctx.getDataFromResultPoolByRef === \"undefined\") return this.getData().entries.find((f) => f.ref.blockId === ref.blockId && f.ref.name === ref.name)?.obj;\n\t\t\tconst data = this.ctx.getDataFromResultPoolByRef(ref.blockId, ref.name);\n\t\t\tif (!data) return void 0;\n\t\t\treturn mapPObjectData(data, (handle) => new TreeNodeAccessor(handle, [ref.blockId, ref.name]));\n\t\t}\n\t\t/**\n\t\t* Returns data associated with the ref ensuring that it is a p-column.\n\t\t* @param ref a Ref\n\t\t* @returns p-column associated with the ref\n\t\t*/\n\t\tgetPColumnByRef(ref) {\n\t\t\tconst data = this.getDataByRef(ref);\n\t\t\tif (!data) return void 0;\n\t\t\treturn ensurePColumn(data);\n\t\t}\n\t\t/**\n\t\t* Returns spec associated with the ref ensuring that it is a p-column spec.\n\t\t* @param ref a Ref\n\t\t* @returns p-column spec associated with the ref\n\t\t*/\n\t\tgetPColumnSpecByRef(ref) {\n\t\t\tconst spec = this.getSpecByRef(ref);\n\t\t\tif (!spec) return void 0;\n\t\t\tif (!isPColumnSpec(spec)) throw new Error(`not a PColumn spec (kind = ${spec.kind})`);\n\t\t\treturn spec;\n\t\t}\n\t\t/**\n\t\t* @param ref a Ref\n\t\t* @returns object spec associated with the ref\n\t\t*/\n\t\tgetSpecByRef(ref) {\n\t\t\treturn this.ctx.getSpecFromResultPoolByRef(ref.blockId, ref.name);\n\t\t}\n\t\t/**\n\t\t* @param spec object specification\n\t\t* @returns array of data objects with compatible specs\n\t\t* @deprecated delete this method after Jan 1, 2025\n\t\t*/\n\t\tfindDataWithCompatibleSpec(spec) {\n\t\t\tconst result = [];\n\t\t\tout: for (const data of this.getData().entries) {\n\t\t\t\tif (!isPColumnSpec(data.obj.spec)) continue;\n\t\t\t\tconst oth = data.obj.spec;\n\t\t\t\tif (spec.name !== oth.name) continue;\n\t\t\t\tif (spec.valueType !== oth.valueType) continue;\n\t\t\t\tif (spec.axesSpec.length !== oth.axesSpec.length) continue;\n\t\t\t\tif (!matchDomain(spec.domain, oth.domain)) continue;\n\t\t\t\tif (!matchDomain(spec.contextDomain, oth.contextDomain)) continue;\n\t\t\t\tfor (let i = 0; i < spec.axesSpec.length; ++i) {\n\t\t\t\t\tconst qAx = spec.axesSpec[i];\n\t\t\t\t\tconst tAx = oth.axesSpec[i];\n\t\t\t\t\tif (qAx.name !== tAx.name) continue out;\n\t\t\t\t\tif (qAx.type !== tAx.type) continue out;\n\t\t\t\t\tif (!matchDomain(qAx.domain, tAx.domain)) continue out;\n\t\t\t\t\tif (!matchDomain(qAx.contextDomain, tAx.contextDomain)) continue out;\n\t\t\t\t}\n\t\t\t\tresult.push(data.obj);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t/**\n\t\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\t* @returns a map of axis value => label\n\t\t*/\n\t\tfindLabels(axis) {\n\t\t\tconst dataPool = this.getData();\n\t\t\tfor (const column of dataPool.entries) {\n\t\t\t\tif (!isPColumn(column.obj)) continue;\n\t\t\t\tconst spec = column.obj.spec;\n\t\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\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\t\treturn Object.fromEntries(Object.entries(column.obj.data.getDataAsJson().data).map((e) => [JSON.parse(e[0])[0], e[1]]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Selects columns based on the provided selectors, returning PColumn objects\n\t\t* with lazily loaded data.\n\t\t*\n\t\t* @param selectors - A predicate function, a single selector, or an array of selectors.\n\t\t* @returns An array of PColumn objects matching the selectors. Data is loaded on first access.\n\t\t*/\n\t\tselectColumns(selectors) {\n\t\t\tconst predicate = typeof selectors === \"function\" ? selectors : legacyColumnSelectorsToPredicate(selectors);\n\t\t\treturn this.getSpecs().entries.filter(({ obj: spec }) => {\n\t\t\t\tif (!isPColumnSpec(spec)) return false;\n\t\t\t\treturn predicate(spec);\n\t\t\t}).map(({ ref, obj: spec }) => {\n\t\t\t\tconst pcolumnSpec = spec;\n\t\t\t\tlet _cachedData = null;\n\t\t\t\tconst self = this;\n\t\t\t\treturn {\n\t\t\t\t\tid: (0, import_canonicalize.default)(ref),\n\t\t\t\t\tspec: pcolumnSpec,\n\t\t\t\t\tget data() {\n\t\t\t\t\t\tif (_cachedData !== null) return _cachedData;\n\t\t\t\t\t\t_cachedData = self.getPColumnByRef(ref)?.data;\n\t\t\t\t\t\treturn _cachedData;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Find labels data for a given axis id of a p-column.\n\t\t* @returns a map of axis value => label\n\t\t*/\n\t\tfindLabelsForColumnAxis(column, axisIdx) {\n\t\t\tconst labels = this.findLabels(column.axesSpec[axisIdx]);\n\t\t\tif (!labels) return void 0;\n\t\t\tconst axisKeys = readAnnotation(column, `pl7.app/axisKeys/${axisIdx}`);\n\t\t\tif (axisKeys !== void 0) {\n\t\t\t\tconst keys = JSON.parse(axisKeys);\n\t\t\t\treturn Object.fromEntries(keys.map((key) => {\n\t\t\t\t\treturn [key, labels[key] ?? \"Unlabelled\"];\n\t\t\t\t}));\n\t\t\t} else return labels;\n\t\t}\n\t};\n\t/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) */\n\tvar RenderCtxBase = class {\n\t\tctx;\n\t\tconstructor() {\n\t\t\tthis.ctx = getCfgRenderCtx();\n\t\t}\n\t\tdataCache;\n\t\tget data() {\n\t\t\tif (this.dataCache === void 0) {\n\t\t\t\tconst raw = this.ctx.data;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.dataCache = { v: value ? JSON.parse(value) : {} };\n\t\t\t}\n\t\t\treturn this.dataCache.v;\n\t\t}\n\t\tactiveArgsCache;\n\t\t/**\n\t\t* Returns args snapshot the block was executed for (i.e. when \"Run\" button was pressed).\n\t\t* Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.\n\t\t* */\n\t\tget activeArgs() {\n\t\t\tif (this.activeArgsCache === void 0) {\n\t\t\t\tconst raw = this.ctx.activeArgs;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.activeArgsCache = { v: value ? JSON.parse(value) : void 0 };\n\t\t\t}\n\t\t\treturn this.activeArgsCache.v;\n\t\t}\n\t\tgetService(name) {\n\t\t\treturn getService(name);\n\t\t}\n\t\tgetNamedAccessor(name) {\n\t\t\treturn ifDef(this.ctx.getAccessorHandleByName(name), (accessor) => new TreeNodeAccessor(accessor, [name]));\n\t\t}\n\t\tget prerun() {\n\t\t\treturn this.getNamedAccessor(StagingAccessorName);\n\t\t}\n\t\tget outputs() {\n\t\t\treturn this.getNamedAccessor(MainAccessorName);\n\t\t}\n\t\tresultPool = new ResultPool();\n\t\t/**\n\t\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\t* @returns a map of axis value => label\n\t\t* @deprecated Use resultPool.findLabels instead\n\t\t*/\n\t\tfindLabels(axis) {\n\t\t\treturn this.resultPool.findLabels(axis);\n\t\t}\n\t\tverifyInlineAndExplicitColumnsSupport(columns) {\n\t\t\tconst hasInlineColumns = columns.some((c) => !(c.data instanceof TreeNodeAccessor) || isDataInfo(c.data));\n\t\t\tconst inlineColumnsSupport = this.ctx.featureFlags?.inlineColumnsSupport === true;\n\t\t\tif (hasInlineColumns && !inlineColumnsSupport) throw Error(`Inline or explicit columns not supported`);\n\t\t}\n\t\tpatchPTableDef(def) {\n\t\t\tif (!this.ctx.featureFlags?.pTablePartitionFiltersSupport) def = {\n\t\t\t\t...def,\n\t\t\t\tpartitionFilters: [],\n\t\t\t\tfilters: [...def.partitionFilters, ...def.filters]\n\t\t\t};\n\t\t\tif (!this.ctx.featureFlags?.pFrameInSetFilterSupport) def = {\n\t\t\t\t...def,\n\t\t\t\tpartitionFilters: patchInSetFilters(def.partitionFilters),\n\t\t\t\tfilters: patchInSetFilters(def.filters)\n\t\t\t};\n\t\t\treturn def;\n\t\t}\n\t\tcreatePFrame(def) {\n\t\t\treturn this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));\n\t\t}\n\t\tcreatePTable(def) {\n\t\t\tlet rawDef;\n\t\t\tif (\"columns\" in def) rawDef = this.patchPTableDef({\n\t\t\t\tsrc: {\n\t\t\t\t\ttype: \"full\",\n\t\t\t\t\tentries: def.columns.map((c) => ({\n\t\t\t\t\t\ttype: \"column\",\n\t\t\t\t\t\tcolumn: c\n\t\t\t\t\t}))\n\t\t\t\t},\n\t\t\t\tpartitionFilters: def.filters ?? [],\n\t\t\t\tfilters: [],\n\t\t\t\tsorting: def.sorting ?? []\n\t\t\t});\n\t\t\telse rawDef = this.patchPTableDef(def);\n\t\t\tconst columns = extractAllColumns(rawDef.src);\n\t\t\tthis.verifyInlineAndExplicitColumnsSupport(columns);\n\t\t\tif (!allPColumnsReady(columns)) return void 0;\n\t\t\treturn this.ctx.createPTable(mapPTableDef(rawDef, (po) => transformPColumnData(po)));\n\t\t}\n\t\tcreatePTableV2(def) {\n\t\t\treturn this.ctx.createPTableV2(mapPTableDefV2(def, (po) => transformPColumnData(po)));\n\t\t}\n\t\t/** @deprecated scheduled for removal from SDK */\n\t\tgetBlockLabel(blockId) {\n\t\t\treturn this.ctx.getBlockLabel(blockId);\n\t\t}\n\t\tgetCurrentUnstableMarker() {\n\t\t\treturn this.ctx.getCurrentUnstableMarker();\n\t\t}\n\t\tlogInfo(msg) {\n\t\t\tthis.ctx.logInfo(msg);\n\t\t}\n\t\tlogWarn(msg) {\n\t\t\tthis.ctx.logWarn(msg);\n\t\t}\n\t\tlogError(msg) {\n\t\t\tthis.ctx.logError(msg);\n\t\t}\n\t};\n\t/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) for v3+ blocks */\n\tvar BlockRenderCtx = class extends RenderCtxBase {\n\t\targsCache;\n\t\tget args() {\n\t\t\tif (this.argsCache === void 0) {\n\t\t\t\tconst raw = this.ctx.args;\n\t\t\t\tconst value = typeof raw === \"function\" ? raw() : raw;\n\t\t\t\tthis.argsCache = { v: value === void 0 ? void 0 : JSON.parse(value) };\n\t\t\t}\n\t\t\treturn this.argsCache.v;\n\t\t}\n\t};\n\t/**\n\t* Render context for plugin output functions.\n\t* Reads plugin data from blockStorage and derives params from pre-wrapped input callbacks.\n\t*\n\t* Parameterized on the factory-like phantom F so that getPluginData returns\n\t* InferFactoryData<F> directly — no casts needed for the data getter.\n\t*\n\t* @typeParam F - PluginFactoryLike phantom carrying data/params/outputs types\n\t*/\n\tvar PluginRenderCtx = class extends RenderCtxBase {\n\t\thandle;\n\t\twrappedInputs;\n\t\tconstructor(handle, wrappedInputs) {\n\t\t\tsuper();\n\t\t\tthis.handle = handle;\n\t\t\tthis.wrappedInputs = wrappedInputs;\n\t\t}\n\t\tpluginDataCache;\n\t\t/** Plugin's persistent data from blockStorage.__plugins.{pluginId}.__data */\n\t\tget data() {\n\t\t\tif (this.pluginDataCache === void 0) this.pluginDataCache = { v: getPluginData(parseJson(this.ctx.blockStorage()), this.handle) };\n\t\t\treturn this.pluginDataCache.v;\n\t\t}\n\t\tparamsCache;\n\t\t/** Params derived from block context via pre-wrapped input callbacks */\n\t\tget params() {\n\t\t\tif (this.paramsCache === void 0) {\n\t\t\t\tconst result = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(this.wrappedInputs)) result[key] = fn();\n\t\t\t\tthis.paramsCache = { v: result };\n\t\t\t}\n\t\t\treturn this.paramsCache.v;\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/version.js\n\tconst PlatformaSDKVersion = \"1.77.0\";\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/bconfig/types.js\n\tfunction isConfigLambda(cfgOrFh) {\n\t\treturn cfgOrFh.__renderLambda === true;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js\n\tfunction downgradeCfgOrLambda(data) {\n\t\tif (data === void 0) return void 0;\n\t\tif (isConfigLambda(data)) return data.handle;\n\t\treturn data;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/plugin_model.js\n\t/** Symbol for internal plugin model creation — not accessible to external consumers */\n\tconst CREATE_PLUGIN_MODEL = Symbol(\"createPluginModel\");\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js\n\t/**\n\t* BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().\n\t*\n\t* Provides pure functions for storage operations (migration, initialization,\n\t* args derivation, updates, debug views). Each function takes its dependencies\n\t* explicitly as parameters.\n\t*\n\t* @module block_storage_callbacks\n\t* @internal\n\t*/\n\t/**\n\t* Normalizes raw storage data and extracts state.\n\t* Handles all formats:\n\t* - New BlockStorage format (has discriminator)\n\t* - Legacy V1/V2 format ({ args, uiState })\n\t* - Raw V3 state (any other format)\n\t*\n\t* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n\t* @returns Object with normalized storage and extracted state\n\t*/\n\tfunction normalizeStorage(rawStorage) {\n\t\tif (rawStorage === void 0 || rawStorage === null) return {\n\t\t\tstorage: createBlockStorage({}),\n\t\t\tdata: {}\n\t\t};\n\t\tlet parsed = rawStorage;\n\t\tif (typeof rawStorage === \"string\") try {\n\t\t\tparsed = JSON.parse(rawStorage);\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\tstorage: createBlockStorage(rawStorage),\n\t\t\t\tdata: rawStorage\n\t\t\t};\n\t\t}\n\t\tif (isBlockStorage(parsed)) {\n\t\t\tconst storage = normalizeBlockStorage(parsed);\n\t\t\treturn {\n\t\t\t\tstorage,\n\t\t\t\tdata: getStorageData(storage)\n\t\t\t};\n\t\t}\n\t\tif (isLegacyModelV1ApiFormat(parsed)) return {\n\t\t\tstorage: createBlockStorage(parsed),\n\t\t\tdata: parsed\n\t\t};\n\t\treturn {\n\t\t\tstorage: createBlockStorage(parsed),\n\t\t\tdata: parsed\n\t\t};\n\t}\n\t/**\n\t* Applies a state update to existing storage.\n\t* Used when setData is called from the frontend.\n\t*\n\t* @param currentStorageJson - Current storage as JSON string (must be defined)\n\t* @param payload - Update payload with operation type and value\n\t* @returns Updated storage as StringifiedJson<BlockStorage>\n\t*/\n\tfunction applyStorageUpdate(currentStorageJson, payload) {\n\t\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\t\treturn stringifyJson(updateStorageData(currentStorage, payload));\n\t}\n\t/**\n\t* Checks if data is in legacy Model API v1 format.\n\t* Legacy format has { args, uiState? } at top level without the BlockStorage discriminator.\n\t*/\n\tfunction isLegacyModelV1ApiFormat(data) {\n\t\tif (data === null || typeof data !== \"object\") return false;\n\t\tif (isBlockStorage(data)) return false;\n\t\treturn \"args\" in data;\n\t}\n\t/**\n\t* Gets storage debug view from raw storage data.\n\t* Returns structured debug info about the storage state.\n\t*\n\t* @param rawStorage - Raw data from blockStorage field (may be JSON string or object)\n\t* @returns JSON string with storage debug view\n\t*/\n\tfunction getStorageDebugView(rawStorage) {\n\t\tconst { storage } = normalizeStorage(rawStorage);\n\t\treturn stringifyJson({\n\t\t\tdataVersion: storage.__dataVersion,\n\t\t\tdata: storage.__data\n\t\t});\n\t}\n\t/**\n\t* Runs storage migration using the provided hooks.\n\t* This is the main entry point for the middle layer to trigger migrations.\n\t*\n\t* @param currentStorageJson - Current storage as JSON string (or undefined)\n\t* @param hooks - Migration dependencies (block/plugin data migration and creation functions)\n\t* @returns MigrationResult\n\t*/\n\tfunction migrateStorage(currentStorageJson, hooks) {\n\t\tconst { storage: currentStorage } = normalizeStorage(currentStorageJson);\n\t\tconst newPluginRegistry = hooks.getPluginRegistry();\n\t\tconst migrationResult = migrateBlockStorage(currentStorage, {\n\t\t\tmigrateBlockData: hooks.migrateBlockData,\n\t\t\tmigratePluginData: hooks.migratePluginData,\n\t\t\tnewPluginRegistry,\n\t\t\tcreatePluginData: hooks.createPluginData\n\t\t});\n\t\tif (!migrationResult.success) return { error: `Migration failed at '${migrationResult.failedAt}': ${migrationResult.error}` };\n\t\tconst oldVersion = currentStorage.__dataVersion;\n\t\tconst newVersion = migrationResult.storage.__dataVersion;\n\t\tconst info = oldVersion === newVersion ? `No migration needed (${oldVersion})` : `Migrated ${oldVersion} -> ${newVersion}`;\n\t\treturn {\n\t\t\tnewStorageJson: stringifyJson(migrationResult.storage),\n\t\t\tinfo\n\t\t};\n\t}\n\t/**\n\t* Creates complete initial storage (block data + all plugin data) atomically.\n\t*\n\t* @param hooks - Dependencies for creating initial block and plugin data\n\t* @returns Initial storage as branded JSON string\n\t* @throws If initialDataFn or createPluginData throws\n\t*/\n\tfunction createInitialStorage(hooks) {\n\t\tconst blockDefault = hooks.getDefaultBlockData();\n\t\tconst pluginRegistry = hooks.getPluginRegistry();\n\t\tconst plugins = {};\n\t\tfor (const handle of Object.keys(pluginRegistry)) {\n\t\t\tconst initial = hooks.createPluginData(handle);\n\t\t\tplugins[handle] = {\n\t\t\t\t__dataVersion: initial.version,\n\t\t\t\t__data: initial.data\n\t\t\t};\n\t\t}\n\t\treturn stringifyJson({\n\t\t\t[BLOCK_STORAGE_KEY]: \"v1\",\n\t\t\t__dataVersion: blockDefault.version,\n\t\t\t__data: blockDefault.data,\n\t\t\t__pluginRegistry: pluginRegistry,\n\t\t\t__plugins: plugins\n\t\t});\n\t}\n\t/**\n\t* Derives args from storage using the provided args function.\n\t* This extracts data from storage and passes it to the block's args() function.\n\t*\n\t* @param storageJson - Storage as JSON string\n\t* @param argsFunction - The block's args derivation function\n\t* @returns ArgsDeriveResult with derived args or error\n\t*/\n\tfunction deriveArgsFromStorage(storageJson, argsFunction) {\n\t\tconst { data } = normalizeStorage(storageJson);\n\t\ttry {\n\t\t\treturn { value: argsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `args() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t}\n\t/**\n\t* Derives prerunArgs from storage.\n\t* Uses prerunArgsFunction if provided, otherwise falls back to argsFunction.\n\t*\n\t* @param storageJson - Storage as JSON string\n\t* @param argsFunction - The block's args derivation function (fallback)\n\t* @param prerunArgsFunction - Optional prerun args derivation function\n\t* @returns ArgsDeriveResult with derived prerunArgs or error\n\t*/\n\tfunction derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction) {\n\t\tconst { data } = normalizeStorage(storageJson);\n\t\tif (prerunArgsFunction) try {\n\t\t\treturn { value: prerunArgsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `prerunArgs() threw: ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t\ttry {\n\t\t\treturn { value: argsFunction(data) };\n\t\t} catch (e) {\n\t\t\treturn { error: `args() threw (fallback): ${e instanceof Error ? e.message : String(e)}` };\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/block_model.js\n\t/**\n\t* Merges two feature flag objects with type-aware logic:\n\t* - `supports*` (boolean): OR — `true` if either side is `true`\n\t* - `requires*` (numeric): MAX — take the higher version requirement\n\t*/\n\tfunction mergeFeatureFlags(base, override) {\n\t\tconst result = { ...base };\n\t\tfor (const [key, value] of Object.entries(override)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst existing = result[key];\n\t\t\tif (typeof value === \"boolean\") result[key] = typeof existing === \"boolean\" && existing || value;\n\t\t\telse if (typeof value === \"number\") result[key] = Math.max(typeof existing === \"number\" ? existing : 0, value);\n\t\t}\n\t\treturn result;\n\t}\n\t/** Main entry point that each block should use in it's \"config\" module. Don't forget\n\t* to call {@link done()} at the end of configuration. Value returned by this builder must be\n\t* exported as constant with name \"platforma\" from the \"config\" module.\n\t* API version is 3 (for UI) and 2 (for model) */\n\tvar BlockModelV3 = class BlockModelV3 {\n\t\tconstructor(config) {\n\t\t\tthis.config = config;\n\t\t}\n\t\tstatic FEATURE_FLAGS = {\n\t\t\tsupportsLazyState: true,\n\t\t\tsupportsPframeQueryRanking: true,\n\t\t\trequiresUIAPIVersion: 3,\n\t\t\trequiresModelAPIVersion: 2,\n\t\t\trequiresCreatePTable: 2,\n\t\t\trequiresPFramesVersion: REQUIRES_PFRAMES_VERSION,\n\t\t\t...BLOCK_SERVICE_FLAGS\n\t\t};\n\t\t/** @deprecated Use FEATURE_FLAGS */\n\t\tstatic INITIAL_BLOCK_FEATURE_FLAGS = BlockModelV3.FEATURE_FLAGS;\n\t\t/**\n\t\t* Creates a new BlockModelV3 builder with the specified data model.\n\t\t*\n\t\t* @example\n\t\t* const dataModel = new DataModelBuilder()\n\t\t* .from<BlockData>(\"v1\")\n\t\t* .init(() => ({ numbers: [], labels: [] }));\n\t\t*\n\t\t* BlockModelV3.create(dataModel)\n\t\t* .args((data) => ({ numbers: data.numbers }))\n\t\t* .sections(() => [{ type: 'link', href: '/', label: 'Main' }])\n\t\t* .done();\n\t\t*\n\t\t* @param dataModel The data model that defines initial data and migrations\n\t\t*/\n\t\tstatic create(dataModel) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\trenderingMode: \"Heavy\",\n\t\t\t\tdataModel,\n\t\t\t\toutputs: {},\n\t\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"sections\",\n\t\t\t\t\tlambda: () => []\n\t\t\t\t}, true),\n\t\t\t\ttitle: void 0,\n\t\t\t\tsubtitle: void 0,\n\t\t\t\ttags: void 0,\n\t\t\t\tenrichmentTargets: void 0,\n\t\t\t\tfeatureFlags: { ...BlockModelV3.FEATURE_FLAGS },\n\t\t\t\targsFunction: void 0,\n\t\t\t\tprerunArgsFunction: void 0,\n\t\t\t\tplugins: {}\n\t\t\t});\n\t\t}\n\t\toutput(key, cfgOrRf, flags = {}) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\toutputs: {\n\t\t\t\t\t...this.config.outputs,\n\t\t\t\t\t[key]: createAndRegisterRenderLambda({\n\t\t\t\t\t\thandle: `block-output#${key}`,\n\t\t\t\t\t\tlambda: () => cfgOrRf(new BlockRenderCtx()),\n\t\t\t\t\t\t...flags\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/** Shortcut for {@link output} with retentive flag set to true. */\n\t\tretentiveOutput(key, rf) {\n\t\t\treturn this.output(key, rf, { retentive: true });\n\t\t}\n\t\t/** Shortcut for {@link output} with withStatus flag set to true. */\n\t\toutputWithStatus(key, rf) {\n\t\t\treturn this.output(key, rf, { withStatus: true });\n\t\t}\n\t\t/**\n\t\t* Sets a function to derive block args from data.\n\t\t* This is called during setData to compute the args that will be used for block execution.\n\t\t*\n\t\t* @example\n\t\t* .args<BlockArgs>((data) => ({ numbers: data.numbers }))\n\t\t*\n\t\t* @example\n\t\t* .args<BlockArgs>((data) => {\n\t\t* if (data.numbers.length === 0) throw new Error('Numbers required'); // block not ready\n\t\t* return { numbers: data.numbers };\n\t\t* })\n\t\t*/\n\t\targs(lambda) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\targsFunction: lambda\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Sets a function to derive pre-run args from data (optional).\n\t\t* This is called during setData to compute the args that will be used for staging/pre-run phase.\n\t\t*\n\t\t* If not defined, defaults to using the args() function result.\n\t\t* If defined, uses its return value for the staging / prerun phase.\n\t\t*\n\t\t* The staging / prerun phase runs only if currentPrerunArgs differs from the executed\n\t\t* version of prerunArgs (same comparison logic as currentArgs vs prodArgs).\n\t\t*\n\t\t* @example\n\t\t* .prerunArgs((data) => ({ numbers: data.numbers }))\n\t\t*\n\t\t* @example\n\t\t* .prerunArgs((data) => {\n\t\t* // Return undefined to skip staging for this block\n\t\t* if (!data.isReady) return undefined;\n\t\t* return { numbers: data.numbers };\n\t\t* })\n\t\t*/\n\t\tprerunArgs(fn) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tprerunArgsFunction: fn\n\t\t\t});\n\t\t}\n\t\t/** Sets the lambda to generate list of sections in the left block overviews panel. */\n\t\tsections(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tsections: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"sections\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t}, true)\n\t\t\t});\n\t\t}\n\t\t/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */\n\t\ttitle(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\ttitle: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"title\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\tsubtitle(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tsubtitle: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"subtitle\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\ttags(rf) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\ttags: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"tags\",\n\t\t\t\t\tlambda: () => rf(new BlockRenderCtx())\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\t/** Sets or overrides feature flags for the block. */\n\t\twithFeatureFlags(flags) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tfeatureFlags: {\n\t\t\t\t\t...this.config.featureFlags,\n\t\t\t\t\t...flags\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.\n\t\t* Influences dependency graph construction.\n\t\t*/\n\t\tenriches(lambda) {\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tenrichmentTargets: createAndRegisterRenderLambda({\n\t\t\t\t\thandle: \"enrichmentTargets\",\n\t\t\t\t\tlambda\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\tplugin(instance, params) {\n\t\t\tconst pluginId = instance.id;\n\t\t\tconst plugin = instance[CREATE_PLUGIN_MODEL]();\n\t\t\tconst resolvedParams = params ?? {};\n\t\t\tif (pluginId in this.config.plugins) throw new Error(`Plugin '${pluginId}' already registered`);\n\t\t\tconst registered = {\n\t\t\t\tmodel: plugin,\n\t\t\t\tinputs: resolvedParams\n\t\t\t};\n\t\t\treturn new BlockModelV3({\n\t\t\t\t...this.config,\n\t\t\t\tplugins: {\n\t\t\t\t\t...this.config.plugins,\n\t\t\t\t\t[pluginId]: registered\n\t\t\t\t},\n\t\t\t\tfeatureFlags: mergeFeatureFlags(this.config.featureFlags, plugin.featureFlags ?? {})\n\t\t\t});\n\t\t}\n\t\t/** Renders all provided block settings into a pre-configured platforma API\n\t\t* instance, that can be used in frontend to interact with block data, and\n\t\t* other features provided by the platforma to the block.\n\t\t*\n\t\t* Type-level check: if there are unconsumed transfers (from `.transfer()` calls\n\t\t* in the migration chain), this method requires an impossible `never` argument,\n\t\t* producing a compile error. Register all transferred plugins via `.plugin(instance)`\n\t\t* before calling `.done()`.\n\t\t*/\n\t\tdone(..._) {\n\t\t\tif (this.config.argsFunction === void 0) throw new Error(\"Args rendering function not set.\");\n\t\t\tconst apiVersion = 3;\n\t\t\tconst { plugins } = this.config;\n\t\t\tconst pluginRegistry = {};\n\t\t\tconst pluginHandles = Object.keys(plugins);\n\t\t\tfor (const handle of pluginHandles) pluginRegistry[handle] = plugins[handle].model.name;\n\t\t\tconst { dataModel, argsFunction, prerunArgsFunction } = this.config;\n\t\t\tfunction getPlugin(handle) {\n\t\t\t\tconst plugin = plugins[handle];\n\t\t\t\tif (!plugin) throw new Error(`Plugin model not found for '${handle}'`);\n\t\t\t\treturn plugin;\n\t\t\t}\n\t\t\tregisterFacadeCallbacks({\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageApplyUpdate]: applyStorageUpdate,\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageDebugView]: getStorageDebugView,\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageMigrate]: (currentStorageJson) => migrateStorage(currentStorageJson, {\n\t\t\t\t\tmigrateBlockData: (v) => dataModel.migrate(v),\n\t\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\t\tmigratePluginData: (handle, v) => getPlugin(handle).model.dataModel.migrate(v),\n\t\t\t\t\tcreatePluginData: (handle, transfer) => {\n\t\t\t\t\t\tif (transfer) return transfer;\n\t\t\t\t\t\treturn getPlugin(handle).model.getDefaultData();\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\t[BlockStorageFacadeCallbacks.StorageInitial]: () => createInitialStorage({\n\t\t\t\t\tgetDefaultBlockData: () => dataModel.getDefaultData(),\n\t\t\t\t\tgetPluginRegistry: () => pluginRegistry,\n\t\t\t\t\tcreatePluginData: (handle) => getPlugin(handle).model.getDefaultData()\n\t\t\t\t}),\n\t\t\t\t[BlockStorageFacadeCallbacks.ArgsDerive]: (storageJson) => deriveArgsFromStorage(storageJson, argsFunction),\n\t\t\t\t[BlockStorageFacadeCallbacks.PrerunArgsDerive]: (storageJson) => derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFunction)\n\t\t\t});\n\t\t\tconst pluginOutputs = {};\n\t\t\tfor (const handle of pluginHandles) {\n\t\t\t\tconst { model, inputs } = plugins[handle];\n\t\t\t\tconst wrappedInputs = {};\n\t\t\t\tfor (const [paramKey, paramFn] of Object.entries(inputs)) wrappedInputs[paramKey] = () => paramFn(new BlockRenderCtx());\n\t\t\t\tconst outputs = model.outputs;\n\t\t\t\tfor (const [outputKey, outputFn] of Object.entries(outputs)) {\n\t\t\t\t\tconst key = pluginOutputKey(handle, outputKey);\n\t\t\t\t\tpluginOutputs[key] = createAndRegisterRenderLambda({\n\t\t\t\t\t\thandle: key,\n\t\t\t\t\t\tlambda: () => outputFn(new PluginRenderCtx(handle, wrappedInputs)),\n\t\t\t\t\t\twithStatus: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst allOutputs = {\n\t\t\t\t...this.config.outputs,\n\t\t\t\t...pluginOutputs\n\t\t\t};\n\t\t\tglobalThis.platformaApiVersion = apiVersion;\n\t\t\tif (!isInUI()) return { config: {\n\t\t\t\tv4: {\n\t\t\t\t\tconfigVersion: 4,\n\t\t\t\t\tmodelAPIVersion: 2,\n\t\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\t\trenderingMode: this.config.renderingMode,\n\t\t\t\t\tsections: this.config.sections,\n\t\t\t\t\ttitle: this.config.title,\n\t\t\t\t\tsubtitle: this.config.subtitle,\n\t\t\t\t\ttags: this.config.tags,\n\t\t\t\t\toutputs: allOutputs,\n\t\t\t\t\tenrichmentTargets: this.config.enrichmentTargets,\n\t\t\t\t\tfeatureFlags: this.config.featureFlags,\n\t\t\t\t\tblockLifecycleCallbacks: { ...BlockStorageFacadeHandles }\n\t\t\t\t},\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\toutputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)]))\n\t\t\t} };\n\t\t\telse return {\n\t\t\t\t...getPlatformaInstance({\n\t\t\t\t\tsdkVersion: PlatformaSDKVersion,\n\t\t\t\t\tapiVersion\n\t\t\t\t}),\n\t\t\t\tblockModelInfo: {\n\t\t\t\t\toutputs: Object.fromEntries(Object.entries(allOutputs).map(([key, value]) => [key, { withStatus: Boolean(isConfigLambda(value) && value.withStatus) }])),\n\t\t\t\t\tpluginIds: pluginHandles,\n\t\t\t\t\tfeatureFlags: this.config.featureFlags,\n\t\t\t\t\tpluginPublicOutputs: Object.fromEntries(pluginHandles.map((handle) => [handle, plugins[handle].model.publicOutputDef]))\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js\n\t/** Create id for column copy with added keys in axes domains */\n\tconst colId = (id, domains, contextDomains) => {\n\t\tlet wid = id.toString();\n\t\tdomains?.forEach((domain) => {\n\t\t\tif (domain) for (const [k, v] of Object.entries(domain)) {\n\t\t\t\twid += k;\n\t\t\t\twid += v;\n\t\t\t}\n\t\t});\n\t\tcontextDomains?.forEach((contextDomain) => {\n\t\t\tif (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {\n\t\t\t\twid += k;\n\t\t\t\twid += v;\n\t\t\t}\n\t\t});\n\t\treturn wid;\n\t};\n\t/** All combinations with 1 key from each list */\n\tfunction getKeysCombinations(idsLists) {\n\t\tif (!idsLists.length) return [];\n\t\tlet result = [[]];\n\t\tidsLists.forEach((list) => {\n\t\t\tconst nextResult = [];\n\t\t\tlist.forEach((key) => {\n\t\t\t\tnextResult.push(...result.map((resultItem) => [...resultItem, key]));\n\t\t\t});\n\t\t\tresult = nextResult;\n\t\t});\n\t\treturn result;\n\t}\n\tfunction getAvailableWithLinkersAxes(linkerColumns, blockAxes) {\n\t\tconst availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));\n\t\treturn new Map(availableAxes.map((axisSpec) => {\n\t\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t\t}));\n\t}\n\t/** Add columns with fully compatible axes created from partial compatible ones */\n\tfunction enrichCompatible(blockAxes, columns) {\n\t\treturn columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));\n\t}\n\tfunction getAdditionalColumnsForColumn(blockAxes, column) {\n\t\tconst columnAxesIds = column.spec.axesSpec.map(getAxisId);\n\t\tif (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];\n\t\tconst secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {\n\t\t\tconst result = [];\n\t\t\tfor (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);\n\t\t\treturn result;\n\t\t}));\n\t\tconst allAddedDomainValues = /* @__PURE__ */ new Set();\n\t\tconst addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();\n\t\tconst addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {\n\t\t\tconst addedSet = /* @__PURE__ */ new Set();\n\t\t\tidsList.map((axisId, idx) => {\n\t\t\t\tconst d1 = column.spec.axesSpec[idx].domain;\n\t\t\t\tconst d2 = axisId.domain;\n\t\t\t\tObject.entries(d2 ?? {}).forEach(([key, value]) => {\n\t\t\t\t\tif (d1?.[key] === void 0) {\n\t\t\t\t\t\tconst item = JSON.stringify([key, value]);\n\t\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst cd1 = column.spec.axesSpec[idx].contextDomain;\n\t\t\t\tconst cd2 = axisId.contextDomain;\n\t\t\t\tObject.entries(cd2 ?? {}).forEach(([key, value]) => {\n\t\t\t\t\tif (cd1?.[key] === void 0) {\n\t\t\t\t\t\tconst item = JSON.stringify([\"ctx:\" + key, value]);\n\t\t\t\t\t\taddedSet.add(item);\n\t\t\t\t\t\tallAddedDomainValues.add(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn {\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});\n\t\t\treturn addedSet;\n\t\t});\n\t\t[...allAddedDomainValues].forEach((addedPart) => {\n\t\t\tif (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);\n\t\t});\n\t\treturn [column, ...secondaryIdsVariants.map((idsList, idx) => {\n\t\t\tconst id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));\n\t\t\tconst label = readAnnotation(column.spec, Annotation.Label) ?? \"\";\n\t\t\tconst labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(\" / \");\n\t\t\tconst annotations = {\n\t\t\t\t...column.spec.annotations,\n\t\t\t\t[Annotation.Graph.IsVirtual]: stringifyJson(true)\n\t\t\t};\n\t\t\tif (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + \" / \" + labelDomainPart : label + labelDomainPart;\n\t\t\treturn {\n\t\t\t\t...column,\n\t\t\t\tid,\n\t\t\t\tspec: {\n\t\t\t\t\t...column.spec,\n\t\t\t\t\taxesSpec: idsList.map((axisId, idx) => ({\n\t\t\t\t\t\t...axisId,\n\t\t\t\t\t\tannotations: column.spec.axesSpec[idx].annotations\n\t\t\t\t\t})),\n\t\t\t\t\tannotations\n\t\t\t\t}\n\t\t\t};\n\t\t})];\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js\n\tfunction getAllRelatedColumns(ctx, predicate) {\n\t\tconst columns = new PColumnCollection();\n\t\tcolumns.addColumnProvider(ctx.resultPool);\n\t\tconst allColumns = columns.getColumns(predicate, {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? [];\n\t\treturn enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {\n\t\t\treturn [canonicalizeJson(getAxisId(axisSpec)), axisSpec];\n\t\t})), allColumns);\n\t}\n\tfunction getRelatedColumns(ctx, { columns: rootColumns, predicate }) {\n\t\tconst columns = new PColumnCollection();\n\t\tcolumns.addColumnProvider(ctx.resultPool);\n\t\tcolumns.addColumns(rootColumns);\n\t\tconst blockAxes = /* @__PURE__ */ new Map();\n\t\tconst allAxes = /* @__PURE__ */ new Map();\n\t\tfor (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\t\tconst aid = getAxisId(spec);\n\t\t\tblockAxes.set(canonicalizeJson(aid), spec);\n\t\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t\t}\n\t\tconst availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);\n\t\tfor (const item of availableWithLinkersAxes) {\n\t\t\tblockAxes.set(...item);\n\t\t\tallAxes.set(...item);\n\t\t}\n\t\tconst blockAxesArr = Array.from(blockAxes.values());\n\t\tlet compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\t\tfor (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n\t\t\tconst aid = getAxisId(spec);\n\t\t\tallAxes.set(canonicalizeJson(aid), spec);\n\t\t}\n\t\tconst allAxesArr = Array.from(allAxes.values());\n\t\tcompatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => !isLabelColumn(column.spec));\n\t\tconst compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {\n\t\t\tconst axisId = getAxisId(axisSpec);\n\t\t\treturn allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));\n\t\t}), {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t}) ?? []).filter((column) => isLabelColumn(column.spec));\n\t\treturn enrichCompatible(blockAxes, [...compatibleWithoutLabels, ...compatibleLabels]);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js\n\tfunction isHiddenFromGraphColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n\t}\n\tfunction isHiddenFromUIColumn(column) {\n\t\treturn !!readAnnotationJson(column, Annotation.HideDataFromUi);\n\t}\n\t/**\n\tThe aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n\t(including linker columns and all label columns).\n\tBlock’s columns are added to pframe as is.\n\tOther columns are added basing on set of axes of block’s columns, considering available with linker columns.\n\tCompatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n\tresult pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n\tamong existing ones).\n\tIn requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n\tof partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n\tand modified label (with added domain values in case if more than one copy with different domains exist).\n\t*/\n\tfunction createPFrameForGraphs(ctx, blockColumns) {\n\t\tconst suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n\t\tif (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n\t\treturn ctx.createPFrame(getRelatedColumns(ctx, {\n\t\t\tcolumns: blockColumns,\n\t\t\tpredicate: suitableSpec\n\t\t}));\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/filters/traverse.js\n\t/**\n\t* Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.\n\t*\n\t* Entries with `{ type: undefined }` inside `and`/`or` arrays are skipped\n\t* (these represent unfilled filter slots in the UI).\n\t*\n\t* Traversal order:\n\t* 1. Recurse into child filters (`and`/`or`/`not`)\n\t* 2. Apply the corresponding visitor callback with already-traversed children\n\t* 3. For leaf nodes, call `leaf` directly\n\t*/\n\tfunction traverseFilterSpec(filter, visitor) {\n\t\treturn traverseFilterSpecImpl(filter, visitor);\n\t}\n\t/** Internal implementation with simple generics for clean recursion. */\n\tfunction traverseFilterSpecImpl(filter, visitor) {\n\t\tswitch (filter.type) {\n\t\t\tcase \"and\": return visitor.and(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\t\tcase \"or\": return visitor.or(filter.filters.filter((f) => f.type !== void 0).map((f) => traverseFilterSpecImpl(f, visitor)));\n\t\t\tcase \"not\": return visitor.not(traverseFilterSpecImpl(filter.filter, visitor));\n\t\t\tdefault: return visitor.leaf(filter);\n\t\t}\n\t}\n\t/** Collects all column references (`column` and `rhs` fields) from filter leaves. */\n\tfunction collectFilterSpecColumns(filter) {\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: (leaf) => {\n\t\t\t\tconst cols = [];\n\t\t\t\tif (\"column\" in leaf && leaf.column !== void 0) cols.push(leaf.column);\n\t\t\t\tif (\"rhs\" in leaf && leaf.rhs !== void 0) cols.push(leaf.rhs);\n\t\t\t\treturn cols;\n\t\t\t},\n\t\t\tand: (results) => results.flat(),\n\t\t\tor: (results) => results.flat(),\n\t\t\tnot: (result) => result\n\t\t});\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js\n\t/** Parses a CanonicalizedJson<PTableColumnId> string into a SpecQueryExpression reference. */\n\tfunction resolveColumnRef(columnStr) {\n\t\tconst parsed = JSON.parse(columnStr);\n\t\treturn parsed.type === \"axis\" ? {\n\t\t\ttype: \"axisRef\",\n\t\t\tvalue: parsed.id\n\t\t} : {\n\t\t\ttype: \"columnRef\",\n\t\t\tvalue: parsed.id\n\t\t};\n\t}\n\t/** Converts a FilterSpec tree into a SpecQueryExpression. */\n\tfunction filterSpecToSpecQueryExpr(filter) {\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: leafToSpecQueryExpr,\n\t\t\tand: (inputs) => {\n\t\t\t\tif (inputs.length === 0) throw new Error(\"AND filter requires at least one operand\");\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"and\",\n\t\t\t\t\tinput: inputs\n\t\t\t\t};\n\t\t\t},\n\t\t\tor: (inputs) => {\n\t\t\t\tif (inputs.length === 0) throw new Error(\"OR filter requires at least one operand\");\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"or\",\n\t\t\t\t\tinput: inputs\n\t\t\t\t};\n\t\t\t},\n\t\t\tnot: (input) => ({\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput\n\t\t\t})\n\t\t});\n\t}\n\tfunction leafToSpecQueryExpr(filter) {\n\t\tswitch (filter.type) {\n\t\t\tcase \"patternEquals\": return {\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\tcase \"patternNotEquals\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"stringEquals\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\t\tvalue: filter.value,\n\t\t\t\t\tcaseInsensitive: false\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"patternContainSubsequence\": return {\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\tcase \"patternNotContainSubsequence\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"stringContains\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\t\tvalue: filter.value,\n\t\t\t\t\tcaseInsensitive: false\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"patternMatchesRegularExpression\": return {\n\t\t\t\ttype: \"stringRegex\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value\n\t\t\t};\n\t\t\tcase \"patternFuzzyContainSubsequence\": return {\n\t\t\t\ttype: \"stringContainsFuzzy\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tvalue: filter.value,\n\t\t\t\tmaxEdits: filter.maxEdits ?? 1,\n\t\t\t\tcaseInsensitive: false,\n\t\t\t\tsubstitutionsOnly: filter.substitutionsOnly ?? false,\n\t\t\t\twildcard: filter.wildcard ?? null\n\t\t\t};\n\t\t\tcase \"equal\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"eq\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"notEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ne\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"lessThan\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"lt\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"greaterThan\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"gt\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"lessThanOrEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"le\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"greaterThanOrEqual\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"ge\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.x\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"equalToColumn\": return {\n\t\t\t\ttype: \"numericComparison\",\n\t\t\t\toperand: \"eq\",\n\t\t\t\tleft: resolveColumnRef(filter.column),\n\t\t\t\tright: resolveColumnRef(filter.rhs)\n\t\t\t};\n\t\t\tcase \"lessThanColumn\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"lt\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"lt\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"greaterThanColumn\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"gt\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"gt\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"lessThanColumnOrEqual\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"le\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"le\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"greaterThanColumnOrEqual\": {\n\t\t\t\tconst left = resolveColumnRef(filter.column);\n\t\t\t\tconst right = resolveColumnRef(filter.rhs);\n\t\t\t\tif (filter.minDiff !== void 0 && filter.minDiff !== 0) return {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"ge\",\n\t\t\t\t\tleft: {\n\t\t\t\t\t\ttype: \"numericBinary\",\n\t\t\t\t\t\toperand: \"add\",\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\t\t\tvalue: filter.minDiff\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"numericComparison\",\n\t\t\t\t\toperand: \"ge\",\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"inSet\": return {\n\t\t\t\ttype: \"isIn\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tset: filter.value,\n\t\t\t\tnegate: false\n\t\t\t};\n\t\t\tcase \"notInSet\": return {\n\t\t\t\ttype: \"isIn\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\tset: filter.value,\n\t\t\t\tnegate: true\n\t\t\t};\n\t\t\tcase \"isNA\": return {\n\t\t\t\ttype: \"isNull\",\n\t\t\t\tinput: resolveColumnRef(filter.column)\n\t\t\t};\n\t\t\tcase \"isNotNA\": return {\n\t\t\t\ttype: \"not\",\n\t\t\t\tinput: {\n\t\t\t\t\ttype: \"isNull\",\n\t\t\t\t\tinput: resolveColumnRef(filter.column)\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"ifNa\": return {\n\t\t\t\ttype: \"fillNull\",\n\t\t\t\tinput: resolveColumnRef(filter.column),\n\t\t\t\treplacement: {\n\t\t\t\t\ttype: \"constant\",\n\t\t\t\t\tvalue: filter.replacement\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"topN\":\n\t\t\tcase \"bottomN\": throw new Error(`Filter type \"${filter.type}\" is not supported in query expressions`);\n\t\t\tcase void 0: throw new Error(\"Filter type is undefined\");\n\t\t\tdefault: assertNever(filter);\n\t\t}\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs\n\tfunction isArrayLike(value) {\n\t\treturn value != null && typeof value !== \"function\" && isLength(value.length);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs\n\tfunction isArguments(value) {\n\t\treturn value !== null && typeof value === \"object\" && getTag(value) === \"[object Arguments]\";\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs\n\tfunction isPrototype(value) {\n\t\tconst constructor = value?.constructor;\n\t\treturn value === (typeof constructor === \"function\" ? constructor.prototype : Object.prototype);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs\n\tfunction isTypedArray(x) {\n\t\treturn isTypedArray$1(x);\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs\n\tfunction isEmpty(value) {\n\t\tif (value == null) return true;\n\t\tif (isArrayLike(value)) {\n\t\t\tif (typeof value.splice !== \"function\" && typeof value !== \"string\" && (typeof Buffer === \"undefined\" || !Buffer.isBuffer(value)) && !isTypedArray(value) && !isArguments(value)) return false;\n\t\t\treturn value.length === 0;\n\t\t}\n\t\tif (typeof value === \"object\") {\n\t\t\tif (value instanceof Map || value instanceof Set) return value.size === 0;\n\t\t\tconst keys = Object.keys(value);\n\t\t\tif (isPrototype(value)) return keys.filter((x) => x !== \"constructor\").length === 0;\n\t\t\treturn keys.length === 0;\n\t\t}\n\t\treturn true;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/filters/distill.js\n\t/**\n\t* Strips non-FilterSpec metadata (whitelist approach) and removes\n\t* unfilled leaves (type is undefined or any required field is undefined).\n\t*/\n\tfunction distillFilterSpec(filter) {\n\t\tif (filter == null) return null;\n\t\treturn traverseFilterSpec(filter, {\n\t\t\tleaf: (leaf) => {\n\t\t\t\tconst distilled = distillLeaf(leaf);\n\t\t\t\treturn isFilledLeaf(distilled) ? distilled : null;\n\t\t\t},\n\t\t\tand: (results) => {\n\t\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\t\ttype: \"and\",\n\t\t\t\t\tfilters: filtered\n\t\t\t\t};\n\t\t\t},\n\t\t\tor: (results) => {\n\t\t\t\tconst filtered = results.filter((f) => f !== null);\n\t\t\t\treturn filtered.length === 0 ? null : {\n\t\t\t\t\ttype: \"or\",\n\t\t\t\t\tfilters: filtered\n\t\t\t\t};\n\t\t\t},\n\t\t\tnot: (result) => result === null ? null : {\n\t\t\t\ttype: \"not\",\n\t\t\t\tfilter: result\n\t\t\t}\n\t\t});\n\t}\n\tfunction distillLeaf(node) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(node)) if (KNOWN_LEAF_KEYS.has(key)) result[key] = value;\n\t\treturn result;\n\t}\n\t/** Returns true if the leaf is filled — type is defined and every required field per-type is filled. */\n\tfunction isFilledLeaf(node) {\n\t\tif (isNil$1(node.type)) return false;\n\t\tconst required = REQUIRED_KEYS_BY_TYPE[node.type];\n\t\tconst record = node;\n\t\treturn required.every((key) => isFilledValue(record[key]));\n\t}\n\t/**\n\t* Returns true if the value is considered \"filled\":\n\t* - primitives (number, boolean): always true\n\t* - string: non-empty after trim\n\t* - array: non-empty AND every item is filled\n\t* - plain object: non-empty AND every field value is filled\n\t* - null/undefined: false\n\t*/\n\tfunction isFilledValue(value) {\n\t\tif (isNil$1(value)) return false;\n\t\tswitch (typeof value) {\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\": return true;\n\t\t\tcase \"string\": return value.trim() !== \"\";\n\t\t\tdefault:\n\t\t\t\tif (isEmpty(value)) return false;\n\t\t\t\tif (Array.isArray(value)) return value.every(isFilledValue);\n\t\t\t\treturn Object.values(value).every(isFilledValue);\n\t\t}\n\t}\n\tconst KNOWN_LEAF_KEYS = new Set([\n\t\t\"n\",\n\t\t\"x\",\n\t\t\"rhs\",\n\t\t\"type\",\n\t\t\"value\",\n\t\t\"column\",\n\t\t\"minDiff\",\n\t\t\"maxEdits\",\n\t\t\"wildcard\",\n\t\t\"replacement\",\n\t\t\"substitutionsOnly\"\n\t]);\n\t/** Required fields per leaf type. Optional fields (e.g. minDiff, maxEdits) excluded. */\n\tconst REQUIRED_KEYS_BY_TYPE = {\n\t\tisNA: [\"column\"],\n\t\tisNotNA: [\"column\"],\n\t\tifNa: [\"column\", \"replacement\"],\n\t\tpatternEquals: [\"column\", \"value\"],\n\t\tpatternNotEquals: [\"column\", \"value\"],\n\t\tpatternContainSubsequence: [\"column\", \"value\"],\n\t\tpatternNotContainSubsequence: [\"column\", \"value\"],\n\t\tpatternMatchesRegularExpression: [\"column\", \"value\"],\n\t\tpatternFuzzyContainSubsequence: [\"column\", \"value\"],\n\t\tinSet: [\"column\", \"value\"],\n\t\tnotInSet: [\"column\", \"value\"],\n\t\ttopN: [\"column\", \"n\"],\n\t\tbottomN: [\"column\", \"n\"],\n\t\tequal: [\"column\", \"x\"],\n\t\tnotEqual: [\"column\", \"x\"],\n\t\tlessThan: [\"column\", \"x\"],\n\t\tgreaterThan: [\"column\", \"x\"],\n\t\tlessThanOrEqual: [\"column\", \"x\"],\n\t\tgreaterThanOrEqual: [\"column\", \"x\"],\n\t\tequalToColumn: [\"column\", \"rhs\"],\n\t\tlessThanColumn: [\"column\", \"rhs\"],\n\t\tgreaterThanColumn: [\"column\", \"rhs\"],\n\t\tlessThanColumnOrEqual: [\"column\", \"rhs\"],\n\t\tgreaterThanColumnOrEqual: [\"column\", \"rhs\"]\n\t};\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js\n\t/** Upgrade PlDataTableStateV2 to the latest version */\n\tfunction upgradePlDataTableStateV2(state) {\n\t\tif (!state) return createPlDataTableStateV2();\n\t\tif (!(\"version\" in state)) state = createPlDataTableStateV2();\n\t\tif (state.version === 2) state = {\n\t\t\tversion: 3,\n\t\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tfiltersState: []\n\t\t\t})),\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t\tif (state.version === 3) state = createPlDataTableStateV2();\n\t\tif (state.version === 4) state = migrateV4toV6(state);\n\t\tif (state.version === 5) state = migrateV5toV6(state);\n\t\tif (state.version === 6) state = migrateV6toV7(state);\n\t\treturn state;\n\t}\n\t/** Migrate v5 to v6: unwrap `{source, labeled}` colIds in gridState. */\n\tfunction migrateV5toV6(state) {\n\t\treturn {\n\t\t\tversion: 6,\n\t\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tgridState: unwrapV5GridState(entry.gridState)\n\t\t\t})),\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t}\n\t/** Convert v5 wrapped colId JSON to bare PTableColumnSpec JSON, taking `.source`.\n\t* gridState colIds may include the row-number sentinel (a JSON-stringified\n\t* literal, not a wrapped spec) — those pass through unchanged. */\n\tfunction unwrapV5ColId(json) {\n\t\tconst parsed = parseJsonSafely(json);\n\t\treturn !isNil(parsed) && typeof parsed === \"object\" && \"source\" in parsed ? canonicalizeJson(parsed.source) : json;\n\t}\n\tfunction unwrapV5GridState(gridState) {\n\t\tconst unwrapAs = (json) => unwrapV5ColId(json);\n\t\treturn {\n\t\t\tcolumnOrder: gridState.columnOrder ? { orderedColIds: gridState.columnOrder.orderedColIds.map(unwrapAs) } : void 0,\n\t\t\tsort: gridState.sort ? { sortModel: gridState.sort.sortModel.map((s) => ({\n\t\t\t\tcolId: unwrapAs(s.colId),\n\t\t\t\tsort: s.sort\n\t\t\t})) } : void 0,\n\t\t\tcolumnVisibility: gridState.columnVisibility ? { hiddenColIds: gridState.columnVisibility.hiddenColIds.map(unwrapAs) } : void 0\n\t\t};\n\t}\n\t/** Migrate v6 to v7: rewrite each colId from a full PTableColumnSpec to its\n\t* compact PTableColumnId (drops annotations/spec body, ~16× smaller per column). */\n\tfunction migrateV6toV7(state) {\n\t\treturn {\n\t\t\tversion: 7,\n\t\t\tstateCache: state.stateCache.map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tgridState: shrinkV6GridState(entry.gridState)\n\t\t\t})),\n\t\t\tpTableParams: state.pTableParams\n\t\t};\n\t}\n\t/** Convert a v6 fat colId (canonicalized PTableColumnSpec) to a v7 compact colId\n\t* (canonicalized PTableColumnId). The row-number sentinel is a string literal,\n\t* not a spec — pass it through unchanged. */\n\tfunction shrinkV6ColId(json) {\n\t\tconst parsed = parseJsonSafely(json);\n\t\tif (!isNil(parsed) && typeof parsed === \"object\" && \"type\" in parsed && \"id\" in parsed) return canonicalizeJson(getPTableColumnId(parsed));\n\t\treturn json;\n\t}\n\tfunction shrinkV6GridState(gridState) {\n\t\treturn {\n\t\t\tcolumnOrder: gridState.columnOrder ? { orderedColIds: gridState.columnOrder.orderedColIds.map(shrinkV6ColId) } : void 0,\n\t\t\tsort: gridState.sort ? { sortModel: gridState.sort.sortModel.map((s) => ({\n\t\t\t\tcolId: shrinkV6ColId(s.colId),\n\t\t\t\tsort: s.sort\n\t\t\t})) } : void 0,\n\t\t\tcolumnVisibility: gridState.columnVisibility ? { hiddenColIds: gridState.columnVisibility.hiddenColIds.map(shrinkV6ColId) } : void 0\n\t\t};\n\t}\n\t/** Migrate v4 state to v6: convert per-column filters to tree-based format (skips v5). */\n\tfunction migrateV4toV6(state) {\n\t\tlet idCounter = 0;\n\t\tconst nextId = () => ++idCounter;\n\t\tconst migratedCache = state.stateCache.map((entry) => {\n\t\t\tconst leaves = [];\n\t\t\tfor (const f of entry.filtersState) if (f.filter !== null && !f.filter.disabled) {\n\t\t\t\tconst column = canonicalizeJson(f.id);\n\t\t\t\tleaves.push(migrateTableFilter(column, f.filter.value, nextId));\n\t\t\t}\n\t\t\tconst filtersState = leaves.length > 0 ? {\n\t\t\t\tid: nextId(),\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: leaves\n\t\t\t} : null;\n\t\t\treturn {\n\t\t\t\tsourceId: entry.sourceId,\n\t\t\t\tgridState: entry.gridState,\n\t\t\t\tsheetsState: entry.sheetsState,\n\t\t\t\tfiltersState,\n\t\t\t\tdefaultFiltersState: null\n\t\t\t};\n\t\t});\n\t\tconst oldSourceId = state.pTableParams.sourceId;\n\t\tconst currentCache = oldSourceId ? migratedCache.find((e) => e.sourceId === oldSourceId) : void 0;\n\t\treturn {\n\t\t\tversion: 6,\n\t\t\tstateCache: migratedCache,\n\t\t\tpTableParams: currentCache && oldSourceId ? {\n\t\t\t\tsourceId: oldSourceId,\n\t\t\t\thiddenColIds: state.pTableParams.hiddenColIds?.map((id) => ({\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tid\n\t\t\t\t})) ?? null,\n\t\t\t\tfilters: distillFilterSpec(currentCache.filtersState),\n\t\t\t\tdefaultFilters: null,\n\t\t\t\tsorting: state.pTableParams.sorting\n\t\t\t} : createDefaultPTableParams()\n\t\t};\n\t}\n\t/** Migrate a single per-column PlTableFilter to a tree-based FilterSpec node */\n\tfunction migrateTableFilter(column, filter, nextId) {\n\t\tconst id = nextId();\n\t\tswitch (filter.type) {\n\t\t\tcase \"isNA\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"isNA\",\n\t\t\t\tcolumn\n\t\t\t};\n\t\t\tcase \"isNotNA\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"isNotNA\",\n\t\t\t\tcolumn\n\t\t\t};\n\t\t\tcase \"number_equals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"equal\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_notEquals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"notEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_greaterThan\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"greaterThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_greaterThanOrEqualTo\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_lessThan\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"lessThan\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_lessThanOrEqualTo\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"lessThanOrEqual\",\n\t\t\t\tcolumn,\n\t\t\t\tx: filter.reference\n\t\t\t};\n\t\t\tcase \"number_between\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"and\",\n\t\t\t\tfilters: [filter.includeLowerBound ? {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"greaterThanOrEqual\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.lowerBound\n\t\t\t\t} : {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"greaterThan\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.lowerBound\n\t\t\t\t}, filter.includeUpperBound ? {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"lessThanOrEqual\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.upperBound\n\t\t\t\t} : {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"lessThan\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tx: filter.upperBound\n\t\t\t\t}]\n\t\t\t};\n\t\t\tcase \"string_equals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternEquals\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_notEquals\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternNotEquals\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_contains\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_doesNotContain\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternNotContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference\n\t\t\t};\n\t\t\tcase \"string_matches\": return {\n\t\t\t\tid,\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\tcase \"string_doesNotMatch\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"not\",\n\t\t\t\tfilter: {\n\t\t\t\t\tid: nextId(),\n\t\t\t\t\ttype: \"patternMatchesRegularExpression\",\n\t\t\t\t\tcolumn,\n\t\t\t\t\tvalue: filter.reference\n\t\t\t\t}\n\t\t\t};\n\t\t\tcase \"string_containsFuzzyMatch\": return {\n\t\t\t\tid,\n\t\t\t\ttype: \"patternFuzzyContainSubsequence\",\n\t\t\t\tcolumn,\n\t\t\t\tvalue: filter.reference,\n\t\t\t\tmaxEdits: filter.maxEdits,\n\t\t\t\tsubstitutionsOnly: filter.substitutionsOnly,\n\t\t\t\t...filter.wildcard !== void 0 ? { wildcard: filter.wildcard } : {}\n\t\t\t};\n\t\t}\n\t}\n\tfunction createDefaultPTableParams() {\n\t\treturn {\n\t\t\tsourceId: null,\n\t\t\thiddenColIds: null,\n\t\t\tfilters: null,\n\t\t\tdefaultFilters: null,\n\t\t\tsorting: []\n\t\t};\n\t}\n\tfunction createPlDataTableStateV2() {\n\t\treturn {\n\t\t\tversion: 7,\n\t\t\tstateCache: [],\n\t\t\tpTableParams: createDefaultPTableParams()\n\t\t};\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js\n\t/** Check if column is hidden by default */\n\tfunction isColumnOptional(spec) {\n\t\treturn readAnnotation(spec, Annotation.Table.Visibility) === \"optional\";\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/labels.js\n\t/** Get label columns matching the provided columns from the result pool */\n\tfunction getMatchingLabelColumns(columns, allLabelColumns) {\n\t\tconst inputLabelColumns = [];\n\t\tconst inputValueColumns = [];\n\t\tfor (const column of columns) if (isLabelColumn(column.spec)) inputLabelColumns.push(column);\n\t\telse inputValueColumns.push(column);\n\t\tconst unlabeledAxes = [];\n\t\tfor (const column of inputValueColumns) for (const axis of column.spec.axesSpec) {\n\t\t\tconst axisId = getAxisId(axis);\n\t\t\tif (!unlabeledAxes.some((id) => matchAxisId(id, axisId))) unlabeledAxes.push(axisId);\n\t\t}\n\t\tfor (const labelColumn of inputLabelColumns) {\n\t\t\tconst labelAxisId = getAxisId(labelColumn.spec.axesSpec[0]);\n\t\t\tconst labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));\n\t\t\tif (labelMatch !== -1) unlabeledAxes.splice(labelMatch, 1);\n\t\t}\n\t\tconst colId = (id, domain, contextDomain) => {\n\t\t\tlet wid = id.toString();\n\t\t\tif (domain) for (const k in domain) {\n\t\t\t\twid += k;\n\t\t\t\twid += domain[k];\n\t\t\t}\n\t\t\tif (contextDomain) for (const k in contextDomain) {\n\t\t\t\twid += k;\n\t\t\t\twid += contextDomain[k];\n\t\t\t}\n\t\t\treturn wid;\n\t\t};\n\t\tconst labelColumns = [];\n\t\tfor (const labelColumn of allLabelColumns) {\n\t\t\tconst labelAxis = labelColumn.spec.axesSpec[0];\n\t\t\tconst labelAxisId = getAxisId(labelAxis);\n\t\t\tconst labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));\n\t\t\tif (labelMatch !== -1) {\n\t\t\t\tconst axisId = unlabeledAxes[labelMatch];\n\t\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\t\tid: colId(labelColumn.id, axisId.domain, axisId.contextDomain),\n\t\t\t\t\tspec: {\n\t\t\t\t\t\t...labelColumn.spec,\n\t\t\t\t\t\taxesSpec: [{\n\t\t\t\t\t\t\t...axisId,\n\t\t\t\t\t\t\tannotations: labelAxis.annotations\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\tdata: labelColumn.data\n\t\t\t\t});\n\t\t\t\telse labelColumns.push(labelColumn);\n\t\t\t\tunlabeledAxes.splice(labelMatch, 1);\n\t\t\t}\n\t\t}\n\t\treturn labelColumns;\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js\n\tfunction createPTableDefV3(params) {\n\t\tlet query = {\n\t\t\ttype: params.primaryJoinType === \"inner\" ? \"innerJoin\" : \"fullJoin\",\n\t\t\tentries: params.primary.map((a) => toLeaf(a.column, []))\n\t\t};\n\t\tif (params.secondary.length > 0) query = {\n\t\t\ttype: \"outerJoin\",\n\t\t\tprimary: {\n\t\t\t\tentry: query,\n\t\t\t\tqualifications: params.secondary.flatMap((g) => params.primary.flatMap((p) => g.primaryQualifications?.[p.column.id] ?? []))\n\t\t\t},\n\t\t\tsecondary: params.secondary.flatMap((g) => g.entries.map((e) => toJoinEntry(e)))\n\t\t};\n\t\tif (!isNil(params.filters)) {\n\t\t\tconst nonEmpty = distillFilterSpec(params.filters);\n\t\t\tif (!isNil(nonEmpty)) {\n\t\t\t\tconst pridicate = filterSpecToSpecQueryExpr(nonEmpty);\n\t\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\t\tquery = {\n\t\t\t\t\ttype: \"filter\",\n\t\t\t\t\tinput: query,\n\t\t\t\t\tpredicate: pridicate\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (!isNil(params.sorting) && params.sorting.length > 0) query = {\n\t\t\ttype: \"sort\",\n\t\t\tinput: query,\n\t\t\tsortBy: params.sorting.map((s) => ({\n\t\t\t\texpression: columnIdToExpr(s.column),\n\t\t\t\tascending: s.ascending,\n\t\t\t\tnullsFirst: !s.naAndAbsentAreLeastValues\n\t\t\t}))\n\t\t};\n\t\treturn { query };\n\t}\n\tfunction columnIdToExpr(col) {\n\t\treturn col.type === \"axis\" ? {\n\t\t\ttype: \"axisRef\",\n\t\t\tvalue: col.id\n\t\t} : {\n\t\t\ttype: \"columnRef\",\n\t\t\tvalue: col.id\n\t\t};\n\t}\n\tfunction toLeaf(col, qs) {\n\t\treturn {\n\t\t\tentry: {\n\t\t\t\ttype: \"column\",\n\t\t\t\tcolumn: col\n\t\t\t},\n\t\t\tqualifications: qs\n\t\t};\n\t}\n\tfunction toJoinEntry(e) {\n\t\tconst qs = e.qualifications ?? [];\n\t\tif (isNil(e.linkers) || e.linkers.length === 0) return toLeaf(e.column, qs);\n\t\treturn {\n\t\t\t...e.linkers.reduceRight((inner, linker) => ({\n\t\t\t\tentry: {\n\t\t\t\t\ttype: \"linkerJoin\",\n\t\t\t\t\tlinker: { column: linker },\n\t\t\t\t\tsecondary: [inner]\n\t\t\t\t},\n\t\t\t\tqualifications: []\n\t\t\t}), toLeaf(e.column, [])),\n\t\t\tqualifications: qs\n\t\t};\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.js\n\tfunction createPTableDefV2(params) {\n\t\tlet coreColumns = params.columns;\n\t\tconst secondaryColumns = [];\n\t\tif (isFunction(params.coreColumnPredicate)) {\n\t\t\tcoreColumns = [];\n\t\t\tfor (const c of params.columns) if (params.coreColumnPredicate(getColumnIdAndSpec(c))) coreColumns.push(c);\n\t\t\telse secondaryColumns.push(c);\n\t\t}\n\t\tsecondaryColumns.push(...params.labelColumns);\n\t\treturn createPTableDefV3({\n\t\t\tprimary: coreColumns.map((column) => ({ column })),\n\t\t\tsecondary: secondaryColumns.map((column) => ({ entries: [{ column }] })),\n\t\t\tprimaryJoinType: params.coreJoinType,\n\t\t\tfilters: params.filters,\n\t\t\tsorting: params.sorting\n\t\t});\n\t}\n\t//#endregion\n\t//#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.js\n\t/**\n\t* Create p-table spec and handle given ui table state\n\t*\n\t* @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\t* @param ctx context\n\t* @param columns column list\n\t* @param tableState table ui state\n\t* @returns PlAgDataTableV2 table source\n\t*/\n\tfunction createPlDataTableV2(ctx, columns, tableState, options) {\n\t\tif (columns.length === 0) return void 0;\n\t\tconst tableStateNormalized = upgradePlDataTableStateV2(tableState);\n\t\tconst allLabelColumns = getAllLabelColumns(ctx.resultPool) ?? [];\n\t\tlet fullLabelColumns = getMatchingLabelColumns(columns, allLabelColumns);\n\t\tfullLabelColumns = deriveLabels(fullLabelColumns, identity, { includeNativeLabel: true }).map((v) => {\n\t\t\treturn {\n\t\t\t\t...v.value,\n\t\t\t\tspec: {\n\t\t\t\t\t...v.value.spec,\n\t\t\t\t\tannotations: {\n\t\t\t\t\t\t...v.value.spec.annotations,\n\t\t\t\t\t\t[Annotation.Label]: v.label\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t\tconst fullColumns = [...columns, ...fullLabelColumns];\n\t\tconst fullColumnsIds = [...uniqueBy(fullColumns.flatMap((c) => c.spec.axesSpec.map((a) => getAxisId(a))), (a) => canonicalizeJson(a)).map((a) => ({\n\t\t\ttype: \"axis\",\n\t\t\tid: a\n\t\t})), ...fullColumns.map((c) => ({\n\t\t\ttype: \"column\",\n\t\t\tid: c.id\n\t\t}))];\n\t\tconst fullColumnsIdsSet = new Set(fullColumnsIds.map((c) => canonicalizeJson(c)));\n\t\tconst isValidColumnId = (id) => fullColumnsIdsSet.has(id);\n\t\tconst filters = tableStateNormalized.pTableParams.filters;\n\t\tconst defaultFilters = options?.filters ?? void 0;\n\t\tconst firstInvalidFilterColumn = (filters !== null ? collectFilterSpecColumns(filters) : []).find((col) => !isValidColumnId(col));\n\t\tif (firstInvalidFilterColumn) throw new Error(`Invalid filter column ${firstInvalidFilterColumn}: column reference does not match the table columns`);\n\t\tconst firstInvalidDefaultFilterColumn = (defaultFilters !== void 0 ? collectFilterSpecColumns(defaultFilters) : []).find((col) => !isValidColumnId(col));\n\t\tif (firstInvalidDefaultFilterColumn) throw new Error(`Invalid default filter column ${firstInvalidDefaultFilterColumn}: column reference does not match the table columns`);\n\t\tconst userSorting = tableStateNormalized.pTableParams.sorting;\n\t\tconst sorting = (isEmpty(userSorting) ? options?.sorting : userSorting) ?? [];\n\t\tconst firstInvalidSortingColumn = sorting.find((s) => !isValidColumnId(canonicalizeJson(s.column)));\n\t\tif (firstInvalidSortingColumn) throw new Error(`Invalid sorting column ${JSON.stringify(firstInvalidSortingColumn.column)}: column reference does not match the table columns`);\n\t\tconst coreJoinType = options?.coreJoinType ?? \"full\";\n\t\tconst fullDef = createPTableDefV2({\n\t\t\tcolumns,\n\t\t\tlabelColumns: fullLabelColumns,\n\t\t\tcoreJoinType,\n\t\t\tfilters,\n\t\t\tsorting,\n\t\t\tcoreColumnPredicate: options?.coreColumnPredicate\n\t\t});\n\t\tconst fullHandle = ctx.createPTableV2(fullDef);\n\t\tconst pframeHandle = ctx.createPFrame(fullColumns);\n\t\tif (!fullHandle || !pframeHandle) return void 0;\n\t\tconst hiddenColumns = new Set((() => {\n\t\t\tif (coreJoinType === \"inner\") return [];\n\t\t\tconst hiddenColIds = tableStateNormalized.pTableParams.hiddenColIds;\n\t\t\tif (hiddenColIds !== null) return hiddenColIds.filter((s) => s.type === \"column\").map((s) => s.id);\n\t\t\treturn columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);\n\t\t})());\n\t\tcolumns.filter((c) => isLinkerColumn(c.spec)).forEach((c) => hiddenColumns.delete(c.id));\n\t\tconst coreColumnPredicate = options?.coreColumnPredicate;\n\t\tif (coreColumnPredicate) columns.flatMap((c) => coreColumnPredicate(getColumnIdAndSpec(c)) ? [c.id] : []).forEach((c) => hiddenColumns.delete(c));\n\t\tsorting.map((s) => s.column).filter((c) => c.type === \"column\").forEach((c) => hiddenColumns.delete(c.id));\n\t\tif (filters) collectFilterSpecColumns(filters).flatMap((c) => {\n\t\t\tconst obj = parseJson(c);\n\t\t\treturn obj.type === \"column\" ? [obj.id] : [];\n\t\t}).forEach((c) => hiddenColumns.delete(c));\n\t\tconst visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));\n\t\tconst visibleLabelColumns = getMatchingLabelColumns(visibleColumns.map(getColumnIdAndSpec), allLabelColumns);\n\t\tif (!allPColumnsReady([...visibleColumns, ...visibleLabelColumns])) return void 0;\n\t\tconst visibleDef = createPTableDefV2({\n\t\t\tcolumns: visibleColumns,\n\t\t\tlabelColumns: visibleLabelColumns,\n\t\t\tcoreJoinType,\n\t\t\tfilters,\n\t\t\tsorting,\n\t\t\tcoreColumnPredicate\n\t\t});\n\t\tconst visibleHandle = ctx.createPTableV2(visibleDef);\n\t\tif (!visibleHandle) return void 0;\n\t\treturn {\n\t\t\tsourceId: tableStateNormalized.pTableParams.sourceId,\n\t\t\tfullTableHandle: fullHandle,\n\t\t\tfullPframeHandle: pframeHandle,\n\t\t\tvisibleTableHandle: visibleHandle,\n\t\t\tdefaultFilters\n\t\t};\n\t}\n\tfunction getAllLabelColumns(resultPool) {\n\t\treturn new PColumnCollection().addAxisLabelProvider(resultPool).addColumnProvider(resultPool).getColumns({\n\t\t\tname: PColumnName.Label,\n\t\t\taxes: [{}]\n\t\t}, {\n\t\t\tdontWaitAllData: true,\n\t\t\toverrideLabelAnnotation: false\n\t\t});\n\t}\n\t(/* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t\texports = module.exports = stringify;\n\t\texports.getSerialize = serializer;\n\t\tfunction stringify(obj, replacer, spaces, cycleReplacer) {\n\t\t\treturn JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);\n\t\t}\n\t\tfunction serializer(replacer, cycleReplacer) {\n\t\t\tvar stack = [], keys = [];\n\t\t\tif (cycleReplacer == null) cycleReplacer = function(key, value) {\n\t\t\t\tif (stack[0] === value) return \"[Circular ~]\";\n\t\t\t\treturn \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n\t\t\t};\n\t\t\treturn function(key, value) {\n\t\t\t\tif (stack.length > 0) {\n\t\t\t\t\tvar thisPos = stack.indexOf(this);\n\t\t\t\t\t~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n\t\t\t\t\t~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n\t\t\t\t\tif (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value);\n\t\t\t\t} else stack.push(value);\n\t\t\t\treturn replacer == null ? value : replacer.call(this, key, value);\n\t\t\t};\n\t\t}\n\t})))();\n\tconst PlErrorLike = objectType({\n\t\ttype: literalType(\"PlError\"),\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tfullMessage: stringType().optional(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorLike).optional(),\n\t\terrors: lazyType(() => ErrorLike.array()).optional()\n\t});\n\tconst ErrorLike = unionType([objectType({\n\t\ttype: literalType(\"StandardError\"),\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorLike).optional(),\n\t\terrors: lazyType(() => ErrorLike.array()).optional()\n\t}), PlErrorLike]);\n\tconst ErrorShape = objectType({\n\t\tname: stringType(),\n\t\tmessage: stringType(),\n\t\tfullMessage: stringType().optional(),\n\t\tstack: stringType().optional()\n\t}).extend({\n\t\tcause: lazyType(() => ErrorShape).optional(),\n\t\terrors: lazyType(() => ErrorShape.array()).optional()\n\t});\n\t//#endregion\n\t//#region src/dataModel.ts\n\tconst DEFAULT_SCATTER_STATE = {\n\t\ttitle: \"Property Relationships\",\n\t\ttemplate: \"dots\",\n\t\tcurrentTab: null\n\t};\n\tconst DEFAULT_HISTOGRAM_STATE = {\n\t\ttitle: \"Property Distribution\",\n\t\ttemplate: \"bins\",\n\t\tcurrentTab: null,\n\t\tlayersSettings: { bins: { fillColor: \"#99e099\" } }\n\t};\n\tconst blockDataModel = new DataModelBuilder().from(\"Ver_2026_04_28\").migrate(\"Ver_2026_05_05\", (v1) => ({\n\t\t...v1,\n\t\tgraphStateScatter: { ...DEFAULT_SCATTER_STATE },\n\t\tgraphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }\n\t})).init(() => ({\n\t\ttableState: createPlDataTableStateV2(),\n\t\tgraphStateScatter: { ...DEFAULT_SCATTER_STATE },\n\t\tgraphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }\n\t}));\n\t//#endregion\n\t//#region src/index.ts\n\tconst inputAnchorSpecs = [\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t},\n\t\t{\n\t\t\taxes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n\t\t\tannotations: { \"pl7.app/isAnchor\": \"true\" }\n\t\t}\n\t];\n\tconst platforma$1 = BlockModelV3.create(blockDataModel).args((data) => {\n\t\tif (data.inputAnchor === void 0) throw new Error(\"Select an input dataset\");\n\t\treturn { inputAnchor: data.inputAnchor };\n\t}).output(\"inputOptions\", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs)).output(\"inputSpec\", (ctx) => ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : void 0).output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson()).output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false).output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle()).outputWithStatus(\"propertiesTable\", (ctx) => {\n\t\tif (ctx.data.inputAnchor === void 0) return void 0;\n\t\tconst ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (ownCols === void 0) return void 0;\n\t\treturn createPlDataTableV2(ctx, ownCols.filter((c) => c.spec.axesSpec.length === 1), ctx.data.tableState);\n\t}).outputWithStatus(\"propertiesPfHandle\", (ctx) => {\n\t\tconst allPCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (allPCols === void 0) return void 0;\n\t\tconst pCols = allPCols.filter((c) => c.spec.name !== \"pl7.app/aaFraction\");\n\t\tconst inputAnchor = ctx.data.inputAnchor;\n\t\tconst upstreamMeta = inputAnchor !== void 0 ? (ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [{ axes: [{\n\t\t\tanchor: \"main\",\n\t\t\tidx: 0\n\t\t}] }, { axes: [{\n\t\t\tanchor: \"main\",\n\t\t\tidx: 1\n\t\t}] }]) ?? []).filter((c) => !c.spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\")) : [];\n\t\treturn createPFrameForGraphs(ctx, [...pCols, ...upstreamMeta]);\n\t}).output(\"propertiesPfCols\", (ctx) => {\n\t\tconst pCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n\t\tif (pCols === void 0) return void 0;\n\t\treturn pCols.map((c) => ({\n\t\t\tcolumnId: c.id,\n\t\t\tspec: c.spec\n\t\t}));\n\t}).title(() => \"Sequence Properties\").subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\").sections(() => [\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/\",\n\t\t\tlabel: \"Main\"\n\t\t},\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/scatter\",\n\t\t\tlabel: \"Property Relationships\"\n\t\t},\n\t\t{\n\t\t\ttype: \"link\",\n\t\t\thref: \"/histogram\",\n\t\t\tlabel: \"Property Distribution\"\n\t\t}\n\t]).done();\n\t//#endregion\n\texports.blockDataModel = blockDataModel;\n\texports.platforma = platforma$1;\n});\n\n//# sourceMappingURL=bundle.js.map"}}