detect-features
Version:
Detect and report browser and hardware features
3 lines (2 loc) • 22.1 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).DetectFeatures={})}(this,(function(e){"use strict";function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{d(n.next(e))}catch(e){o(e)}}function s(e){try{d(n.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}d((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function n(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{d(n.next(e))}catch(e){o(e)}}function s(e){try{d(n.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}d((n=n.apply(e,t||[])).next())}))}const i=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","radeon r9 200","sgx 543","sgx543"],o=e=>e.toLowerCase().replace(/angle \((.+)\)*$/,"$1").replace(/\s+([0-9]+gb|direct3d.+$)|\(r\)| \([^\)]+\)$/g,""),a=(()=>{const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),i="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(e)||n||i,isSafari12:/Version\/12.+Safari/.test(e)}})(),s=[],d=[],c=(e,t)=>{if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,i=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-i);)n--,i--;let o,a=0;for(;a<n&&e.charCodeAt(a)===t.charCodeAt(a);)a++;if(n-=a,i-=a,0===n)return i;let c,u,p=0,m=0,l=0;for(;m<n;)d[m]=e.charCodeAt(a+m),s[m]=++m;for(;l<i;)for(o=t.charCodeAt(a+l),c=l++,p=l,m=0;m<n;m++)u=o===d[m]?c:c+1,c=s[m],p=s[m]=c>p?u>p?p+1:u:u>c?c+1:u;return p},u="undefined"==typeof window,p={},m=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:{renderer:r,isIpad:s=Boolean(null==a?void 0:a.isIpad),isMobile:d=Boolean(null==a?void 0:a.isMobile),screenSize:m=window.screen,loadBenchmarks:l}={},glContext:g,failIfMajorPerformanceCaveat:f=!1,benchmarksURL:h="https://unpkg.com/detect-gpu@2.0.3/dist/benchmarks"}={})=>n(void 0,void 0,void 0,(function*(){if(u)return{tier:0,type:"IS_SRR"};const x=(e,t,r,n,i)=>({device:i,fps:n,gpu:r,isMobile:d,tier:e,type:t});let w;if(r)w=[r=o(r)];else{const e=g||((e,t=!1)=>{const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=document.createElement("canvas");return n.getContext("webgl",r)||n.getContext("experimental-webgl",r)||void 0})(null==a?void 0:a.isSafari12,f);if(!e)return x(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(r=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!r)return x(1,"FALLBACK");w=((e,t,r)=>"apple gpu"===t?((e,t,r)=>{let n=[t];if(r){const t="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",r="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",i=e.createShader(35633),o=e.createShader(35632),s=e.createProgram();if(o&&i&&s){e.shaderSource(i,t),e.shaderSource(o,r),e.compileShader(i),e.compileShader(o),e.attachShader(s,i),e.attachShader(s,o),e.linkProgram(s),e.detachShader(s,i),e.detachShader(s,o),e.deleteShader(i),e.deleteShader(o),e.useProgram(s);const d=e.createBuffer();e.bindBuffer(34962,d),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const c=e.getAttribLocation(s,"aPosition");e.vertexAttribPointer(c,3,5126,!1,0,0),e.enableVertexAttribArray(c),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const u=new Uint8Array(4);e.readPixels(0,0,1,1,6408,5121,u),e.deleteProgram(s),e.deleteBuffer(d),n={801621810:(null==a?void 0:a.isIpad)?["apple a12x gpu"]:["apple a11 gpu","apple a12 gpu","apple a13 gpu"],8016218135:(null==a?void 0:a.isIpad)?["apple a9x gpu","apple a10 gpu","apple a10x gpu"]:["apple a9 gpu","apple a10 gpu"]}[u.join("")]||n}}return n})(e,t,r):[t])(e,r=o(r),d)}const b=yield Promise.all(w.map((e=>((e=(e=>n(void 0,void 0,void 0,(function*(){try{const t=yield fetch(`${h}/${e}`).then((e=>e.json()));return t.shift(),t}catch(e){return void console.error(e)}}))),t)=>n(void 0,void 0,void 0,(function*(){const r=d?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","amd","radeon","nvidia","geforce"];let n;for(let e=0;e<r.length;e++){const i=r[e];if(t.indexOf(i)>-1){n=i;break}}if(!n)return[];const i=`${d?"m":"d"}-${n}.json`,o=p[i]=p[i]||e(i),a=yield o;if(!a)return[];const u=(e=>{var t;const r=(e=e.replace(/\([^\)]+\)/,"")).match(/[\d]+/)||e.match(/(\W|^)([a-zA-Z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""})(t),l="apple"===n;let g=a.filter((([,e])=>e===u));g.length||(g=a.filter((([e])=>e.indexOf(t)>-1)));const f=g.length;if(0===f)return[];let h,[x,,,w]=f>1?g.map((e=>[e,c(t,e[0])])).sort((([,e],[,t])=>e-t))[0][0]:g[0],b=Number.MAX_VALUE;const{devicePixelRatio:v}=window,S=m.width*v*(m.height*v);l&&d&&(w=w.filter((([,,,e])=>{var t;return(null!==(t=null==e?void 0:e.indexOf(s?"ipad":"iphone"))&&void 0!==t?t:-1)>-1})));for(let e=0;e<w.length;e++){const t=w[e],[r,n]=t,i=r*n,o=Math.abs(S-i);o<b&&(b=o,h=t)}const[,,_,E]=h;return[b,_,x,E]})))(l,e)))),v=1===b.length?b[0]:b.sort((([e=Number.MAX_VALUE],[t=Number.MAX_VALUE])=>e-t))[0];if(0===v.length)return i.filter((e=>(null==r?void 0:r.indexOf(e))>-1))[0]?x(0,"BLOCKLISTED",r):x(1,"FALLBACK",r);const[,S,_,E]=v;if(-1===S)return x(0,"BLOCKLISTED",_,S,E);const A=d?e:t;let y=0;for(let e=0;e<A.length;e++)S>=A[e]&&(y=e);return x(y,"BENCHMARK",_,S,E)}));var l="undefined"==typeof window,g=new(function(){function e(e){this.userAgent=e||(!l&&window.navigator?window.navigator.userAgent:""),this.isAndroidDevice=!/like android/i.test(this.userAgent)&&/android/i.test(this.userAgent),this.iOSDevice=this.match(1,/(iphone|ipod|ipad)/i).toLowerCase(),!l&&"MacIntel"===navigator.platform&&navigator.maxTouchPoints>2&&!window.MSStream&&(this.iOSDevice="ipad")}return e.prototype.match=function(e,t){var r=this.userAgent.match(t);return r&&r.length>1&&r[e]||""},Object.defineProperty(e.prototype,"isMobile",{get:function(){return!this.isTablet&&(/[^-]mobi/i.test(this.userAgent)||"iphone"===this.iOSDevice||"ipod"===this.iOSDevice||this.isAndroidDevice||/nexus\s*[0-6]\s*/i.test(this.userAgent))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTablet",{get:function(){return/tablet/i.test(this.userAgent)&&!/tablet pc/i.test(this.userAgent)||"ipad"===this.iOSDevice||this.isAndroidDevice&&!/[^-]mobi/i.test(this.userAgent)||!/nexus\s*[0-6]\s*/i.test(this.userAgent)&&/nexus\s*[0-9]+/i.test(this.userAgent)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDesktop",{get:function(){return!this.isMobile&&!this.isTablet},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMacOS",{get:function(){return/macintosh/i.test(this.userAgent)&&{version:this.match(1,/mac os x (\d+(\.?_?\d+)+)/i).replace(/[_\s]/g,".").split(".").map((function(e){return e}))[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWindows",{get:function(){return/windows /i.test(this.userAgent)&&{version:this.match(1,/Windows ((NT|XP)( \d\d?.\d)?)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isiOS",{get:function(){return!!this.iOSDevice&&{version:this.match(1,/os (\d+([_\s]\d+)*) like mac os x/i).replace(/[_\s]/g,".")||this.match(1,/version\/(\d+(\.\d+)?)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAndroid",{get:function(){return this.isAndroidDevice&&{version:this.match(1,/android[ \/-](\d+(\.\d+)*)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"browser",{get:function(){var e=this.match(1,/version\/(\d+(\.\d+)?)/i);return/opera/i.test(this.userAgent)?{name:"Opera",version:e||this.match(1,/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(this.userAgent)?{name:"Opera",version:this.match(1,/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||e}:/SamsungBrowser/i.test(this.userAgent)?{name:"Samsung Internet for Android",version:e||this.match(1,/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(this.userAgent)?{name:"Yandex Browser",version:e||this.match(1,/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(this.userAgent)?{name:"UC Browser",version:this.match(1,/(?:ucbrowser)[\s\/](\d+(\.\d+)?)/i)}:/msie|trident/i.test(this.userAgent)?{name:"Internet Explorer",version:this.match(1,/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/(edge|edgios|edga|edg)/i.test(this.userAgent)?{name:"Microsoft Edge",version:this.match(2,/(edge|edgios|edga|edg)\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(this.userAgent)?{name:"Firefox",version:this.match(1,/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)}:/chromium/i.test(this.userAgent)?{name:"Chromium",version:this.match(1,/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||e}:/chrome|crios|crmo/i.test(this.userAgent)?{name:"Chrome",version:this.match(1,/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/safari|applewebkit/i.test(this.userAgent)?{name:"Safari",version:e}:{name:this.match(1,/^(.*)\/(.*) /),version:this.match(2,/^(.*)\/(.*) /)}},enumerable:!1,configurable:!0}),e}()),f=g.isMobile,h=g.isTablet,x=g.isDesktop,w=g.isiOS,b=g.isAndroid,v=g.browser,S="object"==typeof v&&"Chrome"===v.name,_="object"==typeof v&&"Firefox"===v.name,E="object"==typeof v&&"Safari"===v.name,A="object"==typeof v&&"Microsoft Edge"===v.name,y="object"==typeof v&&"Internet Explorer"===v.name,C="object"==typeof v&&"Opera"===v.name,T="object"==typeof v&&"Samsung Internet for Android"===v.name,B="object"==typeof v&&"Yandex Browser"===v.name,P="object"==typeof v&&"UC Browser"===v.name,W="object"==typeof v&&"Chromium"===v.name,M={browserName:"object"==typeof v&&v.name||"",browserVersion:"object"==typeof v&&v.version||"",isAndroid:b,isChrome:S,isChromium:W,isDesktop:x,isEdge:A,isFirefox:_,isInternetExplorer:y,isMobile:f,isOpera:C,isSafari:E,isSamsungBrowser:T,isTablet:h,isUCBrowser:P,isYandexBrowser:B,isiOS:w},L=function(){var e=new Audio,t=document.createElement("video");function r(e,t){var r=e.canPlayType(t);return!("probably"!==r&&"maybe"!==r)}return{audio:{MP3:r(e,"audio/mpeg"),Ogg:r(e,"audio/ogg"),WAV:r(e,"audio/wav")},video:{HLS:r(t,"application/vnd.apple.mpegURL")||r(t,"application/x-mpegurl"),MP4:r(t,"video/mp4"),Ogg:r(t,"video/ogg"),WebM:r(t,"video/webm")}}}();const k=35632,O=35633,R=36336,U=36337,I=36338;var D,G,V=function(e,t){return e.getParameter(t)},j=function(e,t,r){return e.getShaderPrecisionFormat(t,r)},F=function(e,t){return e.getExtension(t)},N=function(){var e={stencil:!0},t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);if(!(r&&r instanceof WebGLRenderingContext))return!1;var n=F(r,"WEBGL_debug_renderer_info");r.enable(2960);var i=F(r,"EXT_texture_filter_anisotropic")||F(r,"WEBKIT_EXT_texture_filter_anisotropic")||F(r,"MOZ_EXT_texture_filter_anisotropic"),o=F(r,"WEBGL_draw_buffers");return{base:{renderer:V(r,7937),rendererUnmasked:n&&V(r,n.UNMASKED_RENDERER_WEBGL),shaderVersion:V(r,35724),vendor:V(r,7936),vendorUnmasked:n&&V(r,n.UNMASKED_VENDOR_WEBGL),version:V(r,7938)},general:{aliasedLineWidthRange:V(r,33902).toString(),aliasedPointSizeRange:V(r,33901).toString(),alphaBits:V(r,3413),antialias:!!r.getContextAttributes().antialias,blueBits:V(r,3412),depthBits:V(r,3414),greenBits:V(r,3411),maxCombinedTextureImageUnits:V(r,35661),maxCubeMapTextureSize:V(r,34076),maxFragmentUniformVectors:V(r,36349),maxRenderBufferSize:V(r,34024),maxTextureImageUnits:V(r,34930),maxTextureSize:V(r,3379),maxVaryingVectors:V(r,36348),maxVertexAttributes:V(r,34921),maxVertexTextureImageUnits:V(r,35660),maxVertexUniformVectors:V(r,36347),maxViewportDimensions:V(r,3386).toString(),precision:{fragmentShaderHighPrecision:[j(r,k,I).rangeMin,j(r,k,I).rangeMax,j(r,k,I).precision].toString(),fragmentShaderLowPrecision:[j(r,k,R).rangeMin,j(r,k,R).rangeMax,j(r,k,R).precision].toString(),fragmentShaderMediumPrecision:[j(r,k,U).rangeMin,j(r,k,U).rangeMax,j(r,k,U).precision].toString(),vertexShaderHighPrecision:[j(r,O,I).rangeMin,j(r,O,I).rangeMax,j(r,O,I).precision].toString(),vertexShaderLowPrecision:[j(r,O,R).rangeMin,j(r,O,R).rangeMax,j(r,O,R).precision].toString(),vertexShaderMediumPrecision:[j(r,O,U).rangeMin,j(r,O,U).rangeMax,j(r,O,U).precision].toString()},redBits:V(r,3410),stencilBits:V(r,3415),subPixelBits:V(r,3408)},extensions:{maxAnisotropy:i?V(r,i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,maxDrawBuffers:o?V(r,o.MAX_DRAW_BUFFERS_WEBGL):0,supportedExtensions:r.getSupportedExtensions(),compressedTextureASTCExtension:F(r,"WEBGL_compressed_texture_astc")||null,compressedTextureATCExtension:F(r,"WEBGL_compressed_texture_atc")||null,compressedTextureETC1Extension:F(r,"WEBGL_compressed_texture_etc1")||null,compressedTextureETCExtension:F(r,"WEBGL_compressed_texture_etc")||null,compressedTexturePVRTCExtension:F(r,"WEBGL_compressed_texture_pvrtc")||F(r,"WEBKIT_WEBGL_compressed_texture_pvrtc")||null,compressedTextureS3TCExtension:F(r,"WEBGL_compressed_texture_s3tc")||null,compressedTextureS3TCSRGBExtension:F(r,"WEBGL_compressed_texture_s3tc_srgb")||null}}}(),X=function(){var e=document.createElement("canvas").getContext("webgl2",{stencil:!0});if(!(e&&e instanceof WebGL2RenderingContext))return!1;var t=F(e,"WEBGL_debug_renderer_info");e.enable(2960);var r=F(e,"EXT_texture_filter_anisotropic")||F(e,"WEBKIT_EXT_texture_filter_anisotropic")||F(e,"MOZ_EXT_texture_filter_anisotropic");return{base:{renderer:V(e,7937),rendererUnmasked:t&&V(e,t.UNMASKED_RENDERER_WEBGL),shaderVersion:V(e,35724),vendor:V(e,7936),vendorUnmasked:t&&V(e,t.UNMASKED_VENDOR_WEBGL),version:V(e,7938)},general:{aliasedLineWidthRange:V(e,33902).toString(),aliasedPointSizeRange:V(e,33901).toString(),alphaBits:V(e,3413),antialias:!!e.getContextAttributes().antialias,blueBits:V(e,3412),depthBits:V(e,3414),greenBits:V(e,3411),maxCombinedTextureImageUnits:V(e,35661),maxCubeMapTextureSize:V(e,34076),maxFragmentUniformVectors:V(e,36349),maxRenderBufferSize:V(e,34024),maxTextureImageUnits:V(e,34930),maxTextureSize:V(e,3379),maxVaryingVectors:V(e,36348),maxVertexAttributes:V(e,34921),maxVertexTextureImageUnits:V(e,35660),maxVertexUniformVectors:V(e,36347),maxViewportDimensions:V(e,3386).toString(),precision:{fragmentShaderHighPrecision:[j(e,k,I).rangeMin,j(e,k,I).rangeMax,j(e,k,I).precision].toString(),fragmentShaderLowPrecision:[j(e,k,R).rangeMin,j(e,k,R).rangeMax,j(e,k,R).precision].toString(),fragmentShaderMediumPrecision:[j(e,k,U).rangeMin,j(e,k,U).rangeMax,j(e,k,U).precision].toString(),vertexShaderHighPrecision:[j(e,O,I).rangeMin,j(e,O,I).rangeMax,j(e,O,I).precision].toString(),vertexShaderLowPrecision:[j(e,O,R).rangeMin,j(e,O,R).rangeMax,j(e,O,R).precision].toString(),vertexShaderMediumPrecision:[j(e,O,U).rangeMin,j(e,O,U).rangeMax,j(e,O,U).precision].toString()},redBits:V(e,3410),stencilBits:V(e,3415),subPixelBits:V(e,3408)},extensions:{maxAnisotropy:r?V(e,r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,supportedExtensions:e.getSupportedExtensions(),compressedTextureASTCExtension:F(e,"WEBGL_compressed_texture_astc")||null,compressedTextureATCExtension:F(e,"WEBGL_compressed_texture_atc")||null,compressedTextureETC1Extension:F(e,"WEBGL_compressed_texture_etc1")||null,compressedTextureETCExtension:F(e,"WEBGL_compressed_texture_etc")||null,compressedTexturePVRTCExtension:F(e,"WEBGL_compressed_texture_pvrtc")||F(e,"WEBKIT_WEBGL_compressed_texture_pvrtc")||null,compressedTextureS3TCExtension:F(e,"WEBGL_compressed_texture_s3tc")||null,compressedTextureS3TCSRGBExtension:F(e,"WEBGL_compressed_texture_s3tc_srgb")||null},specific:{max3DTextureSize:V(e,32883),maxArrayTextureLayers:V(e,35071),maxClientWaitTimeout:V(e,37447),maxColorAttachments:V(e,36063),maxCombinedFragmentUniformComponents:V(e,35379),maxCombinedUniformBlocks:V(e,35374),maxCombinedVertexUniformComponents:V(e,35377),maxDrawBuffers:V(e,34852),maxElementIndex:V(e,36203),maxElementsIndices:V(e,33001),maxElementsVertices:V(e,33e3),maxFragmentInputComponents:V(e,37157),maxFragmentUniformBlocks:V(e,35373),maxFragmentUniformComponents:V(e,35657),maxProgramTexelOffset:V(e,35077),maxSamples:V(e,36183),maxServerWaitTimeout:V(e,37137),maxTextureLODBias:V(e,34045),maxTransformFeedbackInterleavedComponents:V(e,35978),maxTransformFeedbackSeparateAttribs:V(e,35979),maxTransformFeedbackSeparateComponents:V(e,35968),maxUniformBlockSize:V(e,35376),maxUniformBufferBindings:V(e,35375),maxVaryingComponents:V(e,35659),maxVertexOutputComponents:V(e,37154),maxVertexUniformBlocks:V(e,35371),maxVertexUniformComponents:V(e,35658),minProgramTexelOffset:V(e,35076),uniformBufferOffsetAlignment:V(e,35380)}}}(),z=!!window.CSS&&!!window.CSS.animationWorklet||!1,K=!!window.AudioWorklet||!1,$=!!window.BroadcastChannel||!1,q=!!window.crypto&&!!window.crypto.getRandomValues||!1,H=!!window.fetch||!1,Y=!!window.Gamepad||!1,Z=!!window.ImageBitmap&&!!window.createImageBitmap||!1,J=function(){try{return!!(new Image).decode}catch(e){return!1}}(),Q=function(){try{return!!window.indexedDB}catch(e){return!1}}(),ee=!!window.IntersectionObserver||!1,te=!!window.CSS&&!!window.CSS.layoutWorklet||!1,re=function(){try{return!!window.localStorage}catch(e){return!1}}(),ne=!!window.MutationObserver||!1,ie=!!window.OffscreenCanvas||!1,oe=!!window.CSS&&!!window.CSS.paintWorklet||!1,ae=!(!window.performance||!window.performance.now)||!1,se=!!window.PerformanceObserver||!1,de=!!window.requestIdleCallback||!1,ce=!!navigator.serviceWorker||!1,ue=function(){try{return!!window.sessionStorage}catch(e){return!1}}(),pe=function(){try{return!!navigator.userActivation}catch(e){return!1}}(),me=!!window.WebAssembly||!1,le=!!window.AudioContext||!!window.webkitAudioContext||!1,ge=((D=document.createElement("canvas")).width=1,D.height=1,!!D.toDataURL&&5===D.toDataURL("image/webp").indexOf("image/webp")),fe=!!(window.RTCPeerConnection&&window.RTCDataChannelEvent||window.webkitRTCPeerConnection||window.mozRTCPeerConnection||window.msRTCPeerConnection||window.oRTCPeerConnection),he=!!window.WebSocket||!1,xe=!!navigator.getVRDisplays||!1,we=function(){try{var e=window.URL||window.webkitURL;if(void 0===e||void 0===window.Blob||void 0===window.Worker)return!1;var t=new Blob([""]),r=e.createObjectURL(t),n=new Worker(r);return e.revokeObjectURL(r),!!n&&(n.terminate(),!0)}catch(e){return!1}}(),be=!!window.Worker||!1,ve=!!navigator.xr||!1,Se=!!navigator.cookieEnabled||!1,_e=!(!(G=navigator.doNotTrack||!1)||"unspecified"===G),Ee=navigator.hardwareConcurrency||0,Ae=window.devicePixelRatio||1,ye=function(){if(null!==window.ArrayBuffer){var e=new ArrayBuffer(4),t=new Uint32Array(e),r=new Uint8Array(e);return t[0]=1,1===r[0]?"little":"big"}return"Unknown"}();e.getFeatures=function(){return t(void 0,void 0,void 0,(function(){var e,t;return r(this,(function(r){switch(r.label){case 0:return e={browserFeatures:{browserType:M,isAnimationWorkletSupported:z,isAudioWorkletSupported:K,isBroadcastChannelSupported:$,isCryptoSupported:q,isFetchSupported:H,isGamepadSupported:Y,isImageBitmapSupported:Z,isImageDecodeSupported:J,isIndexedDBSupported:Q,isIntersectionObserverSupported:ee,isLayoutWorkletSupported:te,isLocalStorageSupported:re,isMutationObserverSupported:ne,isOffscreenCanvasSupported:ie,isPaintWorkletSupported:oe,isPerformanceNowSupported:ae,isPerformanceObserverSupported:se,isRequestIdleCallbackSupported:de,isServiceWorkerSupported:ce,isSessionStorageSupported:ue,isUserActivationSupported:pe,isWebAssemblySupported:me,isWebAudioSupported:le,isWebGL2Supported:!1!==X,isWebGLSupported:!1!==N,isWebPSupported:ge,isWebRTCSupported:fe,isWebSocketSupported:he,isWebVRSupported:xe,isWebWorkerInlineSupported:we,isWebWorkerSupported:be,isWebXRSupported:ve,mediaFeatures:L,webGL2Features:X,webGLFeatures:N},browserSettings:{isCookieEnabled:Se,isDoNotTrackEnabled:_e}},t={},[4,m()];case 1:return e.hardwareFeatures=(t.GPUTier=r.sent(),t.availableCPUCores=Ee,t.devicePixelRatio=Ae,t.endianness=ye,t),[2,e]}}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=detect-features.umd.js.map