{"version":3,"file":"detectBasis.mjs","sources":["../../../src/compressed-textures/basis/detectBasis.ts"],"sourcesContent":["import { ExtensionType } from '../../extensions/Extensions';\nimport { isWebGLSupported } from '../../utils/browser/isWebGLSupported';\nimport { isWebGPUSupported } from '../../utils/browser/isWebGPUSupported';\n\nimport type { FormatDetectionParser } from '../../assets/detections/types';\n\n/**\n * Detects if Basis textures are supported by the browser.\n * This is done by checking if WebGL or WebGPU is supported.\n * If either is supported, Basis textures can be used.\n * @category assets\n * @internal\n */\nexport const detectBasis = {\n    extension: {\n        type: ExtensionType.DetectionParser,\n        priority: 3,\n    },\n    test: async (): Promise<boolean> =>\n    {\n        if (await isWebGPUSupported()) return true;\n        if (isWebGLSupported()) return true;\n\n        return false;\n    },\n    add: async (formats) => [...formats, 'basis'],\n    remove: async (formats) => formats.filter((f) => f !== 'basis'),\n} as FormatDetectionParser;\n"],"names":[],"mappings":";;;;;AAaO,MAAM,WAAA,GAAc;AAAA,EACvB,SAAA,EAAW;AAAA,IACP,MAAM,aAAA,CAAc,eAAA;AAAA,IACpB,QAAA,EAAU;AAAA,GACd;AAAA,EACA,MAAM,YACN;AACI,IAAA,IAAI,MAAM,iBAAA,EAAkB,EAAG,OAAO,IAAA;AACtC,IAAA,IAAI,gBAAA,IAAoB,OAAO,IAAA;AAE/B,IAAA,OAAO,KAAA;AAAA,EACX,CAAA;AAAA,EACA,KAAK,OAAO,OAAA,KAAY,CAAC,GAAG,SAAS,OAAO,CAAA;AAAA,EAC5C,MAAA,EAAQ,OAAO,OAAA,KAAY,OAAA,CAAQ,OAAO,CAAC,CAAA,KAAM,MAAM,OAAO;AAClE;;;;"}