chunk-RWQH5X3O.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. has
  3. } from "./chunk-SPWQ3AWG.js";
  4. import {
  5. r,
  6. t
  7. } from "./chunk-YXWMMD76.js";
  8. // node_modules/@arcgis/core/views/webgl/context-util.js
  9. var r2;
  10. function o(t2, r3, o2 = {}) {
  11. const l2 = n(t2);
  12. for (; l2.length > 1; ) {
  13. const t3 = c(r3, l2.shift(), o2);
  14. if (r(t3))
  15. return t3;
  16. }
  17. return i(r3, l2.shift(), o2);
  18. }
  19. function n(e) {
  20. const t2 = has("esri-force-webgl");
  21. if (t2 === r2.WEBGL1 || t2 === r2.WEBGL2)
  22. return [t2];
  23. switch (e) {
  24. case "2d":
  25. return has("mac") && has("chrome") ? [r2.WEBGL1, r2.WEBGL2] : [r2.WEBGL2, r2.WEBGL1];
  26. case "3d":
  27. return [r2.WEBGL2, r2.WEBGL1];
  28. }
  29. }
  30. function i(e, r3, o2 = {}) {
  31. if (!window.WebGLRenderingContext)
  32. return l(e, a), null;
  33. const n2 = c(e, r3, o2);
  34. return t(n2) && l(e, s), n2;
  35. }
  36. function c(e, t2, o2 = {}) {
  37. const n2 = t2 === r2.WEBGL1 ? ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"] : ["webgl2"];
  38. let i2 = null;
  39. for (const r3 of n2) {
  40. try {
  41. i2 = e.getContext(r3, o2);
  42. } catch (c2) {
  43. }
  44. if (i2)
  45. break;
  46. }
  47. return i2;
  48. }
  49. function l(e, t2) {
  50. const r3 = e.parentNode;
  51. r3 && (r3.innerHTML = '<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">' + t2 + "</div></div></td></tr></table>");
  52. }
  53. !function(e) {
  54. e[e.WEBGL1 = 1] = "WEBGL1", e[e.WEBGL2 = 2] = "WEBGL2";
  55. }(r2 || (r2 = {}));
  56. var a = 'This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>';
  57. var s = `It doesn't appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>`;
  58. export {
  59. r2 as r,
  60. o,
  61. n,
  62. c
  63. };
  64. //# sourceMappingURL=chunk-RWQH5X3O.js.map