Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.Device.js.map Maven / Gradle / Ivy
{"version":3,"file":"Device.js","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE9C,MAAM,SAAS,GAAG;IACjB,IAAI,SAAS;QACZ,IAAI,KAAK,EAAE;YACV,OAAO,EAAE,CAAC;SACV;QACD,OAAO,SAAS,CAAC,SAAS,CAAC;IAC5B,CAAC;IACD,IAAI,KAAK;QACR,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,MAAM;QACT,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,OAAO;QACV,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,MAAM;QACT,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,CAAC,SAAS,CAAC,MAAM,IAAI,yCAAyC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACjG,CAAC;IACD,IAAI,MAAM;QACT,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO;QACV,IAAI,KAAK,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QACD,OAAO,SAAS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ACf,OAAO,SAAS,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAY,EAAE;IAC/B,IAAI,KAAK,EAAE;QACV,OAAO,KAAK,CAAC;KACb;IACD,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,iBAAiB,EAAE,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,GAAY,EAAE;IAC7B,OAAO,QAAQ,EAAE,IAAI,SAAS,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,GAAY,EAAE;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,GAAY,EAAE;IAC3B,OAAO,SAAS,CAAC,KAAK,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAY,EAAE;IAC/B,OAAO,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,GACL,CAAC","sourcesContent":["const isSSR = typeof document === \"undefined\";\n\nconst internals = {\n\tget userAgent() {\n\t\tif (isSSR) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn navigator.userAgent;\n\t},\n\tget touch() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n\t},\n\n\tget chrome() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn /(Chrome|CriOS)/.test(internals.userAgent);\n\t},\n\tget firefox() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn /Firefox/.test(internals.userAgent);\n\t},\n\tget safari() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !internals.chrome && /(Version|PhantomJS)\\/(\\d+\\.\\d+).*Safari/.test(internals.userAgent);\n\t},\n\tget webkit() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn /webkit/.test(internals.userAgent);\n\t},\n\tget windows() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn navigator.platform.indexOf(\"Win\") !== -1;\n\t},\n\tget macOS() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !!navigator.userAgent.match(/Macintosh|Mac OS X/i);\n\t},\n\tget iOS() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !!(navigator.platform.match(/iPhone|iPad|iPod/)) || !!(internals.userAgent.match(/Mac/) && \"ontouchend\" in document);\n\t},\n\tget android() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !internals.windows && /Android/.test(internals.userAgent);\n\t},\n\tget androidPhone() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\treturn internals.android && /(?=android)(?=.*mobile)/i.test(internals.userAgent);\n\t},\n\tget ipad() {\n\t\tif (isSSR) {\n\t\t\treturn false;\n\t\t}\n\t\t// With iOS 13 the string 'iPad' was removed from the user agent string through a browser setting, which is applied on all sites by default:\n\t\t// \"Request Desktop Website -> All websites\" (for more infos see: https://forums.developer.apple.com/thread/119186).\n\t\t// Therefore the OS is detected as MACINTOSH instead of iOS and the device is a tablet if the Device.support.touch is true.\n\t\treturn /ipad/i.test(internals.userAgent) || (/Macintosh/i.test(internals.userAgent) && \"ontouchend\" in document);\n\t},\n};\n\nlet windowsVersion: number;\nlet webkitVersion: number;\nlet tablet: boolean;\n\nconst isWindows8OrAbove = () => {\n\tif (isSSR) {\n\t\treturn false;\n\t}\n\n\tif (!internals.windows) {\n\t\treturn false;\n\t}\n\n\tif (windowsVersion === undefined) {\n\t\tconst matches = internals.userAgent.match(/Windows NT (\\d+).(\\d)/);\n\t\twindowsVersion = matches ? parseFloat(matches[1]) : 0;\n\t}\n\n\treturn windowsVersion >= 8;\n};\n\nconst isWebkit537OrAbove = () => {\n\tif (isSSR) {\n\t\treturn false;\n\t}\n\n\tif (!internals.webkit) {\n\t\treturn false;\n\t}\n\n\tif (webkitVersion === undefined) {\n\t\tconst matches = internals.userAgent.match(/(webkit)[ /]([\\w.]+)/);\n\t\twebkitVersion = matches ? parseFloat(matches[1]) : 0;\n\t}\n\n\treturn webkitVersion >= 537.10;\n};\n\nconst detectTablet = () => {\n\tif (isSSR) {\n\t\treturn false;\n\t}\n\n\tif (tablet !== undefined) {\n\t\treturn;\n\t}\n\n\tif (internals.ipad) {\n\t\ttablet = true;\n\t\treturn;\n\t}\n\n\tif (internals.touch) {\n\t\tif (isWindows8OrAbove()) {\n\t\t\ttablet = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (internals.chrome && internals.android) {\n\t\t\ttablet = !/Mobile Safari\\/[.0-9]+/.test(internals.userAgent);\n\t\t\treturn;\n\t\t}\n\n\t\tlet densityFactor = window.devicePixelRatio ? window.devicePixelRatio : 1; // may be undefined in Windows Phone devices\n\t\tif (internals.android && isWebkit537OrAbove()) {\n\t\t\tdensityFactor = 1;\n\t\t}\n\n\t\ttablet = (Math.min(window.screen.width / densityFactor, window.screen.height / densityFactor) >= 600);\n\t\treturn;\n\t}\n\n\ttablet = internals.userAgent.indexOf(\"Touch\") !== -1 || (internals.android && !internals.androidPhone);\n};\n\nconst supportsTouch = (): boolean => internals.touch;\nconst isSafari = (): boolean => internals.safari;\nconst isChrome = (): boolean => internals.chrome;\nconst isFirefox = (): boolean => internals.firefox;\n\nconst isTablet = (): boolean => {\n\tdetectTablet();\n\treturn (internals.touch || isWindows8OrAbove()) && tablet;\n};\n\nconst isPhone = (): boolean => {\n\tdetectTablet();\n\treturn internals.touch && !tablet;\n};\n\nconst isDesktop = (): boolean => {\n\tif (isSSR) {\n\t\treturn false;\n\t}\n\treturn (!isTablet() && !isPhone()) || isWindows8OrAbove();\n};\n\nconst isCombi = (): boolean => {\n\treturn isTablet() && isDesktop();\n};\n\nconst isIOS = (): boolean => {\n\treturn internals.iOS;\n};\n\nconst isMac = (): boolean => {\n\treturn internals.macOS;\n};\n\nconst isAndroid = (): boolean => {\n\treturn internals.android || internals.androidPhone;\n};\n\nexport {\n\tsupportsTouch,\n\tisSafari,\n\tisChrome,\n\tisFirefox,\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n\tisCombi,\n\tisIOS,\n\tisAndroid,\n\tisMac,\n};\n"]}