{"version":3,"file":"modal-token-wEQqBBXI.js","sources":["../../../src/packages/core/modal/token/modal-token.ts"],"sourcesContent":["import type { UmbModalConfig } from '../context/modal-manager.context.js';\n\nexport interface UmbModalTokenDefaults<\n\tModalDataType extends { [key: string]: any } = { [key: string]: any },\n\tModalValueType = unknown,\n> {\n\tmodal?: UmbModalConfig;\n\tdata?: ModalDataType;\n\tvalue?: ModalValueType;\n}\n\nexport class UmbModalToken<\n\tModalDataType extends { [key: string]: any } = { [key: string]: any },\n\tModalValueType = unknown,\n> {\n\t/**\n\t * Get the data type of the token's data.\n\t * @public\n\t * @type {ModalDataType}\n\t * @memberOf UmbModalToken\n\t * @example `typeof MyModal.TYPE`\n\t * @returns undefined\n\t */\n\treadonly DATA: ModalDataType = undefined as never;\n\n\t/**\n\t * Get the value type of the token\n\t * @public\n\t * @type {ModalValueType}\n\t * @memberOf UmbModalToken\n\t * @example `typeof MyModal.VALUE`\n\t * @returns undefined\n\t */\n\treadonly VALUE: ModalValueType = undefined as never;\n\n\t#alias;\n\t#defaults;\n\n\t/**\n\t * @param alias Unique identifier for the token,\n\t * @param defaults Defaults for the modal,\n\t */\n\tconstructor(alias: string, defaults?: UmbModalTokenDefaults) {\n\t\tthis.#alias = alias;\n\t\tthis.#defaults = defaults;\n\t}\n\n\t/**\n\t * This method must always return the unique alias of the token since that\n\t * will be used to look up the token in the injector.\n\t * @returns the unique alias of the token\n\t */\n\ttoString(): string {\n\t\treturn this.#alias;\n\t}\n\n\tpublic getDefaultModal(): UmbModalConfig | undefined {\n\t\treturn this.#defaults?.modal;\n\t}\n\n\tpublic getDefaultData(): ModalDataType | undefined {\n\t\treturn this.#defaults?.data;\n\t}\n\n\tpublic getDefaultValue(): ModalValueType | undefined {\n\t\treturn this.#defaults?.value;\n\t}\n}\n"],"names":["UmbModalToken","alias","defaults","#alias","#defaults"],"mappings":"AAWO,MAAMA,EAGX;AAAA;AAAA;AAAA;AAAA;AAAA,EA4BD,YAAYC,GAAeC,GAAiE;AAnB5F,SAAS,OAAsB,QAU/B,KAAS,QAAwB,QAUhC,KAAKC,KAASF,GACd,KAAKG,KAAYF;AAAA,EAClB;AAAA,EAVAC;AAAA,EACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,WAAmB;AAClB,WAAO,KAAKD;AAAA,EACb;AAAA,EAEO,kBAA8C;AACpD,WAAO,KAAKC,IAAW;AAAA,EACxB;AAAA,EAEO,iBAA4C;AAClD,WAAO,KAAKA,IAAW;AAAA,EACxB;AAAA,EAEO,kBAA8C;AACpD,WAAO,KAAKA,IAAW;AAAA,EACxB;AACD;"}