{"version":3,"file":"uid.mjs","sources":["../../../src/utils/data/uid.ts"],"sourcesContent":["const uidCache: Record<string, number> = {\n    default: -1,\n};\n\n/**\n * The names of the unique identifiers. These are used to create unique identifiers for different types of objects.\n * @category utils\n * @internal\n */\nexport type UIDNames =\n    | 'default'\n    | 'resource'\n    | 'texture'\n    | 'textureSource'\n    | 'textureResource'\n    | 'batcher' //\n    | 'graphicsContext' //\n    | 'graphicsView' //\n    | 'graphicsPath' //\n    | 'fillGradient' //\n    | 'fillPattern' //\n    | 'meshView' //\n    | 'renderable' //\n    | 'buffer' //\n    | 'bufferResource' //\n    | 'geometry'\n    | 'instructionSet' //\n    | 'renderTarget' //\n    | 'uniform' //\n    | 'spriteView' //\n    | 'textView' //\n    | 'tilingSpriteView' //\n    | 'shader' //\n    | 'renderer' //\n    | 'textStyle'\n    | (string & {});\n\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @returns {number} The next unique identifier to use.\n * @category utils\n * @internal\n */\nexport function uid(name: UIDNames = 'default'): number\n{\n    if (uidCache[name] === undefined)\n    {\n        uidCache[name] = -1;\n    }\n\n    return ++uidCache[name];\n}\n\n/**\n * Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :)\n * @internal\n */\nexport function resetUids(): void\n{\n    for (const key in uidCache)\n    {\n        delete uidCache[key];\n    }\n}\n"],"names":[],"mappings":";AAAA,MAAM,QAAA,GAAmC;AAAA,EACrC,OAAA,EAAS,CAAA;AACb,CAAA;AA0CO,SAAS,GAAA,CAAI,OAAiB,SAAA,EACrC;AACI,EAAA,IAAI,QAAA,CAAS,IAAI,CAAA,KAAM,KAAA,CAAA,EACvB;AACI,IAAA,QAAA,CAAS,IAAI,CAAA,GAAI,CAAA,CAAA;AAAA,EACrB;AAEA,EAAA,OAAO,EAAE,SAAS,IAAI,CAAA;AAC1B;AAMO,SAAS,SAAA,GAChB;AACI,EAAA,KAAA,MAAW,OAAO,QAAA,EAClB;AACI,IAAA,OAAO,SAAS,GAAG,CAAA;AAAA,EACvB;AACJ;;;;"}