@deck.gl/geo-layers 8.10.0-alpha.7 → 9.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/dist.dev.js +2374 -19037
  2. package/dist/es5/geo-cell-layer/GeoCellLayer.js.map +1 -1
  3. package/dist/es5/geohash-layer/geohash-layer.js.map +1 -1
  4. package/dist/es5/great-circle-layer/great-circle-layer.js.map +1 -1
  5. package/dist/es5/h3-layers/h3-cluster-layer.js +10 -1
  6. package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
  7. package/dist/es5/h3-layers/h3-hexagon-layer.js.map +1 -1
  8. package/dist/es5/index.js +0 -8
  9. package/dist/es5/index.js.map +1 -1
  10. package/{src/mesh-layer/mesh-layer.ts → dist/es5/mesh-layer/mesh-layer.ts.disabled} +8 -7
  11. package/dist/es5/mvt-layer/mvt-layer.js +15 -6
  12. package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
  13. package/dist/es5/quadkey-layer/quadkey-layer.js.map +1 -1
  14. package/dist/es5/s2-layer/s2-layer.js.map +1 -1
  15. package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
  16. package/{src/tile-3d-layer/tile-3d-layer.ts → dist/es5/tile-3d-layer/tile-3d-layer.ts.disabled} +9 -9
  17. package/dist/es5/tile-layer/tile-layer.js +19 -9
  18. package/dist/es5/tile-layer/tile-layer.js.map +1 -1
  19. package/dist/es5/tileset-2d/tile-2d-traversal.js.map +1 -1
  20. package/dist/es5/tileset-2d/tileset-2d.js +1 -1
  21. package/dist/es5/tileset-2d/tileset-2d.js.map +1 -1
  22. package/dist/es5/tileset-2d/utils.js +2 -3
  23. package/dist/es5/tileset-2d/utils.js.map +1 -1
  24. package/dist/es5/trips-layer/trips-layer.js.map +1 -1
  25. package/dist/es5/wms-layer/wms-layer.js +6 -8
  26. package/dist/es5/wms-layer/wms-layer.js.map +1 -1
  27. package/dist/esm/geo-cell-layer/GeoCellLayer.js.map +1 -1
  28. package/dist/esm/geohash-layer/geohash-layer.js.map +1 -1
  29. package/dist/esm/great-circle-layer/great-circle-layer.js.map +1 -1
  30. package/dist/esm/h3-layers/h3-cluster-layer.js +5 -0
  31. package/dist/esm/h3-layers/h3-cluster-layer.js.map +1 -1
  32. package/dist/esm/h3-layers/h3-hexagon-layer.js.map +1 -1
  33. package/dist/esm/index.js +0 -1
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/mesh-layer/mesh-layer.ts.disabled +176 -0
  36. package/dist/esm/mvt-layer/mvt-layer.js +6 -1
  37. package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
  38. package/dist/esm/quadkey-layer/quadkey-layer.js.map +1 -1
  39. package/dist/esm/s2-layer/s2-layer.js.map +1 -1
  40. package/dist/esm/terrain-layer/terrain-layer.js.map +1 -1
  41. package/dist/esm/tile-3d-layer/tile-3d-layer.ts.disabled +436 -0
  42. package/dist/esm/tile-layer/tile-layer.js +10 -6
  43. package/dist/esm/tile-layer/tile-layer.js.map +1 -1
  44. package/dist/esm/tileset-2d/tile-2d-traversal.js.map +1 -1
  45. package/dist/esm/tileset-2d/tileset-2d.js +1 -1
  46. package/dist/esm/tileset-2d/tileset-2d.js.map +1 -1
  47. package/dist/esm/tileset-2d/utils.js +2 -2
  48. package/dist/esm/tileset-2d/utils.js.map +1 -1
  49. package/dist/esm/trips-layer/trips-layer.js.map +1 -1
  50. package/dist/esm/wms-layer/wms-layer.js +5 -5
  51. package/dist/esm/wms-layer/wms-layer.js.map +1 -1
  52. package/dist.min.js +29 -161
  53. package/package.json +14 -14
  54. package/src/geo-cell-layer/GeoCellLayer.ts +1 -1
  55. package/src/geohash-layer/geohash-layer.ts +2 -2
  56. package/src/great-circle-layer/great-circle-layer.ts +1 -1
  57. package/src/h3-layers/h3-cluster-layer.ts +6 -2
  58. package/src/h3-layers/h3-hexagon-layer.ts +2 -2
  59. package/src/index.ts +4 -2
  60. package/src/mesh-layer/mesh-layer.ts.disabled +176 -0
  61. package/src/mvt-layer/mvt-layer.ts +16 -6
  62. package/src/quadkey-layer/quadkey-layer.ts +3 -2
  63. package/src/s2-layer/s2-layer.ts +2 -2
  64. package/src/terrain-layer/terrain-layer.ts +2 -2
  65. package/src/tile-3d-layer/tile-3d-layer.ts.disabled +436 -0
  66. package/src/tile-layer/tile-layer.ts +20 -10
  67. package/src/tileset-2d/tile-2d-traversal.ts +1 -1
  68. package/src/tileset-2d/tileset-2d.ts +6 -7
  69. package/src/tileset-2d/utils.ts +4 -4
  70. package/src/trips-layer/trips-layer.ts +3 -3
  71. package/src/wms-layer/wms-layer.ts +10 -8
  72. package/typed/geo-cell-layer/GeoCellLayer.d.ts +1 -1
  73. package/typed/geo-cell-layer/GeoCellLayer.d.ts.map +1 -1
  74. package/typed/geohash-layer/geohash-layer.d.ts +2 -2
  75. package/typed/geohash-layer/geohash-layer.d.ts.map +1 -1
  76. package/typed/great-circle-layer/great-circle-layer.d.ts +2 -2
  77. package/typed/great-circle-layer/great-circle-layer.d.ts.map +1 -1
  78. package/typed/h3-layers/h3-cluster-layer.d.ts +7 -2
  79. package/typed/h3-layers/h3-cluster-layer.d.ts.map +1 -1
  80. package/typed/h3-layers/h3-hexagon-layer.d.ts +2 -2
  81. package/typed/h3-layers/h3-hexagon-layer.d.ts.map +1 -1
  82. package/typed/index.d.ts +0 -2
  83. package/typed/index.d.ts.map +1 -1
  84. package/typed/mvt-layer/mvt-layer.d.ts +9 -1
  85. package/typed/mvt-layer/mvt-layer.d.ts.map +1 -1
  86. package/typed/quadkey-layer/quadkey-layer.d.ts +2 -2
  87. package/typed/quadkey-layer/quadkey-layer.d.ts.map +1 -1
  88. package/typed/s2-layer/s2-layer.d.ts +2 -2
  89. package/typed/s2-layer/s2-layer.d.ts.map +1 -1
  90. package/typed/terrain-layer/terrain-layer.d.ts +2 -2
  91. package/typed/terrain-layer/terrain-layer.d.ts.map +1 -1
  92. package/typed/tile-layer/tile-layer.d.ts +7 -2
  93. package/typed/tile-layer/tile-layer.d.ts.map +1 -1
  94. package/typed/tileset-2d/tile-2d-traversal.d.ts +1 -1
  95. package/typed/tileset-2d/tile-2d-traversal.d.ts.map +1 -1
  96. package/typed/tileset-2d/tileset-2d.d.ts +4 -4
  97. package/typed/tileset-2d/tileset-2d.d.ts.map +1 -1
  98. package/typed/tileset-2d/utils.d.ts +2 -2
  99. package/typed/tileset-2d/utils.d.ts.map +1 -1
  100. package/typed/trips-layer/trips-layer.d.ts +3 -3
  101. package/typed/trips-layer/trips-layer.d.ts.map +1 -1
  102. package/typed/wms-layer/wms-layer.d.ts.map +1 -1
  103. package/dist/es5/mesh-layer/mesh-layer.js +0 -212
  104. package/dist/es5/mesh-layer/mesh-layer.js.map +0 -1
  105. package/dist/es5/tile-3d-layer/tile-3d-layer.js +0 -512
  106. package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +0 -1
  107. package/dist/esm/mesh-layer/mesh-layer.js +0 -177
  108. package/dist/esm/mesh-layer/mesh-layer.js.map +0 -1
  109. package/dist/esm/tile-3d-layer/tile-3d-layer.js +0 -443
  110. package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +0 -1
  111. package/typed/mesh-layer/mesh-layer.d.ts +0 -38
  112. package/typed/mesh-layer/mesh-layer.d.ts.map +0 -1
  113. package/typed/tile-3d-layer/tile-3d-layer.d.ts +0 -62
  114. package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +0 -1
package/dist.min.js CHANGED
@@ -4,24 +4,23 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['deck'] = factory();
6
6
  else root['deck'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var C_=Object.create;var _o=Object.defineProperty;var M_=Object.getOwnPropertyDescriptor;var I_=Object.getOwnPropertyNames;var O_=Object.getPrototypeOf,R_=Object.prototype.hasOwnProperty;var Uh=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Oe=(t,e)=>{for(var r in e)_o(t,r,{get:e[r],enumerable:!0})},vo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of I_(e))!R_.call(t,i)&&i!==r&&_o(t,i,{get:()=>e[i],enumerable:!(n=M_(e,i))||n.enumerable});return t},Xt=(t,e,r)=>(vo(t,e,"default"),r&&vo(r,e,"default")),X=(t,e,r)=>(r=t!=null?C_(O_(t)):{},vo(e||!t||!t.__esModule?_o(r,"default",{value:t,enumerable:!0}):r,t)),P_=t=>vo(_o({},"__esModule",{value:!0}),t);var ut=Ae((BL,Hh)=>{Hh.exports=globalThis.deck});var lt=Ae((ML,zh)=>{zh.exports=globalThis.deck});var xo=Ae(Ft=>{"use strict";var jh=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",L_=jh+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",kh="["+jh+"]["+L_+"]*",D_=new RegExp("^"+kh+"$"),N_=function(e,r){for(var n=[],i=r.exec(e);i;){var o=[];o.startIndex=r.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)o.push(i[a]);n.push(o),i=r.exec(e)}return n},G_=function(e){var r=D_.exec(e);return!(r===null||typeof r>"u")};Ft.isExist=function(t){return typeof t<"u"};Ft.isEmptyObject=function(t){return Object.keys(t).length===0};Ft.merge=function(t,e,r){if(e)for(var n=Object.keys(e),i=n.length,o=0;o<i;o++)r==="strict"?t[n[o]]=[e[n[o]]]:t[n[o]]=e[n[o]]};Ft.getValue=function(t){return Ft.isExist(t)?t:""};Ft.isName=G_;Ft.getAllMatches=N_;Ft.nameRegexp=kh});var Ic=Ae(Yh=>{"use strict";var Mc=xo(),U_={allowBooleanAttributes:!1,unpairedTags:[]};Yh.validate=function(t,e){e=Object.assign({},U_,e);var r=[],n=!1,i=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(var o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Xh(t,o),o.err)return o}else if(t[o]==="<"){var s=o;if(o++,t[o]==="!"){o=Jh(t,o);continue}else{var a=!1;t[o]==="/"&&(a=!0,o++);for(var c="";o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
8
- `&&t[o]!=="\r";o++)c+=t[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!J_(c)){var u=void 0;return c.trim().length===0?u="Invalid space after '<'.":u="Tag '"+c+"' is an invalid name.",Te("InvalidTag",u,Ve(t,o))}var l=z_(t,o);if(l===!1)return Te("InvalidAttr","Attributes for '"+c+"' have open quote.",Ve(t,o));var f=l.value;if(o=l.index,f[f.length-1]==="/"){var h=o-f.length;f=f.substring(0,f.length-1);var d=qh(f,e);if(d===!0)n=!0;else return Te(d.err.code,d.err.msg,Ve(t,h+d.err.line))}else if(a)if(l.tagClosed){if(f.trim().length>0)return Te("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",Ve(t,s));var p=r.pop();if(c!==p.tagName){var m=Ve(t,p.tagStartPos);return Te("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+m.line+", col "+m.col+") instead of closing tag '"+c+"'.",Ve(t,s))}r.length==0&&(i=!0)}else return Te("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",Ve(t,o));else{var g=qh(f,e);if(g!==!0)return Te(g.err.code,g.err.msg,Ve(t,o-f.length+g.err.line));if(i===!0)return Te("InvalidXml","Multiple possible root nodes found.",Ve(t,o));e.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:s}),n=!0}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=Jh(t,o);continue}else if(t[o+1]==="?"){if(o=Xh(t,++o),o.err)return o}else break;else if(t[o]==="&"){var A=W_(t,o);if(A==-1)return Te("InvalidChar","char '&' is not expected.",Ve(t,o));o=A}else if(i===!0&&!Wh(t[o]))return Te("InvalidXml","Extra text at the end",Ve(t,o));t[o]==="<"&&o--}}else{if(Wh(t[o]))continue;return Te("InvalidChar","char '"+t[o]+"' is not expected.",Ve(t,o))}if(n){if(r.length==1)return Te("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Ve(t,r[0].tagStartPos));if(r.length>0)return Te("InvalidXml","Invalid '"+JSON.stringify(r.map(function(_){return _.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Te("InvalidXml","Start tag expected.",1);return!0};function Wh(t){return t===" "||t===" "||t===`
9
- `||t==="\r"}function Xh(t,e){for(var r=e;e<t.length;e++)if(t[e]=="?"||t[e]==" "){var n=t.substr(r,e-r);if(e>5&&n==="xml")return Te("InvalidXml","XML declaration allowed only at the start of the document.",Ve(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Jh(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){var r=1;for(e+=8;e<t.length;e++)if(t[e]==="<")r++;else if(t[e]===">"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var H_='"',V_="'";function z_(t,e){for(var r="",n="",i=!1;e<t.length;e++){if(t[e]===H_||t[e]===V_)n===""?n=t[e]:n!==t[e]||(n="");else if(t[e]===">"&&n===""){i=!0;break}r+=t[e]}return n!==""?!1:{value:r,index:e,tagClosed:i}}var j_=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function qh(t,e){for(var r=Mc.getAllMatches(t,j_),n={},i=0;i<r.length;i++){if(r[i][1].length===0)return Te("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",ii(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return Te("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",ii(r[i]));if(r[i][3]===void 0&&!e.allowBooleanAttributes)return Te("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",ii(r[i]));var o=r[i][2];if(!X_(o))return Te("InvalidAttr","Attribute '"+o+"' is an invalid name.",ii(r[i]));if(!n.hasOwnProperty(o))n[o]=1;else return Te("InvalidAttr","Attribute '"+o+"' is repeated.",ii(r[i]))}return!0}function k_(t,e){var r=/\d/;for(t[e]==="x"&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}function W_(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,k_(t,e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(t[e]===";")break;return-1}return e}function Te(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function X_(t){return Mc.isName(t)}function J_(t){return Mc.isName(t)}function Ve(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function ii(t){return t.startIndex+t[1].length}});var Zh=Ae(Oc=>{var Kh={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,n){return e}},q_=function(e){return Object.assign({},Kh,e)};Oc.buildOptions=q_;Oc.defaultOptions=Kh});var $h=Ae((FL,Qh)=>{"use strict";function To(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var K_=function(){function t(r){Y_(this,t),this.tagname=r,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(n,i){n==="__proto__"&&(n="#__proto__"),this.child.push(To({},n,i))},e.addChild=function(n){if(n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0){var i;this.child.push((i={},To(i,n.tagname,n.child),To(i,":@",n[":@"]),i))}else this.child.push(To({},n.tagname,n.child))},t}();Qh.exports=K_});var rd=Ae((LL,td)=>{function Z_(t,e){return t1(t)||e1(t,e)||$_(t,e)||Q_()}function Q_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $_(t,e){if(t){if(typeof t=="string")return ed(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ed(t,e)}}function ed(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e1(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function t1(t){if(Array.isArray(t))return t}var r1=xo();function n1(t,e){var r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;for(var n=1,i=!1,o=!1,s="";e<t.length;e++)if(t[e]==="<"&&!o){if(i&&s1(t,e)){e+=7;var a=i1(t,e+1),c=Z_(a,3);entityName=c[0],val=c[1],e=c[2],val.indexOf("&")===-1&&(r[l1(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(i&&a1(t,e))e+=8;else if(i&&c1(t,e))e+=8;else if(i&&u1(t,e))e+=9;else if(o1)o=!0;else throw new Error("Invalid DOCTYPE");n++,s=""}else if(t[e]===">"){if(o?t[e-1]==="-"&&t[e-2]==="-"&&(o=!1,n--):n--,n===0)break}else t[e]==="["?i=!0:s+=t[e];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:e}}function i1(t,e){for(var r="";e<t.length&&t[e]!=="'"&&t[e]!=='"';e++)r+=t[e];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");for(var n=t[e++],i="";e<t.length&&t[e]!==n;e++)i+=t[e];return[r,i,e]}function o1(t,e){return t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-"}function s1(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y"}function a1(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T"}function c1(t,e){return t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T"}function u1(t,e){return t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N"}function l1(t){if(r1.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}td.exports=n1});var id=Ae((DL,nd)=>{var f1=/^[-+]?0x[a-fA-F0-9]+$/,h1=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var d1={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function p1(t,e={}){if(e=Object.assign({},d1,e),!t||typeof t!="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;if(e.hex&&f1.test(r))return Number.parseInt(r,16);{let n=h1.exec(r);if(n){let i=n[1],o=n[2],s=m1(n[3]),a=n[4]||n[6];if(!e.leadingZeros&&o.length>0&&i&&r[2]!==".")return t;if(!e.leadingZeros&&o.length>0&&!i&&r[1]!==".")return t;{let c=Number(r),u=""+c;return u.search(/[eE]/)!==-1||a?e.eNotation?c:t:r.indexOf(".")!==-1?u==="0"&&s===""||u===s||i&&u==="-"+s?c:t:o?s===u||i+s===u?c:t:r===u||r===i+u?c:t}}else return t}}function m1(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}nd.exports=p1});var ad=Ae((UL,sd)=>{"use strict";function od(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function br(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?br=function(r){return typeof r}:br=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},br(t)}function g1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Fc=xo(),oi=$h(),y1=rd(),A1=id(),NL="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Fc.nameRegexp),v1=function t(e){g1(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=_1,this.parseXml=S1,this.parseTextData=b1,this.resolveNameSpace=x1,this.buildAttributesMap=E1,this.isItStopNode=M1,this.replaceEntitiesValue=B1,this.readStopNodeData=O1,this.saveTextToParentTag=C1,this.addChild=w1};function _1(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function b1(t,e,r,n,i,o,s){if(t!==void 0&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));var a=this.options.tagValueProcessor(e,t,r,i,o);if(a==null)return t;if(br(a)!==br(t)||a!==t)return a;if(this.options.trimValues)return Pc(t,this.options.parseTagValue,this.options.numberParseOptions);var c=t.trim();return c===t?Pc(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function x1(t){if(this.options.removeNSPrefix){var e=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=r+e[1])}return t}var T1=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function E1(t,e,r){if(!this.options.ignoreAttributes&&typeof t=="string"){for(var n=Fc.getAllMatches(t,T1),i=n.length,o={},s=0;s<i;s++){var a=this.resolveNameSpace(n[s][1]),c=n[s][4],u=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);var l=this.options.attributeValueProcessor(a,c,e);l==null?o[u]=c:br(l)!==br(c)||l!==c?o[u]=l:o[u]=Pc(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[u]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){var f={};return f[this.options.attributesGroupName]=o,f}return o}}var S1=function(e){e=e.replace(/\r\n?/g,`
11
- `);for(var r=new oi("!xml"),n=r,i="",o="",s=0;s<e.length;s++){var a=e[s];if(a==="<")if(e[s+1]==="/"){var c=_r(e,">",s,"Closing Tag is not closed."),u=e.substring(s+2,c).trim();if(this.options.removeNSPrefix){var l=u.indexOf(":");l!==-1&&(u=u.substr(l+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&(i=this.saveTextToParentTag(i,n,o));var f=o.substring(o.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(u,">"));var h=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(h=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=o.lastIndexOf("."),o=o.substring(0,h),n=this.tagsNodeStack.pop(),i="",s=c}else if(e[s+1]==="?"){var d=Rc(e,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,o),!(this.options.ignoreDeclaration&&d.tagName==="?xml"||this.options.ignorePiTags)){var p=new oi(d.tagName);p.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(p[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(n,p,o)}s=d.closeIndex+1}else if(e.substr(s+1,3)==="!--"){var m=_r(e,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){var g=e.substring(s+4,m-2);i=this.saveTextToParentTag(i,n,o),n.add(this.options.commentPropName,[od({},this.options.textNodeName,g)])}s=m}else if(e.substr(s+1,2)==="!D"){var A=y1(e,s);this.docTypeEntities=A.entities,s=A.i}else if(e.substr(s+1,2)==="!["){var _=_r(e,"]]>",s,"CDATA is not closed.")-2,v=e.substring(s+9,_);if(i=this.saveTextToParentTag(i,n,o),this.options.cdataPropName)n.add(this.options.cdataPropName,[od({},this.options.textNodeName,v)]);else{var x=this.parseTextData(v,n.tagname,o,!0,!1,!0);x==null&&(x=""),n.add(this.options.textNodeName,x)}s=_+2}else{var w=Rc(e,s,this.options.removeNSPrefix),S=w.tagName,C=w.tagExp,B=w.attrExpPresent,T=w.closeIndex;this.options.transformTagName&&(S=this.options.transformTagName(S)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,o,!1));var y=n;if(y&&this.options.unpairedTags.indexOf(y.tagname)!==-1&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),S!==r.tagname&&(o+=o?"."+S:S),this.isItStopNode(this.options.stopNodes,o,S)){var M="";if(C.length>0&&C.lastIndexOf("/")===C.length-1)s=w.closeIndex;else if(this.options.unpairedTags.indexOf(S)!==-1)s=w.closeIndex;else{var P=this.readStopNodeData(e,S,T+1);if(!P)throw new Error("Unexpected end of ".concat(S));s=P.i,M=P.tagContent}var F=new oi(S);S!==C&&B&&(F[":@"]=this.buildAttributesMap(C,o,S)),M&&(M=this.parseTextData(M,S,o,!0,B,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),F.add(this.options.textNodeName,M),this.addChild(n,F,o)}else{if(C.length>0&&C.lastIndexOf("/")===C.length-1){S[S.length-1]==="/"?(S=S.substr(0,S.length-1),o=o.substr(0,o.length-1),C=S):C=C.substr(0,C.length-1),this.options.transformTagName&&(S=this.options.transformTagName(S));var I=new oi(S);S!==C&&B&&(I[":@"]=this.buildAttributesMap(C,o,S)),this.addChild(n,I,o),o=o.substr(0,o.lastIndexOf("."))}else{var N=new oi(S);this.tagsNodeStack.push(n),S!==C&&B&&(N[":@"]=this.buildAttributesMap(C,o,S)),this.addChild(n,N,o),n=N}i="",s=T}}else i+=e[s]}return r.child};function w1(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),t.addChild(e))}var B1=function(e){if(this.options.processEntities){for(var r in this.docTypeEntities){var n=this.docTypeEntities[r];e=e.replace(n.regx,n.val)}for(var i in this.lastEntities){var o=this.lastEntities[i];e=e.replace(o.regex,o.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var a=this.htmlEntities[s];e=e.replace(a.regex,a.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function C1(t,e,r,n){return t&&(n===void 0&&(n=Object.keys(e.child).length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function M1(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function I1(t,e){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",o=e;o<t.length;o++){var s=t[o];if(n)s===n&&(n="");else if(s==='"'||s==="'")n=s;else if(s===r[0])if(r[1]){if(t[o+1]===r[1])return{data:i,index:o}}else return{data:i,index:o};else s===" "&&(s=" ");i+=s}}function _r(t,e,r,n){var i=t.indexOf(e,r);if(i===-1)throw new Error(n);return i+e.length-1}function Rc(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=I1(t,e+1,n);if(i){var o=i.data,s=i.index,a=o.search(/\s/),c=o,u=!0;if(a!==-1&&(c=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1)),r){var l=c.indexOf(":");l!==-1&&(c=c.substr(l+1),u=c!==i.data.substr(l+1))}return{tagName:c,tagExp:o,closeIndex:s,attrExpPresent:u}}}function O1(t,e,r){for(var n=r,i=1;r<t.length;r++)if(t[r]==="<")if(t[r+1]==="/"){var o=_r(t,">",r,"".concat(e," is not closed")),s=t.substring(r+2,o).trim();if(s===e&&(i--,i===0))return{tagContent:t.substring(n,r),i:o};r=o}else if(t[r+1]==="?"){var a=_r(t,"?>",r+1,"StopNode is not closed.");r=a}else if(t.substr(r+1,3)==="!--"){var c=_r(t,"-->",r+3,"StopNode is not closed.");r=c}else if(t.substr(r+1,2)==="!["){var u=_r(t,"]]>",r,"StopNode is not closed.")-2;r=u}else{var l=Rc(t,r,">");if(l){var f=l&&l.tagName;f===e&&l.tagExp[l.tagExp.length-1]!=="/"&&i++,r=l.closeIndex}}}function Pc(t,e,r){if(e&&typeof t=="string"){var n=t.trim();return n==="true"?!0:n==="false"?!1:A1(t,r)}else return Fc.isExist(t)?t:""}sd.exports=v1});var ld=Ae(ud=>{"use strict";function R1(t,e){return cd(t,e)}function cd(t,e,r){for(var n,i={},o=0;o<t.length;o++){var s=t[o],a=P1(s),c="";if(r===void 0?c=a:c=r+"."+a,a===e.textNodeName)n===void 0?n=s[a]:n+=""+s[a];else{if(a===void 0)continue;if(s[a]){var u=cd(s[a],e,c),l=L1(u,e);s[":@"]?F1(u,s[":@"],c,e):Object.keys(u).length===1&&u[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?u=u[e.textNodeName]:Object.keys(u).length===0&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""),i[a]!==void 0&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(u)):e.isArray(a,c,l)?i[a]=[u]:i[a]=u}}}return typeof n=="string"?n.length>0&&(i[e.textNodeName]=n):n!==void 0&&(i[e.textNodeName]=n),i}function P1(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function F1(t,e,r,n){if(e)for(var i=Object.keys(e),o=i.length,s=0;s<o;s++){var a=i[s];n.isArray(a,r+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}function L1(t,e){var r=e.textNodeName,n=Object.keys(t).length;return!!(n===0||n===1&&(t[r]||typeof t[r]=="boolean"||t[r]===0))}ud.prettify=R1});var hd=Ae((VL,fd)=>{function D1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var N1=Zh(),G1=N1.buildOptions,U1=ad(),H1=ld(),V1=H1.prettify,z1=Ic(),j1=function(){function t(r){D1(this,t),this.externalEntities={},this.options=G1(r)}var e=t.prototype;return e.parse=function(n,i){if(typeof n!="string")if(n.toString)n=n.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});var o=z1.validate(n,i);if(o!==!0)throw Error("".concat(o.err.msg,":").concat(o.err.line,":").concat(o.err.col))}var s=new U1(this.options);s.addExternalEntities(this.externalEntities);var a=s.parseXml(n);return this.options.preserveOrder||a===void 0?a:V1(a,this.options)},e.addEntity=function(n,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(n.indexOf("&")!==-1||n.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[n]=i},t}();fd.exports=j1});var yd=Ae((zL,gd)=>{var k1=`
12
- `;function W1(t,e){var r="";return e.format&&e.indentBy.length>0&&(r=k1),pd(t,e,"",r)}function pd(t,e,r,n){for(var i="",o=!1,s=0;s<t.length;s++){var a=t[s],c=X1(a),u="";if(r.length===0?u=c:u="".concat(r,".").concat(c),c===e.textNodeName){var l=a[c];J1(u,e)||(l=e.tagValueProcessor(c,l),l=md(l,e)),o&&(i+=n),i+=l,o=!1;continue}else if(c===e.cdataPropName){o&&(i+=n),i+="<![CDATA[".concat(a[c][0][e.textNodeName],"]]>"),o=!1;continue}else if(c===e.commentPropName){i+=n+"<!--".concat(a[c][0][e.textNodeName],"-->"),o=!0;continue}else if(c[0]==="?"){var f=dd(a[":@"],e),h=c==="?xml"?"":n,d=a[c][0][e.textNodeName];d=d.length!==0?" "+d:"",i+=h+"<".concat(c).concat(d).concat(f,"?>"),o=!0;continue}var p=n;p!==""&&(p+=e.indentBy);var m=dd(a[":@"],e),g=n+"<".concat(c).concat(m),A=pd(a[c],e,u,p);e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?i+=g+">":i+=g+"/>":(!A||A.length===0)&&e.suppressEmptyNode?i+=g+"/>":A&&A.endsWith(">")?i+=g+">".concat(A).concat(n,"</").concat(c,">"):(i+=g+">",A&&n!==""&&(A.includes("/>")||A.includes("</"))?i+=n+e.indentBy+A+n:i+=A,i+="</".concat(c,">")),o=!0}return i}function X1(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function dd(t,e){var r="";if(t&&!e.ignoreAttributes)for(var n in t){var i=e.attributeValueProcessor(n,t[n]);i=md(i,e),i===!0&&e.suppressBooleanAttributes?r+=" ".concat(n.substr(e.attributeNamePrefix.length)):r+=" ".concat(n.substr(e.attributeNamePrefix.length),'="').concat(i,'"')}return r}function J1(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);var r=t.substr(t.lastIndexOf(".")+1);for(var n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return!0;return!1}function md(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var n=e.entities[r];t=t.replace(n.regex,n.val)}return t}gd.exports=W1});var vd=Ae((jL,Ad)=>{"use strict";function si(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?si=function(r){return typeof r}:si=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},si(t)}function q1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Y1=yd(),K1={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Jt(t){this.options=Object.assign({},K1,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$1),this.processTextOrObjNode=Z1,this.options.format?(this.indentate=Q1,this.tagEndChar=`>
7
+ "use strict";var __exports__=(()=>{var xu=Object.create;var sr=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,Mu=Object.prototype.hasOwnProperty;var jo=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kn=(t,e)=>{for(var r in e)sr(t,r,{get:e[r],enumerable:!0})},or=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!Mu.call(t,i)&&i!==r&&sr(t,i,{get:()=>e[i],enumerable:!(n=_u(e,i))||n.enumerable});return t},Et=(t,e,r)=>(or(t,e,"default"),r&&or(r,e,"default")),B=(t,e,r)=>(r=t!=null?xu(wu(t)):{},or(e||!t||!t.__esModule?sr(r,"default",{value:t,enumerable:!0}):r,t)),Su=t=>or(sr({},"__esModule",{value:!0}),t);var ct=Y((gv,Vo)=>{Vo.exports=globalThis.deck});var ut=Y((vv,Do)=>{Do.exports=globalThis.deck});var cr=Y(_t=>{"use strict";var Go=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Pu=Go+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Zo="["+Go+"]["+Pu+"]*",Eu=new RegExp("^"+Zo+"$"),Ou=function(e,r){for(var n=[],i=r.exec(e);i;){var o=[];o.startIndex=r.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)o.push(i[a]);n.push(o),i=r.exec(e)}return n},Iu=function(e){var r=Eu.exec(e);return!(r===null||typeof r>"u")};_t.isExist=function(t){return typeof t<"u"};_t.isEmptyObject=function(t){return Object.keys(t).length===0};_t.merge=function(t,e,r){if(e)for(var n=Object.keys(e),i=n.length,o=0;o<i;o++)r==="strict"?t[n[o]]=[e[n[o]]]:t[n[o]]=e[n[o]]};_t.getValue=function(t){return _t.isExist(t)?t:""};_t.isName=Iu;_t.getAllMatches=Ou;_t.nameRegexp=Zo});var Un=Y(Qo=>{"use strict";var qn=cr(),Au={allowBooleanAttributes:!1,unpairedTags:[]};Qo.validate=function(t,e){e=Object.assign({},Au,e);var r=[],n=!1,i=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(var o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Yo(t,o),o.err)return o}else if(t[o]==="<"){var s=o;if(o++,t[o]==="!"){o=Ho(t,o);continue}else{var a=!1;t[o]==="/"&&(a=!0,o++);for(var c="";o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
8
+ `&&t[o]!=="\r";o++)c+=t[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!ku(c)){var l=void 0;return c.trim().length===0?l="Invalid space after '<'.":l="Tag '"+c+"' is an invalid name.",H("InvalidTag",l,J(t,o))}var u=Fu(t,o);if(u===!1)return H("InvalidAttr","Attributes for '"+c+"' have open quote.",J(t,o));var f=u.value;if(o=u.index,f[f.length-1]==="/"){var h=o-f.length;f=f.substring(0,f.length-1);var d=$o(f,e);if(d===!0)n=!0;else return H(d.err.code,d.err.msg,J(t,h+d.err.line))}else if(a)if(u.tagClosed){if(f.trim().length>0)return H("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",J(t,s));var p=r.pop();if(c!==p.tagName){var g=J(t,p.tagStartPos);return H("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+c+"'.",J(t,s))}r.length==0&&(i=!0)}else return H("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",J(t,o));else{var m=$o(f,e);if(m!==!0)return H(m.err.code,m.err.msg,J(t,o-f.length+m.err.line));if(i===!0)return H("InvalidXml","Multiple possible root nodes found.",J(t,o));e.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:s}),n=!0}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=Ho(t,o);continue}else if(t[o+1]==="?"){if(o=Yo(t,++o),o.err)return o}else break;else if(t[o]==="&"){var v=zu(t,o);if(v==-1)return H("InvalidChar","char '&' is not expected.",J(t,o));o=v}else if(i===!0&&!Xo(t[o]))return H("InvalidXml","Extra text at the end",J(t,o));t[o]==="<"&&o--}}else{if(Xo(t[o]))continue;return H("InvalidChar","char '"+t[o]+"' is not expected.",J(t,o))}if(n){if(r.length==1)return H("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",J(t,r[0].tagStartPos));if(r.length>0)return H("InvalidXml","Invalid '"+JSON.stringify(r.map(function(w){return w.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return H("InvalidXml","Start tag expected.",1);return!0};function Xo(t){return t===" "||t===" "||t===`
9
+ `||t==="\r"}function Yo(t,e){for(var r=e;e<t.length;e++)if(t[e]=="?"||t[e]==" "){var n=t.substr(r,e-r);if(e>5&&n==="xml")return H("InvalidXml","XML declaration allowed only at the start of the document.",J(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Ho(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){var r=1;for(e+=8;e<t.length;e++)if(t[e]==="<")r++;else if(t[e]===">"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var Lu='"',Ru="'";function Fu(t,e){for(var r="",n="",i=!1;e<t.length;e++){if(t[e]===Lu||t[e]===Ru)n===""?n=t[e]:n!==t[e]||(n="");else if(t[e]===">"&&n===""){i=!0;break}r+=t[e]}return n!==""?!1:{value:r,index:e,tagClosed:i}}var Nu=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $o(t,e){for(var r=qn.getAllMatches(t,Nu),n={},i=0;i<r.length;i++){if(r[i][1].length===0)return H("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",xe(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return H("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",xe(r[i]));if(r[i][3]===void 0&&!e.allowBooleanAttributes)return H("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",xe(r[i]));var o=r[i][2];if(!Bu(o))return H("InvalidAttr","Attribute '"+o+"' is an invalid name.",xe(r[i]));if(!n.hasOwnProperty(o))n[o]=1;else return H("InvalidAttr","Attribute '"+o+"' is repeated.",xe(r[i]))}return!0}function Cu(t,e){var r=/\d/;for(t[e]==="x"&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}function zu(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,Cu(t,e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(t[e]===";")break;return-1}return e}function H(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function Bu(t){return qn.isName(t)}function ku(t){return qn.isName(t)}function J(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function xe(t){return t.startIndex+t[1].length}});var Jo=Y(jn=>{var Ko={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,n){return e}},qu=function(e){return Object.assign({},Ko,e)};jn.buildOptions=qu;jn.defaultOptions=Ko});var es=Y((Mv,ts)=>{"use strict";function lr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ju=function(){function t(r){Uu(this,t),this.tagname=r,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(n,i){n==="__proto__"&&(n="#__proto__"),this.child.push(lr({},n,i))},e.addChild=function(n){if(n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0){var i;this.child.push((i={},lr(i,n.tagname,n.child),lr(i,":@",n[":@"]),i))}else this.child.push(lr({},n.tagname,n.child))},t}();ts.exports=ju});var is=Y((Sv,ns)=>{function Vu(t,e){return Zu(t)||Gu(t,e)||Du(t,e)||Wu()}function Wu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Du(t,e){if(t){if(typeof t=="string")return rs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rs(t,e)}}function rs(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Gu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function Zu(t){if(Array.isArray(t))return t}var Xu=cr();function Yu(t,e){var r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;for(var n=1,i=!1,o=!1,s="";e<t.length;e++)if(t[e]==="<"&&!o){if(i&&Qu(t,e)){e+=7;var a=Hu(t,e+1),c=Vu(a,3);entityName=c[0],val=c[1],e=c[2],val.indexOf("&")===-1&&(r[ef(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(i&&Ku(t,e))e+=8;else if(i&&Ju(t,e))e+=8;else if(i&&tf(t,e))e+=9;else if($u)o=!0;else throw new Error("Invalid DOCTYPE");n++,s=""}else if(t[e]===">"){if(o?t[e-1]==="-"&&t[e-2]==="-"&&(o=!1,n--):n--,n===0)break}else t[e]==="["?i=!0:s+=t[e];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:e}}function Hu(t,e){for(var r="";e<t.length&&t[e]!=="'"&&t[e]!=='"';e++)r+=t[e];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");for(var n=t[e++],i="";e<t.length&&t[e]!==n;e++)i+=t[e];return[r,i,e]}function $u(t,e){return t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-"}function Qu(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y"}function Ku(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T"}function Ju(t,e){return t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T"}function tf(t,e){return t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N"}function ef(t){if(Xu.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}ns.exports=Yu});var ss=Y((Tv,os)=>{var rf=/^[-+]?0x[a-fA-F0-9]+$/,nf=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var of={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function sf(t,e={}){if(e=Object.assign({},of,e),!t||typeof t!="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;if(e.hex&&rf.test(r))return Number.parseInt(r,16);{let n=nf.exec(r);if(n){let i=n[1],o=n[2],s=af(n[3]),a=n[4]||n[6];if(!e.leadingZeros&&o.length>0&&i&&r[2]!==".")return t;if(!e.leadingZeros&&o.length>0&&!i&&r[1]!==".")return t;{let c=Number(r),l=""+c;return l.search(/[eE]/)!==-1||a?e.eNotation?c:t:r.indexOf(".")!==-1?l==="0"&&s===""||l===s||i&&l==="-"+s?c:t:o?s===l||i+s===l?c:t:r===l||r===i+l?c:t}}else return t}}function af(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}os.exports=sf});var ls=Y((Ev,cs)=>{"use strict";function as(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ut(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ut=function(r){return typeof r}:Ut=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ut(t)}function cf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Dn=cr(),_e=es(),lf=is(),uf=ss(),Pv="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Dn.nameRegexp),ff=function t(e){cf(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=hf,this.parseXml=yf,this.parseTextData=df,this.resolveNameSpace=pf,this.buildAttributesMap=gf,this.isItStopNode=bf,this.replaceEntitiesValue=xf,this.readStopNodeData=Mf,this.saveTextToParentTag=_f,this.addChild=vf};function hf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function df(t,e,r,n,i,o,s){if(t!==void 0&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));var a=this.options.tagValueProcessor(e,t,r,i,o);if(a==null)return t;if(Ut(a)!==Ut(t)||a!==t)return a;if(this.options.trimValues)return Wn(t,this.options.parseTagValue,this.options.numberParseOptions);var c=t.trim();return c===t?Wn(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function pf(t){if(this.options.removeNSPrefix){var e=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=r+e[1])}return t}var mf=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function gf(t,e,r){if(!this.options.ignoreAttributes&&typeof t=="string"){for(var n=Dn.getAllMatches(t,mf),i=n.length,o={},s=0;s<i;s++){var a=this.resolveNameSpace(n[s][1]),c=n[s][4],l=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l==="__proto__"&&(l="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);var u=this.options.attributeValueProcessor(a,c,e);u==null?o[l]=c:Ut(u)!==Ut(c)||u!==c?o[l]=u:o[l]=Wn(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[l]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){var f={};return f[this.options.attributesGroupName]=o,f}return o}}var yf=function(e){e=e.replace(/\r\n?/g,`
11
+ `);for(var r=new _e("!xml"),n=r,i="",o="",s=0;s<e.length;s++){var a=e[s];if(a==="<")if(e[s+1]==="/"){var c=qt(e,">",s,"Closing Tag is not closed."),l=e.substring(s+2,c).trim();if(this.options.removeNSPrefix){var u=l.indexOf(":");u!==-1&&(l=l.substr(u+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&(i=this.saveTextToParentTag(i,n,o));var f=o.substring(o.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(l,">"));var h=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(h=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=o.lastIndexOf("."),o=o.substring(0,h),n=this.tagsNodeStack.pop(),i="",s=c}else if(e[s+1]==="?"){var d=Vn(e,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,o),!(this.options.ignoreDeclaration&&d.tagName==="?xml"||this.options.ignorePiTags)){var p=new _e(d.tagName);p.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(p[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(n,p,o)}s=d.closeIndex+1}else if(e.substr(s+1,3)==="!--"){var g=qt(e,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){var m=e.substring(s+4,g-2);i=this.saveTextToParentTag(i,n,o),n.add(this.options.commentPropName,[as({},this.options.textNodeName,m)])}s=g}else if(e.substr(s+1,2)==="!D"){var v=lf(e,s);this.docTypeEntities=v.entities,s=v.i}else if(e.substr(s+1,2)==="!["){var w=qt(e,"]]>",s,"CDATA is not closed.")-2,x=e.substring(s+9,w);if(i=this.saveTextToParentTag(i,n,o),this.options.cdataPropName)n.add(this.options.cdataPropName,[as({},this.options.textNodeName,x)]);else{var b=this.parseTextData(x,n.tagname,o,!0,!1,!0);b==null&&(b=""),n.add(this.options.textNodeName,b)}s=w+2}else{var T=Vn(e,s,this.options.removeNSPrefix),S=T.tagName,P=T.tagExp,M=T.attrExpPresent,_=T.closeIndex;this.options.transformTagName&&(S=this.options.transformTagName(S)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,o,!1));var y=n;if(y&&this.options.unpairedTags.indexOf(y.tagname)!==-1&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),S!==r.tagname&&(o+=o?"."+S:S),this.isItStopNode(this.options.stopNodes,o,S)){var E="";if(P.length>0&&P.lastIndexOf("/")===P.length-1)s=T.closeIndex;else if(this.options.unpairedTags.indexOf(S)!==-1)s=T.closeIndex;else{var A=this.readStopNodeData(e,S,_+1);if(!A)throw new Error("Unexpected end of ".concat(S));s=A.i,E=A.tagContent}var L=new _e(S);S!==P&&M&&(L[":@"]=this.buildAttributesMap(P,o,S)),E&&(E=this.parseTextData(E,S,o,!0,M,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,E),this.addChild(n,L,o)}else{if(P.length>0&&P.lastIndexOf("/")===P.length-1){S[S.length-1]==="/"?(S=S.substr(0,S.length-1),o=o.substr(0,o.length-1),P=S):P=P.substr(0,P.length-1),this.options.transformTagName&&(S=this.options.transformTagName(S));var I=new _e(S);S!==P&&M&&(I[":@"]=this.buildAttributesMap(P,o,S)),this.addChild(n,I,o),o=o.substr(0,o.lastIndexOf("."))}else{var R=new _e(S);this.tagsNodeStack.push(n),S!==P&&M&&(R[":@"]=this.buildAttributesMap(P,o,S)),this.addChild(n,R,o),n=R}i="",s=_}}else i+=e[s]}return r.child};function vf(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),t.addChild(e))}var xf=function(e){if(this.options.processEntities){for(var r in this.docTypeEntities){var n=this.docTypeEntities[r];e=e.replace(n.regx,n.val)}for(var i in this.lastEntities){var o=this.lastEntities[i];e=e.replace(o.regex,o.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var a=this.htmlEntities[s];e=e.replace(a.regex,a.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function _f(t,e,r,n){return t&&(n===void 0&&(n=Object.keys(e.child).length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function bf(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function wf(t,e){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",o=e;o<t.length;o++){var s=t[o];if(n)s===n&&(n="");else if(s==='"'||s==="'")n=s;else if(s===r[0])if(r[1]){if(t[o+1]===r[1])return{data:i,index:o}}else return{data:i,index:o};else s===" "&&(s=" ");i+=s}}function qt(t,e,r,n){var i=t.indexOf(e,r);if(i===-1)throw new Error(n);return i+e.length-1}function Vn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=wf(t,e+1,n);if(i){var o=i.data,s=i.index,a=o.search(/\s/),c=o,l=!0;if(a!==-1&&(c=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1)),r){var u=c.indexOf(":");u!==-1&&(c=c.substr(u+1),l=c!==i.data.substr(u+1))}return{tagName:c,tagExp:o,closeIndex:s,attrExpPresent:l}}}function Mf(t,e,r){for(var n=r,i=1;r<t.length;r++)if(t[r]==="<")if(t[r+1]==="/"){var o=qt(t,">",r,"".concat(e," is not closed")),s=t.substring(r+2,o).trim();if(s===e&&(i--,i===0))return{tagContent:t.substring(n,r),i:o};r=o}else if(t[r+1]==="?"){var a=qt(t,"?>",r+1,"StopNode is not closed.");r=a}else if(t.substr(r+1,3)==="!--"){var c=qt(t,"-->",r+3,"StopNode is not closed.");r=c}else if(t.substr(r+1,2)==="!["){var l=qt(t,"]]>",r,"StopNode is not closed.")-2;r=l}else{var u=Vn(t,r,">");if(u){var f=u&&u.tagName;f===e&&u.tagExp[u.tagExp.length-1]!=="/"&&i++,r=u.closeIndex}}}function Wn(t,e,r){if(e&&typeof t=="string"){var n=t.trim();return n==="true"?!0:n==="false"?!1:uf(t,r)}else return Dn.isExist(t)?t:""}cs.exports=ff});var hs=Y(fs=>{"use strict";function Sf(t,e){return us(t,e)}function us(t,e,r){for(var n,i={},o=0;o<t.length;o++){var s=t[o],a=Tf(s),c="";if(r===void 0?c=a:c=r+"."+a,a===e.textNodeName)n===void 0?n=s[a]:n+=""+s[a];else{if(a===void 0)continue;if(s[a]){var l=us(s[a],e,c),u=Ef(l,e);s[":@"]?Pf(l,s[":@"],c,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),i[a]!==void 0&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(l)):e.isArray(a,c,u)?i[a]=[l]:i[a]=l}}}return typeof n=="string"?n.length>0&&(i[e.textNodeName]=n):n!==void 0&&(i[e.textNodeName]=n),i}function Tf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function Pf(t,e,r,n){if(e)for(var i=Object.keys(e),o=i.length,s=0;s<o;s++){var a=i[s];n.isArray(a,r+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}function Ef(t,e){var r=e.textNodeName,n=Object.keys(t).length;return!!(n===0||n===1&&(t[r]||typeof t[r]=="boolean"||t[r]===0))}fs.prettify=Sf});var ps=Y((Iv,ds)=>{function Of(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var If=Jo(),Af=If.buildOptions,Lf=ls(),Rf=hs(),Ff=Rf.prettify,Nf=Un(),Cf=function(){function t(r){Of(this,t),this.externalEntities={},this.options=Af(r)}var e=t.prototype;return e.parse=function(n,i){if(typeof n!="string")if(n.toString)n=n.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});var o=Nf.validate(n,i);if(o!==!0)throw Error("".concat(o.err.msg,":").concat(o.err.line,":").concat(o.err.col))}var s=new Lf(this.options);s.addExternalEntities(this.externalEntities);var a=s.parseXml(n);return this.options.preserveOrder||a===void 0?a:Ff(a,this.options)},e.addEntity=function(n,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(n.indexOf("&")!==-1||n.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[n]=i},t}();ds.exports=Cf});var xs=Y((Av,vs)=>{var zf=`
12
+ `;function Bf(t,e){var r="";return e.format&&e.indentBy.length>0&&(r=zf),gs(t,e,"",r)}function gs(t,e,r,n){for(var i="",o=!1,s=0;s<t.length;s++){var a=t[s],c=kf(a),l="";if(r.length===0?l=c:l="".concat(r,".").concat(c),c===e.textNodeName){var u=a[c];qf(l,e)||(u=e.tagValueProcessor(c,u),u=ys(u,e)),o&&(i+=n),i+=u,o=!1;continue}else if(c===e.cdataPropName){o&&(i+=n),i+="<![CDATA[".concat(a[c][0][e.textNodeName],"]]>"),o=!1;continue}else if(c===e.commentPropName){i+=n+"<!--".concat(a[c][0][e.textNodeName],"-->"),o=!0;continue}else if(c[0]==="?"){var f=ms(a[":@"],e),h=c==="?xml"?"":n,d=a[c][0][e.textNodeName];d=d.length!==0?" "+d:"",i+=h+"<".concat(c).concat(d).concat(f,"?>"),o=!0;continue}var p=n;p!==""&&(p+=e.indentBy);var g=ms(a[":@"],e),m=n+"<".concat(c).concat(g),v=gs(a[c],e,l,p);e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?i+=m+">":i+=m+"/>":(!v||v.length===0)&&e.suppressEmptyNode?i+=m+"/>":v&&v.endsWith(">")?i+=m+">".concat(v).concat(n,"</").concat(c,">"):(i+=m+">",v&&n!==""&&(v.includes("/>")||v.includes("</"))?i+=n+e.indentBy+v+n:i+=v,i+="</".concat(c,">")),o=!0}return i}function kf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function ms(t,e){var r="";if(t&&!e.ignoreAttributes)for(var n in t){var i=e.attributeValueProcessor(n,t[n]);i=ys(i,e),i===!0&&e.suppressBooleanAttributes?r+=" ".concat(n.substr(e.attributeNamePrefix.length)):r+=" ".concat(n.substr(e.attributeNamePrefix.length),'="').concat(i,'"')}return r}function qf(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);var r=t.substr(t.lastIndexOf(".")+1);for(var n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return!0;return!1}function ys(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var n=e.entities[r];t=t.replace(n.regex,n.val)}return t}vs.exports=Bf});var bs=Y((Lv,_s)=>{"use strict";function be(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?be=function(r){return typeof r}:be=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},be(t)}function Uf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var jf=xs(),Vf={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Ot(t){this.options=Object.assign({},Vf,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Gf),this.processTextOrObjNode=Wf,this.options.format?(this.indentate=Df,this.tagEndChar=`>
13
13
  `,this.newLine=`
14
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Jt.prototype.build=function(t){return this.options.preserveOrder?Y1(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=q1({},this.options.arrayNodeName,t)),this.j2x(t,0).val)};Jt.prototype.j2x=function(t,e){var r="",n="";for(var i in t)if(typeof t[i]>"u")this.isAttribute(i)&&(n+="");else if(t[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextValNode(t[i],i,"",e);else if(si(t[i])!=="object"){var o=this.isAttribute(i);if(o)r+=this.buildAttrPairStr(o,""+t[i]);else if(i===this.options.textNodeName){var s=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(s)}else n+=this.buildTextValNode(t[i],i,"",e)}else if(Array.isArray(t[i])){for(var a=t[i].length,c="",u=0;u<a;u++){var l=t[i][u];typeof l>"u"||(l===null?i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:si(l)==="object"?this.options.oneListGroup?c+=this.j2x(l,e+1).val:c+=this.processTextOrObjNode(l,i,e):c+=this.buildTextValNode(l,i,"",e))}this.options.oneListGroup&&(c=this.buildObjectNode(c,i,"",e)),n+=c}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var f=Object.keys(t[i]),h=f.length,d=0;d<h;d++)r+=this.buildAttrPairStr(f[d],""+t[i][f[d]]);else n+=this.processTextOrObjNode(t[i],i,e);return{attrStr:r,val:n}};Jt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function Z1(t,e,r){var n=this.j2x(t,r+1);return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}Jt.prototype.buildObjectNode=function(t,e,r,n){if(t==="")return e[0]==="?"?this.indentate(n)+"<"+e+r+"?"+this.tagEndChar:this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var i="</"+e+this.tagEndChar,o="";return e[0]==="?"&&(o="?",i=""),(r||r==="")&&t.indexOf("<")===-1?this.indentate(n)+"<"+e+r+o+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(n)+"<!--".concat(t,"-->")+this.newLine:this.indentate(n)+"<"+e+r+o+this.tagEndChar+t+this.indentate(n)+i};Jt.prototype.closeTag=function(t){var e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e="></".concat(t),e};Jt.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(n)+"<!--".concat(t,"-->")+this.newLine;if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar};Jt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};function Q1(t){return this.options.indentBy.repeat(t)}function $1(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}Ad.exports=Jt});var bd=Ae((kL,_d)=>{"use strict";var eb=Ic(),tb=hd(),rb=vd();_d.exports={XMLParser:tb,XMLValidator:eb,XMLBuilder:rb}});var zu=Ae((cm,xi)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Uh=="function"&&typeof xi=="object"&&xi&&xi.exports?xi.exports=e():(t.dcodeIO=t.dcodeIO||{}).Long=e()})(cm,function(){"use strict";function t(T,y,M){this.low=T|0,this.high=y|0,this.unsigned=!!M}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function e(T){return(T&&T.__isLong__)===!0}t.isLong=e;var r={},n={};function i(T,y){var M,P,F;return y?(T>>>=0,(F=0<=T&&T<256)&&(P=n[T],P)?P:(M=s(T,(T|0)<0?-1:0,!0),F&&(n[T]=M),M)):(T|=0,(F=-128<=T&&T<128)&&(P=r[T],P)?P:(M=s(T,T<0?-1:0,!1),F&&(r[T]=M),M))}t.fromInt=i;function o(T,y){if(isNaN(T)||!isFinite(T))return y?A:g;if(y){if(T<0)return A;if(T>=d)return S}else{if(T<=-p)return C;if(T+1>=p)return w}return T<0?o(-T,y).neg():s(T%h|0,T/h|0,y)}t.fromNumber=o;function s(T,y,M){return new t(T,y,M)}t.fromBits=s;var a=Math.pow;function c(T,y,M){if(T.length===0)throw Error("empty string");if(T==="NaN"||T==="Infinity"||T==="+Infinity"||T==="-Infinity")return g;if(typeof y=="number"?(M=y,y=!1):y=!!y,M=M||10,M<2||36<M)throw RangeError("radix");var P;if((P=T.indexOf("-"))>0)throw Error("interior hyphen");if(P===0)return c(T.substring(1),y,M).neg();for(var F=o(a(M,8)),I=g,N=0;N<T.length;N+=8){var q=Math.min(8,T.length-N),U=parseInt(T.substring(N,N+q),M);if(q<8){var V=o(a(M,q));I=I.mul(V).add(o(U))}else I=I.mul(F),I=I.add(o(U))}return I.unsigned=y,I}t.fromString=c;function u(T){return T instanceof t?T:typeof T=="number"?o(T):typeof T=="string"?c(T):s(T.low,T.high,T.unsigned)}t.fromValue=u;var l=1<<16,f=1<<24,h=l*l,d=h*h,p=d/2,m=i(f),g=i(0);t.ZERO=g;var A=i(0,!0);t.UZERO=A;var _=i(1);t.ONE=_;var v=i(1,!0);t.UONE=v;var x=i(-1);t.NEG_ONE=x;var w=s(-1,2147483647,!1);t.MAX_VALUE=w;var S=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=S;var C=s(0,-2147483648,!1);t.MIN_VALUE=C;var B=t.prototype;return B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},B.toString=function(y){if(y=y||10,y<2||36<y)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(C)){var M=o(y),P=this.div(M),F=P.mul(M).sub(this);return P.toString(y)+F.toInt().toString(y)}else return"-"+this.neg().toString(y);for(var I=o(a(y,6),this.unsigned),N=this,q="";;){var U=N.div(I),V=N.sub(U.mul(I)).toInt()>>>0,Y=V.toString(y);if(N=U,N.isZero())return Y+q;for(;Y.length<6;)Y="0"+Y;q=""+Y+q}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var y=this.high!=0?this.high:this.low,M=31;M>0&&!(y&1<<M);M--);return this.high!=0?M+33:M+1},B.isZero=function(){return this.high===0&&this.low===0},B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return(this.low&1)===1},B.isEven=function(){return(this.low&1)===0},B.equals=function(y){return e(y)||(y=u(y)),this.unsigned!==y.unsigned&&this.high>>>31===1&&y.high>>>31===1?!1:this.high===y.high&&this.low===y.low},B.eq=B.equals,B.notEquals=function(y){return!this.eq(y)},B.neq=B.notEquals,B.lessThan=function(y){return this.comp(y)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(y){return this.comp(y)<=0},B.lte=B.lessThanOrEqual,B.greaterThan=function(y){return this.comp(y)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(y){return this.comp(y)>=0},B.gte=B.greaterThanOrEqual,B.compare=function(y){if(e(y)||(y=u(y)),this.eq(y))return 0;var M=this.isNegative(),P=y.isNegative();return M&&!P?-1:!M&&P?1:this.unsigned?y.high>>>0>this.high>>>0||y.high===this.high&&y.low>>>0>this.low>>>0?-1:1:this.sub(y).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(_)},B.neg=B.negate,B.add=function(y){e(y)||(y=u(y));var M=this.high>>>16,P=this.high&65535,F=this.low>>>16,I=this.low&65535,N=y.high>>>16,q=y.high&65535,U=y.low>>>16,V=y.low&65535,Y=0,ee=0,oe=0,me=0;return me+=I+V,oe+=me>>>16,me&=65535,oe+=F+U,ee+=oe>>>16,oe&=65535,ee+=P+q,Y+=ee>>>16,ee&=65535,Y+=M+N,Y&=65535,s(oe<<16|me,Y<<16|ee,this.unsigned)},B.subtract=function(y){return e(y)||(y=u(y)),this.add(y.neg())},B.sub=B.subtract,B.multiply=function(y){if(this.isZero()||(e(y)||(y=u(y)),y.isZero()))return g;if(this.eq(C))return y.isOdd()?C:g;if(y.eq(C))return this.isOdd()?C:g;if(this.isNegative())return y.isNegative()?this.neg().mul(y.neg()):this.neg().mul(y).neg();if(y.isNegative())return this.mul(y.neg()).neg();if(this.lt(m)&&y.lt(m))return o(this.toNumber()*y.toNumber(),this.unsigned);var M=this.high>>>16,P=this.high&65535,F=this.low>>>16,I=this.low&65535,N=y.high>>>16,q=y.high&65535,U=y.low>>>16,V=y.low&65535,Y=0,ee=0,oe=0,me=0;return me+=I*V,oe+=me>>>16,me&=65535,oe+=F*V,ee+=oe>>>16,oe&=65535,oe+=I*U,ee+=oe>>>16,oe&=65535,ee+=P*V,Y+=ee>>>16,ee&=65535,ee+=F*U,Y+=ee>>>16,ee&=65535,ee+=I*q,Y+=ee>>>16,ee&=65535,Y+=M*V+P*U+F*q+I*N,Y&=65535,s(oe<<16|me,Y<<16|ee,this.unsigned)},B.mul=B.multiply,B.divide=function(y){if(e(y)||(y=u(y)),y.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?A:g;var M,P,F;if(this.unsigned){if(y.unsigned||(y=y.toUnsigned()),y.gt(this))return A;if(y.gt(this.shru(1)))return v;F=A}else{if(this.eq(C)){if(y.eq(_)||y.eq(x))return C;if(y.eq(C))return _;var I=this.shr(1);return M=I.div(y).shl(1),M.eq(g)?y.isNegative()?_:x:(P=this.sub(y.mul(M)),F=M.add(P.div(y)),F)}else if(y.eq(C))return this.unsigned?A:g;if(this.isNegative())return y.isNegative()?this.neg().div(y.neg()):this.neg().div(y).neg();if(y.isNegative())return this.div(y.neg()).neg();F=g}for(P=this;P.gte(y);){M=Math.max(1,Math.floor(P.toNumber()/y.toNumber()));for(var N=Math.ceil(Math.log(M)/Math.LN2),q=N<=48?1:a(2,N-48),U=o(M),V=U.mul(y);V.isNegative()||V.gt(P);)M-=q,U=o(M,this.unsigned),V=U.mul(y);U.isZero()&&(U=_),F=F.add(U),P=P.sub(V)}return F},B.div=B.divide,B.modulo=function(y){return e(y)||(y=u(y)),this.sub(this.div(y).mul(y))},B.mod=B.modulo,B.not=function(){return s(~this.low,~this.high,this.unsigned)},B.and=function(y){return e(y)||(y=u(y)),s(this.low&y.low,this.high&y.high,this.unsigned)},B.or=function(y){return e(y)||(y=u(y)),s(this.low|y.low,this.high|y.high,this.unsigned)},B.xor=function(y){return e(y)||(y=u(y)),s(this.low^y.low,this.high^y.high,this.unsigned)},B.shiftLeft=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low<<y,this.high<<y|this.low>>>32-y,this.unsigned):s(0,this.low<<y-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low>>>y|this.high<<32-y,this.high>>y,this.unsigned):s(this.high>>y-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(y){if(e(y)&&(y=y.toInt()),y&=63,y===0)return this;var M=this.high;if(y<32){var P=this.low;return s(P>>>y|M<<32-y,M>>>y,this.unsigned)}else return y===32?s(M,0,this.unsigned):s(M>>>y-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},B.toBytes=function(T){return T?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var T=this.high,y=this.low;return[y&255,y>>>8&255,y>>>16&255,y>>>24&255,T&255,T>>>8&255,T>>>16&255,T>>>24&255]},B.toBytesBE=function(){var T=this.high,y=this.low;return[T>>>24&255,T>>>16&255,T>>>8&255,T&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255]},t})});var xs=Ae((q4,sg)=>{sg.exports=globalThis.h3||{}});var fl=Ae((n9,_g)=>{_g.exports=globalThis.luma});var Is=Ae((i9,bg)=>{bg.exports=globalThis.deck});var On=Ae((Yz,j0)=>{j0.exports=globalThis.loaders});var Fv=Ae((cY,Pv)=>{Pv.exports=globalThis.deck});var kv=Ae(xh=>{xh.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=o*256+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=s*256+t[e+f],f+=h,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(d?-1:1)*s*Math.pow(2,o-n)};xh.write=function(t,e,r,n,i,o){var s,a,c,u=o*8-i-1,l=(1<<u)-1,f=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?e+=h/c:e+=h*Math.pow(2,1-f),e*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*c-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=a&255,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=s&255,d+=p,s/=256,u-=8);t[r+d-p]|=m*128}});var Kv=Ae((ZY,Yv)=>{"use strict";Yv.exports=ie;var Ac=kv();function ie(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ie.Varint=0;ie.Fixed64=1;ie.Bytes=2;ie.Fixed32=5;var Th=(1<<16)*(1<<16),Wv=1/Th,QP=12,qv=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ie.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=vc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Jv(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=vc(this.buf,this.pos)+vc(this.buf,this.pos+4)*Th;return this.pos+=8,t},readSFixed64:function(){var t=vc(this.buf,this.pos)+Jv(this.buf,this.pos+4)*Th;return this.pos+=8,t},readFloat:function(){var t=Ac.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ac.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,$P(r,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=QP&&qv?dF(this.buf,e,t):hF(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ie.Bytes)return t.push(this.readVarint(e));var r=kt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==ie.Bytes)return t.push(this.readSVarint());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==ie.Bytes)return t.push(this.readBoolean());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==ie.Bytes)return t.push(this.readFloat());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==ie.Bytes)return t.push(this.readDouble());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==ie.Bytes)return t.push(this.readFixed32());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==ie.Bytes)return t.push(this.readSFixed32());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==ie.Bytes)return t.push(this.readFixed64());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==ie.Bytes)return t.push(this.readSFixed64());var e=kt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===ie.Varint)for(;this.buf[this.pos++]>127;);else if(e===ie.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ie.Fixed32)this.pos+=4;else if(e===ie.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ri(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ri(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ri(this.buf,t&-1,this.pos),ri(this.buf,Math.floor(t*Wv),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ri(this.buf,t&-1,this.pos),ri(this.buf,Math.floor(t*Wv),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){eF(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=pF(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Xv(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ac.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ac.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Xv(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ie.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nF,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,iF,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,aF,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,oF,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,sF,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,cF,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uF,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lF,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,fF,e)},writeBytesField:function(t,e){this.writeTag(t,ie.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ie.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ie.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ie.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ie.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ie.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ie.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ie.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ie.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ie.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function $P(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return ti(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function kt(t){return t.type===ie.Bytes?t.readVarint()+t.pos:t.pos+1}function ti(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function eF(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),tF(r,n,e),rF(n,e)}function tF(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function rF(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Xv(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function nF(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function iF(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function oF(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function sF(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function aF(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function cF(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function uF(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function lF(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function fF(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function vc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ri(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Jv(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function hF(t,e,r){for(var n="",i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a>r)break;var c,u,l;a===1?o<128&&(s=o):a===2?(c=t[i+1],(c&192)===128&&(s=(o&31)<<6|c&63,s<=127&&(s=null))):a===3?(c=t[i+1],u=t[i+2],(c&192)===128&&(u&192)===128&&(s=(o&15)<<12|(c&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(c=t[i+1],u=t[i+2],l=t[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(s=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),i+=a}return n}function dF(t,e,r){return qv.decode(t.subarray(e,r))}function pF(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});var Ao={};Oe(Ao,{GeohashLayer:()=>Cc,GreatCircleLayer:()=>Qo,H3ClusterLayer:()=>Ms,H3HexagonLayer:()=>Rr,MVTLayer:()=>Sc,QuadkeyLayer:()=>as,S2Layer:()=>is,TerrainLayer:()=>fc,Tile3DLayer:()=>nc,TileLayer:()=>Ut,TripsLayer:()=>bs,_GeoCellLayer:()=>$e,_Tile2DHeader:()=>Ti,_Tileset2D:()=>Mi,_WMSLayer:()=>Yo,_getURLFromTemplate:()=>wt});var vt={},Vh=X(ut());Xt(vt,X(ut()));if(!Vh.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");Xt(Ao,vt);var Or=X(lt()),im=X(ut());function F_(t){return typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t}function bo(t){if(Array.isArray(t))return t.map(e=>bo(e));if(t&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[F_(r)]=bo(n);return e}return t}var xd=X(bd(),1);function Lc(t,e){if(e!=null&&e._parser&&e._parser!=="fast-xml-parser")throw new Error(e?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(i,o,s,a)=>{var c;return Boolean(e==null||(c=e.arrayPaths)===null||c===void 0?void 0:c.some(l=>o===l))},...e?._fastXML},n=nb(t,r);return e!=null&&e.uncapitalizeKeys?bo(n):n}function nb(t,e){return new xd.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(t)}var ib=typeof __VERSION__<"u"?__VERSION__:"latest",De={name:"XML",id:"xml",module:"xml",version:ib,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:ob,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(t,e)=>Lc(new TextDecoder().decode(t),{...De.options.xml,...e?.xml}),parseTextSync:(t,e)=>Lc(t,{...De.options.xml,...e?.xml})};function ob(t){return t.startsWith("<?xml")}async function Xe(t,e,r,n){return n._parse(t,e,r,n)}function Q(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var _t={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},sb=_t.self||_t.window||_t.global||{},ab=_t.window||_t.self||_t.global||{},cb=_t.global||_t.self||_t.window||{},ub=_t.document||{};var ai=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Td=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),lb=Td&&parseFloat(Td[1])||0;function Dc(t,e){return Ed(t||{},e)}function Ed(t,e){let r={...t};for(let[n,i]of Object.entries(e))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=Ed(r[n]||{},e[n]):r[n]=e[n];return r}var fb="beta";function hb(){var t;return(t=globalThis._loadersgl_)!==null&&t!==void 0&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},typeof __VERSION__>"u"?(console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN."),globalThis._loadersgl_.version=fb):globalThis._loadersgl_.version=__VERSION__),globalThis._loadersgl_.version}var Sd=hb();function wd(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var bt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},tD=bt.self||bt.window||bt.global||{},rD=bt.window||bt.self||bt.global||{},nD=bt.global||bt.self||bt.window||{},iD=bt.document||{};var cn=typeof process!="object"||String(process)!=="[object process]"||process.browser,Eo=typeof importScripts=="function",oD=typeof window<"u"&&typeof window.orientation<"u",Bd=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),sD=Bd&&parseFloat(Bd[1])||0;var Nc={};async function xt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return e&&(t=Cd(t,e,r,n)),Nc[t]=Nc[t]||db(t),await Nc[t]}function Cd(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let i=r.modules||{};return i[n]?i[n]:cn?r.CDN?(wd(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Sd}/dist/libs/${n}`):Eo?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function db(t){if(t.endsWith("wasm"))return await mb(t);if(!cn)try{return Je&&Je.requireFromFile&&await Je.requireFromFile(t)}catch(r){return console.error(r),null}if(Eo)return importScripts(t);let e=await gb(t);return pb(e,t)}function pb(t,e){if(!cn)return Je.requireFromString&&Je.requireFromString(t,e);if(Eo)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function mb(t){return cn||!Je.readFileAsArrayBuffer||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await Je.readFileAsArrayBuffer(t)}async function gb(t){return cn||!Je.readFileAsText||t.startsWith("http")?await(await fetch(t)).text():await Je.readFileAsText(t)}function Id(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?Md(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?Md(t,0,e):""}function Md(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),i="";for(let o=0;o<r;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}function Gc(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${Id(t)}"`)}}function ci(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];let n=e,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let o=n.reduce((c,u)=>c+u.length,0),s=new i(o),a=0;for(let c of n)s.set(c,a),a+=c.length;return s}function xr(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function qt(t,e){return Q(t>=0),Q(e>0),t+(e-1)&~(e-1)}function Uc(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let i=t.byteOffset,o=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,i,o)}return e.set(n,r),r+qt(n.byteLength,4)}function ui(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var Tr=class{constructor(e,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ui(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ui()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var un=class{constructor(e){this.id=void 0,this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,i=this.stats[r];return i||(e instanceof Tr?i=e:i=new Tr(r,n),this.stats[r]=i),i}};var yb="Queued Requests",Ab="Active Requests",vb="Cancelled Requests",_b="Queued Requests Ever",bb="Active Requests Ever",xb={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Yt=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.props=void 0,this.stats=void 0,this.activeRequestCount=0,this.requestQueue=[],this.requestMap=new Map,this.deferredUpdate=null,this.props={...xb,...e},this.stats=new un({id:this.props.id}),this.stats.get(yb),this.stats.get(Ab),this.stats.get(vb),this.stats.get(_b),this.stats.get(bb)}scheduleRequest(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);let n={handle:e,priority:0,getPriority:r},i=new Promise(o=>(n.resolve=o,n));return this.requestQueue.push(n),this.requestMap.set(e,i),this._issueNewRequests(),i}_issueRequest(e){let{handle:r,resolve:n}=e,i=!1,o=()=>{i||(i=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;let e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let r=0;r<e;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let e=this.requestQueue;for(let r=0;r<e.length;++r){let n=e[r];this._updateRequest(n)||(e.splice(r,1),this.requestMap.delete(n.handle),r--)}e.sort((r,n)=>r.priority-n.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}};var Kt={};Oe(Kt,{dirname:()=>Eb,filename:()=>Tb,join:()=>Sb,resolve:()=>wb});function Od(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)===null||t===void 0?void 0:t.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Tb(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function Eb(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function Sb(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];let n="/";return e=e.map((i,o)=>(o&&(i=i.replace(new RegExp(`^${n}`),"")),o!==e.length-1&&(i=i.replace(new RegExp(`${n}$`),"")),i)),e.join(n)}function wb(){let t=[];for(let i=0;i<arguments.length;i++)t[i]=i<0||arguments.length<=i?void 0:arguments[i];let e="",r=!1,n;for(let i=t.length-1;i>=-1&&!r;i--){let o;i>=0?o=t[i]:(n===void 0&&(n=Od()),o=n),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===li)}return e=Bb(e,!r),r?`/${e}`:e.length>0?e:"."}var li=47,Hc=46;function Bb(t,e){let r="",n=-1,i=0,o,s=!1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(o===li)break;o=li}if(o===li){if(!(n===a-1||i===1))if(n!==a-1&&i===2){if(r.length<2||!s||r.charCodeAt(r.length-1)!==Hc||r.charCodeAt(r.length-2)!==Hc){if(r.length>2){let c=r.length-1,u=c;for(;u>=0&&r.charCodeAt(u)!==li;--u);if(u!==c){r=u===-1?"":r.slice(0,u),n=a,i=0,s=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,i=0,s=!1;continue}}e&&(r.length>0?r+="/..":r="..",s=!0)}else{let c=t.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,s=!1}n=a,i=0}else o===Hc&&i!==-1?++i:i=-1}return r}var So=class{constructor(e){this.data=void 0,this.fetch=void 0,this.loadOptions=void 0,this._needsRefresh=!0,this.props=void 0,this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=Cb(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}};function Cb(t){let e=t?.fetch;if(e&&typeof e=="function")return(n,i)=>e(n,i);let r=t?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var Qe=class extends So{};Qe.type="template";Qe.testURL=t=>!1;function Rd(t,e){var r,n,i;let o=(r=De.parseTextSync)===null||r===void 0?void 0:r.call(De,t,e),s=(o==null||(n=o.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(o==null||(i=o["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]);return typeof s=="string"?s:s.value||s.code||"Unknown error"}var Mb=typeof __VERSION__<"u"?__VERSION__:"latest",Er={id:"wms-error",name:"WMS Error",module:"wms",version:Mb,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Ib,options:{wms:{throwOnError:!1}},parse:async(t,e)=>Vc(new TextDecoder().decode(t),e),parseSync:(t,e)=>Vc(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Vc(t,e)};function Ib(t){return t.startsWith("<?xml")}function Vc(t,e){let r={...Er.options.wms,...e?.wms},n=Rd(t,r),i=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(i);return i}function Sr(t){return Array.isArray(t)?t:t?[t]:[]}function fi(t){let e=Sr(t);return e.length>0&&e.every(r=>typeof r=="string")?e:[]}function hi(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseFloat(t);default:return}}function wo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseInt(t,10);default:return}}function wr(t){switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function zc(t,e){var r;let n=(r=De.parseTextSync)===null||r===void 0?void 0:r.call(De,t,e),i=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,o=Ob(i);if(e!=null&&e.inheritedLayerProps)for(let s of o.layers)Fd(s,null);return e!=null&&e.includeRawJSON&&(o.json=i),e!=null&&e.includeXMLText&&(o.xml=t),o}function Ob(t){var e,r,n,i,o,s,a,c,u,l,f,h,d,p,m,g;let A={version:String(t.version||""),name:String(((e=t.Service)===null||e===void 0?void 0:e.Name)||"unnamed"),title:(r=t.Service)!==null&&r!==void 0&&r.Title?String((n=t.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=t.Service)!==null&&i!==void 0&&i.Abstract?String((o=t.Service)===null||o===void 0?void 0:o.Abstract):void 0,keywords:fi((s=t.Service)===null||s===void 0||(a=s.KeywordList)===null||a===void 0?void 0:a.Keyword),fees:(c=t.Service)!==null&&c!==void 0&&c.Fees?JSON.stringify((u=t.Service)===null||u===void 0?void 0:u.Fees):void 0,accessConstraints:(l=t.Service)!==null&&l!==void 0&&l.AccessConstraints?JSON.stringify((f=t.Service)===null||f===void 0?void 0:f.AccessConstraints):void 0,layerLimit:wo((h=t.Service)===null||h===void 0?void 0:h.LayerLimit),maxWidth:wo((d=t.Service)===null||d===void 0?void 0:d.maxWidth),maxHeight:wo((p=t.Service)===null||p===void 0?void 0:p.maxHeight),layers:[],requests:Rb((m=t.Capability)===null||m===void 0?void 0:m.Request),exceptions:Pb(t.Exception)},_=Sr((g=t.Capability)===null||g===void 0?void 0:g.Layer);for(let v of _)A.layers.push(Pd(v));for(let[v,x]of Object.entries(A))x===void 0&&delete A[v];return A}function Rb(t){let e={};for(let[r,n]of Object.entries(t||{})){let i=fi(n?.Format);e[r]={mimeTypes:i}}return e}function Pb(t){if(Sr(t?.Format).length>0)return{mimeTypes:fi(t)}}function Pd(t){var e;let r={title:String(t?.Title||""),name:t?.Name&&String(t?.Name),abstract:t?.Name&&String(t?.Abstract),keywords:fi((e=t.KeywordList)===null||e===void 0?void 0:e.Keyword)},n=t?.CRS||t?.SRS;n&&Array.isArray(n)&&n.every(l=>typeof l=="string")&&(r.crs=n);let i=t?.EX_GeographicBoundingBox&&Fb(t?.EX_GeographicBoundingBox);i&&(r.geographicBoundingBox=i),i=t?.LatLonBoundingBox&&Lb(t?.LatLonBoundingBox),i&&(r.geographicBoundingBox=i);let o=t?.BoundingBox&&Db(t?.BoundingBox);o&&o.length>0&&(r.boundingBoxes=o);let a=Sr(t?.Dimension).map(l=>Gb(l));a.length&&(r.dimensions=a),t!=null&&t.opaque&&(r.opaque=wr(t?.opaque)),t!=null&&t.cascaded&&(r.cascaded=wr(t?.cascaded)),t!=null&&t.queryable&&(r.queryable=wr(t?.queryable));let c=Sr(t?.Layer),u=[];for(let l of c)u.push(Pd(l));u.length>0&&(r.layers=u);for(let[l,f]of Object.entries(r))f===void 0&&delete r[l];return r}function Fb(t){let{westBoundLongitude:e,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:i}=t;return[[e,i],[n,r]]}function Lb(t){let{minx:e,miny:r,maxx:n,maxy:i}=t;return[[e,r],[n,i]]}function Db(t){return Sr(t).map(r=>Nb(r))}function Nb(t){let{CRS:e,SRS:r,minx:n,miny:i,maxx:o,maxy:s,resx:a,resy:c}=t,u={crs:e||r,boundingBox:[[hi(n),hi(i)],[hi(o),hi(s)]]};return a&&(u.xResolution=a),c&&(u.yResolution=c),u}function Gb(t){let{name:e,units:r,value:n}=t,i={name:e,units:r,extent:n};return t.unitSymbol&&(i.unitSymbol=t.unitSymbol),t.default&&(i.defaultValue=t.default),t.multipleValues&&(i.multipleValues=wr(t.multipleValues)),t.nearestValue&&(i.nearestValue=wr(t.nearestValue)),t.current&&(i.current=wr(t.current)),i}function Fd(t,e){e!=null&&e.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=[...e.geographicBoundingBox]),e!=null&&e.crs&&!t.crs&&(t.crs=[...e.crs]),e!=null&&e.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=[...e.boundingBoxes]),e!=null&&e.dimensions&&!t.dimensions&&(t.dimensions=[...e.dimensions]);for(let r of t.layers||[])Fd(r,t)}var Ub=typeof __VERSION__<"u"?__VERSION__:"latest",ln={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:Ub,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:Hb,options:{wms:{}},parse:async(t,e)=>zc(new TextDecoder().decode(t),e?.wms),parseTextSync:(t,e)=>zc(t,e?.wms)};function Hb(t){return t.startsWith("<?xml")}function jc(t,e){var r,n;let o=((n=((r=De.parseTextSync)===null||r===void 0?void 0:r.call(De,t,e)).FeatureInfoResponse)===null||n===void 0?void 0:n.FIELDS)||[];return{features:(Array.isArray(o)?o:[o]).map(a=>Vb(a))}}function Vb(t){return{attributes:t||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var Ld={...ln,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(t,e)=>jc(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>jc(t,e)};function kc(t,e){var r;return(r=De.parseTextSync)===null||r===void 0?void 0:r.call(De,t,e)}var Dd={...ln,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(t,e)=>kc(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>kc(t,e)};function Nd(t,e){let{type:r="auto"}=t,n=r==="auto"?jb(t.url,e):zb(r,e);if(!n)throw new Error("Not a valid image source type");return n.create(t)}function zb(t,e){for(let r of e)if(r.type===t)return r;return null}function jb(t,e){for(let r of e)if(r.testURL&&r.testURL(t))return r;return null}var Gd=typeof __VERSION__<"u"?__VERSION__:"latest";var Wc,kb=(Wc=globalThis.loaders)===null||Wc===void 0?void 0:Wc.parseImageNode,Xc=typeof Image<"u",Jc=typeof ImageBitmap<"u",Wb=Boolean(kb),qc=ai?!0:Wb;function Ud(t){switch(t){case"auto":return Jc||Xc||qc;case"imagebitmap":return Jc;case"image":return Xc;case"data":return qc;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Hd(){if(Jc)return"imagebitmap";if(Xc)return"image";if(qc)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Vd(t){let e=Xb(t);if(!e)throw new Error("Not an image");return e}function di(t){switch(Vd(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Xb(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Jb=/^data:image\/svg\+xml/,qb=/\.svg((\?|#).*)?$/;function Bo(t){return t&&(Jb.test(t)||qb.test(t))}function zd(t,e){if(Bo(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Yc(t,e)}function Yc(t,e){if(Bo(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Co(t,e,r){let n=zd(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Yb(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function Yb(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=o=>i(new Error(`Could not load image ${t}: ${o}`))}catch(o){i(o)}})}var Kb={},jd=!0;async function kd(t,e,r){let n;Bo(r)?n=await Co(t,e,r):n=Yc(t,r);let i=e&&e.imagebitmap;return await Zb(n,i)}async function Zb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((Qb(e)||!jd)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),jd=!1}return await createImageBitmap(t)}function Qb(t){for(let e in t||Kb)return!1;return!0}function Wd(t){return!rx(t,"ftyp",4)||!(t[8]&96)?null:$b(t)}function $b(t){switch(ex(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ex(t,e,r){return String.fromCharCode(...t.slice(e,r))}function tx(t){return[...t].map(e=>e.charCodeAt(0))}function rx(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=tx(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var Tt=!1,pi=!0;function Br(t){let e=mi(t);return ix(e)||ax(e)||ox(e)||sx(e)||nx(e)}function nx(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Wd(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function ix(t){let e=mi(t);return e.byteLength>=24&&e.getUint32(0,Tt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Tt),height:e.getUint32(20,Tt)}:null}function ox(t){let e=mi(t);return e.byteLength>=10&&e.getUint32(0,Tt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,pi),height:e.getUint16(8,pi)}:null}function sx(t){let e=mi(t);return e.byteLength>=14&&e.getUint16(0,Tt)===16973&&e.getUint32(2,pi)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pi),height:e.getUint32(22,pi)}:null}function ax(t){let e=mi(t);if(!(e.byteLength>=3&&e.getUint16(0,Tt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=cx(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Tt);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Tt),width:e.getUint16(o+7,Tt)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Tt)}return null}function cx(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function mi(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Xd(t,e){var r;let{mimeType:n}=Br(t)||{},i=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Q(i),await i(t,n)}async function Jd(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=ux(i),a;switch(s){case"imagebitmap":a=await kd(t,e,o);break;case"image":a=await Co(t,e,o);break;case"data":a=await Xd(t,e);break;default:Q(!1)}return i==="data"&&(a=di(a)),a}function ux(t){switch(t){case"auto":case"data":return Hd();default:return Ud(t),t}}var lx=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],fx=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],hx={image:{type:"auto",decode:!0}},Zt={id:"image",module:"images",name:"Images",version:Gd,mimeTypes:fx,extensions:lx,parse:Jd,tests:[t=>Boolean(Br(new DataView(t)))],options:hx};var Kc={};function Zc(t){if(Kc[t]===void 0){let e=ai?px(t):dx(t);Kc[t]=e}return Kc[t]}function dx(t){var e,r;let n=["image/png","image/jpeg","image/gif"],i=((e=globalThis.loaders)===null||e===void 0?void 0:e.imageFormatsNode)||n,o=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Boolean(o)&&i.includes(t)}function px(t){switch(t){case"image/avif":case"image/webp":return mx(t);default:return!0}}function mx(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var qd={type:"wms",testURL:t=>t.toLowerCase().includes("wms"),create:t=>new Qc(t)},Qc=class extends Qe{constructor(e){var r;super(e),this.url=void 0,this.data=void 0,this.substituteCRS84=void 0,this.flipCRS=void 0,this.wmsParameters=void 0,this.vendorParameters=void 0,this.capabilities=null,this.url=e.url,this.data=e.url,this.substituteCRS84=(r=e.substituteCRS84)!==null&&r!==void 0?r:!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...e.wmsParameters},this.vendorParameters=e.vendorParameters||{}}async getMetadata(){let e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){return await this.getMap(e)}normalizeMetadata(e){return e}async getCapabilities(e,r){let n=this.getCapabilitiesURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);let s=await ln.parse(o,this.loadOptions);return this.capabilities=s,s}async getMap(e,r){let n=this.getMapURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await Zt.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}async getFeatureInfo(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await Ld.parse(o,this.loadOptions)}async getFeatureInfoText(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),new TextDecoder().decode(o)}async describeLayer(e,r){let n=this.describeLayerURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await Dd.parse(o,this.loadOptions)}async getLegendGraphic(e,r){let n=this.getLegendGraphicURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await Zt.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}getCapabilitiesURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(e,r){e=this._getWMS130Parameters(e);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(e,r){e=this._getWMS130Parameters(e);let n={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetFeatureInfo",n,r)}describeLayerURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(e){let[r,n]=e.split("?"),i=n.split("&"),o={};for(let s of i){let[a,c]=s.split("=");o[a]=c}return{url:r,parameters:o}}_getWMSUrl(e,r,n){let i=this.url,o=!0,s={service:"WMS",version:r.version,request:e,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,u]of Object.entries(s))(!a.includes(c)||u)&&(i+=o?"?":"&",o=!1,i+=this._getURLParameter(c,u,r));return encodeURI(i)}_getWMS130Parameters(e){let r={...e};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(e,r,n){switch(e){case"crs":n.version!=="1.3.0"?e="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(e="crs");break;case"boundingBox":let i=r,o=[...i[0],...i[1]];o=this._flipBoundingBox(i,n),o&&(r=o);break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;default:}return e=e.toUpperCase(),Array.isArray(r)?`${e}=${r.join(",")}`:`${e}=${r?String(r):""}`}_flipBoundingBox(e,r){if(!Array.isArray(e)||e.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),i=e;return n?[i[1],i[0],i[3],i[2]]:i}async _fetchArrayBuffer(e){let r=await this.fetch(e),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(e,r){let n=e.headers["content-type"];if(!e.ok||Er.mimeTypes.includes(n)){var i;let o=Dc(this.loadOptions,{wms:{throwOnError:!0}}),s=(i=Er.parseSync)===null||i===void 0?void 0:i.call(Er,r,o);throw new Error(s)}}_parseError(e){var r;let n=(r=Er.parseSync)===null||r===void 0?void 0:r.call(Er,e,this.loadOptions);return new Error(n)}};var fn=class extends Qe{constructor(e){super(e)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(e){let r=this.getGranularParameters(e),n=this.getURLFromTemplate(r),o=await(await this.fetch(n)).arrayBuffer();return await Zt.parse(o)}getGranularParameters(e){let[[r,n],[i,o]]=e.boundingBox;return{...e,east:r,north:n,south:o,west:i}}getURLFromTemplate(e){let r=this.props.url;for(let[n,i]of Object.entries(e))r=r.replace(`\${${n}}`,String(i)),r=r.replace(`{${n}}`,String(i));return r}};fn.type="template";fn.testURL=t=>t.toLowerCase().includes("{");var $c=class extends fn{constructor(e){super(e),this.data=void 0,this.data=e.url}async getMetadata(){return await this.metadata()}async getImage(e){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(e){throw new Error("not implemented")}metadataURL(e){return`${this.props.url}?f=pjson`}exportImageURL(e){let r=`bbox=${e.bbox[0]},${e.bbox[1]},${e.bbox[2]},${e.bbox[3]}`,n=`size=${e.width},${e.height}`,i={...e,bbox:r,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(e,r,n){let i=`${this.props.url}/${e}`,o=!0;for(let[s,a]of Object.entries(r))i+=o?"?":"&",o=!1,Array.isArray(a)?i+=`${s.toUpperCase()}=${a.join(",")}`:i+=`${s.toUpperCase()}=${a?String(a):""}`;return i}async checkResponse(e){if(!e.ok)throw new Error("error")}},Yd={type:"arcgis-image-server",testURL:t=>t.toLowerCase().includes("ImageServer"),create:t=>new $c(t)};var gx=[qd,Yd];function eu(t){return Nd(t,gx)}function L(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var yx=1/Math.PI*180,Ax=1/180*Math.PI,vx={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...vx}};var ue=globalThis.mathgl.config;function tu(t,{precision:e=ue.precision}={}){return t=_x(t),"".concat(parseFloat(t.toPrecision(e)))}function qe(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ru(t){return Kd(t)}function nu(t){return Ye(t)}function Kd(t,e){return iu(t,r=>r*Ax,e)}function Ye(t,e){return iu(t,r=>r*yx,e)}function Mo(t,e,r){return iu(t,n=>Math.max(e,Math.min(r,n)))}function Qt(t,e,r){return qe(t)?t.map((n,i)=>Qt(n,e[i],r)):r*e+(1-r)*t}function Ne(t,e,r){let n=ue.EPSILON;r&&(ue.EPSILON=r);try{if(t===e)return!0;if(qe(t)&&qe(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Ne(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=ue.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{ue.EPSILON=n}}function _x(t){return Math.round(t/ue.EPSILON)*ue.EPSILON}function bx(t){return t.clone?t.clone():new Array(t.length)}function iu(t,e,r){if(qe(t)){let n=t;r=r||bx(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof t=="number"?t:t[i];r[i]=e(o,i,r)}return r}return e(t)}function xx(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var $t=class extends xx(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:qe(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(ue)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+tu(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Ne(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(ue.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function Tx(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function K(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function er(t,e,r=""){if(ue.debug&&!Tx(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function Be(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var tr=class extends $t{get x(){return this[0]}set x(e){this[0]=K(e)}get y(){return this[1]}set y(e){this[1]=K(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return K(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return K(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Be(e>=0&&e<this.ELEMENTS,"index is out of range"),K(this[e])}setComponent(e,r){return Be(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var de=typeof Float32Array<"u"?Float32Array:Array,gi=Math.random;function hn(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var FG=Math.PI/180;function Ex(){let t=new de(2);return de!=Float32Array&&(t[0]=0,t[1]=0),t}function Zd(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Qd(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Io(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Oo(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var LG=function(){let t=Ex();return function(e,r,n,i,o,s){let a,c;for(r||(r=2),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Ro(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function Po(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function $d(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function ep(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3],t}function Fo(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}var Cr=class extends tr{constructor(e=0,r=0){super(2),qe(e)&&arguments.length===1?this.copy(e):(ue.debug&&(K(e),K(r)),this[0]=e,this[1]=r)}set(e,r){return this[0]=e,this[1]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return ue.debug&&(K(e.x),K(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Oo(this,this,e),this.check()}transformAsVector(e){return Ro(this,this,e),this.check()}transformByMatrix3(e){return Io(this,this,e),this.check()}transformByMatrix2x3(e){return Qd(this,this,e),this.check()}transformByMatrix2(e){return Zd(this,this,e),this.check()}};var pn={};Oe(pn,{add:()=>Cx,angle:()=>uu,bezier:()=>Vx,ceil:()=>Mx,clone:()=>Sx,copy:()=>wx,create:()=>Lo,cross:()=>Mr,dist:()=>Kx,distance:()=>op,div:()=>Yx,divide:()=>ip,dot:()=>yi,equals:()=>Xx,exactEquals:()=>Wx,floor:()=>Ix,forEach:()=>$x,fromValues:()=>Do,hermite:()=>Hx,inverse:()=>Nx,len:()=>lu,length:()=>tp,lerp:()=>Gx,max:()=>Rx,min:()=>Ox,mul:()=>qx,multiply:()=>np,negate:()=>Dx,normalize:()=>ou,random:()=>zx,rotateX:()=>su,rotateY:()=>au,rotateZ:()=>cu,round:()=>Px,scale:()=>Fx,scaleAndAdd:()=>Lx,set:()=>Bx,slerp:()=>Ux,sqrDist:()=>Zx,sqrLen:()=>Qx,squaredDistance:()=>sp,squaredLength:()=>ap,str:()=>kx,sub:()=>Jx,subtract:()=>rp,transformMat3:()=>Ai,transformMat4:()=>Ir,transformQuat:()=>vi,zero:()=>jx});function Lo(){let t=new de(3);return de!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Sx(t){let e=new de(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function tp(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function Do(t,e,r){let n=new de(3);return n[0]=t,n[1]=e,n[2]=r,n}function wx(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Bx(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Cx(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function rp(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function np(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function ip(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Mx(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ix(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Ox(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function Rx(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function Px(t,e){return t[0]=hn(e[0]),t[1]=hn(e[1]),t[2]=hn(e[2]),t}function Fx(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Lx(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function op(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}function sp(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ap(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function Dx(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Nx(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function ou(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function yi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Mr(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2];return t[0]=i*c-o*a,t[1]=o*s-n*c,t[2]=n*a-i*s,t}function Gx(t,e,r,n){let i=e[0],o=e[1],s=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t}function Ux(t,e,r,n){let i=Math.acos(Math.min(Math.max(yi(e,r),-1),1)),o=Math.sin(i),s=Math.sin((1-n)*i)/o,a=Math.sin(n*i)/o;return t[0]=s*e[0]+a*r[0],t[1]=s*e[1]+a*r[1],t[2]=s*e[2]+a*r[2],t}function Hx(t,e,r,n,i,o){let s=o*o,a=s*(2*o-3)+1,c=s*(o-2)+o,u=s*(o-1),l=s*(3-2*o);return t[0]=e[0]*a+r[0]*c+n[0]*u+i[0]*l,t[1]=e[1]*a+r[1]*c+n[1]*u+i[1]*l,t[2]=e[2]*a+r[2]*c+n[2]*u+i[2]*l,t}function Vx(t,e,r,n,i,o){let s=1-o,a=s*s,c=o*o,u=a*s,l=3*o*a,f=3*c*s,h=c*o;return t[0]=e[0]*u+r[0]*l+n[0]*f+i[0]*h,t[1]=e[1]*u+r[1]*l+n[1]*f+i[1]*h,t[2]=e[2]*u+r[2]*l+n[2]*f+i[2]*h,t}function zx(t,e){e=e===void 0?1:e;let r=gi()*2*Math.PI,n=gi()*2-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function Ir(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function Ai(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function vi(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],c=e[1],u=e[2],l=i*u-o*c,f=o*a-n*u,h=n*c-i*a,d=i*h-o*f,p=o*l-n*h,m=n*f-i*l,g=s*2;return l*=g,f*=g,h*=g,d*=2,p*=2,m*=2,t[0]=a+l+d,t[1]=c+f+p,t[2]=u+h+m,t}function su(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function au(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function cu(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function uu(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),u=c&&yi(t,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function jx(t){return t[0]=0,t[1]=0,t[2]=0,t}function kx(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function Wx(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Xx(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=1e-6*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=1e-6*Math.max(1,Math.abs(i),Math.abs(a))}var Jx=rp,qx=np,Yx=ip,Kx=op,Zx=sp,lu=tp,Qx=ap,$x=function(){let t=Lo();return function(e,r,n,i,o,s){let a,c;for(r||(r=3),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var fu=[0,0,0],No,E=class extends tr{static get ZERO(){return No||(No=new E(0,0,0),Object.freeze(No)),No}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&qe(e)?this.copy(e):(ue.debug&&(K(e),K(r),K(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return ue.debug&&(K(e.x),K(e.y),K(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=K(e)}angle(e){return uu(this,e)}cross(e){return Mr(this,this,e),this.check()}rotateX({radians:e,origin:r=fu}){return su(this,this,r,e),this.check()}rotateY({radians:e,origin:r=fu}){return au(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=fu}){return cu(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Ir(this,this,e),this.check()}transformAsVector(e){return Po(this,this,e),this.check()}transformByMatrix3(e){return Ai(this,this,e),this.check()}transformByMatrix2(e){return $d(this,this,e),this.check()}transformByQuaternion(e){return vi(this,this,e),this.check()}};var Go,mn=class extends tr{static get ZERO(){return Go||(Go=new mn(0,0,0,0),Object.freeze(Go)),Go}constructor(e=0,r=0,n=0,i=0){super(-0,-0,-0,-0),qe(e)&&arguments.length===1?this.copy(e):(ue.debug&&(K(e),K(r),K(n),K(i)),this[0]=e,this[1]=r,this[2]=n,this[3]=i)}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return ue.debug&&(K(e.x),K(e.y),K(e.z),K(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=K(e)}get w(){return this[3]}set w(e){this[3]=K(e)}transform(e){return Ir(this,this,e),this.check()}transformByMatrix3(e){return Fo(this,this,e),this.check()}transformByMatrix2(e){return ep(this,this,e),this.check()}transformByQuaternion(e){return vi(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var gn=class extends $t{toString(){let e="[";if(ue.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=K(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function cp(){let t=new de(9);return de!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function up(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function lp(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],l=e[8],f=l*s-a*u,h=-l*o+a*c,d=u*o-s*c,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-l*n+i*u)*p,t[2]=(a*n-i*s)*p,t[3]=h*p,t[4]=(l*r-i*c)*p,t[5]=(-a*r+i*o)*p,t[6]=d*p,t[7]=(-u*r+n*c)*p,t[8]=(s*r-n*o)*p,t):null}function fp(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],u=t[8];return e*(u*o-s*c)+r*(-u*i+s*a)+n*(c*i-o*a)}function hu(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],h=r[0],d=r[1],p=r[2],m=r[3],g=r[4],A=r[5],_=r[6],v=r[7],x=r[8];return t[0]=h*n+d*s+p*u,t[1]=h*i+d*a+p*l,t[2]=h*o+d*c+p*f,t[3]=m*n+g*s+A*u,t[4]=m*i+g*a+A*l,t[5]=m*o+g*c+A*f,t[6]=_*n+v*s+x*u,t[7]=_*i+v*a+x*l,t[8]=_*o+v*c+x*f,t}function hp(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],h=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=h*n+d*s+u,t[7]=h*i+d*a+l,t[8]=h*o+d*c+f,t}function dp(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);return t[0]=d*n+h*s,t[1]=d*i+h*a,t[2]=d*o+h*c,t[3]=d*s-h*n,t[4]=d*a-h*i,t[5]=d*c-h*o,t[6]=u,t[7]=l,t[8]=f,t}function du(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function pp(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,u=r*s,l=n*s,f=n*a,h=i*s,d=i*a,p=i*c,m=o*s,g=o*a,A=o*c;return t[0]=1-f-p,t[3]=l-A,t[6]=h+g,t[1]=l+A,t[4]=1-u-p,t[7]=d-m,t[2]=h-g,t[5]=d+m,t[8]=1-u-f,t}var pu;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(pu||(pu={}));var tT=Object.freeze([1,0,0,0,1,0,0,0,1]),ne=class extends gn{static get IDENTITY(){return nT()}static get ZERO(){return rT()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return pu}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(tT)}fromObject(e){return this.check()}fromQuaternion(e){return pp(this,e),this.check()}set(e,r,n,i,o,s,a,c,u){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=u,this.check()}setRowMajor(e,r,n,i,o,s,a,c,u){return this[0]=e,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=u,this.check()}determinant(){return fp(this)}transpose(){return up(this,this),this.check()}invert(){return lp(this,this),this.check()}multiplyLeft(e){return hu(this,e,this),this.check()}multiplyRight(e){return hu(this,this,e),this.check()}rotate(e){return dp(this,this,e),this.check()}scale(e){return Array.isArray(e)?du(this,this,e):du(this,this,[e,e]),this.check()}translate(e){return hp(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Io(r||[-0,-0],e,this);break;case 3:n=Ai(r||[-0,-0,-0],e,this);break;case 4:n=Fo(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return er(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},Uo,Ho=null;function rT(){return Uo||(Uo=new ne([0,0,0,0,0,0,0,0,0]),Object.freeze(Uo)),Uo}function nT(){return Ho||(Ho=new ne,Object.freeze(Ho)),Ho}var Vo={};Oe(Vo,{add:()=>CT,adjoint:()=>uT,clone:()=>oT,copy:()=>sT,create:()=>iT,decompose:()=>vT,determinant:()=>yu,equals:()=>RT,exactEquals:()=>OT,frob:()=>BT,fromQuat:()=>Eu,fromQuat2:()=>gT,fromRotation:()=>hT,fromRotationTranslation:()=>gp,fromRotationTranslationScale:()=>_T,fromRotationTranslationScaleOrigin:()=>bT,fromScaling:()=>fT,fromTranslation:()=>lT,fromValues:()=>aT,fromXRotation:()=>dT,fromYRotation:()=>pT,fromZRotation:()=>mT,frustum:()=>Su,getRotation:()=>AT,getScaling:()=>yp,getTranslation:()=>yT,identity:()=>mp,invert:()=>gu,lookAt:()=>Cu,mul:()=>PT,multiply:()=>_i,multiplyScalar:()=>MT,multiplyScalarAndAdd:()=>IT,ortho:()=>Bu,orthoNO:()=>vp,orthoZO:()=>ET,perspective:()=>wu,perspectiveFromFieldOfView:()=>TT,perspectiveNO:()=>Ap,perspectiveZO:()=>xT,rotate:()=>_u,rotateX:()=>bu,rotateY:()=>xu,rotateZ:()=>Tu,scale:()=>vu,set:()=>cT,str:()=>wT,sub:()=>FT,subtract:()=>_p,targetTo:()=>ST,translate:()=>Au,transpose:()=>mu});function iT(){let t=new de(16);return de!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function oT(t){let e=new de(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function sT(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function aT(t,e,r,n,i,o,s,a,c,u,l,f,h,d,p,m){let g=new de(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=s,g[7]=a,g[8]=c,g[9]=u,g[10]=l,g[11]=f,g[12]=h,g[13]=d,g[14]=p,g[15]=m,g}function cT(t,e,r,n,i,o,s,a,c,u,l,f,h,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=c,t[8]=u,t[9]=l,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function mp(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mu(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gu(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],g=e[14],A=e[15],_=r*a-n*s,v=r*c-i*s,x=r*u-o*s,w=n*c-i*a,S=n*u-o*a,C=i*u-o*c,B=l*m-f*p,T=l*g-h*p,y=l*A-d*p,M=f*g-h*m,P=f*A-d*m,F=h*A-d*g,I=_*F-v*P+x*M+w*y-S*T+C*B;return I?(I=1/I,t[0]=(a*F-c*P+u*M)*I,t[1]=(i*P-n*F-o*M)*I,t[2]=(m*C-g*S+A*w)*I,t[3]=(h*S-f*C-d*w)*I,t[4]=(c*y-s*F-u*T)*I,t[5]=(r*F-i*y+o*T)*I,t[6]=(g*x-p*C-A*v)*I,t[7]=(l*C-h*x+d*v)*I,t[8]=(s*P-a*y+u*B)*I,t[9]=(n*y-r*P-o*B)*I,t[10]=(p*S-m*x+A*_)*I,t[11]=(f*x-l*S-d*_)*I,t[12]=(a*T-s*M-c*B)*I,t[13]=(r*M-n*T+i*B)*I,t[14]=(m*v-p*w-g*_)*I,t[15]=(l*w-f*v+h*_)*I,t):null}function uT(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],g=e[14],A=e[15],_=r*a-n*s,v=r*c-i*s,x=r*u-o*s,w=n*c-i*a,S=n*u-o*a,C=i*u-o*c,B=l*m-f*p,T=l*g-h*p,y=l*A-d*p,M=f*g-h*m,P=f*A-d*m,F=h*A-d*g;return t[0]=a*F-c*P+u*M,t[1]=i*P-n*F-o*M,t[2]=m*C-g*S+A*w,t[3]=h*S-f*C-d*w,t[4]=c*y-s*F-u*T,t[5]=r*F-i*y+o*T,t[6]=g*x-p*C-A*v,t[7]=l*C-h*x+d*v,t[8]=s*P-a*y+u*B,t[9]=n*y-r*P-o*B,t[10]=p*S-m*x+A*_,t[11]=f*x-l*S-d*_,t[12]=a*T-s*M-c*B,t[13]=r*M-n*T+i*B,t[14]=m*v-p*w-g*_,t[15]=l*w-f*v+h*_,t}function yu(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],u=t[8],l=t[9],f=t[10],h=t[11],d=t[12],p=t[13],m=t[14],g=t[15],A=e*s-r*o,_=e*a-n*o,v=r*a-n*s,x=u*p-l*d,w=u*m-f*d,S=l*m-f*p,C=e*S-r*w+n*x,B=o*S-s*w+a*x,T=u*v-l*_+f*A,y=d*v-p*_+m*A;return c*C-i*B+g*T-h*y}function _i(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],m=e[12],g=e[13],A=e[14],_=e[15],v=r[0],x=r[1],w=r[2],S=r[3];return t[0]=v*n+x*a+w*f+S*m,t[1]=v*i+x*c+w*h+S*g,t[2]=v*o+x*u+w*d+S*A,t[3]=v*s+x*l+w*p+S*_,v=r[4],x=r[5],w=r[6],S=r[7],t[4]=v*n+x*a+w*f+S*m,t[5]=v*i+x*c+w*h+S*g,t[6]=v*o+x*u+w*d+S*A,t[7]=v*s+x*l+w*p+S*_,v=r[8],x=r[9],w=r[10],S=r[11],t[8]=v*n+x*a+w*f+S*m,t[9]=v*i+x*c+w*h+S*g,t[10]=v*o+x*u+w*d+S*A,t[11]=v*s+x*l+w*p+S*_,v=r[12],x=r[13],w=r[14],S=r[15],t[12]=v*n+x*a+w*f+S*m,t[13]=v*i+x*c+w*h+S*g,t[14]=v*o+x*u+w*d+S*A,t[15]=v*s+x*l+w*p+S*_,t}function Au(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,c,u,l,f,h,d,p,m,g,A;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],c=e[2],u=e[3],l=e[4],f=e[5],h=e[6],d=e[7],p=e[8],m=e[9],g=e[10],A=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=u,t[4]=l,t[5]=f,t[6]=h,t[7]=d,t[8]=p,t[9]=m,t[10]=g,t[11]=A,t[12]=s*n+l*i+p*o+e[12],t[13]=a*n+f*i+m*o+e[13],t[14]=c*n+h*i+g*o+e[14],t[15]=u*n+d*i+A*o+e[15]),t}function vu(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function _u(t,e,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,u,l,f,h,d,p,m,g,A,_,v,x,w,S,C,B,T,y,M,P,F,I,N;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,u=Math.sin(r),c=Math.cos(r),l=1-c,f=e[0],h=e[1],d=e[2],p=e[3],m=e[4],g=e[5],A=e[6],_=e[7],v=e[8],x=e[9],w=e[10],S=e[11],C=i*i*l+c,B=o*i*l+s*u,T=s*i*l-o*u,y=i*o*l-s*u,M=o*o*l+c,P=s*o*l+i*u,F=i*s*l+o*u,I=o*s*l-i*u,N=s*s*l+c,t[0]=f*C+m*B+v*T,t[1]=h*C+g*B+x*T,t[2]=d*C+A*B+w*T,t[3]=p*C+_*B+S*T,t[4]=f*y+m*M+v*P,t[5]=h*y+g*M+x*P,t[6]=d*y+A*M+w*P,t[7]=p*y+_*M+S*P,t[8]=f*F+m*I+v*N,t[9]=h*F+g*I+x*N,t[10]=d*F+A*I+w*N,t[11]=p*F+_*I+S*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function bu(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=s*i+l*n,t[6]=a*i+f*n,t[7]=c*i+h*n,t[8]=u*i-o*n,t[9]=l*i-s*n,t[10]=f*i-a*n,t[11]=h*i-c*n,t}function xu(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],u=e[8],l=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*n,t[1]=s*i-l*n,t[2]=a*i-f*n,t[3]=c*i-h*n,t[8]=o*n+u*i,t[9]=s*n+l*i,t[10]=a*n+f*i,t[11]=c*n+h*i,t}function Tu(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],u=e[4],l=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=s*i+l*n,t[2]=a*i+f*n,t[3]=c*i+h*n,t[4]=u*i-o*n,t[5]=l*i-s*n,t[6]=f*i-a*n,t[7]=h*i-c*n,t}function lT(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function fT(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function hT(t,e,r){let n=r[0],i=r[1],o=r[2],s=Math.sqrt(n*n+i*i+o*o),a,c,u;return s<1e-6?null:(s=1/s,n*=s,i*=s,o*=s,c=Math.sin(e),a=Math.cos(e),u=1-a,t[0]=n*n*u+a,t[1]=i*n*u+o*c,t[2]=o*n*u-i*c,t[3]=0,t[4]=n*i*u-o*c,t[5]=i*i*u+a,t[6]=o*i*u+n*c,t[7]=0,t[8]=n*o*u+i*c,t[9]=i*o*u-n*c,t[10]=o*o*u+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function dT(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pT(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mT(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function gp(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,c=i+i,u=o+o,l=n*a,f=n*c,h=n*u,d=i*c,p=i*u,m=o*u,g=s*a,A=s*c,_=s*u;return t[0]=1-(d+m),t[1]=f+_,t[2]=h-A,t[3]=0,t[4]=f-_,t[5]=1-(l+m),t[6]=p+g,t[7]=0,t[8]=h+A,t[9]=p-g,t[10]=1-(l+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function gT(t,e){let r=new de(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=n*n+i*i+o*o+s*s;return f>0?(r[0]=(a*s+l*n+c*o-u*i)*2/f,r[1]=(c*s+l*i+u*n-a*o)*2/f,r[2]=(u*s+l*o+a*i-c*n)*2/f):(r[0]=(a*s+l*n+c*o-u*i)*2,r[1]=(c*s+l*i+u*n-a*o)*2,r[2]=(u*s+l*o+a*i-c*n)*2),gp(t,e,r),t}function yT(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function yp(t,e){let r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],c=e[8],u=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(c*c+u*u+l*l),t}function AT(t,e){let r=new de(3);yp(r,e);let n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,c=e[2]*o,u=e[4]*n,l=e[5]*i,f=e[6]*o,h=e[8]*n,d=e[9]*i,p=e[10]*o,m=s+l+p,g=0;return m>0?(g=Math.sqrt(m+1)*2,t[3]=.25*g,t[0]=(f-d)/g,t[1]=(h-c)/g,t[2]=(a-u)/g):s>l&&s>p?(g=Math.sqrt(1+s-l-p)*2,t[3]=(f-d)/g,t[0]=.25*g,t[1]=(a+u)/g,t[2]=(h+c)/g):l>p?(g=Math.sqrt(1+l-s-p)*2,t[3]=(h-c)/g,t[0]=(a+u)/g,t[1]=.25*g,t[2]=(f+d)/g):(g=Math.sqrt(1+p-s-l)*2,t[3]=(a-u)/g,t[0]=(h+c)/g,t[1]=(f+d)/g,t[2]=.25*g),t}function vT(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let i=n[0],o=n[1],s=n[2],a=n[4],c=n[5],u=n[6],l=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(i*i+o*o+s*s),r[1]=Math.sqrt(a*a+c*c+u*u),r[2]=Math.sqrt(l*l+f*f+h*h);let d=1/r[0],p=1/r[1],m=1/r[2],g=i*d,A=o*p,_=s*m,v=a*d,x=c*p,w=u*m,S=l*d,C=f*p,B=h*m,T=g+x+B,y=0;return T>0?(y=Math.sqrt(T+1)*2,t[3]=.25*y,t[0]=(w-C)/y,t[1]=(S-_)/y,t[2]=(A-v)/y):g>x&&g>B?(y=Math.sqrt(1+g-x-B)*2,t[3]=(w-C)/y,t[0]=.25*y,t[1]=(A+v)/y,t[2]=(S+_)/y):x>B?(y=Math.sqrt(1+x-g-B)*2,t[3]=(S-_)/y,t[0]=(A+v)/y,t[1]=.25*y,t[2]=(w+C)/y):(y=Math.sqrt(1+B-g-x)*2,t[3]=(A-v)/y,t[0]=(S+_)/y,t[1]=(w+C)/y,t[2]=.25*y),t}function _T(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=i+i,u=o+o,l=s+s,f=i*c,h=i*u,d=i*l,p=o*u,m=o*l,g=s*l,A=a*c,_=a*u,v=a*l,x=n[0],w=n[1],S=n[2];return t[0]=(1-(p+g))*x,t[1]=(h+v)*x,t[2]=(d-_)*x,t[3]=0,t[4]=(h-v)*w,t[5]=(1-(f+g))*w,t[6]=(m+A)*w,t[7]=0,t[8]=(d+_)*S,t[9]=(m-A)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function bT(t,e,r,n,i){let o=e[0],s=e[1],a=e[2],c=e[3],u=o+o,l=s+s,f=a+a,h=o*u,d=o*l,p=o*f,m=s*l,g=s*f,A=a*f,_=c*u,v=c*l,x=c*f,w=n[0],S=n[1],C=n[2],B=i[0],T=i[1],y=i[2],M=(1-(m+A))*w,P=(d+x)*w,F=(p-v)*w,I=(d-x)*S,N=(1-(h+A))*S,q=(g+_)*S,U=(p+v)*C,V=(g-_)*C,Y=(1-(h+m))*C;return t[0]=M,t[1]=P,t[2]=F,t[3]=0,t[4]=I,t[5]=N,t[6]=q,t[7]=0,t[8]=U,t[9]=V,t[10]=Y,t[11]=0,t[12]=r[0]+B-(M*B+I*T+U*y),t[13]=r[1]+T-(P*B+N*T+V*y),t[14]=r[2]+y-(F*B+q*T+Y*y),t[15]=1,t}function Eu(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,u=r*s,l=n*s,f=n*a,h=i*s,d=i*a,p=i*c,m=o*s,g=o*a,A=o*c;return t[0]=1-f-p,t[1]=l+A,t[2]=h-g,t[3]=0,t[4]=l-A,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Su(t,e,r,n,i,o,s){let a=1/(r-e),c=1/(i-n),u=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*c,t[10]=(s+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*u,t[15]=0,t}function Ap(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}var wu=Ap;function xT(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=i*s,t[14]=i*n*s}else t[10]=-1,t[14]=-n;return t}function TT(t,e,r,n){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),c=2/(s+a),u=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((s-a)*c*.5),t[9]=(i-o)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function vp(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=(s+o)*u,t[15]=1,t}var Bu=vp;function ET(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=o*u,t[15]=1,t}function Cu(t,e,r,n){let i,o,s,a,c,u,l,f,h,d,p=e[0],m=e[1],g=e[2],A=n[0],_=n[1],v=n[2],x=r[0],w=r[1],S=r[2];return Math.abs(p-x)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(g-S)<1e-6?mp(t):(f=p-x,h=m-w,d=g-S,i=1/Math.sqrt(f*f+h*h+d*d),f*=i,h*=i,d*=i,o=_*d-v*h,s=v*f-A*d,a=A*h-_*f,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=h*a-d*s,u=d*o-f*a,l=f*s-h*o,i=Math.sqrt(c*c+u*u+l*l),i?(i=1/i,c*=i,u*=i,l*=i):(c=0,u=0,l=0),t[0]=o,t[1]=c,t[2]=f,t[3]=0,t[4]=s,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(o*p+s*m+a*g),t[13]=-(c*p+u*m+l*g),t[14]=-(f*p+h*m+d*g),t[15]=1,t)}function ST(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=n[0],c=n[1],u=n[2],l=i-r[0],f=o-r[1],h=s-r[2],d=l*l+f*f+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,f*=d,h*=d);let p=c*h-u*f,m=u*l-a*h,g=a*f-c*l;return d=p*p+m*m+g*g,d>0&&(d=1/Math.sqrt(d),p*=d,m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=f*g-h*m,t[5]=h*p-l*g,t[6]=l*m-f*p,t[7]=0,t[8]=l,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function wT(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function BT(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function CT(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function _p(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function MT(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function IT(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function OT(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function RT(t,e){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],u=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],m=t[13],g=t[14],A=t[15],_=e[0],v=e[1],x=e[2],w=e[3],S=e[4],C=e[5],B=e[6],T=e[7],y=e[8],M=e[9],P=e[10],F=e[11],I=e[12],N=e[13],q=e[14],U=e[15];return Math.abs(r-_)<=1e-6*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-v)<=1e-6*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-x)<=1e-6*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=1e-6*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-S)<=1e-6*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(a-C)<=1e-6*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(u-T)<=1e-6*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(l-y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(f-M)<=1e-6*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(d-F)<=1e-6*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(p-I)<=1e-6*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-N)<=1e-6*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(g-q)<=1e-6*Math.max(1,Math.abs(g),Math.abs(q))&&Math.abs(A-U)<=1e-6*Math.max(1,Math.abs(A),Math.abs(U))}var PT=_i,FT=_p;function LT(){let t=new de(4);return de!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function bp(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function xp(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Tp(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function Ep(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Sp(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function wp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Bp(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function Cp(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}function Mp(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2],u=r[3],l=u*n+a*o-c*i,f=u*i+c*n-s*o,h=u*o+s*i-a*n,d=-s*n-a*i-c*o;return t[0]=l*u+d*-s+f*-c-h*-a,t[1]=f*u+d*-a+h*-s-l*-c,t[2]=h*u+d*-c+l*-a-f*-s,t[3]=e[3],t}var dU=function(){let t=LT();return function(e,r,n,i,o,s){let a,c;for(r||(r=4),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Ou;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Ou||(Ou={}));var NT=45*Math.PI/180,GT=1,Mu=.1,Iu=500,UT=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),k=class extends gn{static get IDENTITY(){return VT()}static get ZERO(){return HT()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Ou}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,s,a,c,u,l,f,h,d,p,m,g){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=u,this[9]=l,this[10]=f,this[11]=h,this[12]=d,this[13]=p,this[14]=m,this[15]=g,this.check()}setRowMajor(e,r,n,i,o,s,a,c,u,l,f,h,d,p,m,g){return this[0]=e,this[1]=o,this[2]=u,this[3]=d,this[4]=r,this[5]=s,this[6]=l,this[7]=p,this[8]=n,this[9]=a,this[10]=f,this[11]=m,this[12]=i,this[13]=c,this[14]=h,this[15]=g,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(UT)}fromObject(e){return this.check()}fromQuaternion(e){return Eu(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=Mu,far:a=Iu}=e;return a===1/0?zT(this,r,n,i,o,s):Su(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return Cu(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=Mu,far:a=Iu}=e;return Bu(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=NT,aspect:n=GT,focalDistance:i=1,near:o=Mu,far:s=Iu}=e;Ip(r);let a=r/2,c=i*Math.tan(a),u=c*n;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:o,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return Ip(r),wu(this,r,n,i,o),this.check()}determinant(){return yu(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*s,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*s,e}transpose(){return mu(this,this),this.check()}invert(){return gu(this,this),this.check()}multiplyLeft(e){return _i(this,e,this),this.check()}multiplyRight(e){return _i(this,this,e),this.check()}rotateX(e){return bu(this,this,e),this.check()}rotateY(e){return xu(this,this,e),this.check()}rotateZ(e){return Tu(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return _u(this,this,e,r),this.check()}scale(e){return vu(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return Au(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Cp(r||[-0,-0,-0,-0],e,this),er(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=Oo(r||[-0,-0],e,this);break;case 3:i=Ir(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return er(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=Ro(r||[-0,-0],e,this);break;case 3:n=Po(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return er(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},zo,jo;function HT(){return zo||(zo=new k([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(zo)),zo}function VT(){return jo||(jo=new k,Object.freeze(jo)),jo}function Ip(t){if(t>Math.PI*2)throw Error("expected radians")}function zT(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),c=(r+e)/(r-e),u=(i+n)/(i-n),l=-1,f=-1,h=-2*o;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=u,t[10]=l,t[11]=f,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function Op(){let t=new de(4);return de!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Rp(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ru(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Pu(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],c=r[1],u=r[2],l=r[3];return t[0]=n*l+s*a+i*u-o*c,t[1]=i*l+s*c+o*a-n*u,t[2]=o*l+s*u+n*c-i*a,t[3]=s*l-n*a-i*c-o*u,t}function Pp(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=i*c+o*a,t[2]=o*c-i*a,t[3]=s*c-n*a,t}function Fp(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-o*a,t[1]=i*c+s*a,t[2]=o*c+n*a,t[3]=s*c-i*a,t}function Lp(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*a,t[1]=i*c-n*a,t[2]=o*c+s*a,t[3]=s*c-o*a,t}function Dp(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function bi(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=r[0],u=r[1],l=r[2],f=r[3],h,d,p,m,g;return h=i*c+o*u+s*l+a*f,h<0&&(h=-h,c=-c,u=-u,l=-l,f=-f),1-h>1e-6?(d=Math.acos(h),g=Math.sin(d),p=Math.sin((1-n)*d)/g,m=Math.sin(n*d)/g):(p=1-n,m=n),t[0]=p*i+m*c,t[1]=p*o+m*u,t[2]=p*s+m*l,t[3]=p*a+m*f,t}function Np(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function Gp(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Fu(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}var Up=bp;var Hp=xp,Vp=wp,zp=Bp,jp=Tp;var kp=Ep;var Wp=Sp;var Xp=function(){let t=Lo(),e=Do(1,0,0),r=Do(0,1,0);return function(n,i,o){let s=yi(i,o);return s<-.999999?(Mr(t,e,i),lu(t)<1e-6&&Mr(t,r,i),ou(t,t),Ru(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Mr(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,Wp(n,n))}}(),BU=function(){let t=Op(),e=Op();return function(r,n,i,o,s,a){return bi(t,n,s,a),bi(e,i,o,a),bi(r,t,e,2*a*(1-a)),r}}(),CU=function(){let t=cp();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],Wp(e,Fu(e,t))}}();var jT=[0,0,0,1],Et=class extends $t{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Fu(this,e),this.check()}fromAxisRotation(e,r){return Ru(this,e,r),this.check()}identity(){return Rp(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=K(e)}get y(){return this[1]}set y(e){this[1]=K(e)}get z(){return this[2]}set z(e){this[2]=K(e)}get w(){return this[3]}set w(e){this[3]=K(e)}len(){return jp(this)}lengthSquared(){return kp(this)}dot(e){return Vp(this,e)}rotationTo(e,r){return Xp(this,e,r),this.check()}add(e){return Up(this,this,e),this.check()}calculateW(){return Dp(this,this),this.check()}conjugate(){return Gp(this,this),this.check()}invert(){return Np(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(zp(this,e,r,n),this.check())}multiplyRight(e){return Pu(this,this,e),this.check()}multiplyLeft(e){return Pu(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Pp(this,this,e),this.check()}rotateY(e){return Fp(this,this,e),this.check()}rotateZ(e){return Lp(this,this,e),this.check()}scale(e){return Hp(this,this,e),this.check()}slerp(e,r,n){let i,o,s;switch(arguments.length){case 1:({start:i=jT,target:o,ratio:s}=e);break;case 2:i=this,o=e,s=r;break;default:i=e,o=r,s=n}return bi(this,i,o,s),this.check()}transformVector4(e,r=new mn){return Mp(r,e,this),er(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var ft={};Oe(ft,{EPSILON1:()=>kT,EPSILON10:()=>$T,EPSILON11:()=>eE,EPSILON12:()=>tE,EPSILON13:()=>rE,EPSILON14:()=>nE,EPSILON15:()=>iE,EPSILON16:()=>oE,EPSILON17:()=>sE,EPSILON18:()=>aE,EPSILON19:()=>cE,EPSILON2:()=>WT,EPSILON20:()=>uE,EPSILON3:()=>XT,EPSILON4:()=>JT,EPSILON5:()=>qT,EPSILON6:()=>YT,EPSILON7:()=>KT,EPSILON8:()=>ZT,EPSILON9:()=>QT,PI_OVER_FOUR:()=>fE,PI_OVER_SIX:()=>hE,PI_OVER_TWO:()=>lE,TWO_PI:()=>dE});var kT=.1,WT=.01,XT=.001,JT=1e-4,qT=1e-5,YT=1e-6,KT=1e-7,ZT=1e-8,QT=1e-9,$T=1e-10,eE=1e-11,tE=1e-12,rE=1e-13,nE=1e-14,iE=1e-15,oE=1e-16,sE=1e-17,aE=1e-18,cE=1e-19,uE=1e-20,lE=Math.PI/2,fE=Math.PI/4,hE=Math.PI/6,dE=Math.PI*2;function ko(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var ht=Math.PI,Kp=ht/4,Jp=ht/180,qp=180/ht,Wo=512;function Lt(t){let[e,r]=t;ko(Number.isFinite(e)),ko(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=e*Jp,i=r*Jp,o=Wo*(n+ht)/(2*ht),s=Wo*(ht+Math.log(Math.tan(Kp+i*.5)))/(2*ht);return[o,s]}function Dt(t){let[e,r]=t,n=e/Wo*(2*ht)-ht,i=2*(Math.atan(Math.exp(r/Wo*(2*ht)-ht))-Kp);return[n*qp,i*qp]}var f8=Math.PI/180;var Qp=6378137*Math.PI;function Lu(t){var e=Lt(t);return e[0]=(e[0]/256-1)*Qp,e[1]=(e[1]/256-1)*Qp,e}function Jo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jo=function(r){return typeof r}:Jo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jo(t)}function $p(t,e){return RE(t)||OE(t,e)||IE(t,e)||ME()}function ME(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IE(t,e){if(t){if(typeof t=="string")return em(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return em(t,e)}}function em(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function OE(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function RE(t){if(Array.isArray(t))return t}function tm(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(n,i)}function Du(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){tm(o,n,i,s,a,"next",c)}function a(c){tm(o,n,i,s,a,"throw",c)}s(void 0)})}}function rm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rm(Object(r),!0).forEach(function(n){PE(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rm(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function PE(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function LE(t,e,r){return e&&nm(t.prototype,e),r&&nm(t,r),t}function qo(t,e,r){return typeof Reflect<"u"&&Reflect.get?qo=Reflect.get:qo=function(i,o,s){var a=DE(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},qo(t,e,r||t)}function DE(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=yn(t),t!==null););return t}function NE(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nu(t,e)}function Nu(t,e){return Nu=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Nu(t,e)}function GE(t){var e=VE();return function(){var n=yn(t),i;if(e){var o=yn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return UE(this,i)}}function UE(t,e){if(e&&(Jo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HE(t)}function HE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function VE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yn(t){return yn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},yn(t)}var zE={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(e,r){return console.error(r,e)}}},Yo=function(t){NE(r,t);var e=GE(r);function r(){var i;FE(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.shouldUpdateState=function(){return!0},n.initializeState=function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0},n.updateState=function(o){var s=this,a=o.changeFlags,c=o.props,u=o.oldProps,l=this.context.viewport;a.dataChanged||c.serviceType!==u.serviceType?(this.state.imageSource=this._createImageSource(c),this._loadMetadata(),this.debounce(function(){return s.loadImage(l,"image source changed")},0)):(0,Or._deepEqual)(c.layers,u.layers,1)?a.viewportChanged&&this.debounce(function(){return s.loadImage(l,"viewport changed")}):this.debounce(function(){return s.loadImage(l,"layers changed")},0)},n.finalizeState=function(){},n.renderLayers=function(){var o=this.state,s=o.bounds,a=o.image,c=o.lastRequestParameters;return a&&new im.BitmapLayer(Xo(Xo({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:c.srs==="EPSG:4326"?Or.COORDINATE_SYSTEM.LNGLAT:Or.COORDINATE_SYSTEM.CARTESIAN,bounds:s,image:a}))},n.getFeatureInfoText=function(){var i=Du(regeneratorRuntime.mark(function s(a,c){var u,l,f,h;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u=this.state.lastRequestParameters,!u){p.next=6;break}return p.next=4,(l=(f=this.state.imageSource).getFeatureInfoText)===null||l===void 0?void 0:l.call(f,Xo(Xo({},u),{},{query_layers:u.layers,x:a,y:c,info_format:"application/vnd.ogc.gml"}));case 4:return h=p.sent,p.abrupt("return",h);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},s,this)}));function o(s,a){return i.apply(this,arguments)}return o}(),n._createImageSource=function(o){if(o.data instanceof Qe)return o.data;if(typeof o.data=="string")return eu({url:o.data,loadOptions:o.loadOptions,type:o.serviceType});throw new Error("invalid image source in props.data")},n._loadMetadata=function(){var i=Du(regeneratorRuntime.mark(function s(){var a,c,u,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this.state.imageSource,h.prev=1,this.state.loadCounter++,h.next=5,a.getMetadata();case 5:c=h.sent,this.state.imageSource===a&&((u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoad(c)),h.next=12;break;case 9:h.prev=9,h.t0=h.catch(1),(l=this.getCurrentLayer())===null||l===void 0||l.props.onMetadataLoadError(h.t0);case 12:return h.prev=12,this.state.loadCounter--,h.finish(12);case 15:case"end":return h.stop()}},s,this,[[1,9,12,15]])}));function o(){return i.apply(this,arguments)}return o}(),n.loadImage=function(){var i=Du(regeneratorRuntime.mark(function s(a,c){var u,l,f,h,d,p,m,g,A,_,v,x,w,S,C,B,T,y,M,P;return regeneratorRuntime.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(u=this.props,l=u.layers,f=u.serviceType,!(f==="wms"&&l.length===0)){I.next=3;break}return I.abrupt("return");case 3:return h=a.getBounds(),d=a.width,p=a.height,m=this.getRequestId(),g=this.props.srs,g==="auto"&&(g=a.resolution?"EPSG:4326":"EPSG:3857"),A={width:d,height:p,bbox:h,layers:l,srs:g},g==="EPSG:3857"&&(_=Lu([h[0],h[1]]),v=$p(_,2),x=v[0],w=v[1],S=Lu([h[2],h[3]]),C=$p(S,2),B=C[0],T=C[1],A.bbox=[x,w,B,T]),I.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(m),I.next=15,this.state.imageSource.getImage(A);case 15:y=I.sent,this.state.lastRequestId<m&&((M=this.getCurrentLayer())===null||M===void 0||M.props.onImageLoad(m),this.setState({image:y,bounds:h,lastRequestParameters:A,lastRequestId:m})),I.next=23;break;case 19:I.prev=19,I.t0=I.catch(10),this.raiseError(I.t0,"Load image"),(P=this.getCurrentLayer())===null||P===void 0||P.props.onImageLoadError(m,I.t0);case 23:return I.prev=23,this.state.loadCounter--,I.finish(23);case 26:case"end":return I.stop()}},s,this,[[10,19,23,26]])}));function o(s,a){return i.apply(this,arguments)}return o}(),n.getRequestId=function(){return this.state._nextRequestId++},n.debounce=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return o()},s)},LE(r,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&qo(yn(r.prototype),"isLoaded",this)}}]),r}(Or.CompositeLayer);Yo.layerName="WMSLayer";Yo.defaultProps=zE;var om=X(ut());function Ko(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ko=function(r){return typeof r}:Ko=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ko(t)}function jE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kE(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gu(t,e)}function Gu(t,e){return Gu=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gu(t,e)}function WE(t){var e=qE();return function(){var n=Zo(t),i;if(e){var o=Zo(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return XE(this,i)}}function XE(t,e){if(e&&(Ko(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JE(t)}function JE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zo(t){return Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Zo(t)}var YE={getHeight:{type:"accessor",value:0},greatCircle:!0},Qo=function(t){kE(r,t);var e=WE(r);function r(){return jE(this,r),e.apply(this,arguments)}return r}(om.ArcLayer);Qo.layerName="GreatCircleLayer";Qo.defaultProps=YE;var am=X(lt()),Vu=X(ut());function $o(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$o=function(r){return typeof r}:$o=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$o(t)}var KE=["updateTriggers"];function ZE(t,e){if(t==null)return{};var r=QE(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function QE(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function $E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eS(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uu(t,e)}function Uu(t,e){return Uu=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Uu(t,e)}function tS(t){var e=iS();return function(){var n=es(t),i;if(e){var o=es(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return rS(this,i)}}function rS(t,e){if(e&&($o(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nS(t)}function nS(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function iS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function es(t){return es=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},es(t)}function sm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sm(Object(r),!0).forEach(function(n){oS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sm(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oS(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var sS=Hu({},Vu.PolygonLayer.defaultProps),$e=function(t){eS(r,t);var e=tS(r);function r(){return $E(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){return null},n.renderLayers=function(){var o=this.props,s=o.elevationScale,a=o.extruded,c=o.wireframe,u=o.filled,l=o.stroked,f=o.lineWidthUnits,h=o.lineWidthScale,d=o.lineWidthMinPixels,p=o.lineWidthMaxPixels,m=o.lineJointRounded,g=o.lineMiterLimit,A=o.lineDashJustified,_=o.getElevation,v=o.getFillColor,x=o.getLineColor,w=o.getLineWidth,S=this.props,C=S.updateTriggers,B=S.material,T=S.transitions,y=this.getSubLayerClass("cell",Vu.PolygonLayer),M=this.indexToBounds()||{},P=M.updateTriggers,F=ZE(M,KE);return new y({filled:u,wireframe:c,extruded:a,elevationScale:s,stroked:l,lineWidthUnits:f,lineWidthScale:h,lineWidthMinPixels:d,lineWidthMaxPixels:p,lineJointRounded:m,lineMiterLimit:g,lineDashJustified:A,material:B,transitions:T,getElevation:_,getFillColor:v,getLineColor:x,getLineWidth:w},this.getSubLayerProps({id:"cell",updateTriggers:C&&Hu(Hu({},P),{},{getElevation:C.getElevation,getFillColor:C.getFillColor,getLineColor:C.getLineColor,getLineWidth:C.getLineWidth})}),F)},r}(am.CompositeLayer);$e.layerName="GeoCellLayer";$e.defaultProps=sS;var ts=X(zu());function hm(t,e){return lS(t)||uS(t,e)||cS(t,e)||aS()}function aS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cS(t,e){if(t){if(typeof t=="string")return um(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return um(t,e)}}function um(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function uS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function lS(t){if(Array.isArray(t))return t}var fS=3,hS=30,dS=2*hS+1,lm=180/Math.PI;function dm(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function fm(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function pm(t){return[fm(t[0]),fm(t[1])]}function mm(t,e){var r=hm(e,2),n=r[0],i=r[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function gm(t){var e=hm(t,3),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,Math.sqrt(r*r+n*n)),s=Math.atan2(n,r);return[s*lm,o*lm]}function ym(t){for(var e=ts.default.fromString(t,!0,10).toString(2);e.length<fS+dS;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,s=ts.default.fromString(n,!0,2).toString(10),a=ts.default.fromString(i,!0,2).toString(4);a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}function pS(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function Am(t){for(var e=t.split("/"),r=parseInt(e[0],10),n=e[1],i=n.length,o=[0,0],s,a=i-1;a>=0;a--){s=i-a;var c=n[a],u=0,l=0;c==="1"?l=1:c==="2"?(u=1,l=1):c==="3"&&(u=1);var f=Math.pow(2,s-1);pS(f,o,u,l),o[0]+=f*u,o[1]+=f*l}if(r%2===1){var h=o[0];o[0]=o[1],o[1]=h}return{face:r,ij:o,level:s}}var vm=X(zu());function mS(t){var e=t.padEnd(16,"0");return vm.default.fromString(e,16)}var gS=100;function yS(t){for(var e=t.face,r=t.ij,n=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(gS*Math.pow(2,-n))),s=new Float64Array(4*o*2+2),a=0,c=0,u=0;u<4;u++)for(var l=i[u].slice(0),f=i[u+1],h=(f[0]-l[0])/o,d=(f[1]-l[1])/o,p=0;p<o;p++){l[0]+=h,l[1]+=d;var m=dm(r,n,l),g=pm(m),A=mm(e,g),_=gm(A);Math.abs(_[1])>89.999&&(_[0]=c);var v=_[0]-c;_[0]+=v>180?-360:v<-180?360:0,s[a++]=_[0],s[a++]=_[1],c=_[0]}return s[a++]=s[0],s[a++]=s[1],s}function AS(t){if(typeof t=="string"){if(t.indexOf("/")>0)return t;t=mS(t)}return ym(t.toString())}function _m(t){var e=AS(t),r=Am(e);return yS(r)}function rs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rs=function(r){return typeof r}:rs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},rs(t)}function vS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _S(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ju(t,e)}function ju(t,e){return ju=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ju(t,e)}function bS(t){var e=ES();return function(){var n=ns(t),i;if(e){var o=ns(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xS(this,i)}}function xS(t,e){if(e&&(rs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TS(t)}function TS(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ES(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ns(t){return ns=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ns(t)}var SS={getS2Token:{type:"accessor",value:function(e){return e.token}}},is=function(t){_S(r,t);var e=bS(r);function r(){return vS(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getS2Token;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(u,l){return _m(a(u,l))}}},r}($e);is.layerName="S2Layer";is.defaultProps=SS;function ku(t,e){return MS(t)||CS(t,e)||BS(t,e)||wS()}function wS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BS(t,e){if(t){if(typeof t=="string")return bm(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bm(t,e)}}function bm(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function CS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function MS(t){if(Array.isArray(t))return t}var Wu=512;function IS(t,e){for(var r=0,n=0,i=1<<t.length,o=i/Wu,s=0;s<t.length;s++){i>>=1;var a=parseInt(t[s]);a%2&&(r|=i),a>1&&(n|=i)}return[[r/o,Wu-n/o],[(r+e)/o,Wu-(n+e)/o]]}function xm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=IS(t,e),n=ku(r,2),i=n[0],o=n[1],s=Dt(i),a=ku(s,2),c=a[0],u=a[1],l=Dt(o),f=ku(l,2),h=f[0],d=f[1];return[h,u,h,d,c,d,c,u,h,u]}function os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?os=function(r){return typeof r}:os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},os(t)}function OS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RS(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xu(t,e)}function Xu(t,e){return Xu=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Xu(t,e)}function PS(t){var e=DS();return function(){var n=ss(t),i;if(e){var o=ss(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return FS(this,i)}}function FS(t,e){if(e&&(os(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LS(t)}function LS(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function DS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ss(t){return ss=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ss(t)}var NS={getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}},as=function(t){RS(r,t);var e=PS(r);function r(){return OS(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.extruded,c=o.getQuadkey,u=a?.99:1;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(f,h){return xm(c(f,h),u)},updateTriggers:{getPolygon:u}}},r}($e);as.layerName="QuadkeyLayer";as.defaultProps=NS;var vs=X(lt()),rg=X(ut());function Tm(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(n,i)}function GS(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){Tm(o,n,i,s,a,"next",c)}function a(c){Tm(o,n,i,s,a,"throw",c)}s(void 0)})}}function US(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Em(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function HS(t,e,r){return e&&Em(t.prototype,e),r&&Em(t,r),t}var Ti=function(){function t(r){US(this,t),this.index=void 0,this.isVisible=void 0,this.isSelected=void 0,this.parent=void 0,this.children=void 0,this.content=void 0,this.state=void 0,this.layers=void 0,this.id=void 0,this.zoom=void 0,this.userData=void 0,this.boundingBox=void 0,this._abortController=void 0,this._loader=void 0,this._loaderId=void 0,this._isLoaded=void 0,this._isCancelled=void 0,this._needsReload=void 0,this._bbox=void 0,this.index=r,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var e=t.prototype;return e._loadData=function(){var r=GS(regeneratorRuntime.mark(function i(o){var s,a,c,u,l,f,h,d,p,m,g,A,_,v;return regeneratorRuntime.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return s=o.getData,a=o.requestScheduler,c=o.onLoad,u=o.onError,l=this.index,f=this.id,h=this.bbox,d=this.userData,p=this.zoom,m=this._loaderId,this._abortController=new AbortController,g=this._abortController.signal,w.next=7,a.scheduleRequest(this,function(S){return S.isSelected?1:-1});case 7:if(A=w.sent,A){w.next=11;break}return this._isCancelled=!0,w.abrupt("return");case 11:if(!this._isCancelled){w.next=14;break}return A.done(),w.abrupt("return");case 14:return _=null,w.prev=15,w.next=18,s({index:l,id:f,bbox:h,userData:d,zoom:p,signal:g});case 18:_=w.sent,w.next=24;break;case 21:w.prev=21,w.t0=w.catch(15),v=w.t0||!0;case 24:return w.prev=24,A.done(),w.finish(24);case 27:if(m===this._loaderId){w.next=29;break}return w.abrupt("return");case 29:if(this._loader=void 0,this.content=_,!(this._isCancelled&&!_)){w.next=34;break}return this._isLoaded=!1,w.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?u(v,this):c(this);case 37:case"end":return w.stop()}},i,this,[[15,21,24,27]])}));function n(i){return r.apply(this,arguments)}return n}(),e.loadData=function(n){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(n),this._loader},e.setNeedsReload=function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0},e.abort=function(){var n;this.isLoaded||(this._isCancelled=!0,(n=this._abortController)===null||n===void 0||n.abort())},HS(t,[{key:"bbox",get:function(){return this._bbox},set:function(n){this._bbox||(this._bbox=n,"west"in n?this.boundingBox=[[n.west,n.south],[n.east,n.north]]:this.boundingBox=[[n.left,n.top],[n.right,n.bottom]])}},{key:"data",get:function(){var n=this;return this.isLoading&&this._loader?this._loader.then(function(){return n.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var n=this.content?this.content.byteLength:0;return Number.isFinite(n)||console.error("byteLength not defined in tile data"),n}}]),t}();var wi=X(lt());var be={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var Sm=new E,VS=new E,rr=class{constructor(e=[0,0,0],r=[0,0,0],n){L(this,"center",void 0),L(this,"halfDiagonal",void 0),L(this,"minimum",void 0),L(this,"maximum",void 0),n=n||Sm.copy(e).add(r).scale(.5),this.center=new E(n),this.halfDiagonal=new E(r).subtract(this.center),this.minimum=new E(e),this.maximum=new E(r)}clone(){return new rr(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){let{halfDiagonal:r}=this,n=VS.from(e.normal),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),o=this.center.dot(n)+e.distance;return o-i>0?be.INSIDE:o+i<0?be.OUTSIDE:be.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=Sm.from(e).subtract(this.center),{halfDiagonal:n}=this,i=0,o;return o=Math.abs(r.x)-n.x,o>0&&(i+=o*o),o=Math.abs(r.y)-n.y,o>0&&(i+=o*o),o=Math.abs(r.z)-n.z,o>0&&(i+=o*o),i}};var Ei=new E,wm=new E,et=class{constructor(e=[0,0,0],r=0){L(this,"center",void 0),L(this,"radius",void 0),this.radius=-0,this.center=new E,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Ei.from(r),this.center=new E().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new et(this.center,this.radius)}union(e){let r=this.center,n=this.radius,i=e.center,o=e.radius,s=Ei.copy(i).subtract(r),a=s.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return e.clone();let c=(n+a+o)*.5;return wm.copy(s).scale((-n+c)/a).add(r),this.center.copy(wm),this.radius=c,this}expand(e){let n=Ei.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Vo.getScaling(Ei,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Ei.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,o=e.normal.dot(r)+e.distance;return o<-n?be.OUTSIDE:o<n?be.INTERSECTING:be.INSIDE}};var zS=new E,jS=new E,cs=new E,us=new E,ls=new E,kS=new E,WS=new E,Nt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},dt=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){L(this,"center",void 0),L(this,"halfAxes",void 0),this.center=new E().from(e),this.halfAxes=new ne(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new E(e).len(),new E(r).len(),new E(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new E(e).normalize(),o=new E(r).normalize(),s=new E(n).normalize();return new Et().fromMatrix3(new ne([...i,...o,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let i=new Et(n),o=new ne().fromQuaternion(i);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new E().from(e),this.halfAxes=o,this}clone(){return new dt(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new et){let r=this.halfAxes,n=r.getColumn(0,cs),i=r.getColumn(1,us),o=r.getColumn(2,ls),s=zS.copy(n).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,i=this.halfAxes,o=n.x,s=n.y,a=n.z,c=Math.abs(o*i[Nt.COLUMN0ROW0]+s*i[Nt.COLUMN0ROW1]+a*i[Nt.COLUMN0ROW2])+Math.abs(o*i[Nt.COLUMN1ROW0]+s*i[Nt.COLUMN1ROW1]+a*i[Nt.COLUMN1ROW2])+Math.abs(o*i[Nt.COLUMN2ROW0]+s*i[Nt.COLUMN2ROW1]+a*i[Nt.COLUMN2ROW2]),u=n.dot(r)+e.distance;return u<=-c?be.OUTSIDE:u>=c?be.INSIDE:be.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=jS.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,cs),o=n.getColumn(1,us),s=n.getColumn(2,ls),a=i.magnitude(),c=o.magnitude(),u=s.magnitude();i.normalize(),o.normalize(),s.normalize();let l=0,f;return f=Math.abs(r.dot(i))-a,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),f=Math.abs(r.dot(s))-u,f>0&&(l+=f*f),l}computePlaneDistances(e,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,c=a.getColumn(0,cs),u=a.getColumn(1,us),l=a.getColumn(2,ls),f=kS.copy(c).add(u).add(l).add(s),h=WS.copy(f).subtract(e),d=r.dot(h);return i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).add(u).subtract(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(u).add(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(u).subtract(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(u).add(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(u).subtract(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(u).add(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(u).subtract(l),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),n[0]=i,n[1]=o,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,cs);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,us);n.transformAsPoint(e);let i=this.halfAxes.getColumn(2,ls);return i.transformAsPoint(e),this.halfAxes=new ne([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var Bm=new E,Cm=new E,Ce=class{constructor(e=[0,0,1],r=0){L(this,"normal",void 0),L(this,"distance",void 0),this.normal=new E,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return Be(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=Bm.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,i){return this.normal.set(e,r,n),Be(Ne(this.normal.len(),1)),this.distance=i,this}clone(){return new Ce(this.normal,this.distance)}equals(e){return Ne(this.distance,e.distance)&&Ne(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=Cm.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=Bm.from(e),i=this.getPointDistance(n),o=Cm.copy(this.normal).scale(i);return n.subtract(o).to(r)}};var Mm=[new E([1,0,0]),new E([0,1,0]),new E([0,0,1])],Im=new E,XS=new E,Ee=class{constructor(e=[]){L(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Mm.length;let r=e.center,n=e.radius,i=0;for(let o of Mm){let s=this.planes[i],a=this.planes[i+1];s||(s=this.planes[i]=new Ce),a||(a=this.planes[i+1]=new Ce);let c=Im.copy(o).scale(-n).add(r);s.fromPointNormal(c,o);let u=Im.copy(o).scale(n).add(r),l=XS.copy(o).negate();a.fromPointNormal(u,l),i+=2}return this}computeVisibility(e){let r=be.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case be.OUTSIDE:return be.OUTSIDE;case be.INTERSECTING:r=be.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(Be(Number.isFinite(r),"parentPlaneMask is required."),r===Ee.MASK_OUTSIDE||r===Ee.MASK_INSIDE)return r;let n=Ee.MASK_INSIDE,i=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&!(r&s))continue;let a=i[o],c=e.intersectPlane(a);if(c===be.OUTSIDE)return Ee.MASK_OUTSIDE;c===be.INTERSECTING&&(n|=s)}return n}};L(Ee,"MASK_OUTSIDE",4294967295);L(Ee,"MASK_INSIDE",0);L(Ee,"MASK_INDETERMINATE",2147483647);var L6=new E,D6=new E,N6=new E,G6=new E,U6=new E;var X6=new E,J6=new E,q6=new E,Y6=new E,K6=new E,Z6=new E,Q6=new E,$6=new E,e4=new E,t4=new E,r4=new E,n4=new E;var St=new ne,qS=new ne,YS=new ne,fs=new ne,Om=new ne;function Yu(t,e={}){let r=ft.EPSILON20,n=10,i=0,o=0,s=qS,a=YS;s.identity(),a.copy(t);let c=r*KS(a);for(;o<n&&ZS(a)>c;)QS(a,fs),Om.copy(fs).transpose(),a.multiplyRight(fs),a.multiplyLeft(Om),s.multiplyRight(fs),++i>2&&(++o,i=0);return e.unitary=s.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function KS(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var Ju=[1,0,0],qu=[2,2,1];function ZS(t){let e=0;for(let r=0;r<3;++r){let n=t[St.getElementIndex(qu[r],Ju[r])];e+=2*n*n}return Math.sqrt(e)}function QS(t,e){let r=ft.EPSILON15,n=0,i=1;for(let u=0;u<3;++u){let l=Math.abs(t[St.getElementIndex(qu[u],Ju[u])]);l>n&&(i=u,n=l)}let o=Ju[i],s=qu[i],a=1,c=0;if(Math.abs(t[St.getElementIndex(s,o)])>r){let u=t[St.getElementIndex(s,s)],l=t[St.getElementIndex(o,o)],f=t[St.getElementIndex(s,o)],h=(u-l)/2/f,d;h<0?d=-1/(-h+Math.sqrt(1+h*h)):d=1/(h+Math.sqrt(1+h*h)),a=1/Math.sqrt(1+d*d),c=d*a}return ne.IDENTITY.to(e),e[St.getElementIndex(o,o)]=e[St.getElementIndex(s,s)]=a,e[St.getElementIndex(s,o)]=c,e[St.getElementIndex(o,s)]=-c,e}var nr=new E,$S=new E,ew=new E,tw=new E,rw=new E,nw=new ne,iw={diagonal:new ne,unitary:new ne};function Si(t,e=new dt){if(!t||t.length===0)return e.halfAxes=new ne([0,0,0,0,0,0,0,0,0]),e.center=new E,e;let r=t.length,n=new E(0,0,0);for(let T of t)n.add(T);let i=1/r;n.multiplyByScalar(i);let o=0,s=0,a=0,c=0,u=0,l=0;for(let T of t){let y=nr.copy(T).subtract(n);o+=y.x*y.x,s+=y.x*y.y,a+=y.x*y.z,c+=y.y*y.y,u+=y.y*y.z,l+=y.z*y.z}o*=i,s*=i,a*=i,c*=i,u*=i,l*=i;let f=nw;f[0]=o,f[1]=s,f[2]=a,f[3]=s,f[4]=c,f[5]=u,f[6]=a,f[7]=u,f[8]=l;let{unitary:h}=Yu(f,iw),d=e.halfAxes.copy(h),p=d.getColumn(0,ew),m=d.getColumn(1,tw),g=d.getColumn(2,rw),A=-Number.MAX_VALUE,_=-Number.MAX_VALUE,v=-Number.MAX_VALUE,x=Number.MAX_VALUE,w=Number.MAX_VALUE,S=Number.MAX_VALUE;for(let T of t)nr.copy(T),A=Math.max(nr.dot(p),A),_=Math.max(nr.dot(m),_),v=Math.max(nr.dot(g),v),x=Math.min(nr.dot(p),x),w=Math.min(nr.dot(m),w),S=Math.min(nr.dot(g),S);p=p.multiplyByScalar(.5*(x+A)),m=m.multiplyByScalar(.5*(w+_)),g=g.multiplyByScalar(.5*(S+v)),e.center.copy(p).add(m).add(g);let C=$S.set(A-x,_-w,v-S).multiplyByScalar(.5),B=new ne([C[0],0,0,0,C[1],0,0,0,C[2]]);return e.halfAxes.multiplyRight(B),e}function Lm(t,e){return aw(t)||sw(t,e)||Dm(t,e)||ow()}function ow(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sw(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function aw(t){if(Array.isArray(t))return t}function Ku(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Dm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Dm(t,e){if(t){if(typeof t=="string")return Rm(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rm(t,e)}}function Rm(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function uw(t,e,r){return e&&Pm(t.prototype,e),r&&Pm(t,r),t}var An=512,Fm=3,Nm=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Gm=Nm.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),lw=Gm.concat([[.25,.5],[.75,.5]]),fw=function(){function t(r,n,i){cw(this,t),this.x=void 0,this.y=void 0,this.z=void 0,this.childVisible=void 0,this.selected=void 0,this._children=void 0,this.x=r,this.y=n,this.z=i}var e=t.prototype;return e.update=function(n){var i=n.viewport,o=n.cullingVolume,s=n.elevationBounds,a=n.minZ,c=n.maxZ,u=n.bounds,l=n.offset,f=n.project,h=this.getBoundingVolume(s,l,f);if(u&&!this.insideBounds(u))return!1;var d=o.computeVisibility(h);if(d<0)return!1;if(!this.childVisible){var p=this.z;if(p<c&&p>=a){var m=h.distanceTo(i.cameraPosition)*i.scale/i.height;p+=Math.floor(Math.log2(m))}if(p>=c)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var g=Ku(this.children),A;try{for(g.s();!(A=g.n()).done;){var _=A.value;_.update(n)}}catch(v){g.e(v)}finally{g.f()}return!0},e.getSelected=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&n.push(this),this._children){var i=Ku(this._children),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.getSelected(n)}}catch(a){i.e(a)}finally{i.f()}}return n},e.insideBounds=function(n){var i=Lm(n,4),o=i[0],s=i[1],a=i[2],c=i[3],u=Math.pow(2,this.z),l=An/u;return this.x*l<a&&this.y*l<c&&(this.x+1)*l>o&&(this.y+1)*l>s},e.getBoundingVolume=function(n,i,o){if(o){var s=this.z<1?lw:this.z<2?Gm:Nm,a=[],c=Ku(s),u;try{for(c.s();!(u=c.n()).done;){var l=u.value,f=hs(this.x+l[0],this.y+l[1],this.z);f[2]=n[0],a.push(o(f)),n[0]!==n[1]&&(f[2]=n[1],a.push(o(f)))}}catch(g){c.e(g)}finally{c.f()}return Si(a)}var h=Math.pow(2,this.z),d=An/h,p=this.x*d+i*An,m=An-(this.y+1)*d;return new rr([p,m,n[0]],[p+d,m+d,n[1]])},uw(t,[{key:"children",get:function(){if(!this._children){var n=this.x*2,i=this.y*2,o=this.z+1;this._children=[new t(n,i,o),new t(n,i+1,o),new t(n+1,i,o),new t(n+1,i+1,o)]}return this._children}}]),t}();function Um(t,e,r,n){var i=t instanceof wi._GlobeViewport&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map(function(w){var S=w.normal,C=w.distance;return new Ce(S.clone().negate(),C)}),s=new Ee(o),a=t.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,u=r&&r[1]*a||0,l=t instanceof wi.WebMercatorViewport&&t.pitch<=60?e:0;if(n){var f=n,h=Lm(f,4),d=h[0],p=h[1],m=h[2],g=h[3],A=Lt([d,g]),_=Lt([m,p]);n=[A[0],An-A[1],_[0],An-_[1]]}var v=new fw(0,0,0),x={viewport:t,project:i,cullingVolume:s,elevationBounds:[c,u],minZ:l,maxZ:e,bounds:n,offset:0};if(v.update(x),t instanceof wi.WebMercatorViewport&&t.subViewports&&t.subViewports.length>1){for(x.offset=-1;v.update(x)&&!(--x.offset<-Fm););for(x.offset=1;v.update(x)&&!(++x.offset>Fm););}return v.getSelected()}function vn(t,e){return pw(t)||dw(t,e)||Vm(t,e)||hw()}function hw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dw(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function pw(t){if(Array.isArray(t))return t}function ds(t){return yw(t)||gw(t)||Vm(t)||mw()}function mw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vm(t,e){if(t){if(typeof t=="string")return Zu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zu(t,e)}}function gw(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yw(t){if(Array.isArray(t))return Zu(t)}function Zu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Gt=512,Aw=[-1/0,-1/0,1/0,1/0],ir={type:"object",value:null,validate:function(e,r){return r.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(function(n){return typeof n=="string"})},equal:function(e,r){if(e===r)return!0;if(!Array.isArray(e)||!Array.isArray(r))return!1;var n=e.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0}};function zm(t,e){var r=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])],n=[Math.min.apply(Math,ds(r.map(function(i){return i[0]}))),Math.min.apply(Math,ds(r.map(function(i){return i[1]}))),Math.max.apply(Math,ds(r.map(function(i){return i[0]}))),Math.max.apply(Math,ds(r.map(function(i){return i[1]})))];return n}function vw(t){return Math.abs(t.split("").reduce(function(e,r){return(e<<5)-e+r.charCodeAt(0)|0},0))}function wt(t,e){if(!t||!t.length)return null;var r=e.index,n=e.id;if(Array.isArray(t)){var i=vw(n)%t.length;t=t[i]}for(var o=t,s=0,a=Object.keys(r);s<a.length;s++){var c=a[s],u=new RegExp("{".concat(c,"}"),"g");o=o.replace(u,String(r[c]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),o}function _w(t,e,r){var n;if(e&&e.length===2){var i=vn(e,2),o=i[0],s=i[1],a=t.getBounds({z:o}),c=t.getBounds({z:s});n=[Math.min(a[0],c[0]),Math.min(a[1],c[1]),Math.max(a[2],c[2]),Math.max(a[3],c[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function jm(t){var e=t.viewport,r=t.z,n=r===void 0?0:r,i=t.cullRect,o=e.subViewports||[e];return o.map(function(s){return Qu(s,n,i)})}function Qu(t,e,r){if(!Array.isArray(e)){var n=r.x-t.x,i=r.y-t.y,o=r.width,s=r.height,a={targetZ:e},c=t.unproject([n,i],a),u=t.unproject([n+o,i],a),l=t.unproject([n,i+s],a),f=t.unproject([n+o,i+s],a);return[Math.min(c[0],u[0],l[0],f[0]),Math.min(c[1],u[1],l[1],f[1]),Math.max(c[0],u[0],l[0],f[0]),Math.max(c[1],u[1],l[1],f[1])]}var h=Qu(t,e[0],r),d=Qu(t,e[1],r);return[Math.min(h[0],d[0]),Math.min(h[1],d[1]),Math.max(h[2],d[2]),Math.max(h[3],d[3])]}function bw(t,e,r){if(r){var n=zm(t,r).map(function(i){return i*e/Gt});return n}return t.map(function(i){return i*e/Gt})}function $u(t,e){return Math.pow(2,t)*Gt/e}function hs(t,e,r){var n=$u(r,Gt),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n,s=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[i,s]}function Hm(t,e,r,n){var i=$u(r,n);return[t/i*Gt,e/i*Gt]}function el(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Gt;if(t.isGeospatial){var o=hs(e,r,n),s=vn(o,2),a=s[0],c=s[1],u=hs(e+1,r+1,n),l=vn(u,2),f=l[0],h=l[1];return{west:a,north:c,east:f,south:h}}var d=Hm(e,r,n,i),p=vn(d,2),m=p[0],g=p[1],A=Hm(e+1,r+1,n,i),_=vn(A,2),v=_[0],x=_[1];return{left:m,top:g,right:v,bottom:x}}function xw(t,e,r,n,i){for(var o=_w(t,null,n),s=$u(e,r),a=bw(o,s,i),c=vn(a,4),u=c[0],l=c[1],f=c[2],h=c[3],d=[],p=Math.floor(u);p<f;p++)for(var m=Math.floor(l);m<h;m++)d.push({x:p,y:m,z:e});return d}function tl(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,s=t.tileSize,a=s===void 0?Gt:s,c=t.modelMatrix,u=t.modelMatrixInverse,l=t.zoomOffset,f=l===void 0?0:l,h=e.isGeospatial?Math.round(e.zoom+Math.log2(Gt/a))+f:Math.ceil(e.zoom)+f;if(typeof n=="number"&&Number.isFinite(n)&&h<n){if(!o)return[];h=n}typeof r=="number"&&Number.isFinite(r)&&h>r&&(h=r);var d=o;return c&&u&&o&&!e.isGeospatial&&(d=zm(o,c)),e.isGeospatial?Um(e,h,i,o):xw(e,h,a,d||Aw,u)}function rl(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function nl(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}function km(t){var e={},r;return function(n){for(var i in n)if(!Tw(n[i],e[i])){r=t(n),e=n;break}return r}}function Tw(t,e){if(t===e)return!0;if(Array.isArray(t)){var r=t.length;if(!e||e.length!==r)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}return!1}var Bi;function Wm(t,e){return ww(t)||Sw(t,e)||Zm(t,e)||Ew()}function Ew(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sw(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function ww(t){if(Array.isArray(t))return t}function Me(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Zm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Zm(t,e){if(t){if(typeof t=="string")return Xm(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xm(t,e)}}function Xm(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qm(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jm(Object(r),!0).forEach(function(n){ps(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jm(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ym(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Cw(t,e,r){return e&&Ym(t.prototype,e),r&&Ym(t,r),t}function ps(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Km=1,ms=2,Mw="never",Iw="no-overlap",Ci="best-available",Ow=5,Rw=(Bi={},ps(Bi,Ci,Fw),ps(Bi,Iw,Lw),ps(Bi,Mw,function(){}),Bi),Pw={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},Mi=function(){function t(r){var n=this;Bw(this,t),this.opts=void 0,this._requestScheduler=void 0,this._cache=void 0,this._dirty=void 0,this._tiles=void 0,this._cacheByteSize=void 0,this._viewport=void 0,this._zRange=void 0,this._selectedTiles=void 0,this._frameNumber=void 0,this._modelMatrix=void 0,this._modelMatrixInverse=void 0,this._maxZoom=void 0,this._minZoom=void 0,this.onTileLoad=void 0,this._getCullBounds=km(jm),this.opts=qm(qm({},Pw),r),this.onTileLoad=function(i){var o,s;(o=(s=n.opts).onTileLoad)===null||o===void 0||o.call(s,i),n.opts.maxCacheByteSize&&(n._cacheByteSize+=i.byteLength,n._resizeCache())},this._requestScheduler=new Yt({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new k,this._modelMatrixInverse=new k,this.setOptions(r)}var e=t.prototype;return e.setOptions=function(n){Object.assign(this.opts,n),Number.isFinite(n.maxZoom)&&(this._maxZoom=Math.floor(n.maxZoom)),Number.isFinite(n.minZoom)&&(this._minZoom=Math.ceil(n.minZoom))},e.finalize=function(){var n=Me(this._cache.values()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o.isLoading&&o.abort()}}catch(s){n.e(s)}finally{n.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null},e.reloadAll=function(){var n=Me(this._cache.keys()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=this._cache.get(o);!this._selectedTiles||!this._selectedTiles.includes(s)?this._cache.delete(o):s.setNeedsReload()}}catch(a){n.e(a)}finally{n.f()}},e.update=function(n){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.zRange,a=o.modelMatrix,c=new k(a),u=!c.equals(this._modelMatrix);if(!this._viewport||!n.equals(this._viewport)||!Ne(this._zRange,s)||u){u&&(this._modelMatrixInverse=c.clone().invert(),this._modelMatrix=c),this._viewport=n,this._zRange=s;var l=this.getTileIndices({viewport:n,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:s,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=l.map(function(h){return i._getTile(h,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(h){return i._getTile(h.index,!0)}));var f=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),f&&this._frameNumber++,this._frameNumber},e.isTileVisible=function(n,i){if(!n.isVisible)return!1;if(i&&this._viewport){var o=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:i}),s=n.bbox,a=Me(o),c;try{for(a.s();!(c=a.n()).done;){var u=Wm(c.value,4),l=u[0],f=u[1],h=u[2],d=u[3],p=void 0;if("west"in s)p=s.west<h&&s.east>l&&s.south<d&&s.north>f;else{var m=Math.min(s.top,s.bottom),g=Math.max(s.top,s.bottom);p=s.left<h&&s.right>l&&m<d&&g>f}if(p)return!0}}catch(A){a.e(A)}finally{a.f()}return!1}return!0},e.getTileIndices=function(n){var i=n.viewport,o=n.maxZoom,s=n.minZoom,a=n.zRange,c=n.modelMatrix,u=n.modelMatrixInverse,l=this.opts,f=l.tileSize,h=l.extent,d=l.zoomOffset;return tl({viewport:i,maxZoom:o,minZoom:s,zRange:a,tileSize:f,extent:h,modelMatrix:c,modelMatrixInverse:u,zoomOffset:d})},e.getTileId=function(n){return"".concat(n.x,"-").concat(n.y,"-").concat(n.z)},e.getTileZoom=function(n){return n.z},e.getTileMetadata=function(n){var i=this.opts.tileSize;return{bbox:el(this._viewport,n.x,n.y,n.z,i)}},e.getParentIndex=function(n){var i=Math.floor(n.x/2),o=Math.floor(n.y/2),s=n.z-1;return{x:i,y:o,z:s}},e.updateTileStates=function(){var n=this.opts.refinementStrategy||Ci,i=new Array(this._cache.size),o=0,s=Me(this._cache.values()),a;try{for(s.s();!(a=s.n()).done;){var c=a.value;i[o++]=c.isVisible,c.isSelected=!1,c.isVisible=!1}}catch(m){s.e(m)}finally{s.f()}var u=Me(this._selectedTiles),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;f.isSelected=!0,f.isVisible=!0}}catch(m){u.e(m)}finally{u.f()}(typeof n=="function"?n:Rw[n])(Array.from(this._cache.values())),o=0;var h=Me(this._cache.values()),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;if(i[o++]!==p.isVisible)return!0}}catch(m){h.e(m)}finally{h.f()}return!1},e._pruneRequests=function(){var n=this.opts.maxRequests,i=n===void 0?0:n,o=[],s=0,a=Me(this._cache.values()),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;u.isLoading&&(s++,!u.isSelected&&!u.isVisible&&o.push(u))}}catch(f){a.e(f)}finally{a.f()}for(;i>0&&s>i&&o.length>0;){var l=o.shift();l.abort(),s--}},e._rebuildTree=function(){var n=this._cache,i=Me(n.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.parent=null,s.children&&(s.children.length=0)}}catch(f){i.e(f)}finally{i.f()}var a=Me(n.values()),c;try{for(a.s();!(c=a.n()).done;){var u=c.value,l=this._getNearestAncestor(u);u.parent=l,l!=null&&l.children&&l.children.push(u)}}catch(f){a.e(f)}finally{a.f()}},e._resizeCache=function(){var n=this._cache,i=this.opts,o=i.maxCacheSize||(i.maxCacheByteSize?1/0:Ow*this.selectedTiles.length),s=i.maxCacheByteSize||1/0,a=n.size>o||this._cacheByteSize>s;if(a){var c=Me(n),u;try{for(c.s();!(u=c.n()).done;){var l=Wm(u.value,2),f=l[0],h=l[1];if(!h.isVisible&&!h.isSelected){var d,p;this._cacheByteSize-=i.maxCacheByteSize?h.byteLength:0,n.delete(f),(d=(p=this.opts).onTileUnload)===null||d===void 0||d.call(p,h)}if(n.size<=o&&this._cacheByteSize<=s)break}}catch(m){c.e(m)}finally{c.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(m,g){return m.zoom-g.zoom}),this._dirty=!1)},e._getTile=function(n,i){var o=this.getTileId(n),s=this._cache.get(o),a=!1;return!s&&i?(s=new Ti(n),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:o,zoom:this.getTileZoom(s.index)}),a=!0,this._cache.set(o,s),this._dirty=!0):s&&s.needsReload&&(a=!0),s&&a&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s},e._getNearestAncestor=function(n){for(var i=this._minZoom,o=i===void 0?0:i,s=n.index;this.getTileZoom(s)>o;){s=this.getParentIndex(s);var a=this._getTile(s);if(a)return a}return null},Cw(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(n){return n.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(n){return n.needsReload})}}]),t}();function Fw(t){var e=Me(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(l){e.e(l)}finally{e.f()}var i=Me(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&!Qm(s)&&il(s)}}catch(l){i.e(l)}finally{i.f()}var a=Me(t),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;u.isVisible=Boolean(u.state&ms)}}catch(l){a.e(l)}finally{a.f()}}function Lw(t){var e=Me(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(p){e.e(p)}finally{e.f()}var i=Me(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&Qm(s)}}catch(p){i.e(p)}finally{i.f()}var a=Array.from(t).sort(function(p,m){return p.zoom-m.zoom}),c=Me(a),u;try{for(c.s();!(u=c.n()).done;){var l=u.value;if(l.isVisible=Boolean(l.state&ms),l.children&&(l.isVisible||l.state&Km)){var f=Me(l.children),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;d.state=Km}}catch(p){f.e(p)}finally{f.f()}}else l.isSelected&&il(l)}}catch(p){c.e(p)}finally{c.f()}}function Qm(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=ms,!0;e=e.parent}return!1}function il(t){var e=Me(t.children),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.isLoaded||n.content?n.state|=ms:il(n)}}catch(i){e.e(i)}finally{e.f()}}function ys(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ys=function(r){return typeof r}:ys=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ys(t)}function $m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$m(Object(r),!0).forEach(function(n){Dw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$m(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Dw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nw(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gw(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Gw(t,e){if(t){if(typeof t=="string")return eg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eg(t,e)}}function eg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Uw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tg(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Hw(t,e,r){return e&&tg(t.prototype,e),r&&tg(t,r),t}function Vw(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ol(t,e)}function ol(t,e){return ol=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ol(t,e)}function zw(t){var e=Ww();return function(){var n=As(t),i;if(e){var o=As(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return jw(this,i)}}function jw(t,e){if(e&&(ys(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kw(t)}function kw(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ww(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function As(t){return As=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},As(t)}var Xw={TilesetClass:Mi,data:{type:"data",value:[]},dataComparator:ir.equal,renderSubLayers:{type:"function",value:function(e){return new rg.GeoJsonLayer(e)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(e){}},onTileUnload:{type:"function",value:function(e){}},onTileError:{type:"function",value:function(e){return console.error(e)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Ci,zRange:null,maxRequests:6,zoomOffset:0},Ut=function(t){Vw(r,t);var e=zw(r);function r(){return Uw(this,r),e.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){this.state={tileset:null,isLoaded:!1}},n.finalizeState=function(){var o,s;(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0||s.finalize()},n.shouldUpdateState=function(o){var s=o.changeFlags;return s.somethingChanged},n.updateState=function(o){var s=o.changeFlags,a=this.state.tileset,c=s.propsOrDataChanged||s.updateTriggersChanged,u=s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getTileData);a?c&&(a.setOptions(this._getTilesetOptions()),u?a.reloadAll():this.state.tileset.tiles.forEach(function(l){l.layers=null})):(a=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:a})),this._updateTileset()},n._getTilesetOptions=function(){var o=this.props,s=o.tileSize,a=o.maxCacheSize,c=o.maxCacheByteSize,u=o.refinementStrategy,l=o.extent,f=o.maxZoom,h=o.minZoom,d=o.maxRequests,p=o.zoomOffset;return{maxCacheSize:a,maxCacheByteSize:c,maxZoom:f,minZoom:h,tileSize:s,refinementStrategy:u,extent:l,maxRequests:d,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}},n._updateTileset=function(){var o=this.state.tileset,s=this.props,a=s.zRange,c=s.modelMatrix,u=o.update(this.context.viewport,{zRange:a,modelMatrix:c}),l=o.isLoaded,f=this.state.isLoaded!==l,h=this.state.frameNumber!==u;l&&(f||h)&&this._onViewportLoad(),h&&this.setState({frameNumber:u}),this.state.isLoaded=l},n._onViewportLoad=function(){var o=this.state.tileset,s=this.props.onViewportLoad;s&&s(o.selectedTiles)},n._onTileLoad=function(o){this.props.onTileLoad(o),o.layers=null,this.setNeedsUpdate()},n._onTileError=function(o,s){this.props.onTileError(o),s.layers=null,this.setNeedsUpdate()},n._onTileUnload=function(o){this.props.onTileUnload(o)},n.getTileData=function(o){var s=this.props,a=s.data,c=s.getTileData,u=s.fetch,l=o.signal;return o.url=typeof a=="string"||Array.isArray(a)?wt(a,o):null,c?c(o):u&&o.url?u(o.url,{propName:"data",layer:this,signal:l}):null},n.renderSubLayers=function(o){return this.props.renderSubLayers(o)},n.getSubLayerPropsByTile=function(o){return null},n.getPickingInfo=function(o){var s=o.info,a=o.sourceLayer,c=a.props.tile;return s.picked&&(s.tile=c),s.sourceTile=c,s},n._updateAutoHighlight=function(o){var s=o.sourceTile;if(s&&s.layers){var a=Nw(s.layers),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;u.updateAutoHighlight(o)}}catch(l){a.e(l)}finally{a.f()}}},n.renderLayers=function(){var o=this;return this.state.tileset.tiles.map(function(s){var a=o.getSubLayerPropsByTile(s);if(!(!s.isLoaded&&!s.content))if(s.layers)a&&s.layers[0]&&Object.keys(a).some(function(u){return s.layers[0].props[u]!==a[u]})&&(s.layers=s.layers.map(function(u){return u.clone(a)}));else{var c=o.renderSubLayers(gs(gs(gs({},o.props),o.getSubLayerProps({id:s.id,updateTriggers:o.props.updateTriggers})),{},{data:s.content,_offset:0,tile:s}));s.layers=(0,vs._flatten)(c,Boolean).map(function(u){return u.clone(gs({tile:s},a))})}return s.layers})},n.filterSubLayer=function(o){var s=o.layer,a=o.cullRect,c=s.props.tile;return this.state.tileset.isTileVisible(c,a)},Hw(r,[{key:"isLoaded",get:function(){var o,s,a;return(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0||(a=s.selectedTiles)===null||a===void 0?void 0:a.every(function(c){return c.isLoaded&&c.layers&&c.layers.every(function(u){return u.isLoaded})})}}]),r}(vs.CompositeLayer);Ut.defaultProps=Xw;Ut.layerName="TileLayer";var og=X(ut());function _s(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_s=function(r){return typeof r}:_s=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_s(t)}function ng(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ig(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ng(Object(r),!0).forEach(function(n){Jw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ng(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _n(t,e,r){return typeof Reflect<"u"&&Reflect.get?_n=Reflect.get:_n=function(i,o,s){var a=Yw(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},_n(t,e,r||t)}function Yw(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=or(t),t!==null););return t}function Kw(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sl(t,e)}function sl(t,e){return sl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},sl(t,e)}function Zw(t){var e=eB();return function(){var n=or(t),i;if(e){var o=or(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qw(this,i)}}function Qw(t,e){if(e&&(_s(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $w(t)}function $w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},or(t)}var tB={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}},bs=function(t){Kw(r,t);var e=Zw(r);function r(){return qw(this,r),e.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var o=_n(or(r.prototype),"getShaders",this).call(this);return o.inject={"vs:#decl":`uniform float trailLength;
14
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Ot.prototype.build=function(t){return this.options.preserveOrder?jf(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=Uf({},this.options.arrayNodeName,t)),this.j2x(t,0).val)};Ot.prototype.j2x=function(t,e){var r="",n="";for(var i in t)if(typeof t[i]>"u")this.isAttribute(i)&&(n+="");else if(t[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextValNode(t[i],i,"",e);else if(be(t[i])!=="object"){var o=this.isAttribute(i);if(o)r+=this.buildAttrPairStr(o,""+t[i]);else if(i===this.options.textNodeName){var s=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(s)}else n+=this.buildTextValNode(t[i],i,"",e)}else if(Array.isArray(t[i])){for(var a=t[i].length,c="",l=0;l<a;l++){var u=t[i][l];typeof u>"u"||(u===null?i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:be(u)==="object"?this.options.oneListGroup?c+=this.j2x(u,e+1).val:c+=this.processTextOrObjNode(u,i,e):c+=this.buildTextValNode(u,i,"",e))}this.options.oneListGroup&&(c=this.buildObjectNode(c,i,"",e)),n+=c}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var f=Object.keys(t[i]),h=f.length,d=0;d<h;d++)r+=this.buildAttrPairStr(f[d],""+t[i][f[d]]);else n+=this.processTextOrObjNode(t[i],i,e);return{attrStr:r,val:n}};Ot.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function Wf(t,e,r){var n=this.j2x(t,r+1);return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}Ot.prototype.buildObjectNode=function(t,e,r,n){if(t==="")return e[0]==="?"?this.indentate(n)+"<"+e+r+"?"+this.tagEndChar:this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var i="</"+e+this.tagEndChar,o="";return e[0]==="?"&&(o="?",i=""),(r||r==="")&&t.indexOf("<")===-1?this.indentate(n)+"<"+e+r+o+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(n)+"<!--".concat(t,"-->")+this.newLine:this.indentate(n)+"<"+e+r+o+this.tagEndChar+t+this.indentate(n)+i};Ot.prototype.closeTag=function(t){var e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e="></".concat(t),e};Ot.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(n)+"<!--".concat(t,"-->")+this.newLine;if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar};Ot.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};function Df(t){return this.options.indentBy.repeat(t)}function Gf(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}_s.exports=Ot});var Ms=Y((Rv,ws)=>{"use strict";var Zf=Un(),Xf=ps(),Yf=bs();ws.exports={XMLParser:Xf,XMLValidator:Zf,XMLBuilder:Yf}});var Vi=Y((rc,Re)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof jo=="function"&&typeof Re=="object"&&Re&&Re.exports?Re.exports=e():(t.dcodeIO=t.dcodeIO||{}).Long=e()})(rc,function(){"use strict";function t(_,y,E){this.low=_|0,this.high=y|0,this.unsigned=!!E}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function e(_){return(_&&_.__isLong__)===!0}t.isLong=e;var r={},n={};function i(_,y){var E,A,L;return y?(_>>>=0,(L=0<=_&&_<256)&&(A=n[_],A)?A:(E=s(_,(_|0)<0?-1:0,!0),L&&(n[_]=E),E)):(_|=0,(L=-128<=_&&_<128)&&(A=r[_],A)?A:(E=s(_,_<0?-1:0,!1),L&&(r[_]=E),E))}t.fromInt=i;function o(_,y){if(isNaN(_)||!isFinite(_))return y?v:m;if(y){if(_<0)return v;if(_>=d)return S}else{if(_<=-p)return P;if(_+1>=p)return T}return _<0?o(-_,y).neg():s(_%h|0,_/h|0,y)}t.fromNumber=o;function s(_,y,E){return new t(_,y,E)}t.fromBits=s;var a=Math.pow;function c(_,y,E){if(_.length===0)throw Error("empty string");if(_==="NaN"||_==="Infinity"||_==="+Infinity"||_==="-Infinity")return m;if(typeof y=="number"?(E=y,y=!1):y=!!y,E=E||10,E<2||36<E)throw RangeError("radix");var A;if((A=_.indexOf("-"))>0)throw Error("interior hyphen");if(A===0)return c(_.substring(1),y,E).neg();for(var L=o(a(E,8)),I=m,R=0;R<_.length;R+=8){var U=Math.min(8,_.length-R),z=parseInt(_.substring(R,R+U),E);if(U<8){var D=o(a(E,U));I=I.mul(D).add(o(z))}else I=I.mul(L),I=I.add(o(z))}return I.unsigned=y,I}t.fromString=c;function l(_){return _ instanceof t?_:typeof _=="number"?o(_):typeof _=="string"?c(_):s(_.low,_.high,_.unsigned)}t.fromValue=l;var u=1<<16,f=1<<24,h=u*u,d=h*h,p=d/2,g=i(f),m=i(0);t.ZERO=m;var v=i(0,!0);t.UZERO=v;var w=i(1);t.ONE=w;var x=i(1,!0);t.UONE=x;var b=i(-1);t.NEG_ONE=b;var T=s(-1,2147483647,!1);t.MAX_VALUE=T;var S=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=S;var P=s(0,-2147483648,!1);t.MIN_VALUE=P;var M=t.prototype;return M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},M.toString=function(y){if(y=y||10,y<2||36<y)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(P)){var E=o(y),A=this.div(E),L=A.mul(E).sub(this);return A.toString(y)+L.toInt().toString(y)}else return"-"+this.neg().toString(y);for(var I=o(a(y,6),this.unsigned),R=this,U="";;){var z=R.div(I),D=R.sub(z.mul(I)).toInt()>>>0,q=D.toString(y);if(R=z,R.isZero())return q+U;for(;q.length<6;)q="0"+q;U=""+q+U}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(P)?64:this.neg().getNumBitsAbs();for(var y=this.high!=0?this.high:this.low,E=31;E>0&&!(y&1<<E);E--);return this.high!=0?E+33:E+1},M.isZero=function(){return this.high===0&&this.low===0},M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return(this.low&1)===1},M.isEven=function(){return(this.low&1)===0},M.equals=function(y){return e(y)||(y=l(y)),this.unsigned!==y.unsigned&&this.high>>>31===1&&y.high>>>31===1?!1:this.high===y.high&&this.low===y.low},M.eq=M.equals,M.notEquals=function(y){return!this.eq(y)},M.neq=M.notEquals,M.lessThan=function(y){return this.comp(y)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(y){return this.comp(y)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(y){return this.comp(y)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(y){return this.comp(y)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(y){if(e(y)||(y=l(y)),this.eq(y))return 0;var E=this.isNegative(),A=y.isNegative();return E&&!A?-1:!E&&A?1:this.unsigned?y.high>>>0>this.high>>>0||y.high===this.high&&y.low>>>0>this.low>>>0?-1:1:this.sub(y).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(P)?P:this.not().add(w)},M.neg=M.negate,M.add=function(y){e(y)||(y=l(y));var E=this.high>>>16,A=this.high&65535,L=this.low>>>16,I=this.low&65535,R=y.high>>>16,U=y.high&65535,z=y.low>>>16,D=y.low&65535,q=0,X=0,$=0,xt=0;return xt+=I+D,$+=xt>>>16,xt&=65535,$+=L+z,X+=$>>>16,$&=65535,X+=A+U,q+=X>>>16,X&=65535,q+=E+R,q&=65535,s($<<16|xt,q<<16|X,this.unsigned)},M.subtract=function(y){return e(y)||(y=l(y)),this.add(y.neg())},M.sub=M.subtract,M.multiply=function(y){if(this.isZero()||(e(y)||(y=l(y)),y.isZero()))return m;if(this.eq(P))return y.isOdd()?P:m;if(y.eq(P))return this.isOdd()?P:m;if(this.isNegative())return y.isNegative()?this.neg().mul(y.neg()):this.neg().mul(y).neg();if(y.isNegative())return this.mul(y.neg()).neg();if(this.lt(g)&&y.lt(g))return o(this.toNumber()*y.toNumber(),this.unsigned);var E=this.high>>>16,A=this.high&65535,L=this.low>>>16,I=this.low&65535,R=y.high>>>16,U=y.high&65535,z=y.low>>>16,D=y.low&65535,q=0,X=0,$=0,xt=0;return xt+=I*D,$+=xt>>>16,xt&=65535,$+=L*D,X+=$>>>16,$&=65535,$+=I*z,X+=$>>>16,$&=65535,X+=A*D,q+=X>>>16,X&=65535,X+=L*z,q+=X>>>16,X&=65535,X+=I*U,q+=X>>>16,X&=65535,q+=E*D+A*z+L*U+I*R,q&=65535,s($<<16|xt,q<<16|X,this.unsigned)},M.mul=M.multiply,M.divide=function(y){if(e(y)||(y=l(y)),y.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:m;var E,A,L;if(this.unsigned){if(y.unsigned||(y=y.toUnsigned()),y.gt(this))return v;if(y.gt(this.shru(1)))return x;L=v}else{if(this.eq(P)){if(y.eq(w)||y.eq(b))return P;if(y.eq(P))return w;var I=this.shr(1);return E=I.div(y).shl(1),E.eq(m)?y.isNegative()?w:b:(A=this.sub(y.mul(E)),L=E.add(A.div(y)),L)}else if(y.eq(P))return this.unsigned?v:m;if(this.isNegative())return y.isNegative()?this.neg().div(y.neg()):this.neg().div(y).neg();if(y.isNegative())return this.div(y.neg()).neg();L=m}for(A=this;A.gte(y);){E=Math.max(1,Math.floor(A.toNumber()/y.toNumber()));for(var R=Math.ceil(Math.log(E)/Math.LN2),U=R<=48?1:a(2,R-48),z=o(E),D=z.mul(y);D.isNegative()||D.gt(A);)E-=U,z=o(E,this.unsigned),D=z.mul(y);z.isZero()&&(z=w),L=L.add(z),A=A.sub(D)}return L},M.div=M.divide,M.modulo=function(y){return e(y)||(y=l(y)),this.sub(this.div(y).mul(y))},M.mod=M.modulo,M.not=function(){return s(~this.low,~this.high,this.unsigned)},M.and=function(y){return e(y)||(y=l(y)),s(this.low&y.low,this.high&y.high,this.unsigned)},M.or=function(y){return e(y)||(y=l(y)),s(this.low|y.low,this.high|y.high,this.unsigned)},M.xor=function(y){return e(y)||(y=l(y)),s(this.low^y.low,this.high^y.high,this.unsigned)},M.shiftLeft=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low<<y,this.high<<y|this.low>>>32-y,this.unsigned):s(0,this.low<<y-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low>>>y|this.high<<32-y,this.high>>y,this.unsigned):s(this.high>>y-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(y){if(e(y)&&(y=y.toInt()),y&=63,y===0)return this;var E=this.high;if(y<32){var A=this.low;return s(A>>>y|E<<32-y,E>>>y,this.unsigned)}else return y===32?s(E,0,this.unsigned):s(E>>>y-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},M.toBytes=function(_){return _?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var _=this.high,y=this.low;return[y&255,y>>>8&255,y>>>16&255,y>>>24&255,_&255,_>>>8&255,_>>>16&255,_>>>24&255]},M.toBytesBE=function(){var _=this.high,y=this.low;return[_>>>24&255,_>>>16&255,_>>>8&255,_&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255]},t})});var on=Y((sS,tl)=>{tl.exports=globalThis.h3||{}});var ml=Y((mS,pl)=>{pl.exports=globalThis.deck});var El=Y(($S,Pl)=>{Pl.exports=globalThis.deck});var Bl=Y(Po=>{Po.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,l=c>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=o*256+t[e+f],f+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=h,u-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(d?-1:1)*s*Math.pow(2,o-n)};Po.write=function(t,e,r,n,i,o){var s,a,c,l=o*8-i-1,u=(1<<l)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?e+=h/c:e+=h*Math.pow(2,1-f),e*c>=2&&(s++,c/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(e*c-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=a&255,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=s&255,d+=p,s/=256,l-=8);t[r+d-p]|=g*128}});var Wl=Y((qT,Vl)=>{"use strict";Vl.exports=C;var En=Bl();function C(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}C.Varint=0;C.Fixed64=1;C.Bytes=2;C.Fixed32=5;var Eo=(1<<16)*(1<<16),kl=1/Eo,jy=12,jl=typeof TextDecoder>"u"?null:new TextDecoder("utf8");C.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=On(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=On(this.buf,this.pos)+On(this.buf,this.pos+4)*Eo;return this.pos+=8,t},readSFixed64:function(){var t=On(this.buf,this.pos)+Ul(this.buf,this.pos+4)*Eo;return this.pos+=8,t},readFloat:function(){var t=En.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=En.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,Vy(r,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=jy&&jl?r1(this.buf,e,t):e1(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==C.Bytes)return t.push(this.readVarint(e));var r=Pt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==C.Bytes)return t.push(this.readSVarint());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==C.Bytes)return t.push(this.readBoolean());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==C.Bytes)return t.push(this.readFloat());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==C.Bytes)return t.push(this.readDouble());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==C.Bytes)return t.push(this.readFixed32());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==C.Bytes)return t.push(this.readSFixed32());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==C.Bytes)return t.push(this.readFixed64());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==C.Bytes)return t.push(this.readSFixed64());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===C.Varint)for(;this.buf[this.pos++]>127;);else if(e===C.Bytes)this.pos=this.readVarint()+this.pos;else if(e===C.Fixed32)this.pos+=4;else if(e===C.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ve(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ve(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ve(this.buf,t&-1,this.pos),ve(this.buf,Math.floor(t*kl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ve(this.buf,t&-1,this.pos),ve(this.buf,Math.floor(t*kl),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Wy(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=n1(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ql(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),En.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),En.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&ql(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,C.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Zy,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Xy,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,$y,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Yy,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Hy,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Qy,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ky,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Jy,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,t1,e)},writeBytesField:function(t,e){this.writeTag(t,C.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,C.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,C.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,C.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,C.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,C.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,C.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,C.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,C.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,C.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Vy(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return ye(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function Pt(t){return t.type===C.Bytes?t.readVarint()+t.pos:t.pos+1}function ye(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Wy(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Dy(r,n,e),Gy(n,e)}function Dy(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Gy(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function ql(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Zy(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Xy(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Yy(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Hy(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function $y(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Qy(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Ky(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Jy(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function t1(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function On(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ve(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function e1(t,e,r){for(var n="",i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a>r)break;var c,l,u;a===1?o<128&&(s=o):a===2?(c=t[i+1],(c&192)===128&&(s=(o&31)<<6|c&63,s<=127&&(s=null))):a===3?(c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(s=(o&15)<<12|(c&63)<<6|l&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(c=t[i+1],l=t[i+2],u=t[i+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(s=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),i+=a}return n}function r1(t,e,r){return jl.decode(t.subarray(e,r))}function n1(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});var ir={};kn(ir,{GeohashLayer:()=>Bn,GreatCircleLayer:()=>Nr,H3ClusterLayer:()=>hn,H3HexagonLayer:()=>Xt,MVTLayer:()=>Nn,QuadkeyLayer:()=>Wr,S2Layer:()=>Ur,TerrainLayer:()=>_n,TileLayer:()=>Tt,TripsLayer:()=>nn,_GeoCellLayer:()=>nt,_Tile2DHeader:()=>Fe,_Tileset2D:()=>ke,_WMSLayer:()=>Lr,_getURLFromTemplate:()=>yt});var lt={},Wo=B(ct());Et(lt,B(ct()));if(!Wo.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");Et(ir,lt);var Gt=B(ut()),Ka=B(ct());function Tu(t){return typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t}function ar(t){if(Array.isArray(t))return t.map(e=>ar(e));if(t&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[Tu(r)]=ar(n);return e}return t}var Ss=B(Ms(),1);function Gn(t,e){if(e!=null&&e._parser&&e._parser!=="fast-xml-parser")throw new Error(e?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(i,o,s,a)=>{var c;return Boolean(e==null||(c=e.arrayPaths)===null||c===void 0?void 0:c.some(u=>o===u))},...e?._fastXML},n=Hf(t,r);return e!=null&&e.uncapitalizeKeys?ar(n):n}function Hf(t,e){return new Ss.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(t)}var $f=typeof __VERSION__<"u"?__VERSION__:"latest",K={name:"XML",id:"xml",module:"xml",version:$f,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:Qf,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(t,e)=>Gn(new TextDecoder().decode(t),{...K.options.xml,...e?.xml}),parseTextSync:(t,e)=>Gn(t,{...K.options.xml,...e?.xml})};function Qf(t){return t.startsWith("<?xml")}async function Zn(t,e,r,n){return n._parse(t,e,r,n)}function we(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var ft={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Kf=ft.self||ft.window||ft.global||{},Jf=ft.window||ft.self||ft.global||{},th=ft.global||ft.self||ft.window||{},eh=ft.document||{};var Xn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ts=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),rh=Ts&&parseFloat(Ts[1])||0;function Yn(t,e){return Ps(t||{},e)}function Ps(t,e){let r={...t};for(let[n,i]of Object.entries(e))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=Ps(r[n]||{},e[n]):r[n]=e[n];return r}function Me(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];let n=e,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let o=n.reduce((c,l)=>c+l.length,0),s=new i(o),a=0;for(let c of n)s.set(c,a),a+=c.length;return s}function Se(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var jt=class{constructor(e,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Se(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Se()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var te=class{constructor(e){this.id=void 0,this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,i=this.stats[r];return i||(e instanceof jt?i=e:i=new jt(r,n),this.stats[r]=i),i}};var nh="Queued Requests",ih="Active Requests",oh="Cancelled Requests",sh="Queued Requests Ever",ah="Active Requests Ever",ch={id:"request-scheduler",throttleRequests:!0,maxRequests:6},ee=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.props=void 0,this.stats=void 0,this.activeRequestCount=0,this.requestQueue=[],this.requestMap=new Map,this.deferredUpdate=null,this.props={...ch,...e},this.stats=new te({id:this.props.id}),this.stats.get(nh),this.stats.get(ih),this.stats.get(oh),this.stats.get(sh),this.stats.get(ah)}scheduleRequest(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);let n={handle:e,priority:0,getPriority:r},i=new Promise(o=>(n.resolve=o,n));return this.requestQueue.push(n),this.requestMap.set(e,i),this._issueNewRequests(),i}_issueRequest(e){let{handle:r,resolve:n}=e,i=!1,o=()=>{i||(i=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;let e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let r=0;r<e;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let e=this.requestQueue;for(let r=0;r<e.length;++r){let n=e[r];this._updateRequest(n)||(e.splice(r,1),this.requestMap.delete(n.handle),r--)}e.sort((r,n)=>r.priority-n.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}};var ur=class{constructor(e){this.data=void 0,this.fetch=void 0,this.loadOptions=void 0,this._needsRefresh=!0,this.props=void 0,this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=lh(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}};function lh(t){let e=t?.fetch;if(e&&typeof e=="function")return(n,i)=>e(n,i);let r=t?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var rt=class extends ur{};rt.type="template";rt.testURL=t=>!1;function Es(t,e){var r,n,i;let o=(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e),s=(o==null||(n=o.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(o==null||(i=o["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]);return typeof s=="string"?s:s.value||s.code||"Unknown error"}var uh=typeof __VERSION__<"u"?__VERSION__:"latest",Vt={id:"wms-error",name:"WMS Error",module:"wms",version:uh,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:fh,options:{wms:{throwOnError:!1}},parse:async(t,e)=>Hn(new TextDecoder().decode(t),e),parseSync:(t,e)=>Hn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Hn(t,e)};function fh(t){return t.startsWith("<?xml")}function Hn(t,e){let r={...Vt.options.wms,...e?.wms},n=Es(t,r),i=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(i);return i}function Wt(t){return Array.isArray(t)?t:t?[t]:[]}function Te(t){let e=Wt(t);return e.length>0&&e.every(r=>typeof r=="string")?e:[]}function Pe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseFloat(t);default:return}}function fr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseInt(t,10);default:return}}function Dt(t){switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function $n(t,e){var r;let n=(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e),i=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,o=hh(i);if(e!=null&&e.inheritedLayerProps)for(let s of o.layers)Is(s,null);return e!=null&&e.includeRawJSON&&(o.json=i),e!=null&&e.includeXMLText&&(o.xml=t),o}function hh(t){var e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m;let v={version:String(t.version||""),name:String(((e=t.Service)===null||e===void 0?void 0:e.Name)||"unnamed"),title:(r=t.Service)!==null&&r!==void 0&&r.Title?String((n=t.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=t.Service)!==null&&i!==void 0&&i.Abstract?String((o=t.Service)===null||o===void 0?void 0:o.Abstract):void 0,keywords:Te((s=t.Service)===null||s===void 0||(a=s.KeywordList)===null||a===void 0?void 0:a.Keyword),fees:(c=t.Service)!==null&&c!==void 0&&c.Fees?JSON.stringify((l=t.Service)===null||l===void 0?void 0:l.Fees):void 0,accessConstraints:(u=t.Service)!==null&&u!==void 0&&u.AccessConstraints?JSON.stringify((f=t.Service)===null||f===void 0?void 0:f.AccessConstraints):void 0,layerLimit:fr((h=t.Service)===null||h===void 0?void 0:h.LayerLimit),maxWidth:fr((d=t.Service)===null||d===void 0?void 0:d.maxWidth),maxHeight:fr((p=t.Service)===null||p===void 0?void 0:p.maxHeight),layers:[],requests:dh((g=t.Capability)===null||g===void 0?void 0:g.Request),exceptions:ph(t.Exception)},w=Wt((m=t.Capability)===null||m===void 0?void 0:m.Layer);for(let x of w)v.layers.push(Os(x));for(let[x,b]of Object.entries(v))b===void 0&&delete v[x];return v}function dh(t){let e={};for(let[r,n]of Object.entries(t||{})){let i=Te(n?.Format);e[r]={mimeTypes:i}}return e}function ph(t){if(Wt(t?.Format).length>0)return{mimeTypes:Te(t)}}function Os(t){var e;let r={title:String(t?.Title||""),name:t?.Name&&String(t?.Name),abstract:t?.Name&&String(t?.Abstract),keywords:Te((e=t.KeywordList)===null||e===void 0?void 0:e.Keyword)},n=t?.CRS||t?.SRS;n&&Array.isArray(n)&&n.every(u=>typeof u=="string")&&(r.crs=n);let i=t?.EX_GeographicBoundingBox&&mh(t?.EX_GeographicBoundingBox);i&&(r.geographicBoundingBox=i),i=t?.LatLonBoundingBox&&gh(t?.LatLonBoundingBox),i&&(r.geographicBoundingBox=i);let o=t?.BoundingBox&&yh(t?.BoundingBox);o&&o.length>0&&(r.boundingBoxes=o);let a=Wt(t?.Dimension).map(u=>xh(u));a.length&&(r.dimensions=a),t!=null&&t.opaque&&(r.opaque=Dt(t?.opaque)),t!=null&&t.cascaded&&(r.cascaded=Dt(t?.cascaded)),t!=null&&t.queryable&&(r.queryable=Dt(t?.queryable));let c=Wt(t?.Layer),l=[];for(let u of c)l.push(Os(u));l.length>0&&(r.layers=l);for(let[u,f]of Object.entries(r))f===void 0&&delete r[u];return r}function mh(t){let{westBoundLongitude:e,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:i}=t;return[[e,i],[n,r]]}function gh(t){let{minx:e,miny:r,maxx:n,maxy:i}=t;return[[e,r],[n,i]]}function yh(t){return Wt(t).map(r=>vh(r))}function vh(t){let{CRS:e,SRS:r,minx:n,miny:i,maxx:o,maxy:s,resx:a,resy:c}=t,l={crs:e||r,boundingBox:[[Pe(n),Pe(i)],[Pe(o),Pe(s)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function xh(t){let{name:e,units:r,value:n}=t,i={name:e,units:r,extent:n};return t.unitSymbol&&(i.unitSymbol=t.unitSymbol),t.default&&(i.defaultValue=t.default),t.multipleValues&&(i.multipleValues=Dt(t.multipleValues)),t.nearestValue&&(i.nearestValue=Dt(t.nearestValue)),t.current&&(i.current=Dt(t.current)),i}function Is(t,e){e!=null&&e.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=[...e.geographicBoundingBox]),e!=null&&e.crs&&!t.crs&&(t.crs=[...e.crs]),e!=null&&e.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=[...e.boundingBoxes]),e!=null&&e.dimensions&&!t.dimensions&&(t.dimensions=[...e.dimensions]);for(let r of t.layers||[])Is(r,t)}var _h=typeof __VERSION__<"u"?__VERSION__:"latest",re={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:_h,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:bh,options:{wms:{}},parse:async(t,e)=>$n(new TextDecoder().decode(t),e?.wms),parseTextSync:(t,e)=>$n(t,e?.wms)};function bh(t){return t.startsWith("<?xml")}function Qn(t,e){var r,n;let o=((n=((r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e)).FeatureInfoResponse)===null||n===void 0?void 0:n.FIELDS)||[];return{features:(Array.isArray(o)?o:[o]).map(a=>wh(a))}}function wh(t){return{attributes:t||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var As={...re,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(t,e)=>Qn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Qn(t,e)};function Kn(t,e){var r;return(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e)}var Ls={...re,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(t,e)=>Kn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Kn(t,e)};function Rs(t,e){let{type:r="auto"}=t,n=r==="auto"?Sh(t.url,e):Mh(r,e);if(!n)throw new Error("Not a valid image source type");return n.create(t)}function Mh(t,e){for(let r of e)if(r.type===t)return r;return null}function Sh(t,e){for(let r of e)if(r.testURL&&r.testURL(t))return r;return null}var Fs=typeof __VERSION__<"u"?__VERSION__:"latest";var Jn,Th=(Jn=globalThis.loaders)===null||Jn===void 0?void 0:Jn.parseImageNode,ti=typeof Image<"u",ei=typeof ImageBitmap<"u",Ph=Boolean(Th),ri=Xn?!0:Ph;function Ns(t){switch(t){case"auto":return ei||ti||ri;case"imagebitmap":return ei;case"image":return ti;case"data":return ri;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Cs(){if(ei)return"imagebitmap";if(ti)return"image";if(ri)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Eh(t){let e=Oh(t);if(!e)throw new Error("Not an image");return e}function zs(t){switch(Eh(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Oh(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Ih=/^data:image\/svg\+xml/,Ah=/\.svg((\?|#).*)?$/;function hr(t){return t&&(Ih.test(t)||Ah.test(t))}function Bs(t,e){if(hr(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return ni(t,e)}function ni(t,e){if(hr(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function dr(t,e,r){let n=Bs(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Lh(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function Lh(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var Rh={},ks=!0;async function qs(t,e,r){let n;hr(r)?n=await dr(t,e,r):n=ni(t,r);let i=e&&e.imagebitmap;return await Fh(n,i)}async function Fh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((Nh(e)||!ks)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),ks=!1}return await createImageBitmap(t)}function Nh(t){for(let e in t||Rh)return!1;return!0}function Us(t){return!kh(t,"ftyp",4)||!(t[8]&96)?null:Ch(t)}function Ch(t){switch(zh(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function zh(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Bh(t){return[...t].map(e=>e.charCodeAt(0))}function kh(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Bh(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var ht=!1,Ee=!0;function pr(t){let e=Oe(t);return Uh(e)||Wh(e)||jh(e)||Vh(e)||qh(e)}function qh(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Us(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Uh(t){let e=Oe(t);return e.byteLength>=24&&e.getUint32(0,ht)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ht),height:e.getUint32(20,ht)}:null}function jh(t){let e=Oe(t);return e.byteLength>=10&&e.getUint32(0,ht)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Ee),height:e.getUint16(8,Ee)}:null}function Vh(t){let e=Oe(t);return e.byteLength>=14&&e.getUint16(0,ht)===16973&&e.getUint32(2,Ee)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Ee),height:e.getUint32(22,Ee)}:null}function Wh(t){let e=Oe(t);if(!(e.byteLength>=3&&e.getUint16(0,ht)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=Dh(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,ht);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,ht),width:e.getUint16(o+7,ht)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,ht)}return null}function Dh(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Oe(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function js(t,e){var r;let{mimeType:n}=pr(t)||{},i=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return we(i),await i(t,n)}async function Vs(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=Gh(i),a;switch(s){case"imagebitmap":a=await qs(t,e,o);break;case"image":a=await dr(t,e,o);break;case"data":a=await js(t,e);break;default:we(!1)}return i==="data"&&(a=zs(a)),a}function Gh(t){switch(t){case"auto":case"data":return Cs();default:return Ns(t),t}}var Zh=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Xh=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Yh={image:{type:"auto",decode:!0}},ne={id:"image",module:"images",name:"Images",version:Fs,mimeTypes:Xh,extensions:Zh,parse:Vs,tests:[t=>Boolean(pr(new DataView(t)))],options:Yh};var Ws={type:"wms",testURL:t=>t.toLowerCase().includes("wms"),create:t=>new ii(t)},ii=class extends rt{constructor(e){var r;super(e),this.url=void 0,this.data=void 0,this.substituteCRS84=void 0,this.flipCRS=void 0,this.wmsParameters=void 0,this.vendorParameters=void 0,this.capabilities=null,this.url=e.url,this.data=e.url,this.substituteCRS84=(r=e.substituteCRS84)!==null&&r!==void 0?r:!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...e.wmsParameters},this.vendorParameters=e.vendorParameters||{}}async getMetadata(){let e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){return await this.getMap(e)}normalizeMetadata(e){return e}async getCapabilities(e,r){let n=this.getCapabilitiesURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);let s=await re.parse(o,this.loadOptions);return this.capabilities=s,s}async getMap(e,r){let n=this.getMapURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await ne.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}async getFeatureInfo(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await As.parse(o,this.loadOptions)}async getFeatureInfoText(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),new TextDecoder().decode(o)}async describeLayer(e,r){let n=this.describeLayerURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await Ls.parse(o,this.loadOptions)}async getLegendGraphic(e,r){let n=this.getLegendGraphicURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await ne.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}getCapabilitiesURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(e,r){e=this._getWMS130Parameters(e);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(e,r){e=this._getWMS130Parameters(e);let n={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetFeatureInfo",n,r)}describeLayerURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(e){let[r,n]=e.split("?"),i=n.split("&"),o={};for(let s of i){let[a,c]=s.split("=");o[a]=c}return{url:r,parameters:o}}_getWMSUrl(e,r,n){let i=this.url,o=!0,s={service:"WMS",version:r.version,request:e,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(s))(!a.includes(c)||l)&&(i+=o?"?":"&",o=!1,i+=this._getURLParameter(c,l,r));return encodeURI(i)}_getWMS130Parameters(e){let r={...e};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(e,r,n){switch(e){case"crs":n.version!=="1.3.0"?e="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(e="crs");break;case"boundingBox":let i=r,o=[...i[0],...i[1]];o=this._flipBoundingBox(i,n),o&&(r=o);break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;default:}return e=e.toUpperCase(),Array.isArray(r)?`${e}=${r.join(",")}`:`${e}=${r?String(r):""}`}_flipBoundingBox(e,r){if(!Array.isArray(e)||e.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),i=e;return n?[i[1],i[0],i[3],i[2]]:i}async _fetchArrayBuffer(e){let r=await this.fetch(e),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(e,r){let n=e.headers["content-type"];if(!e.ok||Vt.mimeTypes.includes(n)){var i;let o=Yn(this.loadOptions,{wms:{throwOnError:!0}}),s=(i=Vt.parseSync)===null||i===void 0?void 0:i.call(Vt,r,o);throw new Error(s)}}_parseError(e){var r;let n=(r=Vt.parseSync)===null||r===void 0?void 0:r.call(Vt,e,this.loadOptions);return new Error(n)}};var ie=class extends rt{constructor(e){super(e)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(e){let r=this.getGranularParameters(e),n=this.getURLFromTemplate(r),o=await(await this.fetch(n)).arrayBuffer();return await ne.parse(o)}getGranularParameters(e){let[[r,n],[i,o]]=e.boundingBox;return{...e,east:r,north:n,south:o,west:i}}getURLFromTemplate(e){let r=this.props.url;for(let[n,i]of Object.entries(e))r=r.replace(`\${${n}}`,String(i)),r=r.replace(`{${n}}`,String(i));return r}};ie.type="template";ie.testURL=t=>t.toLowerCase().includes("{");var oi=class extends ie{constructor(e){super(e),this.data=void 0,this.data=e.url}async getMetadata(){return await this.metadata()}async getImage(e){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(e){throw new Error("not implemented")}metadataURL(e){return`${this.props.url}?f=pjson`}exportImageURL(e){let r=`bbox=${e.bbox[0]},${e.bbox[1]},${e.bbox[2]},${e.bbox[3]}`,n=`size=${e.width},${e.height}`,i={...e,bbox:r,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(e,r,n){let i=`${this.props.url}/${e}`,o=!0;for(let[s,a]of Object.entries(r))i+=o?"?":"&",o=!1,Array.isArray(a)?i+=`${s.toUpperCase()}=${a.join(",")}`:i+=`${s.toUpperCase()}=${a?String(a):""}`;return i}async checkResponse(e){if(!e.ok)throw new Error("error")}},Ds={type:"arcgis-image-server",testURL:t=>t.toLowerCase().includes("ImageServer"),create:t=>new oi(t)};var Hh=[Ws,Ds];function si(t){return Rs(t,Hh)}function F(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var C2=1/Math.PI*180,z2=1/180*Math.PI,$h={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...$h}};var G=globalThis.mathgl.config;function ai(t,{precision:e=G.precision}={}){return t=Qh(t),"".concat(parseFloat(t.toPrecision(e)))}function dt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function It(t,e,r){return dt(t)?t.map((n,i)=>It(n,e[i],r)):r*e+(1-r)*t}function pt(t,e,r){let n=G.EPSILON;r&&(G.EPSILON=r);try{if(t===e)return!0;if(dt(t)&&dt(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!pt(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=G.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{G.EPSILON=n}}function Qh(t){return Math.round(t/G.EPSILON)*G.EPSILON}function Kh(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var At=class extends Kh(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:dt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(G)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+ai(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!pt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(G.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function Jh(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function N(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function Lt(t,e,r=""){if(G.debug&&!Jh(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function mt(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var oe=class extends At{get x(){return this[0]}set x(e){this[0]=N(e)}get y(){return this[1]}set y(e){this[1]=N(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return N(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return N(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return mt(e>=0&&e<this.ELEMENTS,"index is out of range"),N(this[e])}setComponent(e,r){return mt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var j=typeof Float32Array<"u"?Float32Array:Array;var X2=Math.PI/180;function td(){let t=new j(2);return j!=Float32Array&&(t[0]=0,t[1]=0),t}function Xs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ys(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var Y2=function(){let t=td();return function(e,r,n,i,o,s){let a,c;for(r||(r=2),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Hs(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function mr(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function $s(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function Qs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3],t}function gr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}function ci(){let t=new j(3);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ed(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function li(t,e,r){let n=new j(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ks(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ui(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2];return t[0]=i*c-o*a,t[1]=o*s-n*c,t[2]=n*a-i*s,t}function ce(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function yr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function vr(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*a-n*l,h=n*c-i*a,d=i*h-o*f,p=o*u-n*h,g=n*f-i*u,m=s*2;return u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=a+u+d,t[1]=c+f+p,t[2]=l+h+g,t}function Js(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ta(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ea(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ra(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&ui(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var na=ed;var Q2=function(){let t=ci();return function(e,r,n,i,o,s){let a,c;for(r||(r=3),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var fi=[0,0,0],xr,O=class extends oe{static get ZERO(){return xr||(xr=new O(0,0,0),Object.freeze(xr)),xr}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&dt(e)?this.copy(e):(G.debug&&(N(e),N(r),N(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return G.debug&&(N(e.x),N(e.y),N(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=N(e)}angle(e){return ra(this,e)}cross(e){return ae(this,this,e),this.check()}rotateX({radians:e,origin:r=fi}){return Js(this,this,r,e),this.check()}rotateY({radians:e,origin:r=fi}){return ta(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=fi}){return ea(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return ce(this,this,e),this.check()}transformAsVector(e){return mr(this,this,e),this.check()}transformByMatrix3(e){return yr(this,this,e),this.check()}transformByMatrix2(e){return $s(this,this,e),this.check()}transformByQuaternion(e){return vr(this,this,e),this.check()}};var _r,le=class extends oe{static get ZERO(){return _r||(_r=new le(0,0,0,0),Object.freeze(_r)),_r}constructor(e=0,r=0,n=0,i=0){super(-0,-0,-0,-0),dt(e)&&arguments.length===1?this.copy(e):(G.debug&&(N(e),N(r),N(n),N(i)),this[0]=e,this[1]=r,this[2]=n,this[3]=i)}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return G.debug&&(N(e.x),N(e.y),N(e.z),N(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=N(e)}get w(){return this[3]}set w(e){this[3]=N(e)}transform(e){return ce(this,this,e),this.check()}transformByMatrix3(e){return gr(this,this,e),this.check()}transformByMatrix2(e){return Qs(this,this,e),this.check()}transformByQuaternion(e){return vr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var ue=class extends At{toString(){let e="[";if(G.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=N(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function ia(){let t=new j(9);return j!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function oa(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function sa(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=u*s-a*l,h=-u*o+a*c,d=l*o-s*c,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-u*n+i*l)*p,t[2]=(a*n-i*s)*p,t[3]=h*p,t[4]=(u*r-i*c)*p,t[5]=(-a*r+i*o)*p,t[6]=d*p,t[7]=(-l*r+n*c)*p,t[8]=(s*r-n*o)*p,t):null}function aa(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8];return e*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function hi(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],w=r[6],x=r[7],b=r[8];return t[0]=h*n+d*s+p*l,t[1]=h*i+d*a+p*u,t[2]=h*o+d*c+p*f,t[3]=g*n+m*s+v*l,t[4]=g*i+m*a+v*u,t[5]=g*o+m*c+v*f,t[6]=w*n+x*s+b*l,t[7]=w*i+x*a+b*u,t[8]=w*o+x*c+b*f,t}function ca(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=h*n+d*s+l,t[7]=h*i+d*a+u,t[8]=h*o+d*c+f,t}function la(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);return t[0]=d*n+h*s,t[1]=d*i+h*a,t[2]=d*o+h*c,t[3]=d*s-h*n,t[4]=d*a-h*i,t[5]=d*c-h*o,t[6]=l,t[7]=u,t[8]=f,t}function di(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ua(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,f=n*a,h=i*s,d=i*a,p=i*c,g=o*s,m=o*a,v=o*c;return t[0]=1-f-p,t[3]=u-v,t[6]=h+m,t[1]=u+v,t[4]=1-l-p,t[7]=d-g,t[2]=h-m,t[5]=d+g,t[8]=1-l-f,t}var pi;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(pi||(pi={}));var id=Object.freeze([1,0,0,0,1,0,0,0,1]),V=class extends ue{static get IDENTITY(){return sd()}static get ZERO(){return od()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return pi}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(id)}fromObject(e){return this.check()}fromQuaternion(e){return ua(this,e),this.check()}set(e,r,n,i,o,s,a,c,l){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(e,r,n,i,o,s,a,c,l){return this[0]=e,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return aa(this)}transpose(){return oa(this,this),this.check()}invert(){return sa(this,this),this.check()}multiplyLeft(e){return hi(this,e,this),this.check()}multiplyRight(e){return hi(this,this,e),this.check()}rotate(e){return la(this,this,e),this.check()}scale(e){return Array.isArray(e)?di(this,this,e):di(this,this,[e,e]),this.check()}translate(e){return ca(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Xs(r||[-0,-0],e,this);break;case 3:n=yr(r||[-0,-0,-0],e,this);break;case 4:n=gr(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},br,wr=null;function od(){return br||(br=new V([0,0,0,0,0,0,0,0,0]),Object.freeze(br)),br}function sd(){return wr||(wr=new V,Object.freeze(wr)),wr}var Mr={};kn(Mr,{add:()=>Ld,adjoint:()=>hd,clone:()=>cd,copy:()=>ld,create:()=>ad,decompose:()=>wd,determinant:()=>yi,equals:()=>Cd,exactEquals:()=>Nd,frob:()=>Ad,fromQuat:()=>Si,fromQuat2:()=>xd,fromRotation:()=>md,fromRotationTranslation:()=>ha,fromRotationTranslationScale:()=>Md,fromRotationTranslationScaleOrigin:()=>Sd,fromScaling:()=>pd,fromTranslation:()=>dd,fromValues:()=>ud,fromXRotation:()=>gd,fromYRotation:()=>yd,fromZRotation:()=>vd,frustum:()=>Ti,getRotation:()=>bd,getScaling:()=>da,getTranslation:()=>_d,identity:()=>fa,invert:()=>gi,lookAt:()=>Oi,mul:()=>zd,multiply:()=>Ie,multiplyScalar:()=>Rd,multiplyScalarAndAdd:()=>Fd,ortho:()=>Ei,orthoNO:()=>ma,orthoZO:()=>Ed,perspective:()=>Pi,perspectiveFromFieldOfView:()=>Pd,perspectiveNO:()=>pa,perspectiveZO:()=>Td,rotate:()=>_i,rotateX:()=>bi,rotateY:()=>wi,rotateZ:()=>Mi,scale:()=>xi,set:()=>fd,str:()=>Id,sub:()=>Bd,subtract:()=>ga,targetTo:()=>Od,translate:()=>vi,transpose:()=>mi});function ad(){let t=new j(16);return j!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function cd(t){let e=new j(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ld(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ud(t,e,r,n,i,o,s,a,c,l,u,f,h,d,p,g){let m=new j(16);return m[0]=t,m[1]=e,m[2]=r,m[3]=n,m[4]=i,m[5]=o,m[6]=s,m[7]=a,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m}function fd(t,e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function fa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mi(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],w=r*a-n*s,x=r*c-i*s,b=r*l-o*s,T=n*c-i*a,S=n*l-o*a,P=i*l-o*c,M=u*g-f*p,_=u*m-h*p,y=u*v-d*p,E=f*m-h*g,A=f*v-d*g,L=h*v-d*m,I=w*L-x*A+b*E+T*y-S*_+P*M;return I?(I=1/I,t[0]=(a*L-c*A+l*E)*I,t[1]=(i*A-n*L-o*E)*I,t[2]=(g*P-m*S+v*T)*I,t[3]=(h*S-f*P-d*T)*I,t[4]=(c*y-s*L-l*_)*I,t[5]=(r*L-i*y+o*_)*I,t[6]=(m*b-p*P-v*x)*I,t[7]=(u*P-h*b+d*x)*I,t[8]=(s*A-a*y+l*M)*I,t[9]=(n*y-r*A-o*M)*I,t[10]=(p*S-g*b+v*w)*I,t[11]=(f*b-u*S-d*w)*I,t[12]=(a*_-s*E-c*M)*I,t[13]=(r*E-n*_+i*M)*I,t[14]=(g*x-p*T-m*w)*I,t[15]=(u*T-f*x+h*w)*I,t):null}function hd(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],w=r*a-n*s,x=r*c-i*s,b=r*l-o*s,T=n*c-i*a,S=n*l-o*a,P=i*l-o*c,M=u*g-f*p,_=u*m-h*p,y=u*v-d*p,E=f*m-h*g,A=f*v-d*g,L=h*v-d*m;return t[0]=a*L-c*A+l*E,t[1]=i*A-n*L-o*E,t[2]=g*P-m*S+v*T,t[3]=h*S-f*P-d*T,t[4]=c*y-s*L-l*_,t[5]=r*L-i*y+o*_,t[6]=m*b-p*P-v*x,t[7]=u*P-h*b+d*x,t[8]=s*A-a*y+l*M,t[9]=n*y-r*A-o*M,t[10]=p*S-g*b+v*w,t[11]=f*b-u*S-d*w,t[12]=a*_-s*E-c*M,t[13]=r*E-n*_+i*M,t[14]=g*x-p*T-m*w,t[15]=u*T-f*x+h*w,t}function yi(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15],v=e*s-r*o,w=e*a-n*o,x=r*a-n*s,b=l*p-u*d,T=l*g-f*d,S=u*g-f*p,P=e*S-r*T+n*b,M=o*S-s*T+a*b,_=l*x-u*w+f*v,y=d*x-p*w+g*v;return c*P-i*M+m*_-h*y}function Ie(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],w=e[15],x=r[0],b=r[1],T=r[2],S=r[3];return t[0]=x*n+b*a+T*f+S*g,t[1]=x*i+b*c+T*h+S*m,t[2]=x*o+b*l+T*d+S*v,t[3]=x*s+b*u+T*p+S*w,x=r[4],b=r[5],T=r[6],S=r[7],t[4]=x*n+b*a+T*f+S*g,t[5]=x*i+b*c+T*h+S*m,t[6]=x*o+b*l+T*d+S*v,t[7]=x*s+b*u+T*p+S*w,x=r[8],b=r[9],T=r[10],S=r[11],t[8]=x*n+b*a+T*f+S*g,t[9]=x*i+b*c+T*h+S*m,t[10]=x*o+b*l+T*d+S*v,t[11]=x*s+b*u+T*p+S*w,x=r[12],b=r[13],T=r[14],S=r[15],t[12]=x*n+b*a+T*f+S*g,t[13]=x*i+b*c+T*h+S*m,t[14]=x*o+b*l+T*d+S*v,t[15]=x*s+b*u+T*p+S*w,t}function vi(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,f,h,d,p,g,m,v;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],u=e[4],f=e[5],h=e[6],d=e[7],p=e[8],g=e[9],m=e[10],v=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=u,t[5]=f,t[6]=h,t[7]=d,t[8]=p,t[9]=g,t[10]=m,t[11]=v,t[12]=s*n+u*i+p*o+e[12],t[13]=a*n+f*i+g*o+e[13],t[14]=c*n+h*i+m*o+e[14],t[15]=l*n+d*i+v*o+e[15]),t}function xi(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function _i(t,e,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,f,h,d,p,g,m,v,w,x,b,T,S,P,M,_,y,E,A,L,I,R;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,f=e[0],h=e[1],d=e[2],p=e[3],g=e[4],m=e[5],v=e[6],w=e[7],x=e[8],b=e[9],T=e[10],S=e[11],P=i*i*u+c,M=o*i*u+s*l,_=s*i*u-o*l,y=i*o*u-s*l,E=o*o*u+c,A=s*o*u+i*l,L=i*s*u+o*l,I=o*s*u-i*l,R=s*s*u+c,t[0]=f*P+g*M+x*_,t[1]=h*P+m*M+b*_,t[2]=d*P+v*M+T*_,t[3]=p*P+w*M+S*_,t[4]=f*y+g*E+x*A,t[5]=h*y+m*E+b*A,t[6]=d*y+v*E+T*A,t[7]=p*y+w*E+S*A,t[8]=f*L+g*I+x*R,t[9]=h*L+m*I+b*R,t[10]=d*L+v*I+T*R,t[11]=p*L+w*I+S*R,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function bi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=s*i+u*n,t[6]=a*i+f*n,t[7]=c*i+h*n,t[8]=l*i-o*n,t[9]=u*i-s*n,t[10]=f*i-a*n,t[11]=h*i-c*n,t}function wi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*n,t[1]=s*i-u*n,t[2]=a*i-f*n,t[3]=c*i-h*n,t[8]=o*n+l*i,t[9]=s*n+u*i,t[10]=a*n+f*i,t[11]=c*n+h*i,t}function Mi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*n,t[1]=s*i+u*n,t[2]=a*i+f*n,t[3]=c*i+h*n,t[4]=l*i-o*n,t[5]=u*i-s*n,t[6]=f*i-a*n,t[7]=h*i-c*n,t}function dd(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function pd(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function md(t,e,r){let n=r[0],i=r[1],o=r[2],s=Math.sqrt(n*n+i*i+o*o),a,c,l;return s<1e-6?null:(s=1/s,n*=s,i*=s,o*=s,c=Math.sin(e),a=Math.cos(e),l=1-a,t[0]=n*n*l+a,t[1]=i*n*l+o*c,t[2]=o*n*l-i*c,t[3]=0,t[4]=n*i*l-o*c,t[5]=i*i*l+a,t[6]=o*i*l+n*c,t[7]=0,t[8]=n*o*l+i*c,t[9]=i*o*l-n*c,t[10]=o*o*l+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function gd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ha(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,c=i+i,l=o+o,u=n*a,f=n*c,h=n*l,d=i*c,p=i*l,g=o*l,m=s*a,v=s*c,w=s*l;return t[0]=1-(d+g),t[1]=f+w,t[2]=h-v,t[3]=0,t[4]=f-w,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+v,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function xd(t,e){let r=new j(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=n*n+i*i+o*o+s*s;return f>0?(r[0]=(a*s+u*n+c*o-l*i)*2/f,r[1]=(c*s+u*i+l*n-a*o)*2/f,r[2]=(l*s+u*o+a*i-c*n)*2/f):(r[0]=(a*s+u*n+c*o-l*i)*2,r[1]=(c*s+u*i+l*n-a*o)*2,r[2]=(l*s+u*o+a*i-c*n)*2),ha(t,e,r),t}function _d(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function da(t,e){let r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(c*c+l*l+u*u),t}function bd(t,e){let r=new j(3);da(r,e);let n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,c=e[2]*o,l=e[4]*n,u=e[5]*i,f=e[6]*o,h=e[8]*n,d=e[9]*i,p=e[10]*o,g=s+u+p,m=0;return g>0?(m=Math.sqrt(g+1)*2,t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(a-l)/m):s>u&&s>p?(m=Math.sqrt(1+s-u-p)*2,t[3]=(f-d)/m,t[0]=.25*m,t[1]=(a+l)/m,t[2]=(h+c)/m):u>p?(m=Math.sqrt(1+u-s-p)*2,t[3]=(h-c)/m,t[0]=(a+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=Math.sqrt(1+p-s-u)*2,t[3]=(a-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function wd(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let i=n[0],o=n[1],s=n[2],a=n[4],c=n[5],l=n[6],u=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(i*i+o*o+s*s),r[1]=Math.sqrt(a*a+c*c+l*l),r[2]=Math.sqrt(u*u+f*f+h*h);let d=1/r[0],p=1/r[1],g=1/r[2],m=i*d,v=o*p,w=s*g,x=a*d,b=c*p,T=l*g,S=u*d,P=f*p,M=h*g,_=m+b+M,y=0;return _>0?(y=Math.sqrt(_+1)*2,t[3]=.25*y,t[0]=(T-P)/y,t[1]=(S-w)/y,t[2]=(v-x)/y):m>b&&m>M?(y=Math.sqrt(1+m-b-M)*2,t[3]=(T-P)/y,t[0]=.25*y,t[1]=(v+x)/y,t[2]=(S+w)/y):b>M?(y=Math.sqrt(1+b-m-M)*2,t[3]=(S-w)/y,t[0]=(v+x)/y,t[1]=.25*y,t[2]=(T+P)/y):(y=Math.sqrt(1+M-m-b)*2,t[3]=(v-x)/y,t[0]=(S+w)/y,t[1]=(T+P)/y,t[2]=.25*y),t}function Md(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=i+i,l=o+o,u=s+s,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=s*u,v=a*c,w=a*l,x=a*u,b=n[0],T=n[1],S=n[2];return t[0]=(1-(p+m))*b,t[1]=(h+x)*b,t[2]=(d-w)*b,t[3]=0,t[4]=(h-x)*T,t[5]=(1-(f+m))*T,t[6]=(g+v)*T,t[7]=0,t[8]=(d+w)*S,t[9]=(g-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Sd(t,e,r,n,i){let o=e[0],s=e[1],a=e[2],c=e[3],l=o+o,u=s+s,f=a+a,h=o*l,d=o*u,p=o*f,g=s*u,m=s*f,v=a*f,w=c*l,x=c*u,b=c*f,T=n[0],S=n[1],P=n[2],M=i[0],_=i[1],y=i[2],E=(1-(g+v))*T,A=(d+b)*T,L=(p-x)*T,I=(d-b)*S,R=(1-(h+v))*S,U=(m+w)*S,z=(p+x)*P,D=(m-w)*P,q=(1-(h+g))*P;return t[0]=E,t[1]=A,t[2]=L,t[3]=0,t[4]=I,t[5]=R,t[6]=U,t[7]=0,t[8]=z,t[9]=D,t[10]=q,t[11]=0,t[12]=r[0]+M-(E*M+I*_+z*y),t[13]=r[1]+_-(A*M+R*_+D*y),t[14]=r[2]+y-(L*M+U*_+q*y),t[15]=1,t}function Si(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,f=n*a,h=i*s,d=i*a,p=i*c,g=o*s,m=o*a,v=o*c;return t[0]=1-f-p,t[1]=u+v,t[2]=h-m,t[3]=0,t[4]=u-v,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ti(t,e,r,n,i,o,s){let a=1/(r-e),c=1/(i-n),l=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*c,t[10]=(s+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*l,t[15]=0,t}function pa(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}var Pi=pa;function Td(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=i*s,t[14]=i*n*s}else t[10]=-1,t[14]=-n;return t}function Pd(t,e,r,n){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-((s-a)*c*.5),t[9]=(i-o)*l*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ma(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=(s+o)*l,t[15]=1,t}var Ei=ma;function Ed(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=o*l,t[15]=1,t}function Oi(t,e,r,n){let i,o,s,a,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],v=n[0],w=n[1],x=n[2],b=r[0],T=r[1],S=r[2];return Math.abs(p-b)<1e-6&&Math.abs(g-T)<1e-6&&Math.abs(m-S)<1e-6?fa(t):(f=p-b,h=g-T,d=m-S,i=1/Math.sqrt(f*f+h*h+d*d),f*=i,h*=i,d*=i,o=w*d-x*h,s=x*f-v*d,a=v*h-w*f,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=h*a-d*s,l=d*o-f*a,u=f*s-h*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),t[0]=o,t[1]=c,t[2]=f,t[3]=0,t[4]=s,t[5]=l,t[6]=h,t[7]=0,t[8]=a,t[9]=u,t[10]=d,t[11]=0,t[12]=-(o*p+s*g+a*m),t[13]=-(c*p+l*g+u*m),t[14]=-(f*p+h*g+d*m),t[15]=1,t)}function Od(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=n[0],c=n[1],l=n[2],u=i-r[0],f=o-r[1],h=s-r[2],d=u*u+f*f+h*h;d>0&&(d=1/Math.sqrt(d),u*=d,f*=d,h*=d);let p=c*h-l*f,g=l*u-a*h,m=a*f-c*u;return d=p*p+g*g+m*m,d>0&&(d=1/Math.sqrt(d),p*=d,g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function Id(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function Ad(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function Ld(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function ga(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Rd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Fd(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function Nd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Cd(t,e){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],v=t[15],w=e[0],x=e[1],b=e[2],T=e[3],S=e[4],P=e[5],M=e[6],_=e[7],y=e[8],E=e[9],A=e[10],L=e[11],I=e[12],R=e[13],U=e[14],z=e[15];return Math.abs(r-w)<=1e-6*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(n-x)<=1e-6*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-S)<=1e-6*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(a-P)<=1e-6*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(c-M)<=1e-6*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-y)<=1e-6*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-E)<=1e-6*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-A)<=1e-6*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-L)<=1e-6*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-I)<=1e-6*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=1e-6*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-U)<=1e-6*Math.max(1,Math.abs(m),Math.abs(U))&&Math.abs(v-z)<=1e-6*Math.max(1,Math.abs(v),Math.abs(z))}var zd=Ie,Bd=ga;function kd(){let t=new j(4);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ya(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function va(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function xa(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function _a(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function ba(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function wa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ma(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function Sa(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}function Ta(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2],l=r[3],u=l*n+a*o-c*i,f=l*i+c*n-s*o,h=l*o+s*i-a*n,d=-s*n-a*i-c*o;return t[0]=u*l+d*-s+f*-c-h*-a,t[1]=f*l+d*-a+h*-s-u*-c,t[2]=h*l+d*-c+u*-a-f*-s,t[3]=e[3],t}var b_=function(){let t=kd();return function(e,r,n,i,o,s){let a,c;for(r||(r=4),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Li;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Li||(Li={}));var Ud=45*Math.PI/180,jd=1,Ii=.1,Ai=500,Vd=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),et=class extends ue{static get IDENTITY(){return Dd()}static get ZERO(){return Wd()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Li}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=f,this[11]=h,this[12]=d,this[13]=p,this[14]=g,this[15]=m,this.check()}setRowMajor(e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return this[0]=e,this[1]=o,this[2]=l,this[3]=d,this[4]=r,this[5]=s,this[6]=u,this[7]=p,this[8]=n,this[9]=a,this[10]=f,this[11]=g,this[12]=i,this[13]=c,this[14]=h,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Vd)}fromObject(e){return this.check()}fromQuaternion(e){return Si(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=Ii,far:a=Ai}=e;return a===1/0?Gd(this,r,n,i,o,s):Ti(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return Oi(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=Ii,far:a=Ai}=e;return Ei(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Ud,aspect:n=jd,focalDistance:i=1,near:o=Ii,far:s=Ai}=e;Pa(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return Pa(r),Pi(this,r,n,i,o),this.check()}determinant(){return yi(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*s,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*s,e}transpose(){return mi(this,this),this.check()}invert(){return gi(this,this),this.check()}multiplyLeft(e){return Ie(this,e,this),this.check()}multiplyRight(e){return Ie(this,this,e),this.check()}rotateX(e){return bi(this,this,e),this.check()}rotateY(e){return wi(this,this,e),this.check()}rotateZ(e){return Mi(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return _i(this,this,e,r),this.check()}scale(e){return xi(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return vi(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Sa(r||[-0,-0,-0,-0],e,this),Lt(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=Ys(r||[-0,-0],e,this);break;case 3:i=ce(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=Hs(r||[-0,-0],e,this);break;case 3:n=mr(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},Sr,Tr;function Wd(){return Sr||(Sr=new et([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Sr)),Sr}function Dd(){return Tr||(Tr=new et,Object.freeze(Tr)),Tr}function Pa(t){if(t>Math.PI*2)throw Error("expected radians")}function Gd(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),c=(r+e)/(r-e),l=(i+n)/(i-n),u=-1,f=-1,h=-2*o;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=u,t[11]=f,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function Ea(){let t=new j(4);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Oa(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ri(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Fi(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],c=r[1],l=r[2],u=r[3];return t[0]=n*u+s*a+i*l-o*c,t[1]=i*u+s*c+o*a-n*l,t[2]=o*u+s*l+n*c-i*a,t[3]=s*u-n*a-i*c-o*l,t}function Ia(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=i*c+o*a,t[2]=o*c-i*a,t[3]=s*c-n*a,t}function Aa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-o*a,t[1]=i*c+s*a,t[2]=o*c+n*a,t[3]=s*c-i*a,t}function La(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*a,t[1]=i*c-n*a,t[2]=o*c+s*a,t[3]=s*c-o*a,t}function Ra(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ae(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=r[0],l=r[1],u=r[2],f=r[3],h,d,p,g,m;return h=i*c+o*l+s*u+a*f,h<0&&(h=-h,c=-c,l=-l,u=-u,f=-f),1-h>1e-6?(d=Math.acos(h),m=Math.sin(d),p=Math.sin((1-n)*d)/m,g=Math.sin(n*d)/m):(p=1-n,g=n),t[0]=p*i+g*c,t[1]=p*o+g*l,t[2]=p*s+g*u,t[3]=p*a+g*f,t}function Fa(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function Na(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ni(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}var Ca=ya;var za=va,Ba=wa,ka=Ma,qa=xa;var Ua=_a;var ja=ba;var Va=function(){let t=ci(),e=li(1,0,0),r=li(0,1,0);return function(n,i,o){let s=ui(i,o);return s<-.999999?(ae(t,e,i),na(t)<1e-6&&ae(t,r,i),Ks(t,t),Ri(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ae(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,ja(n,n))}}(),C_=function(){let t=Ea(),e=Ea();return function(r,n,i,o,s,a){return Ae(t,n,s,a),Ae(e,i,o,a),Ae(r,t,e,2*a*(1-a)),r}}(),z_=function(){let t=ia();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ja(e,Ni(e,t))}}();var Zd=[0,0,0,1],fe=class extends At{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Ni(this,e),this.check()}fromAxisRotation(e,r){return Ri(this,e,r),this.check()}identity(){return Oa(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=N(e)}get y(){return this[1]}set y(e){this[1]=N(e)}get z(){return this[2]}set z(e){this[2]=N(e)}get w(){return this[3]}set w(e){this[3]=N(e)}len(){return qa(this)}lengthSquared(){return Ua(this)}dot(e){return Ba(this,e)}rotationTo(e,r){return Va(this,e,r),this.check()}add(e){return Ca(this,this,e),this.check()}calculateW(){return Ra(this,this),this.check()}conjugate(){return Na(this,this),this.check()}invert(){return Fa(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ka(this,e,r,n),this.check())}multiplyRight(e){return Fi(this,this,e),this.check()}multiplyLeft(e){return Fi(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Ia(this,this,e),this.check()}rotateY(e){return Aa(this,this,e),this.check()}rotateZ(e){return La(this,this,e),this.check()}scale(e){return za(this,this,e),this.check()}slerp(e,r,n){let i,o,s;switch(arguments.length){case 1:({start:i=Zd,target:o,ratio:s}=e);break;case 2:i=this,o=e,s=r;break;default:i=e,o=r,s=n}return Ae(this,i,o,s),this.check()}transformVector4(e,r=new le){return Ta(r,e,this),Lt(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var Le={};kn(Le,{EPSILON1:()=>Xd,EPSILON10:()=>rp,EPSILON11:()=>np,EPSILON12:()=>ip,EPSILON13:()=>op,EPSILON14:()=>sp,EPSILON15:()=>ap,EPSILON16:()=>cp,EPSILON17:()=>lp,EPSILON18:()=>up,EPSILON19:()=>fp,EPSILON2:()=>Yd,EPSILON20:()=>hp,EPSILON3:()=>Hd,EPSILON4:()=>$d,EPSILON5:()=>Qd,EPSILON6:()=>Kd,EPSILON7:()=>Jd,EPSILON8:()=>tp,EPSILON9:()=>ep,PI_OVER_FOUR:()=>pp,PI_OVER_SIX:()=>mp,PI_OVER_TWO:()=>dp,TWO_PI:()=>gp});var Xd=.1,Yd=.01,Hd=.001,$d=1e-4,Qd=1e-5,Kd=1e-6,Jd=1e-7,tp=1e-8,ep=1e-9,rp=1e-10,np=1e-11,ip=1e-12,op=1e-13,sp=1e-14,ap=1e-15,cp=1e-16,lp=1e-17,up=1e-18,fp=1e-19,hp=1e-20,dp=Math.PI/2,pp=Math.PI/4,mp=Math.PI/6,gp=Math.PI*2;function Pr(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var st=Math.PI,Za=st/4,Wa=st/180,Da=180/st,Er=512;function bt(t){let[e,r]=t;Pr(Number.isFinite(e)),Pr(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=e*Wa,i=r*Wa,o=Er*(n+st)/(2*st),s=Er*(st+Math.log(Math.tan(Za+i*.5)))/(2*st);return[o,s]}function wt(t){let[e,r]=t,n=e/Er*(2*st)-st,i=2*(Math.atan(Math.exp(r/Er*(2*st)-st))-Za);return[n*Da,i*Da]}var Mb=Math.PI/180;var Ya=6378137*Math.PI;function Ci(t){var e=bt(t);return e[0]=(e[0]/256-1)*Ya,e[1]=(e[1]/256-1)*Ya,e}function Ir(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ir=function(r){return typeof r}:Ir=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ir(t)}function Ha(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function zi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){Ha(o,n,i,s,a,"next",c)}function a(c){Ha(o,n,i,s,a,"throw",c)}s(void 0)})}}function $a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$a(Object(r),!0).forEach(function(n){Rp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rp(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Np(t,e,r){return e&&Qa(t.prototype,e),r&&Qa(t,r),t}function Ar(t,e,r){return typeof Reflect<"u"&&Reflect.get?Ar=Reflect.get:Ar=function(i,o,s){var a=Cp(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},Ar(t,e,r||t)}function Cp(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=he(t),t!==null););return t}function zp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bi(t,e)}function Bi(t,e){return Bi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Bi(t,e)}function Bp(t){var e=Up();return function(){var n=he(t),i;if(e){var o=he(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return kp(this,i)}}function kp(t,e){if(e&&(Ir(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qp(t)}function qp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Up(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(t){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},he(t)}var jp={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(e,r){return console.error(r,e)}}},Lr=function(t){zp(r,t);var e=Bp(r);function r(){var i;Fp(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.shouldUpdateState=function(){return!0},n.initializeState=function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0},n.updateState=function(o){var s=this,a=o.changeFlags,c=o.props,l=o.oldProps,u=this.context.viewport;a.dataChanged||c.serviceType!==l.serviceType?(this.state.imageSource=this._createImageSource(c),this._loadMetadata(),this.debounce(function(){return s.loadImage(u,"image source changed")},0)):(0,Gt._deepEqual)(c.layers,l.layers,1)?a.viewportChanged&&this.debounce(function(){return s.loadImage(u,"viewport changed")}):this.debounce(function(){return s.loadImage(u,"layers changed")},0)},n.finalizeState=function(){},n.renderLayers=function(){var o=this.state,s=o.bounds,a=o.image,c=o.lastRequestParameters;return a&&new Ka.BitmapLayer(Or(Or({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:c.srs==="EPSG:4326"?Gt.COORDINATE_SYSTEM.LNGLAT:Gt.COORDINATE_SYSTEM.CARTESIAN,bounds:s,image:a}))},n.getFeatureInfoText=function(){var i=zi(regeneratorRuntime.mark(function s(a,c){var l,u,f,h;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(l=this.state.lastRequestParameters,!l){p.next=6;break}return p.next=4,(u=(f=this.state.imageSource).getFeatureInfoText)===null||u===void 0?void 0:u.call(f,Or(Or({},l),{},{query_layers:l.layers,x:a,y:c,info_format:"application/vnd.ogc.gml"}));case 4:return h=p.sent,p.abrupt("return",h);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},s,this)}));function o(s,a){return i.apply(this,arguments)}return o}(),n._createImageSource=function(o){if(o.data instanceof rt)return o.data;if(typeof o.data=="string")return si({url:o.data,loadOptions:o.loadOptions,type:o.serviceType});throw new Error("invalid image source in props.data")},n._loadMetadata=function(){var i=zi(regeneratorRuntime.mark(function s(){var a,c,l,u;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this.state.imageSource,h.prev=1,this.state.loadCounter++,h.next=5,a.getMetadata();case 5:c=h.sent,this.state.imageSource===a&&((l=this.getCurrentLayer())===null||l===void 0||l.props.onMetadataLoad(c)),h.next=12;break;case 9:h.prev=9,h.t0=h.catch(1),(u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoadError(h.t0);case 12:return h.prev=12,this.state.loadCounter--,h.finish(12);case 15:case"end":return h.stop()}},s,this,[[1,9,12,15]])}));function o(){return i.apply(this,arguments)}return o}(),n.loadImage=function(){var i=zi(regeneratorRuntime.mark(function s(a,c){var l,u,f,h,d,p,g,m,v,w,x,b,T,S;return regeneratorRuntime.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(l=this.props,u=l.layers,f=l.serviceType,!(f==="wms"&&u.length===0)){M.next=3;break}return M.abrupt("return");case 3:return h=a.getBounds(),d=a.width,p=a.height,g=this.getRequestId(),m=this.props.srs,m==="auto"&&(m=a.resolution?"EPSG:4326":"EPSG:3857"),v={width:d,height:p,boundingBox:[[h[0],h[1]],[h[2],h[3]]],layers:u,crs:m},m==="EPSG:3857"&&(w=Ci([h[0],h[1]]),x=Ci([h[2],h[3]]),v.boundingBox=[w,x]),M.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(g),M.next=15,this.state.imageSource.getImage(v);case 15:b=M.sent,this.state.lastRequestId<g&&((T=this.getCurrentLayer())===null||T===void 0||T.props.onImageLoad(g),this.setState({image:b,bounds:h,lastRequestParameters:v,lastRequestId:g})),M.next=23;break;case 19:M.prev=19,M.t0=M.catch(10),this.raiseError(M.t0,"Load image"),(S=this.getCurrentLayer())===null||S===void 0||S.props.onImageLoadError(g,M.t0);case 23:return M.prev=23,this.state.loadCounter--,M.finish(23);case 26:case"end":return M.stop()}},s,this,[[10,19,23,26]])}));function o(s,a){return i.apply(this,arguments)}return o}(),n.getRequestId=function(){return this.state._nextRequestId++},n.debounce=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return o()},s)},Np(r,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&Ar(he(r.prototype),"isLoaded",this)}}]),r}(Gt.CompositeLayer);Lr.layerName="WMSLayer";Lr.defaultProps=jp;var Ja=B(ct());function Rr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rr=function(r){return typeof r}:Rr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rr(t)}function Vp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ki(t,e)}function ki(t,e){return ki=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ki(t,e)}function Dp(t){var e=Xp();return function(){var n=Fr(t),i;if(e){var o=Fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gp(this,i)}}function Gp(t,e){if(e&&(Rr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zp(t)}function Zp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fr(t){return Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Fr(t)}var Yp={getHeight:{type:"accessor",value:0},greatCircle:!0},Nr=function(t){Wp(r,t);var e=Dp(r);function r(){return Vp(this,r),e.apply(this,arguments)}return r}(Ja.ArcLayer);Nr.layerName="GreatCircleLayer";Nr.defaultProps=Yp;var ec=B(ut()),ji=B(ct());function Cr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(r){return typeof r}:Cr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Cr(t)}var Hp=["updateTriggers"];function $p(t,e){if(t==null)return{};var r=Qp(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Qp(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Kp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qi(t,e)}function qi(t,e){return qi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},qi(t,e)}function t0(t){var e=n0();return function(){var n=zr(t),i;if(e){var o=zr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return e0(this,i)}}function e0(t,e){if(e&&(Cr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r0(t)}function r0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zr(t){return zr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zr(t)}function tc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ui(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tc(Object(r),!0).forEach(function(n){i0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function i0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o0=Ui({},ji.PolygonLayer.defaultProps),nt=function(t){Jp(r,t);var e=t0(r);function r(){return Kp(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){return null},n.renderLayers=function(){var o=this.props,s=o.elevationScale,a=o.extruded,c=o.wireframe,l=o.filled,u=o.stroked,f=o.lineWidthUnits,h=o.lineWidthScale,d=o.lineWidthMinPixels,p=o.lineWidthMaxPixels,g=o.lineJointRounded,m=o.lineMiterLimit,v=o.lineDashJustified,w=o.getElevation,x=o.getFillColor,b=o.getLineColor,T=o.getLineWidth,S=this.props,P=S.updateTriggers,M=S.material,_=S.transitions,y=this.getSubLayerClass("cell",ji.PolygonLayer),E=this.indexToBounds()||{},A=E.updateTriggers,L=$p(E,Hp);return new y({filled:l,wireframe:c,extruded:a,elevationScale:s,stroked:u,lineWidthUnits:f,lineWidthScale:h,lineWidthMinPixels:d,lineWidthMaxPixels:p,lineJointRounded:g,lineMiterLimit:m,lineDashJustified:v,material:M,transitions:_,getElevation:w,getFillColor:x,getLineColor:b,getLineWidth:T},this.getSubLayerProps({id:"cell",updateTriggers:P&&Ui(Ui({},A),{},{getElevation:P.getElevation,getFillColor:P.getFillColor,getLineColor:P.getLineColor,getLineWidth:P.getLineWidth})}),L)},r}(ec.CompositeLayer);nt.layerName="GeoCellLayer";nt.defaultProps=o0;var Br=B(Vi());function sc(t,e){return l0(t)||c0(t,e)||a0(t,e)||s0()}function s0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a0(t,e){if(t){if(typeof t=="string")return nc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nc(t,e)}}function nc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c0(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function l0(t){if(Array.isArray(t))return t}var u0=3,f0=30,h0=2*f0+1,ic=180/Math.PI;function ac(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function oc(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function cc(t){return[oc(t[0]),oc(t[1])]}function lc(t,e){var r=sc(e,2),n=r[0],i=r[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function uc(t){var e=sc(t,3),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,Math.sqrt(r*r+n*n)),s=Math.atan2(n,r);return[s*ic,o*ic]}function fc(t){for(var e=Br.default.fromString(t,!0,10).toString(2);e.length<u0+h0;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,s=Br.default.fromString(n,!0,2).toString(10),a=Br.default.fromString(i,!0,2).toString(4);a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}function d0(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function hc(t){for(var e=t.split("/"),r=parseInt(e[0],10),n=e[1],i=n.length,o=[0,0],s,a=i-1;a>=0;a--){s=i-a;var c=n[a],l=0,u=0;c==="1"?u=1:c==="2"?(l=1,u=1):c==="3"&&(l=1);var f=Math.pow(2,s-1);d0(f,o,l,u),o[0]+=f*l,o[1]+=f*u}if(r%2===1){var h=o[0];o[0]=o[1],o[1]=h}return{face:r,ij:o,level:s}}var dc=B(Vi());function p0(t){var e=t.padEnd(16,"0");return dc.default.fromString(e,16)}var m0=100;function g0(t){for(var e=t.face,r=t.ij,n=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(m0*Math.pow(2,-n))),s=new Float64Array(4*o*2+2),a=0,c=0,l=0;l<4;l++)for(var u=i[l].slice(0),f=i[l+1],h=(f[0]-u[0])/o,d=(f[1]-u[1])/o,p=0;p<o;p++){u[0]+=h,u[1]+=d;var g=ac(r,n,u),m=cc(g),v=lc(e,m),w=uc(v);Math.abs(w[1])>89.999&&(w[0]=c);var x=w[0]-c;w[0]+=x>180?-360:x<-180?360:0,s[a++]=w[0],s[a++]=w[1],c=w[0]}return s[a++]=s[0],s[a++]=s[1],s}function y0(t){if(typeof t=="string"){if(t.indexOf("/")>0)return t;t=p0(t)}return fc(t.toString())}function pc(t){var e=y0(t),r=hc(e);return g0(r)}function kr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kr=function(r){return typeof r}:kr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kr(t)}function v0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wi(t,e)}function Wi(t,e){return Wi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Wi(t,e)}function _0(t){var e=M0();return function(){var n=qr(t),i;if(e){var o=qr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return b0(this,i)}}function b0(t,e){if(e&&(kr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w0(t)}function w0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function M0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qr(t){return qr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},qr(t)}var S0={getS2Token:{type:"accessor",value:function(e){return e.token}}},Ur=function(t){x0(r,t);var e=_0(r);function r(){return v0(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getS2Token;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(l,u){return pc(a(l,u))}}},r}(nt);Ur.layerName="S2Layer";Ur.defaultProps=S0;function Di(t,e){return O0(t)||E0(t,e)||P0(t,e)||T0()}function T0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0(t,e){if(t){if(typeof t=="string")return mc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mc(t,e)}}function mc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E0(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function O0(t){if(Array.isArray(t))return t}var Gi=512;function I0(t,e){for(var r=0,n=0,i=1<<t.length,o=i/Gi,s=0;s<t.length;s++){i>>=1;var a=parseInt(t[s]);a%2&&(r|=i),a>1&&(n|=i)}return[[r/o,Gi-n/o],[(r+e)/o,Gi-(n+e)/o]]}function gc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=I0(t,e),n=Di(r,2),i=n[0],o=n[1],s=wt(i),a=Di(s,2),c=a[0],l=a[1],u=wt(o),f=Di(u,2),h=f[0],d=f[1];return[h,l,h,d,c,d,c,l,h,l]}function jr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jr=function(r){return typeof r}:jr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jr(t)}function A0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zi(t,e)}function Zi(t,e){return Zi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Zi(t,e)}function R0(t){var e=C0();return function(){var n=Vr(t),i;if(e){var o=Vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return F0(this,i)}}function F0(t,e){if(e&&(jr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N0(t)}function N0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vr(t){return Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Vr(t)}var z0={getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}},Wr=function(t){L0(r,t);var e=R0(r);function r(){return A0(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.extruded,c=o.getQuadkey,l=a?.99:1;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(f,h){return gc(c(f,h),l)},updateTriggers:{getPolygon:l}}},r}(nt);Wr.layerName="QuadkeyLayer";Wr.defaultProps=z0;var en=B(ut()),$c=B(ct());function yc(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function B0(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){yc(o,n,i,s,a,"next",c)}function a(c){yc(o,n,i,s,a,"throw",c)}s(void 0)})}}function k0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function q0(t,e,r){return e&&vc(t.prototype,e),r&&vc(t,r),t}var Fe=function(){function t(r){k0(this,t),this.index=void 0,this.isVisible=void 0,this.isSelected=void 0,this.parent=void 0,this.children=void 0,this.content=void 0,this.state=void 0,this.layers=void 0,this.id=void 0,this.zoom=void 0,this.userData=void 0,this.boundingBox=void 0,this._abortController=void 0,this._loader=void 0,this._loaderId=void 0,this._isLoaded=void 0,this._isCancelled=void 0,this._needsReload=void 0,this._bbox=void 0,this.index=r,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var e=t.prototype;return e._loadData=function(){var r=B0(regeneratorRuntime.mark(function i(o){var s,a,c,l,u,f,h,d,p,g,m,v,w,x;return regeneratorRuntime.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=o.getData,a=o.requestScheduler,c=o.onLoad,l=o.onError,u=this.index,f=this.id,h=this.bbox,d=this.userData,p=this.zoom,g=this._loaderId,this._abortController=new AbortController,m=this._abortController.signal,T.next=7,a.scheduleRequest(this,function(S){return S.isSelected?1:-1});case 7:if(v=T.sent,v){T.next=11;break}return this._isCancelled=!0,T.abrupt("return");case 11:if(!this._isCancelled){T.next=14;break}return v.done(),T.abrupt("return");case 14:return w=null,T.prev=15,T.next=18,s({index:u,id:f,bbox:h,userData:d,zoom:p,signal:m});case 18:w=T.sent,T.next=24;break;case 21:T.prev=21,T.t0=T.catch(15),x=T.t0||!0;case 24:return T.prev=24,v.done(),T.finish(24);case 27:if(g===this._loaderId){T.next=29;break}return T.abrupt("return");case 29:if(this._loader=void 0,this.content=w,!(this._isCancelled&&!w)){T.next=34;break}return this._isLoaded=!1,T.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,x?l(x,this):c(this);case 37:case"end":return T.stop()}},i,this,[[15,21,24,27]])}));function n(i){return r.apply(this,arguments)}return n}(),e.loadData=function(n){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(n),this._loader},e.setNeedsReload=function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0},e.abort=function(){var n;this.isLoaded||(this._isCancelled=!0,(n=this._abortController)===null||n===void 0||n.abort())},q0(t,[{key:"bbox",get:function(){return this._bbox},set:function(n){this._bbox||(this._bbox=n,"west"in n?this.boundingBox=[[n.west,n.south],[n.east,n.north]]:this.boundingBox=[[n.left,n.top],[n.right,n.bottom]])}},{key:"data",get:function(){var n=this;return this.isLoading&&this._loader?this._loader.then(function(){return n.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var n=this.content?this.content.byteLength:0;return Number.isFinite(n)||console.error("byteLength not defined in tile data"),n}}]),t}();var Ce=B(ut());var Z={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var xc=new O,U0=new O,Rt=class{constructor(e=[0,0,0],r=[0,0,0],n){F(this,"center",void 0),F(this,"halfDiagonal",void 0),F(this,"minimum",void 0),F(this,"maximum",void 0),n=n||xc.copy(e).add(r).scale(.5),this.center=new O(n),this.halfDiagonal=new O(r).subtract(this.center),this.minimum=new O(e),this.maximum=new O(r)}clone(){return new Rt(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){let{halfDiagonal:r}=this,n=U0.from(e.normal),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),o=this.center.dot(n)+e.distance;return o-i>0?Z.INSIDE:o+i<0?Z.OUTSIDE:Z.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=xc.from(e).subtract(this.center),{halfDiagonal:n}=this,i=0,o;return o=Math.abs(r.x)-n.x,o>0&&(i+=o*o),o=Math.abs(r.y)-n.y,o>0&&(i+=o*o),o=Math.abs(r.z)-n.z,o>0&&(i+=o*o),i}};var Ne=new O,_c=new O,Ft=class{constructor(e=[0,0,0],r=0){F(this,"center",void 0),F(this,"radius",void 0),this.radius=-0,this.center=new O,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Ne.from(r),this.center=new O().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new Ft(this.center,this.radius)}union(e){let r=this.center,n=this.radius,i=e.center,o=e.radius,s=Ne.copy(i).subtract(r),a=s.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return e.clone();let c=(n+a+o)*.5;return _c.copy(s).scale((-n+c)/a).add(r),this.center.copy(_c),this.radius=c,this}expand(e){let n=Ne.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Mr.getScaling(Ne,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Ne.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,o=e.normal.dot(r)+e.distance;return o<-n?Z.OUTSIDE:o<n?Z.INTERSECTING:Z.INSIDE}};var j0=new O,V0=new O,Dr=new O,Gr=new O,Zr=new O,W0=new O,D0=new O,Mt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Zt=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){F(this,"center",void 0),F(this,"halfAxes",void 0),this.center=new O().from(e),this.halfAxes=new V(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new O(e).len(),new O(r).len(),new O(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new O(e).normalize(),o=new O(r).normalize(),s=new O(n).normalize();return new fe().fromMatrix3(new V([...i,...o,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let i=new fe(n),o=new V().fromQuaternion(i);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new O().from(e),this.halfAxes=o,this}clone(){return new Zt(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Ft){let r=this.halfAxes,n=r.getColumn(0,Dr),i=r.getColumn(1,Gr),o=r.getColumn(2,Zr),s=j0.copy(n).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,i=this.halfAxes,o=n.x,s=n.y,a=n.z,c=Math.abs(o*i[Mt.COLUMN0ROW0]+s*i[Mt.COLUMN0ROW1]+a*i[Mt.COLUMN0ROW2])+Math.abs(o*i[Mt.COLUMN1ROW0]+s*i[Mt.COLUMN1ROW1]+a*i[Mt.COLUMN1ROW2])+Math.abs(o*i[Mt.COLUMN2ROW0]+s*i[Mt.COLUMN2ROW1]+a*i[Mt.COLUMN2ROW2]),l=n.dot(r)+e.distance;return l<=-c?Z.OUTSIDE:l>=c?Z.INSIDE:Z.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=V0.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,Dr),o=n.getColumn(1,Gr),s=n.getColumn(2,Zr),a=i.magnitude(),c=o.magnitude(),l=s.magnitude();i.normalize(),o.normalize(),s.normalize();let u=0,f;return f=Math.abs(r.dot(i))-a,f>0&&(u+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(u+=f*f),f=Math.abs(r.dot(s))-l,f>0&&(u+=f*f),u}computePlaneDistances(e,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,c=a.getColumn(0,Dr),l=a.getColumn(1,Gr),u=a.getColumn(2,Zr),f=W0.copy(c).add(l).add(u).add(s),h=D0.copy(f).subtract(e),d=r.dot(h);return i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).add(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),n[0]=i,n[1]=o,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Dr);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Gr);n.transformAsPoint(e);let i=this.halfAxes.getColumn(2,Zr);return i.transformAsPoint(e),this.halfAxes=new V([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var bc=new O,wc=new O,at=class{constructor(e=[0,0,1],r=0){F(this,"normal",void 0),F(this,"distance",void 0),this.normal=new O,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return mt(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=bc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,i){return this.normal.set(e,r,n),mt(pt(this.normal.len(),1)),this.distance=i,this}clone(){return new at(this.normal,this.distance)}equals(e){return pt(this.distance,e.distance)&&pt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=wc.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=bc.from(e),i=this.getPointDistance(n),o=wc.copy(this.normal).scale(i);return n.subtract(o).to(r)}};var Mc=[new O([1,0,0]),new O([0,1,0]),new O([0,0,1])],Sc=new O,G0=new O,tt=class{constructor(e=[]){F(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Mc.length;let r=e.center,n=e.radius,i=0;for(let o of Mc){let s=this.planes[i],a=this.planes[i+1];s||(s=this.planes[i]=new at),a||(a=this.planes[i+1]=new at);let c=Sc.copy(o).scale(-n).add(r);s.fromPointNormal(c,o);let l=Sc.copy(o).scale(n).add(r),u=G0.copy(o).negate();a.fromPointNormal(l,u),i+=2}return this}computeVisibility(e){let r=Z.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case Z.OUTSIDE:return Z.OUTSIDE;case Z.INTERSECTING:r=Z.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(mt(Number.isFinite(r),"parentPlaneMask is required."),r===tt.MASK_OUTSIDE||r===tt.MASK_INSIDE)return r;let n=tt.MASK_INSIDE,i=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&!(r&s))continue;let a=i[o],c=e.intersectPlane(a);if(c===Z.OUTSIDE)return tt.MASK_OUTSIDE;c===Z.INTERSECTING&&(n|=s)}return n}};F(tt,"MASK_OUTSIDE",4294967295);F(tt,"MASK_INSIDE",0);F(tt,"MASK_INDETERMINATE",2147483647);var Xw=new O,Yw=new O,Hw=new O,$w=new O,Qw=new O;var iM=new O,oM=new O,sM=new O,aM=new O,cM=new O,lM=new O,uM=new O,fM=new O,hM=new O,dM=new O,pM=new O,mM=new O;var gt=new V,X0=new V,Y0=new V,Xr=new V,Tc=new V;function Hi(t,e={}){let r=Le.EPSILON20,n=10,i=0,o=0,s=X0,a=Y0;s.identity(),a.copy(t);let c=r*H0(a);for(;o<n&&$0(a)>c;)Q0(a,Xr),Tc.copy(Xr).transpose(),a.multiplyRight(Xr),a.multiplyLeft(Tc),s.multiplyRight(Xr),++i>2&&(++o,i=0);return e.unitary=s.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function H0(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var Xi=[1,0,0],Yi=[2,2,1];function $0(t){let e=0;for(let r=0;r<3;++r){let n=t[gt.getElementIndex(Yi[r],Xi[r])];e+=2*n*n}return Math.sqrt(e)}function Q0(t,e){let r=Le.EPSILON15,n=0,i=1;for(let l=0;l<3;++l){let u=Math.abs(t[gt.getElementIndex(Yi[l],Xi[l])]);u>n&&(i=l,n=u)}let o=Xi[i],s=Yi[i],a=1,c=0;if(Math.abs(t[gt.getElementIndex(s,o)])>r){let l=t[gt.getElementIndex(s,s)],u=t[gt.getElementIndex(o,o)],f=t[gt.getElementIndex(s,o)],h=(l-u)/2/f,d;h<0?d=-1/(-h+Math.sqrt(1+h*h)):d=1/(h+Math.sqrt(1+h*h)),a=1/Math.sqrt(1+d*d),c=d*a}return V.IDENTITY.to(e),e[gt.getElementIndex(o,o)]=e[gt.getElementIndex(s,s)]=a,e[gt.getElementIndex(s,o)]=c,e[gt.getElementIndex(o,s)]=-c,e}var Nt=new O,K0=new O,J0=new O,tm=new O,em=new O,rm=new V,nm={diagonal:new V,unitary:new V};function $i(t,e=new Zt){if(!t||t.length===0)return e.halfAxes=new V([0,0,0,0,0,0,0,0,0]),e.center=new O,e;let r=t.length,n=new O(0,0,0);for(let _ of t)n.add(_);let i=1/r;n.multiplyByScalar(i);let o=0,s=0,a=0,c=0,l=0,u=0;for(let _ of t){let y=Nt.copy(_).subtract(n);o+=y.x*y.x,s+=y.x*y.y,a+=y.x*y.z,c+=y.y*y.y,l+=y.y*y.z,u+=y.z*y.z}o*=i,s*=i,a*=i,c*=i,l*=i,u*=i;let f=rm;f[0]=o,f[1]=s,f[2]=a,f[3]=s,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=u;let{unitary:h}=Hi(f,nm),d=e.halfAxes.copy(h),p=d.getColumn(0,J0),g=d.getColumn(1,tm),m=d.getColumn(2,em),v=-Number.MAX_VALUE,w=-Number.MAX_VALUE,x=-Number.MAX_VALUE,b=Number.MAX_VALUE,T=Number.MAX_VALUE,S=Number.MAX_VALUE;for(let _ of t)Nt.copy(_),v=Math.max(Nt.dot(p),v),w=Math.max(Nt.dot(g),w),x=Math.max(Nt.dot(m),x),b=Math.min(Nt.dot(p),b),T=Math.min(Nt.dot(g),T),S=Math.min(Nt.dot(m),S);p=p.multiplyByScalar(.5*(b+v)),g=g.multiplyByScalar(.5*(T+w)),m=m.multiplyByScalar(.5*(S+x)),e.center.copy(p).add(g).add(m);let P=K0.set(v-b,w-T,x-S).multiplyByScalar(.5),M=new V([P[0],0,0,0,P[1],0,0,0,P[2]]);return e.halfAxes.multiplyRight(M),e}function Ic(t,e){return sm(t)||om(t,e)||Ac(t,e)||im()}function im(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function om(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function sm(t){if(Array.isArray(t))return t}function Qi(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ac(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Ac(t,e){if(t){if(typeof t=="string")return Pc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pc(t,e)}}function Pc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function am(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ec(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function cm(t,e,r){return e&&Ec(t.prototype,e),r&&Ec(t,r),t}var de=512,Oc=3,Lc=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Rc=Lc.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),lm=Rc.concat([[.25,.5],[.75,.5]]),um=function(){function t(r,n,i){am(this,t),this.x=void 0,this.y=void 0,this.z=void 0,this.childVisible=void 0,this.selected=void 0,this._children=void 0,this.x=r,this.y=n,this.z=i}var e=t.prototype;return e.update=function(n){var i=n.viewport,o=n.cullingVolume,s=n.elevationBounds,a=n.minZ,c=n.maxZ,l=n.bounds,u=n.offset,f=n.project,h=this.getBoundingVolume(s,u,f);if(l&&!this.insideBounds(l))return!1;var d=o.computeVisibility(h);if(d<0)return!1;if(!this.childVisible){var p=this.z;if(p<c&&p>=a){var g=h.distanceTo(i.cameraPosition)*i.scale/i.height;p+=Math.floor(Math.log2(g))}if(p>=c)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var m=Qi(this.children),v;try{for(m.s();!(v=m.n()).done;){var w=v.value;w.update(n)}}catch(x){m.e(x)}finally{m.f()}return!0},e.getSelected=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&n.push(this),this._children){var i=Qi(this._children),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.getSelected(n)}}catch(a){i.e(a)}finally{i.f()}}return n},e.insideBounds=function(n){var i=Ic(n,4),o=i[0],s=i[1],a=i[2],c=i[3],l=Math.pow(2,this.z),u=de/l;return this.x*u<a&&this.y*u<c&&(this.x+1)*u>o&&(this.y+1)*u>s},e.getBoundingVolume=function(n,i,o){if(o){var s=this.z<1?lm:this.z<2?Rc:Lc,a=[],c=Qi(s),l;try{for(c.s();!(l=c.n()).done;){var u=l.value,f=Yr(this.x+u[0],this.y+u[1],this.z);f[2]=n[0],a.push(o(f)),n[0]!==n[1]&&(f[2]=n[1],a.push(o(f)))}}catch(m){c.e(m)}finally{c.f()}return $i(a)}var h=Math.pow(2,this.z),d=de/h,p=this.x*d+i*de,g=de-(this.y+1)*d;return new Rt([p,g,n[0]],[p+d,g+d,n[1]])},cm(t,[{key:"children",get:function(){if(!this._children){var n=this.x*2,i=this.y*2,o=this.z+1;this._children=[new t(n,i,o),new t(n,i+1,o),new t(n+1,i,o),new t(n+1,i+1,o)]}return this._children}}]),t}();function Fc(t,e,r,n){var i=t instanceof Ce._GlobeViewport&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map(function(T){var S=T.normal,P=T.distance;return new at(S.clone().negate(),P)}),s=new tt(o),a=t.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,u=t instanceof Ce.WebMercatorViewport&&t.pitch<=60?e:0;if(n){var f=n,h=Ic(f,4),d=h[0],p=h[1],g=h[2],m=h[3],v=bt([d,m]),w=bt([g,p]);n=[v[0],de-v[1],w[0],de-w[1]]}var x=new um(0,0,0),b={viewport:t,project:i,cullingVolume:s,elevationBounds:[c,l],minZ:u,maxZ:e,bounds:n,offset:0};if(x.update(b),t instanceof Ce.WebMercatorViewport&&t.subViewports&&t.subViewports.length>1){for(b.offset=-1;x.update(b)&&!(--b.offset<-Oc););for(b.offset=1;x.update(b)&&!(++b.offset>Oc););}return x.getSelected()}function pe(t,e){return dm(t)||hm(t,e)||Cc(t,e)||fm()}function fm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function dm(t){if(Array.isArray(t))return t}function Hr(t){return gm(t)||mm(t)||Cc(t)||pm()}function pm(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cc(t,e){if(t){if(typeof t=="string")return Ki(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ki(t,e)}}function mm(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gm(t){if(Array.isArray(t))return Ki(t)}function Ki(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var St=512,ym=[-1/0,-1/0,1/0,1/0],Ct={type:"object",value:null,validate:function(e,r){return r.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(function(n){return typeof n=="string"})},equal:function(e,r){if(e===r)return!0;if(!Array.isArray(e)||!Array.isArray(r))return!1;var n=e.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0}};function zc(t,e){var r=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])],n=[Math.min.apply(Math,Hr(r.map(function(i){return i[0]}))),Math.min.apply(Math,Hr(r.map(function(i){return i[1]}))),Math.max.apply(Math,Hr(r.map(function(i){return i[0]}))),Math.max.apply(Math,Hr(r.map(function(i){return i[1]})))];return n}function vm(t){return Math.abs(t.split("").reduce(function(e,r){return(e<<5)-e+r.charCodeAt(0)|0},0))}function yt(t,e){if(!t||!t.length)return null;var r=e.index,n=e.id;if(Array.isArray(t)){var i=vm(n)%t.length;t=t[i]}for(var o=t,s=0,a=Object.keys(r);s<a.length;s++){var c=a[s],l=new RegExp("{".concat(c,"}"),"g");o=o.replace(l,String(r[c]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),o}function xm(t,e,r){var n;if(e&&e.length===2){var i=pe(e,2),o=i[0],s=i[1],a=t.getBounds({z:o}),c=t.getBounds({z:s});n=[Math.min(a[0],c[0]),Math.min(a[1],c[1]),Math.max(a[2],c[2]),Math.max(a[3],c[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function Bc(t){var e=t.viewport,r=t.z,n=t.cullRect,i=e.subViewports||[e];return i.map(function(o){return Ji(o,r||0,n)})}function Ji(t,e,r){if(!Array.isArray(e)){var n=r.x-t.x,i=r.y-t.y,o=r.width,s=r.height,a={targetZ:e},c=t.unproject([n,i],a),l=t.unproject([n+o,i],a),u=t.unproject([n,i+s],a),f=t.unproject([n+o,i+s],a);return[Math.min(c[0],l[0],u[0],f[0]),Math.min(c[1],l[1],u[1],f[1]),Math.max(c[0],l[0],u[0],f[0]),Math.max(c[1],l[1],u[1],f[1])]}var h=Ji(t,e[0],r),d=Ji(t,e[1],r);return[Math.min(h[0],d[0]),Math.min(h[1],d[1]),Math.max(h[2],d[2]),Math.max(h[3],d[3])]}function _m(t,e,r){if(r){var n=zc(t,r).map(function(i){return i*e/St});return n}return t.map(function(i){return i*e/St})}function to(t,e){return Math.pow(2,t)*St/e}function Yr(t,e,r){var n=to(r,St),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n,s=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[i,s]}function Nc(t,e,r,n){var i=to(r,n);return[t/i*St,e/i*St]}function eo(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:St;if(t.isGeospatial){var o=Yr(e,r,n),s=pe(o,2),a=s[0],c=s[1],l=Yr(e+1,r+1,n),u=pe(l,2),f=u[0],h=u[1];return{west:a,north:c,east:f,south:h}}var d=Nc(e,r,n,i),p=pe(d,2),g=p[0],m=p[1],v=Nc(e+1,r+1,n,i),w=pe(v,2),x=w[0],b=w[1];return{left:g,top:m,right:x,bottom:b}}function bm(t,e,r,n,i){for(var o=xm(t,null,n),s=to(e,r),a=_m(o,s,i),c=pe(a,4),l=c[0],u=c[1],f=c[2],h=c[3],d=[],p=Math.floor(l);p<f;p++)for(var g=Math.floor(u);g<h;g++)d.push({x:p,y:g,z:e});return d}function ro(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,s=t.tileSize,a=s===void 0?St:s,c=t.modelMatrix,l=t.modelMatrixInverse,u=t.zoomOffset,f=u===void 0?0:u,h=e.isGeospatial?Math.round(e.zoom+Math.log2(St/a))+f:Math.ceil(e.zoom)+f;if(typeof n=="number"&&Number.isFinite(n)&&h<n){if(!o)return[];h=n}typeof r=="number"&&Number.isFinite(r)&&h>r&&(h=r);var d=o;return c&&l&&o&&!e.isGeospatial&&(d=zc(o,c)),e.isGeospatial?Fc(e,h,i,o):bm(e,h,a,d||ym,l)}function no(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function io(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}function kc(t){var e={},r;return function(n){for(var i in n)if(!wm(n[i],e[i])){r=t(n),e=n;break}return r}}function wm(t,e){if(t===e)return!0;if(Array.isArray(t)){var r=t.length;if(!e||e.length!==r)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}return!1}var ze;function qc(t,e){return Tm(t)||Sm(t,e)||Gc(t,e)||Mm()}function Mm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function Tm(t){if(Array.isArray(t))return t}function Q(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gc(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Gc(t,e){if(t){if(typeof t=="string")return Uc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uc(t,e)}}function Uc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Vc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jc(Object(r),!0).forEach(function(n){$r(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Em(t,e,r){return e&&Wc(t.prototype,e),r&&Wc(t,r),t}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Dc=1,Qr=2,Om="never",Im="no-overlap",Be="best-available",Am=5,Lm=(ze={},$r(ze,Be,Fm),$r(ze,Im,Nm),$r(ze,Om,function(){}),ze),Rm={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},ke=function(){function t(r){var n=this;Pm(this,t),this.opts=void 0,this._requestScheduler=void 0,this._cache=void 0,this._dirty=void 0,this._tiles=void 0,this._cacheByteSize=void 0,this._viewport=void 0,this._zRange=void 0,this._selectedTiles=void 0,this._frameNumber=void 0,this._modelMatrix=void 0,this._modelMatrixInverse=void 0,this._maxZoom=void 0,this._minZoom=void 0,this.onTileLoad=void 0,this._getCullBounds=kc(Bc),this.opts=Vc(Vc({},Rm),r),this.onTileLoad=function(i){var o,s;(o=(s=n.opts).onTileLoad)===null||o===void 0||o.call(s,i),n.opts.maxCacheByteSize&&(n._cacheByteSize+=i.byteLength,n._resizeCache())},this._requestScheduler=new ee({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new et,this._modelMatrixInverse=new et,this.setOptions(r)}var e=t.prototype;return e.setOptions=function(n){Object.assign(this.opts,n),Number.isFinite(n.maxZoom)&&(this._maxZoom=Math.floor(n.maxZoom)),Number.isFinite(n.minZoom)&&(this._minZoom=Math.ceil(n.minZoom))},e.finalize=function(){var n=Q(this._cache.values()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o.isLoading&&o.abort()}}catch(s){n.e(s)}finally{n.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null},e.reloadAll=function(){var n=Q(this._cache.keys()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=this._cache.get(o);!this._selectedTiles||!this._selectedTiles.includes(s)?this._cache.delete(o):s.setNeedsReload()}}catch(a){n.e(a)}finally{n.f()}},e.update=function(n){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.zRange,a=o.modelMatrix,c=a?new et(a):new et,l=!c.equals(this._modelMatrix);if(!this._viewport||!n.equals(this._viewport)||!pt(this._zRange,s)||l){l&&(this._modelMatrixInverse=c.clone().invert(),this._modelMatrix=c),this._viewport=n,this._zRange=s;var u=this.getTileIndices({viewport:n,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:s,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=u.map(function(h){return i._getTile(h,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(h){return i._getTile(h.index,!0)}));var f=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),f&&this._frameNumber++,this._frameNumber},e.isTileVisible=function(n,i){if(!n.isVisible)return!1;if(i&&this._viewport){var o=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:i}),s=n.bbox,a=Q(o),c;try{for(a.s();!(c=a.n()).done;){var l=qc(c.value,4),u=l[0],f=l[1],h=l[2],d=l[3],p=void 0;if("west"in s)p=s.west<h&&s.east>u&&s.south<d&&s.north>f;else{var g=Math.min(s.top,s.bottom),m=Math.max(s.top,s.bottom);p=s.left<h&&s.right>u&&g<d&&m>f}if(p)return!0}}catch(v){a.e(v)}finally{a.f()}return!1}return!0},e.getTileIndices=function(n){var i=n.viewport,o=n.maxZoom,s=n.minZoom,a=n.zRange,c=n.modelMatrix,l=n.modelMatrixInverse,u=this.opts,f=u.tileSize,h=u.extent,d=u.zoomOffset;return ro({viewport:i,maxZoom:o,minZoom:s,zRange:a,tileSize:f,extent:h,modelMatrix:c,modelMatrixInverse:l,zoomOffset:d})},e.getTileId=function(n){return"".concat(n.x,"-").concat(n.y,"-").concat(n.z)},e.getTileZoom=function(n){return n.z},e.getTileMetadata=function(n){var i=this.opts.tileSize;return{bbox:eo(this._viewport,n.x,n.y,n.z,i)}},e.getParentIndex=function(n){var i=Math.floor(n.x/2),o=Math.floor(n.y/2),s=n.z-1;return{x:i,y:o,z:s}},e.updateTileStates=function(){var n=this.opts.refinementStrategy||Be,i=new Array(this._cache.size),o=0,s=Q(this._cache.values()),a;try{for(s.s();!(a=s.n()).done;){var c=a.value;i[o++]=c.isVisible,c.isSelected=!1,c.isVisible=!1}}catch(g){s.e(g)}finally{s.f()}var l=Q(this._selectedTiles),u;try{for(l.s();!(u=l.n()).done;){var f=u.value;f.isSelected=!0,f.isVisible=!0}}catch(g){l.e(g)}finally{l.f()}(typeof n=="function"?n:Lm[n])(Array.from(this._cache.values())),o=0;var h=Q(this._cache.values()),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;if(i[o++]!==p.isVisible)return!0}}catch(g){h.e(g)}finally{h.f()}return!1},e._pruneRequests=function(){var n=this.opts.maxRequests,i=n===void 0?0:n,o=[],s=0,a=Q(this._cache.values()),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.isLoading&&(s++,!l.isSelected&&!l.isVisible&&o.push(l))}}catch(f){a.e(f)}finally{a.f()}for(;i>0&&s>i&&o.length>0;){var u=o.shift();u.abort(),s--}},e._rebuildTree=function(){var n=this._cache,i=Q(n.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.parent=null,s.children&&(s.children.length=0)}}catch(f){i.e(f)}finally{i.f()}var a=Q(n.values()),c;try{for(a.s();!(c=a.n()).done;){var l=c.value,u=this._getNearestAncestor(l);l.parent=u,u!=null&&u.children&&u.children.push(l)}}catch(f){a.e(f)}finally{a.f()}},e._resizeCache=function(){var n=this._cache,i=this.opts,o=i.maxCacheSize||(i.maxCacheByteSize?1/0:Am*this.selectedTiles.length),s=i.maxCacheByteSize||1/0,a=n.size>o||this._cacheByteSize>s;if(a){var c=Q(n),l;try{for(c.s();!(l=c.n()).done;){var u=qc(l.value,2),f=u[0],h=u[1];if(!h.isVisible&&!h.isSelected){var d,p;this._cacheByteSize-=i.maxCacheByteSize?h.byteLength:0,n.delete(f),(d=(p=this.opts).onTileUnload)===null||d===void 0||d.call(p,h)}if(n.size<=o&&this._cacheByteSize<=s)break}}catch(g){c.e(g)}finally{c.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(g,m){return g.zoom-m.zoom}),this._dirty=!1)},e._getTile=function(n,i){var o=this.getTileId(n),s=this._cache.get(o),a=!1;return!s&&i?(s=new Fe(n),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:o,zoom:this.getTileZoom(s.index)}),a=!0,this._cache.set(o,s),this._dirty=!0):s&&s.needsReload&&(a=!0),s&&a&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s},e._getNearestAncestor=function(n){for(var i=this._minZoom,o=i===void 0?0:i,s=n.index;this.getTileZoom(s)>o;){s=this.getParentIndex(s);var a=this._getTile(s);if(a)return a}return null},Em(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(n){return n.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(n){return n.needsReload})}}]),t}();function Fm(t){var e=Q(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(u){e.e(u)}finally{e.f()}var i=Q(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&!Zc(s)&&oo(s)}}catch(u){i.e(u)}finally{i.f()}var a=Q(t),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.isVisible=Boolean(l.state&Qr)}}catch(u){a.e(u)}finally{a.f()}}function Nm(t){var e=Q(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(p){e.e(p)}finally{e.f()}var i=Q(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&Zc(s)}}catch(p){i.e(p)}finally{i.f()}var a=Array.from(t).sort(function(p,g){return p.zoom-g.zoom}),c=Q(a),l;try{for(c.s();!(l=c.n()).done;){var u=l.value;if(u.isVisible=Boolean(u.state&Qr),u.children&&(u.isVisible||u.state&Dc)){var f=Q(u.children),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;d.state=Dc}}catch(p){f.e(p)}finally{f.f()}}else u.isSelected&&oo(u)}}catch(p){c.e(p)}finally{c.f()}}function Zc(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=Qr,!0;e=e.parent}return!1}function oo(t){var e=Q(t.children),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.isLoaded||n.content?n.state|=Qr:oo(n)}}catch(i){e.e(i)}finally{e.f()}}function Jr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jr=function(r){return typeof r}:Jr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jr(t)}function Xc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xc(Object(r),!0).forEach(function(n){Cm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zm(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Bm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Bm(t,e){if(t){if(typeof t=="string")return Yc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yc(t,e)}}function Yc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function km(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function qm(t,e,r){return e&&Hc(t.prototype,e),r&&Hc(t,r),t}function Um(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}function so(t,e){return so=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},so(t,e)}function jm(t){var e=Dm();return function(){var n=tn(t),i;if(e){var o=tn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Vm(this,i)}}function Vm(t,e){if(e&&(Jr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wm(t)}function Wm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tn(t){return tn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},tn(t)}var Gm={TilesetClass:ke,data:{type:"data",value:[]},dataComparator:Ct.equal,renderSubLayers:{type:"function",value:function(e){return new $c.GeoJsonLayer(e)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(e){}},onTileUnload:{type:"function",value:function(e){}},onTileError:{type:"function",value:function(e){return console.error(e)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Be,zRange:null,maxRequests:6,zoomOffset:0},Tt=function(t){Um(r,t);var e=jm(r);function r(){var i;km(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){this.state={tileset:null,isLoaded:!1}},n.finalizeState=function(){var o,s;(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0||s.finalize()},n.shouldUpdateState=function(o){var s=o.changeFlags;return s.somethingChanged},n.updateState=function(o){var s=o.changeFlags,a=this.state.tileset,c=s.propsOrDataChanged||s.updateTriggersChanged,l=s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getTileData);a?c&&(a.setOptions(this._getTilesetOptions()),l?a.reloadAll():a.tiles.forEach(function(u){u.layers=null})):(a=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:a})),this._updateTileset()},n._getTilesetOptions=function(){var o=this.props,s=o.tileSize,a=o.maxCacheSize,c=o.maxCacheByteSize,l=o.refinementStrategy,u=o.extent,f=o.maxZoom,h=o.minZoom,d=o.maxRequests,p=o.zoomOffset;return{maxCacheSize:a,maxCacheByteSize:c,maxZoom:f,minZoom:h,tileSize:s,refinementStrategy:l,extent:u,maxRequests:d,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}},n._updateTileset=function(){var o=this.state.tileset,s=this.props,a=s.zRange,c=s.modelMatrix,l=o.update(this.context.viewport,{zRange:a,modelMatrix:c}),u=o.isLoaded,f=this.state.isLoaded!==u,h=this.state.frameNumber!==l;u&&(f||h)&&this._onViewportLoad(),h&&this.setState({frameNumber:l}),this.state.isLoaded=u},n._onViewportLoad=function(){var o=this.state.tileset,s=this.props.onViewportLoad;s&&s(o.selectedTiles)},n._onTileLoad=function(o){this.props.onTileLoad(o),o.layers=null,this.setNeedsUpdate()},n._onTileError=function(o,s){this.props.onTileError(o),s.layers=null,this.setNeedsUpdate()},n._onTileUnload=function(o){this.props.onTileUnload(o)},n.getTileData=function(o){var s=this.props,a=s.data,c=s.getTileData,l=s.fetch,u=o.signal;return o.url=typeof a=="string"||Array.isArray(a)?yt(a,o):null,c?c(o):l&&o.url?l(o.url,{propName:"data",layer:this,signal:u}):null},n.renderSubLayers=function(o){return this.props.renderSubLayers(o)},n.getSubLayerPropsByTile=function(o){return null},n.getPickingInfo=function(o){var s=o.info,a=o.sourceLayer,c=a.props.tile;return s.picked&&(s.tile=c),s.sourceTile=c,s},n._updateAutoHighlight=function(o){var s=o.sourceTile;if(s&&s.layers){var a=zm(s.layers),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.updateAutoHighlight(o)}}catch(u){a.e(u)}finally{a.f()}}},n.renderLayers=function(){var o=this;return this.state.tileset.tiles.map(function(s){var a=o.getSubLayerPropsByTile(s);if(!(!s.isLoaded&&!s.content))if(s.layers)a&&s.layers[0]&&Object.keys(a).some(function(l){return s.layers[0].props[l]!==a[l]})&&(s.layers=s.layers.map(function(l){return l.clone(a)}));else{var c=o.renderSubLayers(Kr(Kr(Kr({},o.props),o.getSubLayerProps({id:s.id,updateTriggers:o.props.updateTriggers})),{},{data:s.content,_offset:0,tile:s}));s.layers=(0,en._flatten)(c,Boolean).map(function(l){return l.clone(Kr({tile:s},a))})}return s.layers})},n.filterSubLayer=function(o){var s=o.layer,a=o.cullRect,c=s.props.tile;return this.state.tileset.isTileVisible(c,a)},qm(r,[{key:"isLoaded",get:function(){var o,s,a=(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0?void 0:s.selectedTiles;return a?a.every(function(c){return c.isLoaded&&c.layers&&c.layers.every(function(l){return l.isLoaded})}):!1}}]),r}(en.CompositeLayer);Tt.defaultProps=Gm;Tt.layerName="TileLayer";var Jc=B(ct());function rn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rn=function(r){return typeof r}:rn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},rn(t)}function Qc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qc(Object(r),!0).forEach(function(n){Zm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function me(t,e,r){return typeof Reflect<"u"&&Reflect.get?me=Reflect.get:me=function(i,o,s){var a=Ym(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},me(t,e,r||t)}function Ym(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=zt(t),t!==null););return t}function Hm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ao(t,e)}function ao(t,e){return ao=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ao(t,e)}function $m(t){var e=Jm();return function(){var n=zt(t),i;if(e){var o=zt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qm(this,i)}}function Qm(t,e){if(e&&(rn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Km(t)}function Km(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zt(t)}var tg={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}},nn=function(t){Hm(r,t);var e=$m(r);function r(){return Xm(this,r),e.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var o=me(zt(r.prototype),"getShaders",this).call(this);return o.inject={"vs:#decl":`uniform float trailLength;
25
24
  attribute float instanceTimestamps;
26
25
  attribute float instanceNextTimestamps;
27
26
  varying float vTime;
@@ -36,149 +35,18 @@ varying float vTime;
36
35
  `,"fs:DECKGL_FILTER_COLOR":`if(fadeTrail) {
37
36
  color.a *= 1.0 - (currentTime - vTime) / trailLength;
38
37
  }
39
- `},o},n.initializeState=function(){_n(or(r.prototype),"initializeState",this).call(this);var o=this.getAttributeManager();o.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})},n.draw=function(o){var s=this.props,a=s.fadeTrail,c=s.trailLength,u=s.currentTime;o.uniforms=ig(ig({},o.uniforms),{},{fadeTrail:a,trailLength:c,currentTime:u}),_n(or(r.prototype),"draw",this).call(this,o)},r}(og.PathLayer);bs.layerName="TripsLayer";bs.defaultProps=tB;var Ag=X(xs()),vg=X(lt());var tt=X(xs()),ws=X(lt()),Ri=X(ut());var Ii=X(xs());function cg(t,e){return iB(t)||nB(t,e)||lg(t,e)||rB()}function rB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
40
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nB(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function iB(t){if(Array.isArray(t))return t}function ug(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=lg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function lg(t,e){if(t){if(typeof t=="string")return ag(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ag(t,e)}}function ag(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ts(t,e){e=e===void 0?t[0][0]:e;var r=ug(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(s){r.e(s)}finally{r.f()}}function oB(t,e,r){var n=(0,Ii.cellToLatLng)(t),i=cg(n,2),o=i[0],s=i[1],a=e.length;Ts(e,s);for(var c=e[0]===e[a-1]?a-1:a,u=0;u<c;u++)e[u][0]=Qt(s,e[u][0],r),e[u][1]=Qt(o,e[u][1],r)}function fg(t,e,r){var n=t(e,r),i=(0,Ii.cellToLatLng)(n),o=cg(i,2),s=o[0],a=o[1];return[a,s]}function al(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=(0,Ii.cellToBoundary)(t,!0);return e!==1?oB(t,r,e):Ts(r),r}function hg(t){var e=new Float64Array(t.length*2),r=0,n=ug(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;e[r++]=o[0],e[r++]=o[1]}}catch(s){n.e(s)}finally{n.f()}return e}function dg(t,e){return cB(t)||aB(t,e)||gg(t,e)||sB()}function sB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aB(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function cB(t){if(Array.isArray(t))return t}function uB(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=gg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function gg(t,e){if(t){if(typeof t=="string")return pg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pg(t,e)}}function pg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fB(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cl(t,e)}function cl(t,e){return cl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},cl(t,e)}function hB(t){var e=mB();return function(){var n=Es(t),i;if(e){var o=Es(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return dB(this,i)}}function dB(t,e){if(e&&(Oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pB(t)}function pB(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Es(t){return Es=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Es(t)}function mg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ss(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mg(Object(r),!0).forEach(function(n){gB(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gB(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oi=function(r){return typeof r}:Oi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Oi(t)}var yB=10;function AB(t,e){var r;return t==null?r=e:Oi(t)==="object"?r=Ss(Ss({},t),{},{coverage:e}):r={getHexagon:t,coverage:e},r}var vB=Ss(Ss({},Ri.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0}),Rr=function(t){fB(r,t);var e=hB(r);function r(){var i;lB(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}},n.shouldUpdateState=function(o){var s=o.changeFlags;return this._shouldUseHighPrecision()?s.propsOrDataChanged:s.somethingChanged},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(s.highPrecision!==!0&&(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagon)){var c=this._calculateH3DataProps();this.setState(c)}this._updateVertices(this.context.viewport)},n._calculateH3DataProps=function(){var o=-1,s=!1,a=!1,c=(0,ws.createIterable)(this.props.data),u=c.iterable,l=c.objectInfo,f=uB(u),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;l.index++;var p=this.props.getHexagon(d,l),m=(0,tt.getResolution)(p);if(o<0){if(o=m,!this.props.highPrecision)break}else if(o!==m){a=!0;break}if((0,tt.isPentagon)(p)){s=!0;break}}}catch(g){f.e(g)}finally{f.f()}return{resolution:o,edgeLengthKM:o>=0?(0,tt.getHexagonEdgeLengthAvg)(o,"km"):0,hasMultipleRes:a,hasPentagon:s}},n._shouldUseHighPrecision=function(){if(this.props.highPrecision==="auto"){var o=this.state,s=o.resolution,a=o.hasPentagon,c=o.hasMultipleRes,u=this.context.viewport;return Boolean(u?.resolution)||c||a||s>=0&&s<=5}return this.props.highPrecision},n._updateVertices=function(o){if(!this._shouldUseHighPrecision()){var s=this.state,a=s.resolution,c=s.edgeLengthKM,u=s.centerHex;if(!(a<0)){var l=this.props.centerHexagon||(0,tt.latLngToCell)(o.latitude,o.longitude,a);if(u!==l){if(u)try{var f=(0,tt.gridDistance)(u,l);if(f*c<yB)return}catch{}var h=o.distanceScales.unitsPerMeter,d=al(l),p=(0,tt.cellToLatLng)(l),m=dg(p,2),g=m[0],A=m[1],_=o.projectFlat([A,g]),v=dg(_,2),x=v[0],w=v[1];d=d.map(function(S){var C=o.projectFlat(S);return[(C[0]-x)/h[0],(C[1]-w)/h[1]]}),this.setState({centerHex:l,vertices:d})}}}},n.renderLayers=function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()},n._getForwardProps=function(){var o=this.props,s=o.elevationScale,a=o.material,c=o.coverage,u=o.extruded,l=o.wireframe,f=o.stroked,h=o.filled,d=o.lineWidthUnits,p=o.lineWidthScale,m=o.lineWidthMinPixels,g=o.lineWidthMaxPixels,A=o.getFillColor,_=o.getElevation,v=o.getLineColor,x=o.getLineWidth,w=o.transitions,S=o.updateTriggers;return{elevationScale:s,extruded:u,coverage:c,wireframe:l,stroked:f,filled:h,lineWidthUnits:d,lineWidthScale:p,lineWidthMinPixels:m,lineWidthMaxPixels:g,material:a,getElevation:_,getFillColor:A,getLineColor:v,getLineWidth:x,transitions:w,updateTriggers:{getFillColor:S.getFillColor,getElevation:S.getElevation,getLineColor:S.getLineColor,getLineWidth:S.getLineWidth}}},n._renderPolygonLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,u=o.coverage,l=this.getSubLayerClass("hexagon-cell-hifi",Ri.PolygonLayer),f=this._getForwardProps();return f.updateTriggers.getPolygon=AB(c.getHexagon,u),new l(f,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:f.updateTriggers}),{data:s,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(d,p){var m=a(d,p);return hg(al(m,u))}})},n._renderColumnLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,u=this.getSubLayerClass("hexagon-cell",Ri.ColumnLayer),l=this._getForwardProps();return l.updateTriggers.getPosition=c.getHexagon,new u(l,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:l.updateTriggers}),{data:s,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:fg.bind(null,a)})},r}(ws.CompositeLayer);Rr.defaultProps=vB;Rr.layerName="H3HexagonLayer";Rr._checkH3Lib=function(){};function Bs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bs=function(r){return typeof r}:Bs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bs(t)}function ul(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_B(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
44
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function _B(t,e){if(t){if(typeof t=="string")return yg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yg(t,e)}}function yg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xB(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ll(t,e)}function ll(t,e){return ll=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ll(t,e)}function TB(t){var e=wB();return function(){var n=Cs(t),i;if(e){var o=Cs(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return EB(this,i)}}function EB(t,e){if(e&&(Bs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SB(t)}function SB(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cs(t){return Cs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Cs(t)}var BB={getHexagons:{type:"accessor",value:function(e){return e.hexagons}}},Ms=function(t){xB(r,t);var e=TB(r);function r(){return bB(this,r),e.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){Rr._checkH3Lib()},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagons){var c=s.data,u=s.getHexagons,l=[],f=(0,vg.createIterable)(c),h=f.iterable,d=f.objectInfo,p=ul(h),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;d.index++;var A=u(g,d),_=(0,Ag.cellsToMultiPolygon)(A,!0),v=ul(_),x;try{for(v.s();!(x=v.n()).done;){var w=x.value,S=ul(w),C;try{for(S.s();!(C=S.n()).done;){var B=C.value;Ts(B)}}catch(T){S.e(T)}finally{S.f()}l.push(this.getSubLayerRow({polygon:w},g,d.index))}}catch(T){v.e(T)}finally{v.f()}}}catch(T){p.e(T)}finally{p.f()}this.setState({polygons:l})}},n.indexToBounds=function(){var o=this.props,s=o.getElevation,a=o.getFillColor,c=o.getLineColor,u=o.getLineWidth;return{data:this.state.polygons,getPolygon:function(f){return f.polygon},getElevation:this.getSubLayerAccessor(s),getFillColor:this.getSubLayerAccessor(a),getLineColor:this.getSubLayerAccessor(c),getLineWidth:this.getSubLayerAccessor(u)}},r}($e);Ms.layerName="H3ClusterLayer";Ms.defaultProps=BB;var vv=X(fl()),gr=X(lt()),_v=X(ut()),bv=X(Is());function bn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bn=function(r){return typeof r}:bn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},bn(t)}function hl(t){if(typeof window<"u"&&bn(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&bn(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var e=(typeof navigator>"u"?"undefined":bn(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function Os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(t)}function Ge(){var t=(typeof process>"u"?"undefined":Os(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!t||hl()}function Rs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rs=function(r){return typeof r}:Rs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rs(t)}var sr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":Rs(process))==="object"&&process};var CB=sr.self||sr.window||sr.global,xn=sr.window||sr.self||sr.global,MB=sr.document||{},Pr=sr.process||{};var Ps="8.10.0-alpha.7",l9=Ge();function IB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OB(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var xg=function(){function t(r){IB(this,t);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";L(this,"storage",void 0),L(this,"id",void 0),L(this,"config",{}),this.storage=OB(i),this.id=r,this.config={},Object.assign(this.config,n),this._loadConfiguration()}var e=t.prototype;return e.getConfiguration=function(){return this.config},e.setConfiguration=function(n){return this.config={},this.updateConfiguration(n)},e.updateConfiguration=function(n){if(Object.assign(this.config,n),this.storage){var i=JSON.stringify(this.config);this.storage.setItem(this.id,i)}return this},e._loadConfiguration=function(){var n={};if(this.storage){var i=this.storage.getItem(this.id);n=i?JSON.parse(i):{}}return Object.assign(this.config,n),this},t}();function Tg(t){var e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function Eg(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function Fs(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,s=t.height*r,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}var Ls;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ls||(Ls={}));function Sg(t){return typeof t=="string"?Ls[t.toUpperCase()]||Ls.WHITE:t}function wg(t,e,r){return!Ge&&typeof t=="string"&&(e&&(e=Sg(e),t="\x1B[".concat(e,"m").concat(t,"\x1B[39m")),r&&(e=Sg(r),t="\x1B[".concat(r+10,"m").concat(t,"\x1B[49m"))),t}function RB(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=PB(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
45
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function PB(t,e){if(t){if(typeof t=="string")return Bg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bg(t,e)}}function Bg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Cg(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),i=RB(n),o;try{var s=function(){var c=o.value;typeof t[c]=="function"&&(e.find(function(u){return c===u})||(t[c]=t[c].bind(t)))};for(i.s();!(o=i.n()).done;)s()}catch(a){i.e(a)}finally{i.f()}}function Tn(t,e){if(!t)throw new Error(e||"Assertion failed")}function Fr(){var t;if(Ge&&"performance"in xn){var e,r;t=xn===null||xn===void 0||(e=xn.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in Pr){var n,i=Pr===null||Pr===void 0||(n=Pr.hrtime)===null||n===void 0?void 0:n.call(Pr);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}function Sn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sn=function(r){return typeof r}:Sn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Sn(t)}function Ds(t){return NB(t)||DB(t)||LB(t)||FB()}function FB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
46
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LB(t,e){if(t){if(typeof t=="string")return dl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dl(t,e)}}function DB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function NB(t){if(Array.isArray(t))return dl(t)}function dl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function GB(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mg(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function HB(t,e,r){return e&&Mg(t.prototype,e),r&&Mg(t,r),t}var En={debug:Ge&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},VB={enabled:!0,level:0};function rt(){}var Ig={},Og={once:!0},wn=function(){function t(){UB(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""},n=r.id;L(this,"id",void 0),L(this,"VERSION",Ps),L(this,"_startTs",Fr()),L(this,"_deltaTs",Fr()),L(this,"_storage",void 0),L(this,"userData",{}),L(this,"LOG_THROTTLE_TIMEOUT",0),this.id=n,this._storage=new xg("__probe-".concat(this.id,"__"),VB),this.userData={},this.timeStamp("".concat(this.id," started")),Cg(this),Object.seal(this)}var e=t.prototype;return e.isEnabled=function(){return this._storage.config.enabled},e.getLevel=function(){return this._storage.config.level},e.getTotal=function(){return Number((Fr()-this._startTs).toPrecision(10))},e.getDelta=function(){return Number((Fr()-this._deltaTs).toPrecision(10))},e.getPriority=function(){return this.level},e.enable=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:n}),this},e.setLevel=function(n){return this._storage.updateConfiguration({level:n}),this},e.get=function(n){return this._storage.config[n]},e.set=function(n,i){this._storage.updateConfiguration(GB({},n,i))},e.settings=function(){console.table?console.table(this._storage.config):console.log(this._storage.config)},e.assert=function(n,i){Tn(n,i)},e.warn=function(n){return this._getLogFunction(0,n,En.warn,arguments,Og)},e.error=function(n){return this._getLogFunction(0,n,En.error,arguments)},e.deprecated=function(n,i){return this.warn("`".concat(n,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))},e.removed=function(n,i){return this.error("`".concat(n,"` has been removed. Use `").concat(i,"` instead"))},e.probe=function(n,i){return this._getLogFunction(n,i,En.log,arguments,{time:!0,once:!0})},e.log=function(n,i){return this._getLogFunction(n,i,En.debug,arguments)},e.info=function(n,i){return this._getLogFunction(n,i,console.info,arguments)},e.once=function(n,i){for(var o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];return this._getLogFunction(n,i,En.debug||En.info,arguments,Og)},e.table=function(n,i,o){return i?this._getLogFunction(n,i,console.table||rt,o&&[o],{tag:WB(i)}):rt},e.image=function(n){var i=n.logLevel,o=n.priority,s=n.image,a=n.message,c=a===void 0?"":a,u=n.scale,l=u===void 0?1:u;return this._shouldLog(i||o)?Ge?kB({image:s,message:c,scale:l}):jB({image:s,message:c,scale:l}):rt},e.time=function(n,i){return this._getLogFunction(n,i,console.time?console.time:console.info)},e.timeEnd=function(n,i){return this._getLogFunction(n,i,console.timeEnd?console.timeEnd:console.info)},e.timeStamp=function(n,i){return this._getLogFunction(n,i,console.timeStamp||rt)},e.group=function(n,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},s=Rg({logLevel:n,message:i,opts:o}),a=o.collapsed;return s.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)},e.groupCollapsed=function(n,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(n,i,Object.assign({},o,{collapsed:!0}))},e.groupEnd=function(n){return this._getLogFunction(n,"",console.groupEnd||rt)},e.withGroup=function(n,i,o){this.group(n,i)();try{o()}finally{this.groupEnd(n)()}},e.trace=function(){console.trace&&console.trace()},e._shouldLog=function(n){return this.isEnabled()&&this.getLevel()>=Pg(n)},e._getLogFunction=function(n,i,o,s,a){if(this._shouldLog(n)){var c;a=Rg({logLevel:n,message:i,args:s,opts:a}),o=o||a.method,Tn(o),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Fr();var u=a.tag||a.message;if(a.once)if(!Ig[u])Ig[u]=Fr();else return rt;return i=zB(this.id,a.message,a),(c=o).bind.apply(c,[console,i].concat(Ds(a.args)))}return rt},HB(t,[{key:"level",get:function(){return this.getLevel()},set:function(n){this.setLevel(n)}},{key:"priority",get:function(){return this.level},set:function(n){this.level=n}}]),t}();L(wn,"VERSION",Ps);function Pg(t){if(!t)return 0;var e;switch(Sn(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Tn(Number.isFinite(e)&&e>=0),e}function Rg(t){var e=t.logLevel,r=t.message;t.logLevel=Pg(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(Sn(e)){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());var i=Sn(t.message);return Tn(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}function zB(t,e,r){if(typeof e=="string"){var n=r.time?Eg(Tg(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=wg(e,r.color,r.background)}return e}function jB(t){var e=t.image,r=t.message,n=r===void 0?"":r,i=t.scale,o=i===void 0?1:i,s=null;try{s=module.require("asciify-image")}catch{}return s?function(){return s(e,{fit:"box",width:"".concat(Math.round(80*o),"%")}).then(function(a){return console.log(a)})}:rt}function kB(t){var e=t.image,r=t.message,n=r===void 0?"":r,i=t.scale,o=i===void 0?1:i;if(typeof e=="string"){var s=new Image;return s.onload=function(){var l,f=Fs(s,n,o);(l=console).log.apply(l,Ds(f))},s.src=e,rt}var a=e.nodeName||"";if(a.toLowerCase()==="img"){var c;return(c=console).log.apply(c,Ds(Fs(e,n,o))),rt}if(a.toLowerCase()==="canvas"){var u=new Image;return u.onload=function(){var l;return(l=console).log.apply(l,Ds(Fs(u,n,o)))},u.src=e.toDataURL(),rt}return rt}function WB(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var G9=new wn({id:"@probe.gl/log"});var $=new wn({id:"luma.gl"});function Se(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}var XB="Invalid WebGLRenderingContext";var JB="Requires WebGL2";function Ns(t){return typeof WebGLRenderingContext<"u"&&t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function te(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function pl(t){return te(t)?t:null}function Pi(t){return Se(Ns(t),XB),t}function Ie(t){return Se(te(t),JB),t}var Fi={};function qB(t){globalThis.console&&globalThis.console.error&&globalThis.console.error(t)}function YB(t){globalThis.console&&globalThis.console.log&&globalThis.console.log(t)}function KB(t,e){Fi[t]=!0,e!==void 0&&qB(e)}function ZB(t){var e=t.getError;t.getError=function(){var n;do n=e.apply(t),n!==0&&(Fi[n]=!0);while(n!==0);for(n in Fi)if(Fi[n])return delete Fi[n],parseInt(n,10);return 0}}var Li=function t(e){var r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};Li.VertexAttrib=function(e){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};Li.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var Lr=function(e){var r=this;this.gl=e,ZB(e);var n=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(o){return o===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:n.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(o){var s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,o);var a=s.attribs[o];return a.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(o){var s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,o);var a=s.attribs[o];return a.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(o,s){switch(o){case 34962:r.currentArrayBuffer=s;break;case 34963:r.currentVertexArrayObject.elementArrayBuffer=s;break;default:}return n.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(o,s){var a=r.currentVertexArrayObject,c=a.attribs[o];switch(s){case 34975:return c.buffer;case 34338:return c.enabled;case 34339:return c.size;case 34340:return c.stride;case 34341:return c.type;case 34922:return c.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(o,s,a,c,u,l){var f=r.currentVertexArrayObject;f.maxAttrib=Math.max(f.maxAttrib,o);var h=f.attribs[o];return h.buffer=r.currentArrayBuffer,h.size=s,h.type=a,h.normalized=c,h.stride=u,h.offset=l,h.recache(),n.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",function(){YB("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};Lr.prototype.VERTEX_ARRAY_BINDING_OES=34229;Lr.prototype.reset_=function(){var e=this.vertexArrayObjects!==void 0;if(e)for(var r=0;r<this.vertexArrayObjects.length;++r)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new Li(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};Lr.prototype.createVertexArrayOES=function(){var e=new Li(this);return this.vertexArrayObjects.push(e),e};Lr.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)};Lr.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof Li&&e.hasBeenBound&&e.ext===this)};Lr.prototype.bindVertexArrayOES=function(e){var r=this.gl;if(e&&!e.isAlive){KB(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var o=this.currentVertexArrayObject;if(i!==o){(!i||o.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(r,34963,o.elementArrayBuffer);for(var s=this.currentArrayBuffer,a=Math.max(i?i.maxAttrib:0,o.maxAttrib),c=0;c<=a;c++){var u=o.attribs[c],l=i?i.attribs[c]:null;if((!i||u.enabled!==l.enabled)&&(u.enabled?n.enableVertexAttribArray.call(r,c):n.disableVertexAttribArray.call(r,c)),u.enabled){var f=!1;(!i||u.buffer!==l.buffer)&&(s!==u.buffer&&(n.bindBuffer.call(r,34962,u.buffer),s=u.buffer),f=!0),(f||u.cached!==l.cached)&&n.vertexAttribPointer.call(r,c,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==s&&n.bindBuffer.call(r,34962,this.currentArrayBuffer)}};function Fg(t){if(typeof t.createVertexArray!="function"){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var i=e.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var r=t.getExtension;t.getExtension=function(i){var o=r.call(this,i);return o||(i!=="OES_vertex_array_object"?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Lr(this)),this.__OESVertexArrayObject))}}}var W;function Z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Lg="OES_element_index",Dg="WEBGL_draw_buffers",QB="EXT_disjoint_timer_query",$B="EXT_disjoint_timer_query_webgl2",e2="EXT_texture_filter_anisotropic",Ng="WEBGL_debug_renderer_info",t2=35723,r2=4352,n2=36795,i2=34047,o2=37445,s2=37446,le=function(e){return te(e)?void 0:0},a2=(W={},Z(W,3074,function(e){return te(e)?void 0:36064}),Z(W,t2,function(t){return te(t)?void 0:r2}),Z(W,35977,le),Z(W,32937,le),Z(W,n2,function(t,e){var r=te(t)?t.getExtension($B):t.getExtension(QB);return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0}),Z(W,o2,function(t,e){var r=t.getExtension(Ng);return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)}),Z(W,s2,function(t,e){var r=t.getExtension(Ng);return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)}),Z(W,i2,function(t,e){var r=t.luma.extensions[e2];return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Z(W,32883,le),Z(W,35071,le),Z(W,37447,le),Z(W,36063,function(e,r){if(!te(e)){var n=e.getExtension(Dg);return n?r(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Z(W,35379,le),Z(W,35374,le),Z(W,35377,le),Z(W,34852,function(e){if(!te(e)){var r=e.getExtension(Dg);return r?r.MAX_DRAW_BUFFERS_WEBGL:0}}),Z(W,36203,function(e){return e.getExtension(Lg)?2147483647:65535}),Z(W,33001,function(e){return e.getExtension(Lg)?16777216:65535}),Z(W,33e3,function(e){return 16777216}),Z(W,37157,le),Z(W,35373,le),Z(W,35657,le),Z(W,36183,le),Z(W,37137,le),Z(W,34045,le),Z(W,35978,le),Z(W,35979,le),Z(W,35968,le),Z(W,35376,le),Z(W,35375,le),Z(W,35659,le),Z(W,37154,le),Z(W,35371,le),Z(W,35658,le),Z(W,35076,le),Z(W,35077,le),Z(W,35380,le),W);function Gg(t,e,r){var n=a2[r],i=typeof n=="function"?n(t,e,r):n,o=i!==void 0?i:e(r);return o}var Bn;function Gs(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c2="OES_vertex_array_object",Ug="ANGLE_instanced_arrays",u2="WEBGL_draw_buffers",l2="EXT_disjoint_timer_query",f2="EXT_texture_filter_anisotropic",h2="VertexArray requires WebGL2 or OES_vertex_array_object extension";function d2(t,e){return{webgl2:te(t),ext:t.getExtension(e)}}var ml=(Bn={},Gs(Bn,c2,{meta:{suffix:"OES"},createVertexArray:function(){Se(!1,h2)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Gs(Bn,Ug,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,r){Se(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Gs(Bn,u2,{meta:{suffix:"WEBGL"},drawBuffers:function(){Se(!1)}}),Gs(Bn,l2,{meta:{suffix:"EXT"},createQuery:function(){Se(!1)},deleteQuery:function(){Se(!1)},beginQuery:function(){Se(!1)},endQuery:function(){},getQuery:function(e,r){return this.getQueryObject(e,r)},getQueryParameter:function(e,r){return this.getQueryObject(e,r)},getQueryObject:function(){}}),Bn),Us={readBuffer:function(e,r,n){te(e)&&r(n)},getVertexAttrib:function(e,r,n,i){var o=d2(e,Ug),s=o.webgl2,a=o.ext,c;switch(i){case 35069:c=s?void 0:!1;break;case 35070:c=!s&&!a?0:void 0;break;default:}return c!==void 0?c:r(n,i)},getProgramParameter:function(e,r,n,i){if(!te(e))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return r(n,i)},getInternalformatParameter:function(e,r,n,i,o){if(!te(e))switch(o){case 32937:return new Int32Array([0]);default:}return e.getInternalformatParameter(n,i,o)},getTexParameter:function(e,r,n,i){switch(i){case 34046:var o=e.luma.extensions,s=o[f2];i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return r(n,i)},getParameter:Gg,hint:function(e,r,n,i){return r(n,i)}};function Vg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=p2(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
47
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function p2(t,e){if(t){if(typeof t=="string")return Hg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hg(t,e)}}function Hg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zg(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(Fg(t),m2(t),y2(t,ml),g2(t,{target:e,target2:t}),e.polyfilled=!0),t}globalThis.polyfillContext=zg;function m2(t){t.luma.extensions={};var e=t.getSupportedExtensions()||[],r=Vg(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;t.luma[i]=t.getExtension(i)}}catch(o){r.e(o)}finally{r.f()}}function g2(t,e){var r=e.target,n=e.target2;Object.keys(Us).forEach(function(i){if(typeof Us[i]=="function"){var o=t[i]?t[i].bind(t):function(){},s=Us[i].bind(null,t,o);r[i]=s,n[i]=s}})}function y2(t,e){var r=Vg(Object.getOwnPropertyNames(e)),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i!=="overrides"&&A2(t,{extension:i,target:t.luma,target2:t})}}catch(o){r.e(o)}finally{r.f()}}function A2(t,e){var r=e.extension,n=e.target,i=e.target2,o=ml[r];Se(o);for(var s=o.meta,a=s===void 0?{}:s,c=a.suffix,u=c===void 0?"":c,l=t.getExtension(r),f=function(){var m=d[h],g="".concat(m).concat(u),A=null;m==="meta"||typeof t[m]=="function"||(l&&typeof l[g]=="function"?A=function(){return l[g].apply(l,arguments)}:typeof o[m]=="function"&&(A=o[m].bind(n))),A&&(n[m]=A,i[m]=A)},h=0,d=Object.keys(o);h<d.length;h++)f()}var D,O,nt;function gl(t,e){return b2(t)||_2(t,e)||kg(t,e)||v2()}function v2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _2(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function b2(t){if(Array.isArray(t))return t}function ve(t){return E2(t)||T2(t)||kg(t)||x2()}function x2(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
49
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kg(t,e){if(t){if(typeof t=="string")return yl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yl(t,e)}}function T2(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function E2(t){if(Array.isArray(t))return yl(t)}function yl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function b(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Hs=(D={},b(D,3042,!1),b(D,32773,new Float32Array([0,0,0,0])),b(D,32777,32774),b(D,34877,32774),b(D,32969,1),b(D,32968,0),b(D,32971,1),b(D,32970,0),b(D,3106,new Float32Array([0,0,0,0])),b(D,3107,[!0,!0,!0,!0]),b(D,2884,!1),b(D,2885,1029),b(D,2929,!1),b(D,2931,1),b(D,2932,513),b(D,2928,new Float32Array([0,1])),b(D,2930,!0),b(D,3024,!0),b(D,36006,null),b(D,2886,2305),b(D,33170,4352),b(D,2849,1),b(D,32823,!1),b(D,32824,0),b(D,10752,0),b(D,32938,1),b(D,32939,!1),b(D,3089,!1),b(D,3088,new Int32Array([0,0,1024,1024])),b(D,2960,!1),b(D,2961,0),b(D,2968,4294967295),b(D,36005,4294967295),b(D,2962,519),b(D,2967,0),b(D,2963,4294967295),b(D,34816,519),b(D,36003,0),b(D,36004,4294967295),b(D,2964,7680),b(D,2965,7680),b(D,2966,7680),b(D,34817,7680),b(D,34818,7680),b(D,34819,7680),b(D,2978,[0,0,1024,1024]),b(D,3333,4),b(D,3317,4),b(D,37440,!1),b(D,37441,!1),b(D,37443,37444),b(D,35723,4352),b(D,36010,null),b(D,35977,!1),b(D,3330,0),b(D,3332,0),b(D,3331,0),b(D,3314,0),b(D,32878,0),b(D,3316,0),b(D,3315,0),b(D,32877,0),D),ar=function(e,r,n){return r?e.enable(n):e.disable(n)},jg=function(e,r,n){return e.hint(n,r)},Ke=function(e,r,n){return e.pixelStorei(n,r)},S2=function(e,r){var n=te(e)?36009:36160;return e.bindFramebuffer(n,r)},w2=function(e,r){return e.bindFramebuffer(36008,r)};function Di(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var Wg=(O={},b(O,3042,ar),b(O,32773,function(e,r){return e.blendColor.apply(e,ve(r))}),b(O,32777,"blendEquation"),b(O,34877,"blendEquation"),b(O,32969,"blendFunc"),b(O,32968,"blendFunc"),b(O,32971,"blendFunc"),b(O,32970,"blendFunc"),b(O,3106,function(e,r){return e.clearColor.apply(e,ve(r))}),b(O,3107,function(e,r){return e.colorMask.apply(e,ve(r))}),b(O,2884,ar),b(O,2885,function(e,r){return e.cullFace(r)}),b(O,2929,ar),b(O,2931,function(e,r){return e.clearDepth(r)}),b(O,2932,function(e,r){return e.depthFunc(r)}),b(O,2928,function(e,r){return e.depthRange.apply(e,ve(r))}),b(O,2930,function(e,r){return e.depthMask(r)}),b(O,3024,ar),b(O,35723,jg),b(O,36006,S2),b(O,2886,function(e,r){return e.frontFace(r)}),b(O,33170,jg),b(O,2849,function(e,r){return e.lineWidth(r)}),b(O,32823,ar),b(O,32824,"polygonOffset"),b(O,10752,"polygonOffset"),b(O,35977,ar),b(O,32938,"sampleCoverage"),b(O,32939,"sampleCoverage"),b(O,3089,ar),b(O,3088,function(e,r){return e.scissor.apply(e,ve(r))}),b(O,2960,ar),b(O,2961,function(e,r){return e.clearStencil(r)}),b(O,2968,function(e,r){return e.stencilMaskSeparate(1028,r)}),b(O,36005,function(e,r){return e.stencilMaskSeparate(1029,r)}),b(O,2962,"stencilFuncFront"),b(O,2967,"stencilFuncFront"),b(O,2963,"stencilFuncFront"),b(O,34816,"stencilFuncBack"),b(O,36003,"stencilFuncBack"),b(O,36004,"stencilFuncBack"),b(O,2964,"stencilOpFront"),b(O,2965,"stencilOpFront"),b(O,2966,"stencilOpFront"),b(O,34817,"stencilOpBack"),b(O,34818,"stencilOpBack"),b(O,34819,"stencilOpBack"),b(O,2978,function(e,r){return e.viewport.apply(e,ve(r))}),b(O,3333,Ke),b(O,3317,Ke),b(O,37440,Ke),b(O,37441,Ke),b(O,37443,Ke),b(O,3330,Ke),b(O,3332,Ke),b(O,3331,Ke),b(O,36010,w2),b(O,3314,Ke),b(O,32878,Ke),b(O,3316,Ke),b(O,3315,Ke),b(O,32877,Ke),b(O,"framebuffer",function(e,r){var n=r&&"handle"in r?r.handle:r;return e.bindFramebuffer(36160,n)}),b(O,"blend",function(e,r){return r?e.enable(3042):e.disable(3042)}),b(O,"blendColor",function(e,r){return e.blendColor.apply(e,ve(r))}),b(O,"blendEquation",function(e,r){r=Di(r)?r:[r,r],e.blendEquationSeparate.apply(e,ve(r))}),b(O,"blendFunc",function(e,r){r=Di(r)&&r.length===2?[].concat(ve(r),ve(r)):r,e.blendFuncSeparate.apply(e,ve(r))}),b(O,"clearColor",function(e,r){return e.clearColor.apply(e,ve(r))}),b(O,"clearDepth",function(e,r){return e.clearDepth(r)}),b(O,"clearStencil",function(e,r){return e.clearStencil(r)}),b(O,"colorMask",function(e,r){return e.colorMask.apply(e,ve(r))}),b(O,"cull",function(e,r){return r?e.enable(2884):e.disable(2884)}),b(O,"cullFace",function(e,r){return e.cullFace(r)}),b(O,"depthTest",function(e,r){return r?e.enable(2929):e.disable(2929)}),b(O,"depthFunc",function(e,r){return e.depthFunc(r)}),b(O,"depthMask",function(e,r){return e.depthMask(r)}),b(O,"depthRange",function(e,r){return e.depthRange.apply(e,ve(r))}),b(O,"dither",function(e,r){return r?e.enable(3024):e.disable(3024)}),b(O,"derivativeHint",function(e,r){e.hint(35723,r)}),b(O,"frontFace",function(e,r){return e.frontFace(r)}),b(O,"mipmapHint",function(e,r){return e.hint(33170,r)}),b(O,"lineWidth",function(e,r){return e.lineWidth(r)}),b(O,"polygonOffsetFill",function(e,r){return r?e.enable(32823):e.disable(32823)}),b(O,"polygonOffset",function(e,r){return e.polygonOffset.apply(e,ve(r))}),b(O,"sampleCoverage",function(e,r){return e.sampleCoverage.apply(e,ve(r))}),b(O,"scissorTest",function(e,r){return r?e.enable(3089):e.disable(3089)}),b(O,"scissor",function(e,r){return e.scissor.apply(e,ve(r))}),b(O,"stencilTest",function(e,r){return r?e.enable(2960):e.disable(2960)}),b(O,"stencilMask",function(e,r){r=Di(r)?r:[r,r];var n=r,i=gl(n,2),o=i[0],s=i[1];e.stencilMaskSeparate(1028,o),e.stencilMaskSeparate(1029,s)}),b(O,"stencilFunc",function(e,r){r=Di(r)&&r.length===3?[].concat(ve(r),ve(r)):r;var n=r,i=gl(n,6),o=i[0],s=i[1],a=i[2],c=i[3],u=i[4],l=i[5];e.stencilFuncSeparate(1028,o,s,a),e.stencilFuncSeparate(1029,c,u,l)}),b(O,"stencilOp",function(e,r){r=Di(r)&&r.length===3?[].concat(ve(r),ve(r)):r;var n=r,i=gl(n,6),o=i[0],s=i[1],a=i[2],c=i[3],u=i[4],l=i[5];e.stencilOpSeparate(1028,o,s,a),e.stencilOpSeparate(1029,c,u,l)}),b(O,"viewport",function(e,r){return e.viewport.apply(e,ve(r))}),O);function _e(t,e,r){return e[t]!==void 0?e[t]:r[t]}var Xg={blendEquation:function(e,r,n){return e.blendEquationSeparate(_e(32777,r,n),_e(34877,r,n))},blendFunc:function(e,r,n){return e.blendFuncSeparate(_e(32969,r,n),_e(32968,r,n),_e(32971,r,n),_e(32970,r,n))},polygonOffset:function(e,r,n){return e.polygonOffset(_e(32824,r,n),_e(10752,r,n))},sampleCoverage:function(e,r,n){return e.sampleCoverage(_e(32938,r,n),_e(32939,r,n))},stencilFuncFront:function(e,r,n){return e.stencilFuncSeparate(1028,_e(2962,r,n),_e(2967,r,n),_e(2963,r,n))},stencilFuncBack:function(e,r,n){return e.stencilFuncSeparate(1029,_e(34816,r,n),_e(36003,r,n),_e(36004,r,n))},stencilOpFront:function(e,r,n){return e.stencilOpSeparate(1028,_e(2964,r,n),_e(2965,r,n),_e(2966,r,n))},stencilOpBack:function(e,r,n){return e.stencilOpSeparate(1029,_e(34817,r,n),_e(34818,r,n),_e(34819,r,n))}},Al={enable:function(e,r){return e(b({},r,!0))},disable:function(e,r){return e(b({},r,!1))},pixelStorei:function(e,r,n){return e(b({},r,n))},hint:function(e,r,n){return e(b({},r,n))},bindFramebuffer:function(e,r,n){var i;switch(r){case 36160:return e((i={},b(i,36006,n),b(i,36010,n),i));case 36009:return e(b({},36006,n));case 36008:return e(b({},36010,n));default:return null}},blendColor:function(e,r,n,i,o){return e(b({},32773,new Float32Array([r,n,i,o])))},blendEquation:function(e,r){var n;return e((n={},b(n,32777,r),b(n,34877,r),n))},blendEquationSeparate:function(e,r,n){var i;return e((i={},b(i,32777,r),b(i,34877,n),i))},blendFunc:function(e,r,n){var i;return e((i={},b(i,32969,r),b(i,32968,n),b(i,32971,r),b(i,32970,n),i))},blendFuncSeparate:function(e,r,n,i,o){var s;return e((s={},b(s,32969,r),b(s,32968,n),b(s,32971,i),b(s,32970,o),s))},clearColor:function(e,r,n,i,o){return e(b({},3106,new Float32Array([r,n,i,o])))},clearDepth:function(e,r){return e(b({},2931,r))},clearStencil:function(e,r){return e(b({},2961,r))},colorMask:function(e,r,n,i,o){return e(b({},3107,[r,n,i,o]))},cullFace:function(e,r){return e(b({},2885,r))},depthFunc:function(e,r){return e(b({},2932,r))},depthRange:function(e,r,n){return e(b({},2928,new Float32Array([r,n])))},depthMask:function(e,r){return e(b({},2930,r))},frontFace:function(e,r){return e(b({},2886,r))},lineWidth:function(e,r){return e(b({},2849,r))},polygonOffset:function(e,r,n){var i;return e((i={},b(i,32824,r),b(i,10752,n),i))},sampleCoverage:function(e,r,n){var i;return e((i={},b(i,32938,r),b(i,32939,n),i))},scissor:function(e,r,n,i,o){return e(b({},3088,new Int32Array([r,n,i,o])))},stencilMask:function(e,r){var n;return e((n={},b(n,2968,r),b(n,36005,r),n))},stencilMaskSeparate:function(e,r,n){return e(b({},r===1028?2968:36005,n))},stencilFunc:function(e,r,n,i){var o;return e((o={},b(o,2962,r),b(o,2967,n),b(o,2963,i),b(o,34816,r),b(o,36003,n),b(o,36004,i),o))},stencilFuncSeparate:function(e,r,n,i,o){var s;return e((s={},b(s,r===1028?2962:34816,n),b(s,r===1028?2967:36003,i),b(s,r===1028?2963:36004,o),s))},stencilOp:function(e,r,n,i){var o;return e((o={},b(o,2964,r),b(o,2965,n),b(o,2966,i),b(o,34817,r),b(o,34818,n),b(o,34819,i),o))},stencilOpSeparate:function(e,r,n,i,o){var s;return e((s={},b(s,r===1028?2964:34817,n),b(s,r===1028?2965:34818,i),b(s,r===1028?2966:34819,o),s))},viewport:function(e,r,n,i,o){return e(b({},2978,[r,n,i,o]))}},Bt=function(e,r){return e.isEnabled(r)},vl=(nt={},b(nt,3042,Bt),b(nt,2884,Bt),b(nt,2929,Bt),b(nt,3024,Bt),b(nt,32823,Bt),b(nt,32926,Bt),b(nt,32928,Bt),b(nt,3089,Bt),b(nt,2960,Bt),b(nt,35977,Bt),nt);function _l(t){for(var e in t)return!1;return!0}function Jg(t,e){if(t===e)return!0;var r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function B2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qg(t,e){var r=t[e].bind(t);t[e]=function(){var i=arguments.length<=0?void 0:arguments[0];return i in t.state.cache&&t.state.enable?t.state.cache[i]:r.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function C2(t,e,r){var n=t[e].bind(t);t[e]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var c=r.apply(void 0,[t.state._updateCache].concat(s)),u=c.valueChanged,l=c.oldValue;return u&&n.apply(void 0,s),l},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function M2(t){var e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}var I2=function(){function t(r){B2(this,t);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.copyState,o=i===void 0?!1:i,s=n.log,a=s===void 0?function(){}:s;this.gl=r,this.program=null,this.stateStack=[],this.enable=!0,this.cache=o?Tl(r):Object.assign({},Hs),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var e=t.prototype;return e.push=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})},e.pop=function(){Se(this.stateStack.length>0);var n=this.stateStack[this.stateStack.length-1];zs(this.gl,n),this.stateStack.pop()},e._updateCache=function(n){var i=!1,o,s=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var a in n){Se(a!==void 0);var c=n[a],u=this.cache[a];Jg(c,u)||(i=!0,o=u,s&&!(a in s)&&(s[a]=u),this.cache[a]=c)}return{valueChanged:i,oldValue:o}},t}();function bl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.enable,n=r===void 0?!0:r,i=e.copyState;if(Se(i!==void 0),!t.state){var o=globalThis.polyfillContext;o&&o(t),t.state=new I2(t,{copyState:i}),M2(t);for(var s in Al){var a=Al[s];C2(t,s,a)}qg(t,"getParameter"),qg(t,"isEnabled")}return t.state.enable=n,t}function xl(t){t.state||bl(t,{copyState:!1}),t.state.push()}function Vs(t){Se(t.state),t.state.pop()}function O2(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=R2(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function R2(t,e){if(t){if(typeof t=="string")return Yg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yg(t,e)}}function Yg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zs(t,e){if(Se(Ns(t),"setParameters requires a WebGL context"),!_l(e)){var r={};for(var n in e){var i=Number(n),o=Wg[n];o&&(typeof o=="string"?r[o]=!0:o(t,e[n],i))}var s=t.state&&t.state.cache;if(s)for(var a in r){var c=Xg[a];c(t,e,s)}}}function Tl(t,e){if(e=e||Hs,typeof e=="number"){var r=e,n=vl[r];return n?n(t,r):t.getParameter(r)}var i=Array.isArray(e)?e:Object.keys(e),o={},s=O2(i),a;try{for(s.s();!(a=s.n()).done;){var c=a.value,u=vl[c];o[c]=u?u(t,Number(c)):t.getParameter(Number(c))}}catch(l){s.e(l)}finally{s.f()}return o}function Ht(t,e,r){if(_l(e))return r(t);var n=e.nocatch,i=n===void 0?!0:n;xl(t),zs(t,e);var o;if(i)o=r(t),Vs(t);else try{o=r(t)}finally{Vs(t)}return o}var SH=Ge();function Ni(){var t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){var e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}function P2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var js=function(){function t(r,n){P2(this,t),L(this,"name",void 0),L(this,"type",void 0),L(this,"sampleSize",1),L(this,"time",void 0),L(this,"count",void 0),L(this,"samples",void 0),L(this,"lastTiming",void 0),L(this,"lastSampleTime",void 0),L(this,"lastSampleCount",void 0),L(this,"_count",0),L(this,"_time",0),L(this,"_samples",0),L(this,"_startTime",0),L(this,"_timerPending",!1),this.name=r,this.type=n,this.reset()}var e=t.prototype;return e.setSampleSize=function(n){return this.sampleSize=n,this},e.incrementCount=function(){return this.addCount(1),this},e.decrementCount=function(){return this.subtractCount(1),this},e.addCount=function(n){return this._count+=n,this._samples++,this._checkSampling(),this},e.subtractCount=function(n){return this._count-=n,this._samples++,this._checkSampling(),this},e.addTime=function(n){return this._time+=n,this.lastTiming=n,this._samples++,this._checkSampling(),this},e.timeStart=function(){return this._startTime=Ni(),this._timerPending=!0,this},e.timeEnd=function(){return this._timerPending?(this.addTime(Ni()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this},e.getSampleAverageCount=function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0},e.getSampleAverageTime=function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0},e.getSampleHz=function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0},e.getAverageCount=function(){return this.samples>0?this.count/this.samples:0},e.getAverageTime=function(){return this.samples>0?this.time/this.samples:0},e.getHz=function(){return this.time>0?this.samples/(this.time/1e3):0},e.reset=function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this},e._checkSampling=function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)},t}();function F2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kg(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function L2(t,e,r){return e&&Kg(t.prototype,e),r&&Kg(t,r),t}var El=function(){function t(r){F2(this,t),L(this,"id",void 0),L(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}var e=t.prototype;return e.get=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:n,type:i})},e.reset=function(){for(var n in this.stats)this.stats[n].reset();return this},e.forEach=function(n){for(var i in this.stats)n(this.stats[i])},e.getTable=function(){var n={};return this.forEach(function(i){n[i.name]={time:i.time||0,count:i.count||0,average:i.getAverageTime()||0,hz:i.getHz()||0}}),n},e._initializeStats=function(){var n=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];i.forEach(function(o){return n._getOrCreate(o)})},e._getOrCreate=function(n){if(!n||!n.name)return null;var i=n.name,o=n.type;return this.stats[i]||(n instanceof js?this.stats[i]=n:this.stats[i]=new js(i,o)),this.stats[i]},L2(t,[{key:"size",get:function(){return Object.keys(this.stats).length}}]),t}();function D2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Gi="8.5.20",N2="set luma.log.level=1 (or higher) to trace rendering",G2=function(){function t(){D2(this,t),this.stats=new Map}var e=t.prototype;return e.get=function(n){return this.stats.has(n)||this.stats.set(n,new El({id:n})),this.stats.get(n)},t}(),Cn=new G2;if(globalThis.luma&&globalThis.luma.VERSION!==Gi)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(Gi));globalThis.luma||(Ge()&&$.log(1,"luma.gl ".concat(Gi," - ").concat(N2))(),globalThis.luma=globalThis.luma||{VERSION:Gi,version:Gi,log:$,stats:Cn,globals:{modules:{},nodeIO:{}}});var rV=globalThis.luma;function G(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function ks(t,e){if(typeof e!="string")return e;var r=Number(e);if(!isNaN(r))return r;e=e.replace(/^.*\./,"");var n=t[e];return G(n!==void 0,"Accessing undefined constant GL.".concat(e)),n}function Dr(t,e){e=Number(e);for(var r in t)if(t[r]===e)return"GL.".concat(r);return String(e)}var Sl={};function Ws(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Sl[t]=Sl[t]||1;var e=Sl[t]++;return"".concat(t,"-").concat(e)}function wl(t){return G(typeof t=="number","Input must be a number"),t&&(t&t-1)===0}function Zg(t,e,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(t);n.forEach(function(s){o.methodName||(o[s]=function(){throw $.removed("Calling removed method ".concat(e,".").concat(s,": "),i)(),new Error(s)})})}function U2(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=H2(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
51
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function H2(t,e){if(t){if(typeof t=="string")return Qg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qg(t,e)}}function Qg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function V2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function z2(t,e,r){return e&&$g(t.prototype,e),r&&$g(t,r),t}var Mn="Resource subclass must define virtual methods",cr=function(t){function e(n){V2(this,e);var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Pi(n);var o=i.id,s=i.userData,a=s===void 0?{}:s;this.gl=n,this.gl2=n,this.id=o||Ws(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=i.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}var r=e.prototype;return r.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},r.delete=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.deleteChildren,s=o===void 0?!1:o,a=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,a&&s&&a.filter(Boolean).forEach(function(c){return c.delete()}),this},r.bind=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof i!="function")return this._bindHandle(i),this;var o;return this._bound?o=i():(this._bindHandle(this.handle),this._bound=!0,o=i(),this._bound=!1,this._bindHandle(null)),o},r.unbind=function(){this.bind(null)},r.getParameter=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i=ks(this.gl,i),G(i);var s=this.constructor.PARAMETERS||{},a=s[i];if(a){var c=te(this.gl),u=(!("webgl2"in a)||c)&&(!("extension"in a)||this.gl.getExtension(a.extension));if(!u){var l=a.webgl1,f="webgl2"in a?a.webgl2:a.webgl1,h=c?f:l;return h}}return this._getParameter(i,o)},r.getParameters=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.parameters,s=i.keys,a=this.constructor.PARAMETERS||{},c=te(this.gl),u={},l=o||Object.keys(a),f=U2(l),h;try{for(f.s();!(h=f.n()).done;){var d=h.value,p=a[d],m=p&&(!("webgl2"in p)||c)&&(!("extension"in p)||this.gl.getExtension(p.extension));if(m){var g=s?Dr(this.gl,d):d;u[g]=this.getParameter(d,i),s&&p.type==="GLenum"&&(u[g]=Dr(this.gl,u[g]))}}}catch(A){f.e(A)}finally{f.f()}return u},r.setParameter=function(i,o){i=ks(this.gl,i),G(i);var s=this.constructor.PARAMETERS||{},a=s[i];if(a){var c=te(this.gl),u=(!("webgl2"in a)||c)&&(!("extension"in a)||this.gl.getExtension(a.extension));if(!u)throw new Error("Parameter not available on this platform");a.type==="GLenum"&&(o=ks(o))}return this._setParameter(i,o),this},r.setParameters=function(i){for(var o in i)this.setParameter(o,i[o]);return this},r.stubRemovedMethods=function(i,o,s){return Zg(this,i,o,s)},r.initialize=function(i){},r._createHandle=function(){throw new Error(Mn)},r._deleteHandle=function(){throw new Error(Mn)},r._bindHandle=function(i){throw new Error(Mn)},r._getOptsFromHandle=function(){throw new Error(Mn)},r._getParameter=function(i,o){throw new Error(Mn)},r._setParameter=function(i,o){throw new Error(Mn)},r._context=function(){return this.gl.luma=this.gl.luma||{},this.gl.luma},r._addStats=function(){var i=this[Symbol.toStringTag],o=Cn.get("Resource Counts");o.get("Resources Created").incrementCount(),o.get("".concat(i,"s Created")).incrementCount(),o.get("".concat(i,"s Active")).incrementCount()},r._removeStats=function(){var i=this[Symbol.toStringTag],o=Cn.get("Resource Counts");o.get("".concat(i,"s Active")).decrementCount()},r._trackAllocatedMemory=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(i,o),this._trackAllocatedMemoryForContext(i,o,this.gl.canvas&&this.gl.canvas.id),this.byteLength=i},r._trackAllocatedMemoryForContext=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=Cn.get("Memory Usage".concat(s));a.get("GPU Memory").addCount(i),a.get("".concat(o," Memory")).addCount(i)},r._trackDeallocatedMemory=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(i),this._trackDeallocatedMemoryForContext(i,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0},r._trackDeallocatedMemoryForContext=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=Cn.get("Memory Usage".concat(o));s.get("GPU Memory").subtractCount(this.byteLength),s.get("".concat(i," Memory")).subtractCount(this.byteLength)},z2(e,[{key:t,get:function(){return"Resource"}},{key:"handle",get:function(){return this._handle}}]),e}(Symbol.toStringTag);var j2="Failed to deduce GL constant from typed array";function Ui(t){var e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(j2)}}function ur(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.clamped,n=r===void 0?!0:r;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function e0(t){var e=t.data,r=t.width,n=t.height,i=t.bytesPerPixel,o=i===void 0?4:i,s=t.temp,a=r*o;s=s||new Uint8Array(a);for(var c=0;c<n/2;++c){var u=c*a,l=(n-c-1)*a;s.set(e.subarray(u,u+a)),e.copyWithin(u,l,l+a),e.set(s,l)}}function t0(t){for(var e=t.data,r=t.width,n=t.height,i=Math.round(r/2),o=Math.round(n/2),s=new Uint8Array(i*o*4),a=0;a<o;a++)for(var c=0;c<i;c++)for(var u=0;u<4;u++)s[(a*i+c)*4+u]=e[(a*2*r+c*2)*4+u];return{data:s,width:i,height:o}}function Hi(t,e,r){var n=r.removedProps,i=n===void 0?{}:n,o=r.deprecatedProps,s=o===void 0?{}:o,a=r.replacedProps,c=a===void 0?{}:a;for(var u in i)if(u in e){var l=i[u],f=l?"".concat(t,".").concat(i[u]):"N/A";$.removed("".concat(t,".").concat(u),f)()}for(var h in s)if(h in e){var d=s[h];$.deprecated("".concat(t,".").concat(h),"".concat(t,".").concat(d))()}var p=null;for(var m in c)if(m in e){var g=c[m];$.deprecated("".concat(t,".").concat(m),"".concat(t,".").concat(g))(),p=p||Object.assign({},e),p[g]=e[m],delete p[m]}return p||e}function Xs(t,e,r){return k2()?Xs=Reflect.construct:Xs=function(i,o,s){var a=[null];a.push.apply(a,o);var c=Function.bind.apply(i,a),u=new c;return s&&Bl(u,s.prototype),u},Xs.apply(null,arguments)}function k2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bl(t,e){return Bl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Bl(t,e)}function W2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function X2(t,e,r){return e&&r0(t.prototype,e),r&&r0(t,r),t}var J2={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},q2={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Nr=function(){t.getBytesPerElement=function(n){var i=ur(n.type||5126);return i.BYTES_PER_ELEMENT},t.getBytesPerVertex=function(n){G(n.size);var i=ur(n.type||5126);return i.BYTES_PER_ELEMENT*n.size},t.resolve=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Xs(t,[J2].concat(i))};function t(){var r=this;W2(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];i.forEach(function(s){return r._assign(s)}),Object.freeze(this)}var e=t.prototype;return e.toString=function(){return JSON.stringify(this)},e._assign=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n=Hi("Accessor",n,q2),n.type!==void 0&&(this.type=n.type,(n.type===5124||n.type===5125)&&(this.integer=!0)),n.size!==void 0&&(this.size=n.size),n.offset!==void 0&&(this.offset=n.offset),n.stride!==void 0&&(this.stride=n.stride),n.normalized!==void 0&&(this.normalized=n.normalized),n.integer!==void 0&&(this.integer=n.integer),n.divisor!==void 0&&(this.divisor=n.divisor),n.buffer!==void 0&&(this.buffer=n.buffer),n.index!==void 0&&(typeof n.index=="boolean"?this.index=n.index?1:0:this.index=n.index),n.instanced!==void 0&&(this.divisor=n.instanced?1:0),n.isInstanced!==void 0&&(this.divisor=n.isInstanced?1:0),this},X2(t,[{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}}]),t}();function Js(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Js=function(r){return typeof r}:Js=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Js(t)}function Y2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function K2(t,e,r){return e&&n0(t.prototype,e),r&&n0(t,r),t}function Z2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cl(t,e)}function Cl(t,e){return Cl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Cl(t,e)}function Q2(t){var e=eC();return function(){var n=qs(t),i;if(e){var o=qs(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return $2(this,i)}}function $2(t,e){if(e&&(Js(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o0(t)}function o0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qs(t){return qs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},qs(t)}var i0=10,s0={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},tC={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:s0},rC={removedProps:s0},Ml=function(t,e){Z2(n,t);var r=Q2(n);function n(o){var s;Y2(this,n);var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=r.call(this,o,a),s.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),s.target=a.target||(s.gl.webgl2?36662:34962),s.initialize(a),Object.seal(o0(s)),s}var i=n.prototype;return i.getElementCount=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/Nr.getBytesPerElement(s))},i.getVertexCount=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/Nr.getBytesPerVertex(s))},i.initialize=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(s)&&(s={data:s}),Number.isFinite(s)&&(s={byteLength:s}),s=Hi("Buffer",s,tC),this.usage=s.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},s,s.accessor)),s.data?this._setData(s.data,s.offset,s.byteLength):this._setByteLength(s.byteLength||0),this},i.setProps=function(s){return s=Hi("Buffer",s,rC),"accessor"in s&&this.setAccessor(s.accessor),this},i.setAccessor=function(s){return s=Object.assign({},s),delete s.buffer,this.accessor=new Nr(s),this},i.reallocate=function(s){return s>this.byteLength?(this._setByteLength(s),!0):(this.bytesUsed=s,!1)},i.setData=function(s){return this.initialize(s)},i.subData=function(s){ArrayBuffer.isView(s)&&(s={data:s});var a=s,c=a.data,u=a.offset,l=u===void 0?0:u,f=a.srcOffset,h=f===void 0?0:f,d=s.byteLength||s.length;G(c);var p=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(p,this.handle),h!==0||d!==void 0?(Ie(this.gl),this.gl.bufferSubData(this.target,l,c,h,d)):this.gl.bufferSubData(p,l,c),this.gl.bindBuffer(p,null),this.debugData=null,this._inferType(c),this},i.copyData=function(s){var a=s.sourceBuffer,c=s.readOffset,u=c===void 0?0:c,l=s.writeOffset,f=l===void 0?0:l,h=s.size,d=this.gl;return Ie(d),d.bindBuffer(36662,a.handle),d.bindBuffer(36663,this.handle),d.copyBufferSubData(36662,36663,u,f,h),d.bindBuffer(36662,null),d.bindBuffer(36663,null),this.debugData=null,this},i.getData=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.dstData,c=a===void 0?null:a,u=s.srcByteOffset,l=u===void 0?0:u,f=s.dstOffset,h=f===void 0?0:f,d=s.length,p=d===void 0?0:d;Ie(this.gl);var m=ur(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(l),A=h,_,v;c?(v=c.length,_=v-A):(_=Math.min(g,p||g),v=A+_);var x=Math.min(g,_);return p=p||x,G(p<=x),c=c||new m(v),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,l,c,h,p),this.gl.bindBuffer(36662,null),c},i.bind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.target,c=a===void 0?this.target:a,u=s.index,l=u===void 0?this.accessor&&this.accessor.index:u,f=s.offset,h=f===void 0?0:f,d=s.size;return c===35345||c===35982?d!==void 0?this.gl.bindBufferRange(c,l,this.handle,h,d):(G(h===0),this.gl.bindBufferBase(c,l,this.handle)):this.gl.bindBuffer(c,this.handle),this},i.unbind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.target,c=a===void 0?this.target:a,u=s.index,l=u===void 0?this.accessor&&this.accessor.index:u,f=c===35345||c===35982;return f?this.gl.bindBufferBase(c,l,null):this.gl.bindBuffer(c,null),this},i.getDebugData=function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(i0,this.byteLength)}),{data:this.debugData,changed:!0})},i.invalidateDebugData=function(){this.debugData=null},i._setData=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s.byteLength+a;G(ArrayBuffer.isView(s)),this._trackDeallocatedMemory();var u=this._getTarget();this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,c,this.usage),this.gl.bufferSubData(u,a,s),this.gl.bindBuffer(u,null),this.debugData=s.slice(0,i0),this.bytesUsed=c,this._trackAllocatedMemory(c);var l=Ui(s);return G(l),this.setAccessor(new Nr(this.accessor,{type:l})),this},i._setByteLength=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;G(s>=0),this._trackDeallocatedMemory();var c=s;s===0&&(c=new Float32Array(0));var u=this._getTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,c,a),this.gl.bindBuffer(u,null),this.usage=a,this.debugData=null,this.bytesUsed=s,this._trackAllocatedMemory(s),this},i._getTarget=function(){return this.gl.webgl2?36663:this.target},i._getAvailableElementCount=function(s){var a=ur(this.accessor.type||5126,{clamped:!1}),c=s/a.BYTES_PER_ELEMENT;return this.getElementCount()-c},i._inferType=function(s){this.accessor.type||this.setAccessor(new Nr(this.accessor,{type:Ui(s)}))},i._createHandle=function(){return this.gl.createBuffer()},i._deleteHandle=function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()},i._getParameter=function(s){this.gl.bindBuffer(this.target,this.handle);var a=this.gl.getBufferParameter(this.target,s);return this.gl.bindBuffer(this.target,null),a},i.setByteLength=function(s){return $.deprecated("setByteLength","reallocate")(),this.reallocate(s)},i.updateAccessor=function(s){return $.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Nr(this.accessor,s),this},K2(n,[{key:e,get:function(){return"Buffer"}},{key:"type",get:function(){return $.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return $.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),n}(cr,Symbol.toStringTag);var pt,Ue,Ct;function ae(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ys=(pt={},ae(pt,6407,{dataFormat:6407,types:[5121,33635]}),ae(pt,6408,{dataFormat:6408,types:[5121,32819,32820]}),ae(pt,6406,{dataFormat:6406,types:[5121]}),ae(pt,6409,{dataFormat:6409,types:[5121]}),ae(pt,6410,{dataFormat:6410,types:[5121]}),ae(pt,33326,{dataFormat:6403,types:[5126],gl2:!0}),ae(pt,33328,{dataFormat:33319,types:[5126],gl2:!0}),ae(pt,34837,{dataFormat:6407,types:[5126],gl2:!0}),ae(pt,34836,{dataFormat:6408,types:[5126],gl2:!0}),pt),a0=(Ue={},ae(Ue,6403,1),ae(Ue,36244,1),ae(Ue,33319,2),ae(Ue,33320,2),ae(Ue,6407,3),ae(Ue,36248,3),ae(Ue,6408,4),ae(Ue,36249,4),ae(Ue,6402,1),ae(Ue,34041,1),ae(Ue,6406,1),ae(Ue,6409,1),ae(Ue,6410,2),Ue),c0=(Ct={},ae(Ct,5126,4),ae(Ct,5125,4),ae(Ct,5124,4),ae(Ct,5123,2),ae(Ct,5122,2),ae(Ct,5131,2),ae(Ct,5120,1),ae(Ct,5121,1),Ct);function u0(t,e){var r=Ys[e];if(!r)return!1;if(r.gl1===void 0&&r.gl2===void 0)return!0;var n=te(t)&&r.gl2||r.gl1;return typeof n=="string"?t.getExtension(n):n}function l0(t,e){var r=Ys[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function Ks(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ks=function(r){return typeof r}:Ks=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ks(t)}function nC(t,e){return sC(t)||oC(t,e)||p0(t,e)||iC()}function iC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
52
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oC(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function sC(t){if(Array.isArray(t))return t}function aC(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=p0(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
53
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function p0(t,e){if(t){if(typeof t=="string")return f0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f0(t,e)}}function f0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function uC(t,e,r){return e&&h0(t.prototype,e),r&&h0(t,r),t}function lC(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Il(t,e)}function Il(t,e){return Il=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Il(t,e)}function fC(t){var e=pC();return function(){var n=Zs(t),i;if(e){var o=Zs(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hC(this,i)}}function hC(t,e){if(e&&(Ks(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dC(t)}function dC(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zs(t){return Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Zs(t)}var mC=[9729,9728],d0=globalThis.WebGLBuffer||function(){},Ol=function(t,e){lC(n,t);var r=fC(n);n.isSupported=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=a.format,u=a.linearFiltering,l=!0;return c&&(l=l&&u0(s,c),l=l&&(!u||l0(s,c))),l};function n(o,s){var a;cC(this,n);var c=s.id,u=c===void 0?Ws("texture"):c,l=s.handle,f=s.target;return a=r.call(this,o,{id:u,handle:l}),a.target=f,a.textureUnit=void 0,a.loaded=!1,a.width=void 0,a.height=void 0,a.depth=void 0,a.format=void 0,a.type=void 0,a.dataFormat=void 0,a.border=void 0,a.textureUnit=void 0,a.mipmaps=void 0,a}var i=n.prototype;return i.toString=function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")},i.initialize=function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=a.data;if(c instanceof Promise)return c.then(function(Y){return s.initialize(Object.assign({},a,{pixels:Y,data:Y}))}),this;var u=typeof HTMLVideoElement<"u"&&c instanceof HTMLVideoElement;if(u&&c.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,c.addEventListener("loadeddata",function(){return s.initialize(a)}),this;var l=a.pixels,f=l===void 0?null:l,h=a.format,d=h===void 0?6408:h,p=a.border,m=p===void 0?0:p,g=a.recreate,A=g===void 0?!1:g,_=a.parameters,v=_===void 0?{}:_,x=a.pixelStore,w=x===void 0?{}:x,S=a.textureUnit,C=S===void 0?void 0:S;c||(c=f);var B=a.width,T=a.height,y=a.dataFormat,M=a.type,P=a.compressed,F=P===void 0?!1:P,I=a.mipmaps,N=I===void 0?!0:I,q=a.depth,U=q===void 0?0:q,V=this._deduceParameters({format:d,type:M,dataFormat:y,compressed:F,data:c,width:B,height:T});return B=V.width,T=V.height,F=V.compressed,y=V.dataFormat,M=V.type,this.width=B,this.height=T,this.depth=U,this.format=d,this.type=M,this.dataFormat=y,this.border=m,this.textureUnit=C,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),N&&this._isNPOT()&&($.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),N=!1,this._updateForNPOT(v)),this.mipmaps=N,this.setImageData({data:c,width:B,height:T,depth:U,format:d,type:M,dataFormat:y,border:m,mipmaps:N,parameters:w,compressed:F}),N&&this.generateMipmap(),this.setParameters(v),A&&(this.data=c),u&&(this._video={video:c,parameters:v,lastTime:c.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?c.currentTime:-1}),this},i.update=function(){if(this._video){var s=this._video,a=s.video,c=s.parameters,u=s.lastTime;if(u===a.currentTime||a.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:a,parameters:c}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=a.currentTime}},i.resize=function(s){var a=s.height,c=s.width,u=s.mipmaps,l=u===void 0?!1:u;return c!==this.width||a!==this.height?this.initialize({width:c,height:a,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:l}):this},i.generateMipmap=function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?($.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Ht(this.gl,a,function(){s.gl.generateMipmap(s.target)}),this.gl.bindTexture(this.target,null),this)},i.setImageData=function(s){this._trackDeallocatedMemory("Texture");var a=s.target,c=a===void 0?this.target:a,u=s.pixels,l=u===void 0?null:u,f=s.level,h=f===void 0?0:f,d=s.format,p=d===void 0?this.format:d,m=s.border,g=m===void 0?this.border:m,A=s.offset,_=A===void 0?0:A,v=s.parameters,x=v===void 0?{}:v,w=s.data,S=w===void 0?null:w,C=s.type,B=C===void 0?this.type:C,T=s.width,y=T===void 0?this.width:T,M=s.height,P=M===void 0?this.height:M,F=s.dataFormat,I=F===void 0?this.dataFormat:F,N=s.compressed,q=N===void 0?!1:N;S||(S=l);var U=this._deduceParameters({format:p,type:B,dataFormat:I,compressed:q,data:S,width:y,height:P});B=U.type,I=U.dataFormat,q=U.compressed,y=U.width,P=U.height;var V=this.gl;V.bindTexture(this.target,this.handle);var Y=null,ee=this._getDataType({data:S,compressed:q});S=ee.data,Y=ee.dataType;var oe,me=0;if(Ht(this.gl,x,function(){switch(Y){case"null":V.texImage2D(c,h,p,y,P,g,I,B,S);break;case"typed-array":V.texImage2D(c,h,p,y,P,g,I,B,S,_);break;case"buffer":oe=Ie(V),oe.bindBuffer(35052,S.handle||S),oe.texImage2D(c,h,p,y,P,g,I,B,_),oe.bindBuffer(35052,null);break;case"browser-object":te(V)?V.texImage2D(c,h,p,y,P,g,I,B,S):V.texImage2D(c,h,p,I,B,S);break;case"compressed":var Wt=aC(S.entries()),Nh;try{for(Wt.s();!(Nh=Wt.n()).done;){var Gh=nC(Nh.value,2),w_=Gh[0],ni=Gh[1];V.compressedTexImage2D(c,w_,ni.format,ni.width,ni.height,g,ni.data),me+=ni.levelSize}}catch(B_){Wt.e(B_)}finally{Wt.f()}break;default:G(!1,"Unknown image data type")}}),Y==="compressed")this._trackAllocatedMemory(me,"Texture");else if(S&&S.byteLength)this._trackAllocatedMemory(S.byteLength,"Texture");else{var vr=a0[this.dataFormat]||4,an=c0[this.type]||1;this._trackAllocatedMemory(this.width*this.height*vr*an,"Texture")}return this.loaded=!0,this},i.setSubImageData=function(s){var a=this,c=s.target,u=c===void 0?this.target:c,l=s.pixels,f=l===void 0?null:l,h=s.data,d=h===void 0?null:h,p=s.x,m=p===void 0?0:p,g=s.y,A=g===void 0?0:g,_=s.width,v=_===void 0?this.width:_,x=s.height,w=x===void 0?this.height:x,S=s.level,C=S===void 0?0:S,B=s.format,T=B===void 0?this.format:B,y=s.type,M=y===void 0?this.type:y,P=s.dataFormat,F=P===void 0?this.dataFormat:P,I=s.compressed,N=I===void 0?!1:I,q=s.offset,U=q===void 0?0:q,V=s.border,Y=V===void 0?this.border:V,ee=s.parameters,oe=ee===void 0?{}:ee,me=this._deduceParameters({format:T,type:M,dataFormat:F,compressed:N,data:d,width:v,height:w});if(M=me.type,F=me.dataFormat,N=me.compressed,v=me.width,w=me.height,G(this.depth===0,"texSubImage not supported for 3D textures"),d||(d=f),d&&d.data){var vr=d;d=vr.data,v=vr.shape[0],w=vr.shape[1]}d instanceof Ml&&(d=d.handle),this.gl.bindTexture(this.target,this.handle),Ht(this.gl,oe,function(){if(N)a.gl.compressedTexSubImage2D(u,C,m,A,v,w,T,d);else if(d===null)a.gl.texSubImage2D(u,C,m,A,v,w,F,M,null);else if(ArrayBuffer.isView(d))a.gl.texSubImage2D(u,C,m,A,v,w,F,M,d,U);else if(d instanceof d0){var an=Ie(a.gl);an.bindBuffer(35052,d),an.texSubImage2D(u,C,m,A,v,w,F,M,U),an.bindBuffer(35052,null)}else if(te(a.gl)){var Wt=Ie(a.gl);Wt.texSubImage2D(u,C,m,A,v,w,F,M,d)}else a.gl.texSubImage2D(u,C,m,A,F,M,d)}),this.gl.bindTexture(this.target,null)},i.copyFramebuffer=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},i.getActiveUnit=function(){return this.gl.getParameter(34016)-33984},i.bind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return s!==void 0&&(this.textureUnit=s,a.activeTexture(33984+s)),a.bindTexture(this.target,this.handle),s},i.unbind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return s!==void 0&&(this.textureUnit=s,a.activeTexture(33984+s)),a.bindTexture(this.target,null),s},i._getDataType=function(s){var a=s.data,c=s.compressed,u=c===void 0?!1:c;return u?{data:a,dataType:"compressed"}:a===null?{data:a,dataType:"null"}:ArrayBuffer.isView(a)?{data:a,dataType:"typed-array"}:a instanceof Ml?{data:a.handle,dataType:"buffer"}:a instanceof d0?{data:a,dataType:"buffer"}:{data:a,dataType:"browser-object"}},i._deduceParameters=function(s){var a=s.format,c=s.data,u=s.width,l=s.height,f=s.dataFormat,h=s.type,d=s.compressed,p=Ys[a];f=f||p&&p.dataFormat,h=h||p&&p.types[0],d=d||p&&p.compressed;var m=this._deduceImageSize(c,u,l);return u=m.width,l=m.height,{dataFormat:f,type:h,compressed:d,width:u,height:l,format:a,data:c}},i._deduceImageSize=function(s,a,c){var u;return typeof ImageData<"u"&&s instanceof ImageData?u={width:s.width,height:s.height}:typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement?u={width:s.naturalWidth,height:s.naturalHeight}:typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement?u={width:s.width,height:s.height}:typeof ImageBitmap<"u"&&s instanceof ImageBitmap?u={width:s.width,height:s.height}:typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement?u={width:s.videoWidth,height:s.videoHeight}:s?u={width:a,height:c}:u={width:a>=0?a:1,height:c>=0?c:1},G(u,"Could not deduced texture size"),G(a===void 0||u.width===a,"Deduced texture width does not match supplied width"),G(c===void 0||u.height===c,"Deduced texture height does not match supplied height"),u},i._createHandle=function(){return this.gl.createTexture()},i._deleteHandle=function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")},i._getParameter=function(s){switch(s){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var a=this.gl.getTexParameter(this.target,s);return this.gl.bindTexture(this.target,null),a}},i._setParameter=function(s,a){switch(this.gl.bindTexture(this.target,this.handle),a=this._getNPOTParam(s,a),s){case 33082:case 33083:this.gl.texParameterf(this.handle,s,a);break;case 4096:case 4097:G(!1);break;default:this.gl.texParameteri(this.target,s,a);break}return this.gl.bindTexture(this.target,null),this},i._isNPOT=function(){return te(this.gl)||!this.width||!this.height?!1:!wl(this.width)||!wl(this.height)},i._updateForNPOT=function(s){s[this.gl.TEXTURE_MIN_FILTER]===void 0&&(s[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),s[this.gl.TEXTURE_WRAP_S]===void 0&&(s[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),s[this.gl.TEXTURE_WRAP_T]===void 0&&(s[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)},i._getNPOTParam=function(s,a){if(this._isNPOT())switch(s){case 10241:mC.indexOf(a)===-1&&(a=9729);break;case 10242:case 10243:a!==33071&&(a=33071);break;default:break}return a},uC(n,[{key:e,get:function(){return"Texture"}}]),n}(cr,Symbol.toStringTag);var gC="";function m0(t,e){return G(typeof t=="string"),t=gC+t,new Promise(function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(o){n(o)}})}function Qs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qs=function(r){return typeof r}:Qs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qs(t)}function yC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function AC(t,e,r){return e&&g0(t.prototype,e),r&&g0(t,r),t}function vC(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rl(t,e)}function Rl(t,e){return Rl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Rl(t,e)}function _C(t){var e=xC();return function(){var n=$s(t),i;if(e){var o=$s(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return bC(this,i)}}function bC(t,e){if(e&&(Qs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y0(t)}function y0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $s(t){return $s=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},$s(t)}var Gr=function(t,e){vC(n,t);var r=_C(n);n.isSupported=function(o,s){return Ol.isSupported(o,s)};function n(i){var o;yC(this,n);var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Pi(i),(s instanceof Promise||typeof s=="string")&&(s={data:s}),typeof s.data=="string"&&(s=Object.assign({},s,{data:m0(s.data)})),o=r.call(this,i,Object.assign({},s,{target:3553})),o.initialize(s),Object.seal(y0(o)),o}return AC(n,[{key:e,get:function(){return"Texture2D"}}]),n}(Ol,Symbol.toStringTag);var H;function z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ur="EXT_color_buffer_float",Pl=(H={},z(H,33189,{bpp:2}),z(H,33190,{gl2:!0,bpp:3}),z(H,36012,{gl2:!0,bpp:4}),z(H,36168,{bpp:1}),z(H,34041,{bpp:4}),z(H,35056,{gl2:!0,bpp:4}),z(H,36013,{gl2:!0,bpp:5}),z(H,32854,{bpp:2}),z(H,36194,{bpp:2}),z(H,32855,{bpp:2}),z(H,33321,{gl2:!0,bpp:1}),z(H,33330,{gl2:!0,bpp:1}),z(H,33329,{gl2:!0,bpp:1}),z(H,33332,{gl2:!0,bpp:2}),z(H,33331,{gl2:!0,bpp:2}),z(H,33334,{gl2:!0,bpp:4}),z(H,33333,{gl2:!0,bpp:4}),z(H,33323,{gl2:!0,bpp:2}),z(H,33336,{gl2:!0,bpp:2}),z(H,33335,{gl2:!0,bpp:2}),z(H,33338,{gl2:!0,bpp:4}),z(H,33337,{gl2:!0,bpp:4}),z(H,33340,{gl2:!0,bpp:8}),z(H,33339,{gl2:!0,bpp:8}),z(H,32849,{gl2:!0,bpp:3}),z(H,32856,{gl2:!0,bpp:4}),z(H,32857,{gl2:!0,bpp:4}),z(H,36220,{gl2:!0,bpp:4}),z(H,36238,{gl2:!0,bpp:4}),z(H,36975,{gl2:!0,bpp:4}),z(H,36214,{gl2:!0,bpp:8}),z(H,36232,{gl2:!0,bpp:8}),z(H,36226,{gl2:!0,bpp:16}),z(H,36208,{gl2:!0,bpp:16}),z(H,33325,{gl2:Ur,bpp:2}),z(H,33327,{gl2:Ur,bpp:4}),z(H,34842,{gl2:Ur,bpp:8}),z(H,33326,{gl2:Ur,bpp:4}),z(H,33328,{gl2:Ur,bpp:8}),z(H,34836,{gl2:Ur,bpp:16}),z(H,35898,{gl2:Ur,bpp:4}),H);function ea(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ea=function(r){return typeof r}:ea=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ea(t)}function TC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function EC(t,e,r){return e&&A0(t.prototype,e),r&&A0(t,r),t}function SC(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fl(t,e)}function Fl(t,e){return Fl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Fl(t,e)}function wC(t){var e=CC();return function(){var n=ta(t),i;if(e){var o=ta(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return BC(this,i)}}function BC(t,e){if(e&&(ea(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v0(t)}function v0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function CC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ta(t){return ta=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ta(t)}function MC(t,e,r){var n=r[e];if(!n)return!1;var i=te(t)&&n.gl2||n.gl1;return typeof i=="string"?t.getExtension(i):i}var Vi=function(t,e){SC(n,t);var r=wC(n);n.isSupported=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null},c=a.format;return!c||MC(s,c,Pl)},n.getSamplesForFormat=function(s,a){var c=a.format;return s.getInternalformatParameter(36161,c,32937)};function n(o){var s;TC(this,n);var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=r.call(this,o,a),s.initialize(a),Object.seal(v0(s)),s}var i=n.prototype;return i.initialize=function(s){var a=s.format,c=s.width,u=c===void 0?1:c,l=s.height,f=l===void 0?1:l,h=s.samples,d=h===void 0?0:h;return G(a,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),d!==0&&te(this.gl)?this.gl.renderbufferStorageMultisample(36161,d,a,u,f):this.gl.renderbufferStorage(36161,a,u,f),this.format=a,this.width=u,this.height=f,this.samples=d,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Pl[this.format].bpp),this},i.resize=function(s){var a=s.width,c=s.height;return a!==this.width||c!==this.height?this.initialize({width:a,height:c,format:this.format,samples:this.samples}):this},i._createHandle=function(){return this.gl.createRenderbuffer()},i._deleteHandle=function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()},i._bindHandle=function(s){this.gl.bindRenderbuffer(36161,s)},i._syncHandle=function(s){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)},i._getParameter=function(s){this.gl.bindRenderbuffer(36161,this.handle);var a=this.gl.getRenderbufferParameter(36161,s);return a},EC(n,[{key:e,get:function(){return"Renderbuffer"}}]),n}(cr,Symbol.toStringTag);function IC(t,e){return FC(t)||PC(t,e)||RC(t,e)||OC()}function OC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
54
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RC(t,e){if(t){if(typeof t=="string")return _0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _0(t,e)}}function _0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function PC(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function FC(t){if(Array.isArray(t))return t}var LC=256,DC=1024,NC=16384,b0=6144,x0=6145,T0=6146,E0=34041,S0="clear: bad arguments";function w0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.framebuffer,n=r===void 0?null:r,i=e.color,o=i===void 0?null:i,s=e.depth,a=s===void 0?null:s,c=e.stencil,u=c===void 0?null:c,l={};n&&(l.framebuffer=n);var f=0;o&&(f|=NC,o!==!0&&(l.clearColor=o)),a&&(f|=LC,a!==!0&&(l.clearDepth=a)),u&&(f|=DC,a!==!0&&(l.clearStencil=a)),G(f!==0,S0),Ht(t,l,function(){t.clear(f)})}function B0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.framebuffer,n=r===void 0?null:r,i=e.buffer,o=i===void 0?b0:i,s=e.drawBuffer,a=s===void 0?0:s,c=e.value,u=c===void 0?[0,0,0,0]:c;Ie(t),Ht(t,{framebuffer:n},function(){switch(o){case b0:switch(u.constructor){case Int32Array:t.clearBufferiv(o,a,u);break;case Uint32Array:t.clearBufferuiv(o,a,u);break;case Float32Array:default:t.clearBufferfv(o,a,u)}break;case x0:t.clearBufferfv(x0,0,[u]);break;case T0:t.clearBufferiv(T0,0,[u]);break;case E0:var l=IC(u,2),f=l[0],h=l[1];t.clearBufferfi(E0,0,f,h);break;default:G(!1,S0)}})}function C0(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return G(!1),0}}function GC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.sourceX,n=r===void 0?0:r,i=e.sourceY,o=i===void 0?0:i,s=e.sourceFormat,a=s===void 0?6408:s,c=e.sourceAttachment,u=c===void 0?36064:c,l=e.target,f=l===void 0?null:l,h=e.sourceWidth,d=e.sourceHeight,p=e.sourceType,m=UC(t),g=m.framebuffer,A=m.deleteFramebuffer;G(g);var _=g.gl,v=g.handle,x=g.attachments;h=h||g.width,d=d||g.height,u===36064&&v===null&&(u=1028),G(x[u]),p=p||x[u].type,f=HC(f,p,a,h,d),p=p||Ui(f);var w=_.bindFramebuffer(36160,v);return _.readPixels(n,o,h,d,a,p,f),_.bindFramebuffer(36160,w||null),A&&g.delete(),f}function Ll(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.sourceAttachment,n=r===void 0?36064:r,i=e.targetMaxHeight,o=i===void 0?Number.MAX_SAFE_INTEGER:i,s=GC(t,{sourceAttachment:n}),a=t.width,c=t.height;c>o;){var u=t0({data:s,width:a,height:c});s=u.data,a=u.width,c=u.height}e0({data:s,width:a,height:c});var l=document.createElement("canvas");l.width=a,l.height=c;var f=l.getContext("2d"),h=f.createImageData(a,c);return h.data.set(s),f.putImageData(h,0,0),l.toDataURL()}function UC(t){return t instanceof lr?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:M0(t),deleteFramebuffer:!0}}function HC(t,e,r,n,i){if(t)return t;e=e||5121;var o=ur(e,{clamped:!1}),s=C0(r);return new o(n*i*s)}var pe;function ge(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var he={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};function VC(t){var e=new Gr(t,{format:6408,type:5126,dataFormat:6408}),r=new lr(t,{id:"test-framebuffer",check:!1,attachments:ge({},36064,e)}),n=r.getStatus();return e.delete(),r.delete(),n===36053}var Dl=(pe={},ge(pe,he.WEBGL2,[!1,!0]),ge(pe,he.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),ge(pe,he.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),ge(pe,he.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),ge(pe,he.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),ge(pe,he.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),ge(pe,he.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),ge(pe,he.FLOAT_BLEND,["EXT_float_blend"]),ge(pe,he.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),ge(pe,he.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),ge(pe,he.TEXTURE_FLOAT,["OES_texture_float",!0]),ge(pe,he.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),ge(pe,he.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),ge(pe,he.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),ge(pe,he.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),ge(pe,he.COLOR_ATTACHMENT_RGBA32F,[VC,"EXT_color_buffer_float"]),ge(pe,he.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),ge(pe,he.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),ge(pe,he.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),ge(pe,he.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),ge(pe,he.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),ge(pe,he.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),pe);function zC(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=jC(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
55
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function jC(t,e){if(t){if(typeof t=="string")return I0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I0(t,e)}}function I0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var kC=2;function ra(t,e){return Nl(t,e)}function Nl(t,e){return e=Array.isArray(e)?e:[e],e.every(function(r){return O0(t,r)})}function na(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(var e in Dl)t.luma.caps[e]===void 0&&(t.luma.caps[e]=O0(t,e));return t.luma.caps}function O0(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},t.luma.caps[e]===void 0&&(t.luma.caps[e]=WC(t,e)),t.luma.caps[e]||$.log(kC,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}function WC(t,e){var r=Dl[e];G(r,e);var n,i=te(t)&&r[1]||r[0];if(typeof i=="function")n=i(t);else if(Array.isArray(i)){n=!0;var o=zC(i),s;try{for(o.s();!(s=o.n()).done;){var a=s.value;n=n&&Boolean(t.getExtension(a))}}catch(c){o.e(c)}finally{o.f()}}else typeof i=="string"?n=Boolean(t.getExtension(i)):typeof i=="boolean"?n=i:G(!1);return n}function oa(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oa=function(r){return typeof r}:oa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},oa(t)}function ia(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XC(t,e){return YC(t)||qC(t,e)||D0(t,e)||JC()}function JC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
56
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qC(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function YC(t){if(Array.isArray(t))return t}function R0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=D0(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function D0(t,e){if(t){if(typeof t=="string")return P0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P0(t,e)}}function P0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function KC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F0(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ZC(t,e,r){return e&&F0(t.prototype,e),r&&F0(t,r),t}function sa(t,e,r){return typeof Reflect<"u"&&Reflect.get?sa=Reflect.get:sa=function(i,o,s){var a=QC(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},sa(t,e,r||t)}function QC(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=In(t),t!==null););return t}function $C(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gl(t,e)}function Gl(t,e){return Gl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gl(t,e)}function eM(t){var e=rM();return function(){var n=In(t),i;if(e){var o=In(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return tM(this,i)}}function tM(t,e){if(e&&(oa(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N0(t)}function N0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function In(t){return In=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},In(t)}var L0="Multiple render targets not supported",lr=function(t,e){$C(n,t);var r=eM(n);n.isSupported=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=a.colorBufferFloat,u=a.colorBufferHalfFloat,l=!0;return c&&(l=Boolean(s.getExtension("EXT_color_buffer_float")||s.getExtension("WEBGL_color_buffer_float")||s.getExtension("OES_texture_float"))),u&&(l=l&&Boolean(s.getExtension("EXT_color_buffer_float")||s.getExtension("EXT_color_buffer_half_float"))),l},n.getDefaultFramebuffer=function(s){return s.luma=s.luma||{},s.luma.defaultFramebuffer=s.luma.defaultFramebuffer||new n(s,{id:"default-framebuffer",handle:null,attachments:{}}),s.luma.defaultFramebuffer};function n(o){var s;KC(this,n);var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=r.call(this,o,a),s.width=null,s.height=null,s.attachments={},s.readBuffer=36064,s.drawBuffers=[36064],s.ownResources=[],s.initialize(a),Object.seal(N0(s)),s}var i=n.prototype;return i.initialize=function(s){var a=s.width,c=a===void 0?1:a,u=s.height,l=u===void 0?1:u,f=s.attachments,h=f===void 0?null:f,d=s.color,p=d===void 0?!0:d,m=s.depth,g=m===void 0?!0:m,A=s.stencil,_=A===void 0?!1:A,v=s.check,x=v===void 0?!0:v,w=s.readBuffer,S=w===void 0?void 0:w,C=s.drawBuffers,B=C===void 0?void 0:C;if(G(c>=0&&l>=0,"Width and height need to be integers"),this.width=c,this.height=l,h)for(var T in h){var y=h[T],M=Array.isArray(y)?y[0]:y;M.resize({width:c,height:l})}else h=this._createDefaultAttachments(p,g,_,c,l);this.update({clearAttachments:!0,attachments:h,readBuffer:S,drawBuffers:B}),h&&x&&this.checkStatus()},i.delete=function(){var s=R0(this.ownResources),a;try{for(s.s();!(a=s.n()).done;){var c=a.value;c.delete()}}catch(u){s.e(u)}finally{s.f()}return sa(In(n.prototype),"delete",this).call(this),this},i.update=function(s){var a=s.attachments,c=a===void 0?{}:a,u=s.readBuffer,l=s.drawBuffers,f=s.clearAttachments,h=f===void 0?!1:f,d=s.resizeAttachments,p=d===void 0?!0:d;this.attach(c,{clearAttachments:h,resizeAttachments:p});var m=this.gl,g=m.bindFramebuffer(36160,this.handle);return u&&this._setReadBuffer(u),l&&this._setDrawBuffers(l),m.bindFramebuffer(36160,g||null),this},i.resize=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.width,c=s.height;if(this.handle===null)return G(a===void 0&&c===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;a===void 0&&(a=this.gl.drawingBufferWidth),c===void 0&&(c=this.gl.drawingBufferHeight),a!==this.width&&c!==this.height&&$.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(a,"x").concat(c))();for(var u in this.attachments)this.attachments[u].resize({width:a,height:c});return this.width=a,this.height=c,this},i.attach=function(s){var a=this,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=c.clearAttachments,l=u===void 0?!1:u,f=c.resizeAttachments,h=f===void 0?!0:f,d={};l&&Object.keys(this.attachments).forEach(function(T){d[T]=null}),Object.assign(d,s);var p=this.gl.bindFramebuffer(36160,this.handle);for(var m in d){G(m!==void 0,"Misspelled framebuffer binding point?");var g=Number(m),A=d[g],_=A;if(!_)this._unattach(g);else if(_ instanceof Vi)this._attachRenderbuffer({attachment:g,renderbuffer:_});else if(Array.isArray(A)){var v=XC(A,3),x=v[0],w=v[1],S=w===void 0?0:w,C=v[2],B=C===void 0?0:C;_=x,this._attachTexture({attachment:g,texture:x,layer:S,level:B})}else this._attachTexture({attachment:g,texture:_,layer:0,level:0});h&&_&&_.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,p||null),Object.assign(this.attachments,s),Object.keys(this.attachments).filter(function(T){return!a.attachments[T]}).forEach(function(T){delete a.attachments[T]})},i.checkStatus=function(){var s=this.gl,a=this.getStatus();if(a!==36053)throw new Error(iM(a));return this},i.getStatus=function(){var s=this.gl,a=s.bindFramebuffer(36160,this.handle),c=s.checkFramebufferStatus(36160);return s.bindFramebuffer(36160,a||null),c},i.clear=function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=a.color,u=a.depth,l=a.stencil,f=a.drawBuffers,h=f===void 0?[]:f,d=this.gl.bindFramebuffer(36160,this.handle);return(c||u||l)&&w0(this.gl,{color:c,depth:u,stencil:l}),h.forEach(function(p,m){B0(s.gl,{drawBuffer:m,value:p})}),this.gl.bindFramebuffer(36160,d||null),this},i.readPixels=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null},i.readPixelsToBuffer=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null},i.copyToDataUrl=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null},i.copyToImage=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null},i.copyToTexture=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},i.blit=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return $.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null},i.invalidate=function(s){var a=s.attachments,c=a===void 0?[]:a,u=s.x,l=u===void 0?0:u,f=s.y,h=f===void 0?0:f,d=s.width,p=s.height,m=Ie(this.gl),g=m.bindFramebuffer(36008,this.handle),A=l===0&&h===0&&d===void 0&&p===void 0;return A?m.invalidateFramebuffer(36008,c):m.invalidateFramebuffer(36008,c,l,h,d,p),m.bindFramebuffer(36008,g),this},i.getAttachmentParameter=function(s,a,c){var u=this._getAttachmentParameterFallback(a);return u===null&&(this.gl.bindFramebuffer(36160,this.handle),u=this.gl.getFramebufferAttachmentParameter(36160,s,a),this.gl.bindFramebuffer(36160,null)),c&&u>1e3&&(u=Dr(this.gl,u)),u},i.getAttachmentParameters=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,a=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],u={},l=R0(c),f;try{for(l.s();!(f=l.n()).done;){var h=f.value,d=a?Dr(this.gl,h):h;u[d]=this.getAttachmentParameter(s,h,a)}}catch(p){l.e(p)}finally{l.f()}return u},i.getParameters=function(){for(var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,a=Object.keys(this.attachments),c={},u=0,l=a;u<l.length;u++){var f=l[u],h=Number(f),d=s?Dr(this.gl,h):h;c[d]=this.getAttachmentParameters(h,s)}return c},i.show=function(){return typeof window<"u"&&window.open(Ll(this),"luma-debug-texture"),this},i.log=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(s>$.level||typeof window>"u")return this;a=a||"Framebuffer ".concat(this.id);var c=Ll(this,{targetMaxHeight:100});return $.image({logLevel:s,message:a,image:c},a)(),this},i.bind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.target,c=a===void 0?36160:a;return this.gl.bindFramebuffer(c,this.handle),this},i.unbind=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=s.target,c=a===void 0?36160:a;return this.gl.bindFramebuffer(c,null),this},i._createDefaultAttachments=function(s,a,c,u,l){var f=null;if(s){var h;f=f||{},f[36064]=new Gr(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:u,height:l,mipmaps:!1,parameters:(h={},ia(h,10241,9729),ia(h,10240,9729),ia(h,10242,33071),ia(h,10243,33071),h)}),this.ownResources.push(f[36064])}return a&&c?(f=f||{},f[33306]=new Vi(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:u,height:111}),this.ownResources.push(f[33306])):a?(f=f||{},f[36096]=new Vi(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:u,height:l}),this.ownResources.push(f[36096])):c&&G(!1),f},i._unattach=function(s){var a=this.attachments[s];a&&(a instanceof Vi?this.gl.framebufferRenderbuffer(36160,s,36161,null):this.gl.framebufferTexture2D(36160,s,3553,null,0),delete this.attachments[s])},i._attachRenderbuffer=function(s){var a=s.attachment,c=a===void 0?36064:a,u=s.renderbuffer,l=this.gl;l.framebufferRenderbuffer(36160,c,36161,u.handle),this.attachments[c]=u},i._attachTexture=function(s){var a=s.attachment,c=a===void 0?36064:a,u=s.texture,l=s.layer,f=s.level,h=this.gl;switch(h.bindTexture(u.target,u.handle),u.target){case 35866:case 32879:var d=Ie(h);d.framebufferTextureLayer(36160,c,u.target,f,l);break;case 34067:var p=nM(l);h.framebufferTexture2D(36160,c,p,u.handle,f);break;case 3553:h.framebufferTexture2D(36160,c,3553,u.handle,f);break;default:G(!1,"Illegal texture type")}h.bindTexture(u.target,null),this.attachments[c]=u},i._setReadBuffer=function(s){var a=pl(this.gl);a?a.readBuffer(s):G(s===36064||s===1029,L0),this.readBuffer=s},i._setDrawBuffers=function(s){var a=this.gl,c=Ie(a);if(c)c.drawBuffers(s);else{var u=a.getExtension("WEBGL_draw_buffers");u?u.drawBuffersWEBGL(s):G(s.length===1&&(s[0]===36064||s[0]===1029),L0)}this.drawBuffers=s},i._getAttachmentParameterFallback=function(s){var a=na(this.gl);switch(s){case 36052:return a.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return a.WEBGL2?null:8;case 33297:return a.WEBGL2?null:5125;case 33296:return!a.WEBGL2&&!a.EXT_sRGB?9729:null;default:return null}},i._createHandle=function(){return this.gl.createFramebuffer()},i._deleteHandle=function(){this.gl.deleteFramebuffer(this.handle)},i._bindHandle=function(s){return this.gl.bindFramebuffer(36160,s)},ZC(n,[{key:e,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var s=Ie(this.gl);return s.getParameter(s.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var s=Ie(this.gl);return s.getParameter(s.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),n}(cr,Symbol.toStringTag);function nM(t){return t<34069?t+34069:t}function iM(t){var e=lr.STATUS||{};return e[t]||"Framebuffer error ".concat(t)}var oM=[36049,36048,33296,33298,33299,33300,33301,33302,33303];lr.ATTACHMENT_PARAMETERS=oM;function sM(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function M0(t,e){var r=t.gl,n=t.width,i=t.height,o=t.id,s=new lr(r,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:n,height:i,attachments:sM({},36064,t)}));return s}function G0(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ul(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G0(Object(r),!0).forEach(function(n){Hl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hl(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Vl=function(){function t(r,n){aM(this,t);var i=n.attributes,o=n.material,s=n.pbrDebug,a=n.imageBasedLightingEnvironment,c=n.lights,u=n.useTangents;this.gl=r,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ra(r,he.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),s&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(c,"USE_LIGHTS"),this.defineIfPresent(s,"PBR_DEBUG"),o&&this.parseMaterial(o)}var e=t.prototype;return e.defineIfPresent=function(n,i){n&&(this.defines[i]=1)},e.parseTexture=function(n,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=n.texture&&n.texture.sampler&&n.texture.sampler.parameters||{},a=n.texture.source.image,c,u={};a.compressed?(c=a,u=Hl({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):c={data:a};var l=new Gr(this.gl,Ul({id:n.name||n.id,parameters:Ul(Ul({},s),u),pixelStore:Hl({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},c));this.uniforms[i]=l,this.defineIfPresent(o,o),this.generatedTextures.push(l)},e.parsePbrMetallicRoughness=function(n){n.baseColorTexture&&this.parseTexture(n.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=n.baseColorFactor||[1,1,1,1],n.metallicRoughnessTexture&&this.parseTexture(n.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var i=n.metallicFactor,o=i===void 0?1:i,s=n.roughnessFactor,a=s===void 0?1:s;this.uniforms.u_MetallicRoughnessValues=[o,a]},e.parseMaterial=function(n){if(this.uniforms.pbr_uUnlit=Boolean(n.unlit),n.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(n.pbrMetallicRoughness),n.normalTexture){this.parseTexture(n.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var i=n.normalTexture.scale,o=i===void 0?1:i;this.uniforms.u_NormalScale=o}if(n.occlusionTexture){this.parseTexture(n.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var s=n.occlusionTexture.strength,a=s===void 0?1:s;this.uniforms.u_OcclusionStrength=a}if(n.emissiveTexture&&(this.parseTexture(n.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=n.emissiveFactor||[0,0,0]),n.alphaMode==="MASK"){var c=n.alphaCutoff,u=c===void 0?.5:c;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=u}else n.alphaMode==="BLEND"&&($.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))},e.delete=function(){this.generatedTextures.forEach(function(n){return n.delete()})},t}();var ca=X(fl()),z0=X(Is());var U0=`#version 300 es
58
- #define SHADER_NAME simple-mesh-layer-vs
59
- uniform float sizeScale;
60
- uniform bool composeModelMatrix;
61
- uniform bool pickFeatureIds;
62
- in vec3 positions;
63
- in vec3 normals;
64
- in vec3 colors;
65
- in vec2 texCoords;
66
- in vec4 uvRegions;
67
- in vec3 featureIdsPickingColors;
68
- in vec4 instanceColors;
69
- in vec3 instancePickingColors;
70
- in mat3 instanceModelMatrix;
71
- out vec2 vTexCoord;
72
- out vec3 cameraPosition;
73
- out vec3 normals_commonspace;
74
- out vec4 position_commonspace;
75
- out vec4 vColor;
76
-
77
- vec2 applyUVRegion(vec2 uv) {
78
- #ifdef HAS_UV_REGIONS
79
- return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;
80
- #else
81
- return uv;
82
- #endif
83
- }
84
-
85
- void main(void) {
86
- vec2 uv = applyUVRegion(texCoords);
87
- geometry.uv = uv;
88
-
89
- if (pickFeatureIds) {
90
- geometry.pickingColor = featureIdsPickingColors;
91
- } else {
92
- geometry.pickingColor = instancePickingColors;
93
- }
94
-
95
- vTexCoord = uv;
96
- cameraPosition = project_uCameraPosition;
97
- vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
98
-
99
- vec3 pos = (instanceModelMatrix * positions) * sizeScale;
100
- vec3 projectedPosition = project_position(positions);
101
- position_commonspace = vec4(projectedPosition, 1.0);
102
- gl_Position = project_common_position_to_clipspace(position_commonspace);
103
-
104
- geometry.position = position_commonspace;
105
- normals_commonspace = project_normal(instanceModelMatrix * normals);
106
- geometry.normal = normals_commonspace;
107
-
108
- DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
109
-
110
- #ifdef MODULE_PBR
111
- pbr_vPosition = geometry.position.xyz;
112
- #ifdef HAS_NORMALS
113
- pbr_vNormal = geometry.normal;
114
- #endif
115
-
116
- #ifdef HAS_UV
117
- pbr_vUV = uv;
118
- #else
119
- pbr_vUV = vec2(0., 0.);
120
- #endif
121
- geometry.uv = pbr_vUV;
122
- #endif
123
-
124
- DECKGL_FILTER_COLOR(vColor, geometry);
125
- }
126
- `;var H0=`#version 300 es
127
- #define SHADER_NAME simple-mesh-layer-fs
128
-
129
- precision highp float;
130
-
131
- uniform bool hasTexture;
132
- uniform sampler2D sampler;
133
- uniform bool flatShading;
134
- uniform float opacity;
135
-
136
- in vec2 vTexCoord;
137
- in vec3 cameraPosition;
138
- in vec3 normals_commonspace;
139
- in vec4 position_commonspace;
140
- in vec4 vColor;
141
-
142
- out vec4 fragColor;
143
-
144
- void main(void) {
145
-
146
- #ifdef MODULE_PBR
147
-
148
- fragColor = vColor * pbr_filterColor(vec4(0));
149
- geometry.uv = pbr_vUV;
150
- fragColor.a *= opacity;
151
-
152
- #else
153
-
154
- geometry.uv = vTexCoord;
155
-
156
- vec3 normal;
157
- if (flatShading) {
158
- #ifdef DERIVATIVES_AVAILABLE
159
- normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
160
- #else
161
- normal = vec3(0.0, 0.0, 1.0);
162
- #endif
163
- } else {
164
- normal = normals_commonspace;
165
- }
166
-
167
- vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
168
- vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
169
- fragColor = vec4(lightColor, color.a * opacity);
170
-
171
- #endif
172
-
173
- DECKGL_FILTER_COLOR(fragColor, geometry);
174
- }
175
- `;function aa(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?aa=function(r){return typeof r}:aa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},aa(t)}function V0(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V0(Object(r),!0).forEach(function(n){cM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cM(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hr(t,e,r){return typeof Reflect<"u"&&Reflect.get?hr=Reflect.get:hr=function(i,o,s){var a=lM(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},hr(t,e,r||t)}function lM(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=Mt(t),t!==null););return t}function fM(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zl(t,e)}function zl(t,e){return zl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},zl(t,e)}function hM(t){var e=mM();return function(){var n=Mt(t),i;if(e){var o=Mt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return dM(this,i)}}function dM(t,e){if(e&&(aa(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pM(t)}function pM(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mt(t){return Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Mt(t)}function gM(t){var e=t.COLOR_0||t.colors;e||(t.colors={constant:!0,value:new Float32Array([1,1,1])})}var yM={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},ua=function(t){fM(r,t);var e=hM(r);function r(){return uM(this,r),e.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var o=hr(Mt(r.prototype),"getShaders",this).call(this),s=o.modules;return s.push(ca.pbr),fr(fr({},o),{},{vs:U0,fs:H0})},n.initializeState=function(){var o=this.props.featureIds;hr(Mt(r.prototype),"initializeState",this).call(this);var s=this.getAttributeManager();o&&s.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})},n.updateState=function(o){hr(Mt(r.prototype),"updateState",this).call(this,o);var s=o.props,a=o.oldProps;s.pbrMaterial!==a.pbrMaterial&&this.updatePbrMaterialUniforms(s.pbrMaterial)},n.draw=function(o){var s=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(s)}),hr(Mt(r.prototype),"draw",this).call(this,o))},n.getModel=function(o){var s=this.props,a=s.id,c=s.pbrMaterial,u=this.parseMaterial(c,o);this.setState({materialParser:u});var l=this.getShaders();gM(o.attributes);var f=new ca.Model(this.context.gl,fr(fr({},this.getShaders()),{},{id:a,geometry:o,defines:fr(fr(fr({},l.defines),u?.defines),{},{HAS_UV_REGIONS:o.attributes.uvRegions}),parameters:u?.parameters,isInstanced:!0}));return f},n.updatePbrMaterialUniforms=function(o){var s=this.state.model;if(s){var a=this.props.mesh,c=this.parseMaterial(o,a);this.setState({materialParser:c}),s.setUniforms(c.uniforms)}},n.parseMaterial=function(o,s){var a,c=Boolean(o.pbrMetallicRoughness&&o.pbrMetallicRoughness.baseColorTexture);return(a=this.state.materialParser)===null||a===void 0||a.delete(),new Vl(this.context.gl,{attributes:{NORMAL:s.attributes.normals,TEXCOORD_0:s.attributes.texCoords},material:fr({unlit:c},o),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})},n.calculateFeatureIdsPickingColors=function(o){for(var s=this.props.featureIds,a=new Uint8ClampedArray(s.length*o.size),c=[],u=0;u<s.length;u++)this.encodePickingColor(s[u],c),a[u*3]=c[0],a[u*3+1]=c[1],a[u*3+2]=c[2];o.value=a},n.finalizeState=function(o){var s;hr(Mt(r.prototype),"finalizeState",this).call(this,o),(s=this.state.materialParser)===null||s===void 0||s.delete(),this.setState({materialParser:null})},r}(z0.SimpleMeshLayer);ua.layerName="MeshLayer";ua.defaultProps=yM;var xv=X(On());var Vt=6356752314245179e-9,AM={radii:[6378137,6378137,Vt],radiiSquared:[6378137*6378137,6378137*6378137,Vt*Vt],oneOverRadii:[1/6378137,1/6378137,1/Vt],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Vt*Vt)],maximumRadius:Math.max(6378137,6378137,Vt),centerToleranceSquared:.1};function la(t){return t}var $z=new E;function vM(t,e=[],r=la){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function k0(t,e=[]){return vM(t,e,ue._cartographicRadians?la:ru)}function _M(t,e,r=la){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function W0(t,e){return _M(t,e,ue._cartographicRadians?la:nu)}var X0=1e-14,bM=new E,J0={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},jl={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},zi={east:new E,north:new E,up:new E,west:new E,south:new E,down:new E},xM=new E,TM=new E,EM=new E;function kl(t,e,r,n,i,o){let s=J0[e]&&J0[e][r];Be(s&&(!n||n===s));let a,c,u,l=bM.copy(i);if(Ne(l.x,0,X0)&&Ne(l.y,0,X0)){let h=Math.sign(l.z);a=xM.fromArray(jl[e]),e!=="east"&&e!=="west"&&a.scale(h),c=TM.fromArray(jl[r]),r!=="east"&&r!=="west"&&c.scale(h),u=EM.fromArray(jl[n]),n!=="east"&&n!=="west"&&u.scale(h)}else{let{up:h,east:d,north:p}=zi;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);let{down:m,west:g,south:A}=zi;m.copy(h).scale(-1),g.copy(d).scale(-1),A.copy(p).scale(-1),a=zi[e],c=zi[r],u=zi[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=c.x,o[5]=c.y,o[6]=c.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}var Rn=new E,SM=new E,wM=new E;function q0(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:o}=e;Rn.from(t);let s=Rn.x,a=Rn.y,c=Rn.z,u=n.x,l=n.y,f=n.z,h=s*s*u*u,d=a*a*l*l,p=c*c*f*f,m=h+d+p,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;let A=SM;if(A.copy(t).scale(g),m<o)return A.to(r);let _=i.x,v=i.y,x=i.z,w=wM;w.set(A.x*_*2,A.y*v*2,A.z*x*2);let S=(1-g)*Rn.len()/(.5*w.len()),C=0,B,T,y,M;do{S-=C,B=1/(1+S*_),T=1/(1+S*v),y=1/(1+S*x);let P=B*B,F=T*T,I=y*y,N=P*B,q=F*T,U=I*y;M=h*P+d*F+p*I-1;let Y=-2*(h*N*_+d*q*v+p*U*x);C=M/Y}while(Math.abs(M)>ft.EPSILON12);return Rn.scale([B,T,y]).to(r)}var fa=new E,Y0=new E,MM=new E,mt=new E,IM=new E,ha=new E,J=class{constructor(e=0,r=0,n=0){L(this,"radii",void 0),L(this,"radiiSquared",void 0),L(this,"radiiToTheFourth",void 0),L(this,"oneOverRadii",void 0),L(this,"oneOverRadiiSquared",void 0),L(this,"minimumRadius",void 0),L(this,"maximumRadius",void 0),L(this,"centerToleranceSquared",ft.EPSILON1),L(this,"squaredXOverSquaredZ",void 0),Be(e>=0),Be(r>=0),Be(n>=0),this.radii=new E(e,r,n),this.radiiSquared=new E(e*e,r*r,n*n),this.radiiToTheFourth=new E(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new E(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new E(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Y0,i=MM,[,,o]=e;this.geodeticSurfaceNormalCartographic(e,n),i.copy(this.radiiSquared).scale(n);let s=Math.sqrt(n.dot(i));return i.scale(1/s),n.scale(o),i.add(n),i.to(r)}cartesianToCartographic(e,r=[0,0,0]){ha.from(e);let n=this.scaleToGeodeticSurface(ha,mt);if(!n)return;let i=this.geodeticSurfaceNormal(n,Y0),o=IM;o.copy(ha).subtract(n);let s=Math.atan2(i.y,i.x),a=Math.asin(i.z),c=Math.sign(pn.dot(o,ha))*pn.length(o);return W0([s,a,c],r)}eastNorthUpToFixedFrame(e,r=new k){return kl(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,i,o=new k){return kl(this,e,r,n,i,o)}geocentricSurfaceNormal(e,r=[0,0,0]){return fa.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=k0(e),i=n[0],o=n[1],s=Math.cos(o);return fa.set(s*Math.cos(i),s*Math.sin(i),Math.sin(o)).normalize(),fa.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return fa.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return q0(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){mt.from(e);let n=mt.x,i=mt.y,o=mt.z,s=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+i*i*s.y+o*o*s.z);return mt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return mt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return mt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){Be(Ne(this.radii.x,this.radii.y,ft.EPSILON15)),Be(this.radii.z>0),mt.from(e);let i=mt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return mt.set(0,0,i).to(n)}};L(J,"WGS84",new J(6378137,6378137,Vt));function ji(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var Hr=class{constructor(e,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ji(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ji()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Pn=class{constructor(e){this.id=void 0,this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,i=this.stats[r];return i||(e instanceof Hr?i=e:i=new Hr(r,n),this.stats[r]=i),i}};var da=class{constructor(e,r,n){this.item=void 0,this.previous=void 0,this.next=void 0,this.item=e,this.previous=r,this.next=n}};var pa=class{constructor(){this.head=null,this.tail=null,this._length=0}get length(){return this._length}add(e){let r=new da(e,this.tail,null);return this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),++this._length,r}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,r){e!==r&&(this.remove(r),this._insert(e,r))}_insert(e,r){let n=e.next;e.next=r,this.tail===e?this.tail=r:n.previous=r,r.next=n,r.previous=e,++this._length}};var ma=class{constructor(){this._list=void 0,this._sentinel=void 0,this._trimTiles=void 0,this._list=new pa,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){let r=e._cacheNode;r&&this._list.splice(this._sentinel,r)}add(e,r,n){r._cacheNode||(r._cacheNode=this._list.add(r),n&&n(e,r))}unloadTile(e,r,n){let i=r._cacheNode;i&&(this._list.remove(i),r._cacheNode=null,n&&n(e,r))}unloadTiles(e,r){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=e.maximumMemoryUsage*1024*1024,s=this._sentinel,a=i.head;for(;a!==s&&(e.gpuMemoryUsageInBytes>o||n);){let c=a.item;a=a.next,this.unloadTile(e,c,r)}}trim(){this._trimTiles=!0}};function K0(t,e){Q(t),Q(e);let{rtcCenter:r,gltfUpAxis:n}=e,{computedTransform:i,boundingVolume:{center:o}}=t,s=new k(i);switch(r&&s.translate(r),n){case"Z":break;case"Y":let f=new k().rotateX(Math.PI/2);s=s.multiplyRight(f);break;case"X":let h=new k().rotateY(-Math.PI/2);s=s.multiplyRight(h);break;default:break}e.isQuantized&&s.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);let a=new E(o);e.cartesianModelMatrix=s,e.cartesianOrigin=a;let c=J.WGS84.cartesianToCartographic(a,new E),l=J.WGS84.eastNorthUpToFixedFrame(a).invert();e.cartographicModelMatrix=l.multiplyRight(s),e.cartographicOrigin=c,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}var Z0=new E,Wl=new E,Xl=new Ee([new Ce,new Ce,new Ce,new Ce,new Ce,new Ce]);function $0(t,e){let{cameraDirection:r,cameraUp:n,height:i}=t,{metersPerUnit:o}=t.distanceScales,s=ga(t,t.center),a=J.WGS84.eastNorthUpToFixedFrame(s),c=t.unprojectPosition(t.cameraPosition),u=J.WGS84.cartographicToCartesian(c,new E),l=new E(a.transformAsVector(new E(r).scale(o))).normalize(),f=new E(a.transformAsVector(new E(n).scale(o))).normalize();OM(t);let h=t.constructor,{longitude:d,latitude:p,width:m,bearing:g,zoom:A}=t,_=new h({longitude:d,latitude:p,height:i,width:m,bearing:g,zoom:A,pitch:0});return{camera:{position:u,direction:l,up:f},viewport:t,topDownViewport:_,height:i,cullingVolume:Xl,frameNumber:e,sseDenominator:1.15}}function ey(t,e,r){if(r===0||t.length<=r)return[t,[]];let n=[],{longitude:i,latitude:o}=e.viewport;for(let[u,l]of t.entries()){let[f,h]=l.header.mbs,d=Math.abs(i-f),p=Math.abs(o-h),m=Math.sqrt(p*p+d*d);n.push([u,m])}let s=n.sort((u,l)=>u[1]-l[1]),a=[];for(let u=0;u<r;u++)a.push(t[s[u][0]]);let c=[];for(let u=r;u<s.length;u++)c.push(t[s[u][0]]);return[a,c]}function OM(t){let e=t.getFrustumPlanes(),r=Q0(e.near,t.cameraPosition),n=ga(t,r),i=ga(t,t.cameraPosition,Wl),o=0;Xl.planes[o++].fromPointNormal(n,Z0.copy(n).subtract(i));for(let s in e){if(s==="near")continue;let a=e[s],c=Q0(a,r,Wl),u=ga(t,c,Wl);Xl.planes[o++].fromPointNormal(u,Z0.copy(n).subtract(u))}}function Q0(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=t.normal.dot(e);return r.copy(t.normal).scale(t.distance-n).add(e),r}function ga(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=t.unprojectPosition(e);return J.WGS84.cartographicToCartesian(n,r)}var RM=6378137,PM=6378137,Jl=6356752314245179e-9,Fn=new E;function ty(t,e){if(t instanceof dt){let{halfAxes:r}=t,n=FM(r);return Math.log2(Jl/(n+e[2]))}else if(t instanceof et){let{radius:r}=t;return Math.log2(Jl/(r+e[2]))}else if(t.width&&t.height){let{width:r,height:n}=t,i=Math.log2(RM/r),o=Math.log2(PM/n);return(i+o)/2}return 1}function ql(t,e,r){J.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],Fn);let n=Math.sqrt(Math.pow(Fn[0]-r[0],2)+Math.pow(Fn[1]-r[1],2)+Math.pow(Fn[2]-r[2],2));return Math.log2(Jl/(n+e[2]))}function ry(t,e,r){let[n,i,o,s]=t;return ql({xmin:n,xmax:o,ymin:i,ymax:s,zmin:0,zmax:0},e,r)}function FM(t){t.getColumn(0,Fn);let e=t.getColumn(1),r=t.getColumn(2);return Fn.add(e).add(r).len()}var vy=X(On(),1);var He={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},ze=function(t){return t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE",t}({}),It=function(t){return t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh",t}({}),Re=function(t){return t.I3S="I3S",t.TILES3D="TILES3D",t}({}),Vr=function(t){return t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold",t}({}),ny={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};function ay(t){return t!=null}var Pe=new E,ya=new E,LM=new E,DM=new E,zr=new E,iy=new E,oy=new E,sy=new E;function Aa(t,e,r){if(Q(t,"3D Tile: boundingVolume must be defined"),t.box)return uy(t.box,e,r);if(t.region)return GM(t.region);if(t.sphere)return NM(t.sphere,e,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function cy(t,e){if(t.box)return UM(e);if(t.region){let[r,n,i,o,s,a]=t.region;return[[Ye(r),Ye(n),s],[Ye(i),Ye(o),a]]}if(t.sphere)return HM(e);throw new Error("Unkown boundingVolume type")}function uy(t,e,r){let n=new E(t[0],t[1],t[2]);e.transform(n,n);let i=[];if(t.length===10){let u=t.slice(3,6),l=new Et;l.fromArray(t,6);let f=new E([1,0,0]),h=new E([0,1,0]),d=new E([0,0,1]);f.transformByQuaternion(l),f.scale(u[0]),h.transformByQuaternion(l),h.scale(u[1]),d.transformByQuaternion(l),d.scale(u[2]),i=[...f.toArray(),...h.toArray(),...d.toArray()]}else i=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];let o=e.transformAsVector(i.slice(0,3)),s=e.transformAsVector(i.slice(3,6)),a=e.transformAsVector(i.slice(6,9)),c=new ne([o[0],o[1],o[2],s[0],s[1],s[2],a[0],a[1],a[2]]);return ay(r)?(r.center=n,r.halfAxes=c,r):new dt(n,c)}function NM(t,e,r){let n=new E(t[0],t[1],t[2]);e.transform(n,n);let i=e.getScale(ya),o=Math.max(Math.max(i[0],i[1]),i[2]),s=t[3]*o;return ay(r)?(r.center=n,r.radius=s,r):new et(n,s)}function GM(t){let[e,r,n,i,o,s]=t,a=J.WGS84.cartographicToCartesian([Ye(e),Ye(i),o],LM),c=J.WGS84.cartographicToCartesian([Ye(n),Ye(r),s],DM),u=new E().addVectors(a,c).multiplyByScalar(.5);return J.WGS84.cartesianToCartographic(u,zr),J.WGS84.cartographicToCartesian([Ye(n),zr[1],zr[2]],iy),J.WGS84.cartographicToCartesian([zr[0],Ye(i),zr[2]],oy),J.WGS84.cartographicToCartesian([zr[0],zr[1],s],sy),uy([...u,...iy.subtract(u),...oy.subtract(u),...sy.subtract(u)],new k)}function UM(t){let e=ly(),{halfAxes:r}=t,n=new E(r.getColumn(0)),i=new E(r.getColumn(1)),o=new E(r.getColumn(2));for(let s=0;s<2;s++){for(let a=0;a<2;a++){for(let c=0;c<2;c++)Pe.copy(t.center),Pe.add(n),Pe.add(i),Pe.add(o),fy(e,Pe),o.negate();i.negate()}n.negate()}return e}function HM(t){let e=ly(),{center:r,radius:n}=t,i=J.WGS84.scaleToGeodeticSurface(r,Pe),o;i?o=J.WGS84.geodeticSurfaceNormal(i):o=new E(0,0,1);let s=new E(o[2],-o[1],0);s.len()>0?s.normalize():s=new E(0,1,0);let a=s.clone().cross(o);for(let c of[s,a,o]){ya.copy(c).scale(n);for(let u=0;u<2;u++)Pe.copy(r),Pe.add(ya),fy(e,Pe),ya.negate()}return e}function ly(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function fy(t,e){J.WGS84.cartesianToCartographic(e,Pe),t[0][0]=Math.min(t[0][0],Pe[0]),t[0][1]=Math.min(t[0][1],Pe[1]),t[0][2]=Math.min(t[0][2],Pe[2]),t[1][0]=Math.max(t[1][0],Pe[0]),t[1][1]=Math.max(t[1][1],Pe[1]),t[1][2]=Math.max(t[1][2],Pe[2])}var Yj=new E,Kj=new E,Zj=new k,Qj=new E,$j=new E,ek=new E;function VM(t,e){let r=t*e;return 1-Math.exp(-(r*r))}function zM(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){let r=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor;return VM(e,r)*n}return 0}function hy(t,e,r){let n=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=r?i:t.lodMetricValue;if(o===0)return 0;let s=Math.max(t._distanceToCamera,1e-7),{height:a,sseDenominator:c}=e,{viewDistanceScale:u}=n.options,l=o*a*(u||1)/(s*c);return l-=zM(n,s),l}var Yl=new E,dy=new E,dr=new E,py=new E,jM=new E,Kl=new k,my=new k;function gy(t,e){if(t.lodMetricValue===0||isNaN(t.lodMetricValue))return"DIG";let r=2*Zl(t,e);return r<2?"OUT":!t.header.children||r<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}function Zl(t,e){let{topDownViewport:r}=e,n=t.header.mbs[1],i=t.header.mbs[0],o=t.header.mbs[2],s=t.header.mbs[3],a=[...t.boundingVolume.center],c=r.unprojectPosition(r.cameraPosition);J.WGS84.cartographicToCartesian(c,Yl),dy.copy(Yl).subtract(a).normalize(),J.WGS84.eastNorthUpToFixedFrame(a,Kl),my.copy(Kl).invert(),dr.copy(Yl).transform(my);let u=Math.sqrt(dr[0]*dr[0]+dr[1]*dr[1]),l=u*u/dr[2];py.copy([dr[0],dr[1],l]);let h=py.transform(Kl).subtract(a).normalize(),p=dy.cross(h).normalize().scale(s).add(a),m=J.WGS84.cartesianToCartographic(p),g=r.project([i,n,o]),A=r.project(m);return jM.copy(g).subtract(A).magnitude()}function yy(t){return{assetGltfUpAxis:t.asset&&t.asset.gltfUpAxis||"Y"}}var ki=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this._map=new Map,this._array=void 0,this._length=void 0,this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Q(e<this._array.length),this._array[e]}set(e,r){Q(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=r,this._map.set(r,e)}delete(e){let r=this._map.get(e);r>=0&&(this._array.splice(r,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){let r=this.length++;this._array[r]=e,this._map.set(e,r)}}pop(){let e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Q(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){Q(e>=0),this.length=e}trim(e){e==null&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}};var kM={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""},Ot=class{traversalFinished(e){return!0}constructor(e){this.options=void 0,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={},this.lastUpdate=new Date().getTime(),this.updateDebounceTime=1e3,this._traversalStack=new ki,this._emptyTraversalStack=new ki,this._frameNumber=null,this.options={...kM,...e}}traverse(e,r,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,r),this._frameNumber=r.frameNumber,this.executeTraversal(e,r)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,r){let n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){let o=n.pop(),s=!1;this.canTraverse(o,r)&&(this.updateChildTiles(o,r),s=this.updateAndPushChildren(o,r,n,o.hasRenderContent?o._selectionDepth+1:o._selectionDepth));let a=o.parent,c=Boolean(!a||a._shouldRefine),u=!s;o.hasRenderContent?o.refine===ze.ADD?(this.loadTile(o,r),this.selectTile(o,r)):o.refine===ze.REPLACE&&(this.loadTile(o,r),u&&this.selectTile(o,r)):(this.emptyTiles[o.id]=o,this.loadTile(o,r),u&&this.selectTile(o,r)),this.touchTile(o,r),o._shouldRefine=s&&c}let i=new Date().getTime();(this.traversalFinished(r)||i-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=i,this.options.onTraversalEnd(r))}updateChildTiles(e,r){let n=e.children;for(let i of n)this.updateTile(i,r)}updateAndPushChildren(e,r,n,i){let{loadSiblings:o,skipLevelOfDetail:s}=this.options,a=e.children;a.sort(this.compareDistanceToCamera.bind(this));let c=e.refine===ze.REPLACE&&e.hasRenderContent&&!s,u=!1,l=!0;for(let f of a)if(f._selectionDepth=i,f.isVisibleAndInRequestVolume?(n.find(f)&&n.delete(f),n.push(f),u=!0):(c||o)&&(this.loadTile(f,r),this.touchTile(f,r)),c){let h;if(f._inRequestVolume?f.hasRenderContent?h=f.contentAvailable:h=this.executeEmptyTraversal(f,r):h=!1,l=l&&h,!l)return!1}return u||(l=!1),l}updateTile(e,r){this.updateTileVisibility(e,r)}selectTile(e,r){this.shouldSelectTile(e)&&(e._selectedFrame=r.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,r){this.shouldLoadTile(e)&&(e._requestedFrame=r.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,r){e.tileset._cache.touch(e),e._touchedFrame=r.frameNumber}canTraverse(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.hasChildren?e.hasTilesetContent?!e.contentExpired:!i&&!e.isVisibleAndInRequestVolume?!1:this.shouldRefine(e,r,n):!1}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e._screenSpaceError;return n&&(i=e.getScreenSpaceError(r,!0)),i>this.options.maximumScreenSpaceError}updateTileVisibility(e,r){let n=[];if(this.options.viewportTraversersMap)for(let i in this.options.viewportTraversersMap)this.options.viewportTraversersMap[i]===r.viewport.id&&n.push(i);else n.push(r.viewport.id);e.updateVisibility(r,n)}compareDistanceToCamera(e,r){return e._distanceToCamera-r._distanceToCamera}anyChildrenVisible(e,r){let n=!1;for(let i of e.children)i.updateVisibility(r),n=n||i.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,r){let n=!0,i=this._emptyTraversalStack;for(i.push(e);i.length>0&&n;){let o=i.pop();if(this.updateTile(o,r),o.isVisibleAndInRequestVolume||this.loadTile(o,r),this.touchTile(o,r),!o.hasRenderContent&&this.canTraverse(o,r,!1,!0)){let a=o.children;for(let c of a)i.find(c)&&i.delete(c),i.push(c)}else!o.contentAvailable&&!o.hasEmptyContent&&(n=!1)}return n}};var Ay=new E;function WM(t){return t!=null}var jr=class{constructor(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";this.tileset=void 0,this.header=void 0,this.id=void 0,this.url=void 0,this.parent=void 0,this.refine=void 0,this.type=void 0,this.contentUrl=void 0,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=He.UNLOADED,this.gpuMemoryUsageInBytes=0,this.children=[],this.depth=0,this.viewportIds=[],this.transform=new k,this.extensions=null,this.implicitTiling=null,this.userData={},this.computedTransform=void 0,this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.traverser=new Ot({}),this._cacheNode=null,this._frameNumber=null,this._expireDate=null,this._expiredContent=null,this._boundingBox=void 0,this._distanceToCamera=0,this._screenSpaceError=0,this._visibilityPlaneMask=void 0,this._visible=void 0,this._contentBoundingVolume=void 0,this._viewerRequestVolume=void 0,this._initialTransform=new k,this._priority=0,this._selectedFrame=0,this._requestedFrame=0,this._selectionDepth=0,this._touchedFrame=0,this._centerZDepth=0,this._shouldRefine=!1,this._stackLength=0,this._visitedFrame=0,this._inRequestVolume=!1,this._lodJudge=null,this.header=r,this.tileset=e,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===He.READY||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===He.UNLOADED}get contentExpired(){return this.contentState===He.EXPIRED}get contentFailed(){return this.contentState===He.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=cy(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(e,r){switch(this.tileset.type){case Re.I3S:return Zl(this,e);case Re.TILES3D:return hy(this,e,r);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){let e=this.tileset._traverser,{skipLevelOfDetail:r}=e.options,n=this.refine===ze.ADD||r;if(n&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===He.UNLOADED)return-1;let i=this.parent,s=i&&(!n||this._screenSpaceError===0||i.hasTilesetContent)?i._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-s,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=He.LOADING;let r=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!r)return this.contentState=He.UNLOADED,!1;try{let n=this.tileset.getTileUrl(this.contentUrl),i=this.tileset.loader,o={...this.tileset.loadOptions,[i.id]:{...this.tileset.loadOptions[i.id],isTileset:this.type==="json",...this._getLoaderSpecificOptions(i.id)}};return this.content=await(0,vy.load)(n,i,o),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=He.READY,this._onContentLoaded(),!0}catch(n){throw this.contentState=He.FAILED,n}finally{r.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=He.UNLOADED,!0}updateVisibility(e,r){if(this._frameNumber===e.frameNumber)return;let n=this.parent,i=n?n._visibilityPlaneMask:Ee.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){let o=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(o)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,i),this._visible=this._visibilityPlaneMask!==Ee.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=r}visibility(e,r){let{cullingVolume:n}=e,{boundingVolume:i}=this;return n.computeVisibilityWithPlaneMask(i,r)}contentVisibility(){return!0}distanceToTile(e){let r=this.boundingVolume;return Math.sqrt(Math.max(r.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth(e){let{camera:r}=e,n=this.boundingVolume;return Ay.subVectors(n.center,r.position),r.direction.dot(Ay)}insideViewerRequestVolume(e){let r=this._viewerRequestVolume;return!r||r.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(WM(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=He.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new k(e.transform):new k;let r=this.parent,n=this.tileset,i=r&&r.computedTransform?r.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new k(i).multiplyRight(this.transform);let o=r&&r._initialTransform?r._initialTransform.clone():new k;this._initialTransform=new k(o).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=He.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Ee.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||ze.REPLACE}_isTileset(){return this.contentUrl.indexOf(".json")!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(e){this.boundingVolume=Aa(e.boundingVolume,this.computedTransform,this.boundingVolume);let r=e.content;r&&(r.boundingVolume&&(this._contentBoundingVolume=Aa(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=Aa(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(){let r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:new k).clone().multiplyRight(this.transform);r.equals(this.computedTransform)||(this.computedTransform=r,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return yy(this.tileset.tileset)}}};var va=class extends Ot{compareDistanceToCamera(e,r){return r._distanceToCamera===0&&e._distanceToCamera===0?r._centerZDepth-e._centerZDepth:r._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,r){if(super.updateTileVisibility(e,r),!e.isVisibleAndInRequestVolume)return;let n=e.children.length>0;if(e.hasTilesetContent&&n){let s=e.children[0];this.updateTileVisibility(s,r),e._visible=s._visible;return}if(this.meetsScreenSpaceErrorEarly(e,r)){e._visible=!1;return}let i=e.refine===ze.REPLACE,o=e._optimChildrenWithinParent===ny.USE_OPTIMIZATION;if(i&&o&&n&&!this.anyChildrenVisible(e,r)){e._visible=!1;return}}meetsScreenSpaceErrorEarly(e,r){let{parent:n}=e;return!n||n.hasTilesetContent||n.refine!==ze.ADD?!1:!this.shouldRefine(e,r,!0)}};var _y=X(On(),1);var _a=class{constructor(){this.frameNumberMap=new Map}register(e,r){let n=this.frameNumberMap.get(e)||new Map,i=n.get(r)||0;n.set(r,i+1),this.frameNumberMap.set(e,n)}deregister(e,r){let n=this.frameNumberMap.get(e);if(!n)return;let i=n.get(r)||1;n.set(r,i-1)}isZero(e,r){var n;return(((n=this.frameNumberMap.get(e))===null||n===void 0?void 0:n.get(r))||0)===0}};var Ql={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},ba=class{constructor(){this._statusMap=void 0,this.pendingTilesRegister=new _a,this._statusMap={}}add(e,r,n,i){if(!this._statusMap[r]){let{frameNumber:o,viewport:{id:s}}=i;this._statusMap[r]={request:e,callback:n,key:r,frameState:i,status:Ql.REQUESTED},this.pendingTilesRegister.register(s,o),e().then(a=>{this._statusMap[r].status=Ql.COMPLETED;let{frameNumber:c,viewport:{id:u}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(u,c),this._statusMap[r].callback(a,i)}).catch(a=>{this._statusMap[r].status=Ql.ERROR;let{frameNumber:c,viewport:{id:u}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(u,c),n(a)})}}update(e,r){if(this._statusMap[e]){let{frameNumber:n,viewport:{id:i}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(i,n);let{frameNumber:o,viewport:{id:s}}=r;this.pendingTilesRegister.register(s,o),this._statusMap[e].frameState=r}}find(e){return this._statusMap[e]}hasPendingTiles(e,r){return!this.pendingTilesRegister.isZero(e,r)}};var xa=class extends Ot{constructor(e){super(e),this._tileManager=void 0,this._tileManager=new ba}traversalFinished(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}shouldRefine(e,r){return e._lodJudge=gy(e,r),e._lodJudge==="DIG"}updateChildTiles(e,r){let n=e.header.children||[],i=e.children,o=e.tileset;for(let s of n){let a=`${s.id}-${r.viewport.id}`,c=i&&i.find(u=>u.id===a);if(c)c&&this.updateTile(c,r);else{let u=()=>this._loadTile(s.id,o);this._tileManager.find(a)?this._tileManager.update(a,r):(o.tileset.nodePages&&(u=()=>o.tileset.nodePagesTile.formTileFromNodePages(s.id)),this._tileManager.add(u,a,f=>this._onTileLoad(f,e,a),r))}}return!1}async _loadTile(e,r){let{loader:n}=r,i=r.getTileUrl(`${r.url}/nodes/${e}`),o={...r.loadOptions,i3s:{...r.loadOptions.i3s,isTileHeader:!0}};return await(0,_y.load)(i,n,o)}_onTileLoad(e,r,n){let i=new jr(r.tileset,e,r,n);r.children.push(i);let o=this._tileManager.find(i.id).frameState;this.updateTile(i,o),this._frameNumber===o.frameNumber&&(this.traversalFinished(o)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(i,o)}};var XM={description:"",ellipsoid:J.WGS84,modelMatrix:new k,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Ta="Tiles In Tileset(s)",$l="Tiles In Memory",by="Tiles In View",xy="Tiles To Render",Ty="Tiles Loaded",ef="Tiles Loading",Ey="Tiles Unloaded",Sy="Failed Tile Loads",wy="Points/Vertices",tf="Tile Memory Use",Wi=class{constructor(e,r){this.options=void 0,this.loadOptions=void 0,this.type=void 0,this.tileset=void 0,this.loader=void 0,this.url=void 0,this.basePath=void 0,this.modelMatrix=void 0,this.ellipsoid=void 0,this.lodMetricType=void 0,this.lodMetricValue=void 0,this.refine=void 0,this.root=null,this.roots={},this.asset={},this.description="",this.properties=void 0,this.extras=null,this.attributions={},this.credits={},this.stats=void 0,this.contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.dynamicScreenSpaceErrorComputedDensity=0,this.maximumMemoryUsage=32,this.gpuMemoryUsageInBytes=0,this._frameNumber=0,this._queryParams={},this._extensionsUsed=[],this._tiles={},this._pendingCount=0,this.selectedTiles=[],this.traverseCounter=0,this.geometricError=0,this.lastUpdatedVieports=null,this._requestedTiles=[],this._emptyTiles=[],this.frameStateData={},this._traverser=void 0,this._cache=new ma,this._requestScheduler=void 0,this.updatePromise=null,this.tilesetInitializationPromise=void 0,this.options={...XM,...r},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||Kt.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Yt({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new Pn({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(e){this.options={...this.options,...e}}getTileUrl(e){if(e.startsWith("data:"))return e;let n=e;return this.queryParams.length&&(n=`${e}${e.includes("?")?"&":"?"}${this.queryParams}`),n}hasExtension(e){return Boolean(this._extensionsUsed.indexOf(e)>-1)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.tilesetInitializationPromise.then(()=>{!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e&&this.doUpdate(e)})}async selectTiles(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return await this.tilesetInitializationPromise,e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise(r=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),r(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}doUpdate(e){if("loadTiles"in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;let r=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=r.length;let n=[];for(let i of r){let o=i.id;this._needTraverse(o)?n.push(o):this.traverseCounter--}for(let i of r){let o=i.id;if(this.roots[o]||(this.roots[o]=this._initializeTileHeaders(this.tileset,null)),!n.includes(o))continue;let s=$0(i,this._frameNumber);this._traverser.traverse(this.roots[o],s,this.options)}}_needTraverse(e){let r=e;return this.options.viewportTraversersMap&&(r=this.options.viewportTraversersMap[e]),r===e}_onTraversalEnd(e){let r=e.viewport.id;this.frameStateData[r]||(this.frameStateData[r]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});let n=this.frameStateData[r],i=Object.values(this._traverser.selectedTiles),[o,s]=ey(i,e,this.options.maximumTilesSelected);n.selectedTiles=o;for(let a of s)a.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(let e in this.frameStateData){let r=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(r.selectedTiles),this._requestedTiles=this._requestedTiles.concat(r._requestedTiles),this._emptyTiles=this._emptyTiles.concat(r._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(let e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,r){if(e.length!==r.length)return!0;let n=new Set(e.map(s=>s.id)),i=new Set(r.map(s=>s.id)),o=e.filter(s=>!i.has(s.id)).length>0;return o=o||r.filter(s=>!n.has(s.id)).length>0,o}_loadTiles(){for(let e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,r)=>e._unloadTile(r))}_updateStats(){let e=0,r=0;for(let n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount?r+=n.content.pointCount:r+=n.content.vertexCount);this.stats.get(by).count=this.selectedTiles.length,this.stats.get(xy).count=e,this.stats.get(wy).count=r}async _initializeTileSet(e){this.type===Re.I3S&&(this.calculateViewPropsI3S(),e.root=await e.root),this.root=this._initializeTileHeaders(e,null),this.type===Re.TILES3D&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===Re.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var e;let r=this.tileset.fullExtent;if(r){let{xmin:i,xmax:o,ymin:s,ymax:a,zmin:c,zmax:u}=r;this.cartographicCenter=new E(i+(o-i)/2,s+(a-s)/2,c+(u-c)/2),this.cartesianCenter=new E,J.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=ql(r,this.cartographicCenter,this.cartesianCenter);return}let n=(e=this.tileset.store)===null||e===void 0?void 0:e.extent;if(n){let[i,o,s,a]=n;this.cartographicCenter=new E(i+(s-i)/2,o+(a-o)/2,0),this.cartesianCenter=new E,J.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=ry(n,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new E,this.zoom=1}calculateViewPropsTiles3D(){let e=this.root,{center:r}=e.boundingVolume;if(!r){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new E,this.zoom=1;return}r[0]!==0||r[1]!==0||r[2]!==0?(this.cartographicCenter=new E,J.WGS84.cartesianToCartographic(r,this.cartographicCenter)):this.cartographicCenter=new E(0,0,-J.WGS84.radii[0]),this.cartesianCenter=r,this.zoom=ty(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(Ta),this.stats.get(ef),this.stats.get($l),this.stats.get(by),this.stats.get(xy),this.stats.get(Ty),this.stats.get(Ey),this.stats.get(Sy),this.stats.get(wy),this.stats.get(tf,"memory")}_initializeTileHeaders(e,r){let n=new jr(this,e.root,r);if(r&&(r.children.push(n),n.depth=r.depth+1),this.type===Re.TILES3D){let o=[];for(o.push(n);o.length>0;){let s=o.pop();this.stats.get(Ta).incrementCount();let a=s.header.children||[];for(let c of a){var i;let u=new jr(this,c,s);if((i=u.contentUrl)!==null&&i!==void 0&&i.includes("?session=")){let f=new URL(u.contentUrl).searchParams.get("session");f&&(this._queryParams.session=f)}s.children.push(u),u.depth=s.depth+1,o.push(u)}}}return n}_initializeTraverser(){let e;switch(this.type){case Re.TILES3D:e=va;break;case Re.I3S:e=xa;break;default:e=Ot}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let r;try{this._onStartTileLoading(),r=await e.loadContent()}catch(n){this._onTileLoadError(e,n instanceof Error?n:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(e,r)}}_onTileLoadError(e,r){this.stats.get(Sy).incrementCount();let n=r.message||r.toString(),i=e.url;console.error(`A 3D tile failed to load: ${e.url} ${n}`),this.options.onTileError(e,n,i)}_onTileLoad(e,r){if(r){if(this.type===Re.I3S){var n,i;let o=((n=this.tileset)===null||n===void 0||(i=n.nodePagesTile)===null||i===void 0?void 0:i.nodesInNodePages)||0;this.stats.get(Ta).reset(),this.stats.get(Ta).addCount(o)}e&&e.content&&K0(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}updateContentTypes(e){if(this.type===Re.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===Re.TILES3D){var r;let{extensionsRemoved:n=[]}=((r=e.content)===null||r===void 0?void 0:r.gltf)||{};n.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),n.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),n.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(ef).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(ef).decrementCount()}_addTileToCache(e){this._cache.add(this,e,r=>r._updateCacheStats(e))}_updateCacheStats(e){this.stats.get(Ty).incrementCount(),this.stats.get($l).incrementCount(),this.gpuMemoryUsageInBytes+=e.gpuMemoryUsageInBytes||0,this.stats.get(tf).count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.gpuMemoryUsageInBytes||0,this.stats.get($l).decrementCount(),this.stats.get(Ey).incrementCount(),this.stats.get(tf).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){let e=[];for(this.root&&e.push(this.root);e.length>0;){let r=e.pop();for(let n of r.children)e.push(n);this._destroyTile(r)}this.root=null}_destroySubtree(e){let r=e,n=[];for(n.push(r);n.length>0;){e=n.pop();for(let i of e.children)n.push(i);e!==r&&this._destroyTile(e)}r.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeTiles3DTileset(e){if(e.queryString){let r=new URLSearchParams(e.queryString),n=Object.fromEntries(r.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0"&&this.asset.version!=="1.1")throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed||[],this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}};var Ea=typeof __VERSION__<"u"?__VERSION__:"latest";var kr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Yk=Object.keys(kr);function rf(t,e,r){Q(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(t,e,r);return n.decode(i)}function By(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}var Cy=typeof __VERSION__<"u"?__VERSION__:"latest";var JM={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},My={name:"Draco",id:"draco",module:"draco",version:Cy,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:JM};function Iy(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Wr(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],c=a&&a.length;for(let u=0;u<c;u+=3){let l=a[u],f=a[u+1],h=a[u+2];e=l<e?l:e,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,o=f>o?f:o,s=h>s?h:s}return[[e,r,n],[i,o,s]]}function nf(t,e,r){let n=Iy(e.value),i=r||Oy(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Oy(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function Py(t,e,r){let n=Fy(e.metadata),i=[],o=qM(e.attributes);for(let s in t){let a=t[s],c=Ry(s,a,o[s]);i.push(c)}if(r){let s=Ry("indices",r);i.push(s)}return{fields:i,metadata:n}}function qM(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function Ry(t,e,r){let n=r?Fy(r.metadata):void 0;return nf(t,e,n)}function Fy(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Ly={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},YM={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},KM=4,Xi=class{constructor(e){this.draco=void 0,this.decoder=void 0,this.metadataQuerier=void 0,this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let h=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(h)}let a=this._getDracoLoaderData(o,i,r),c=this._getMeshData(o,a,r),u=Wr(c.attributes),l=Py(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:u},...c,schema:l}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(e,r,n){let i=this._getTopLevelMetadata(e),o=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(e,r){let n={};for(let i=0;i<e.num_attributes();i++){let o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,r,n){let i=this._getMeshAttributes(r,e,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(e,r,n){let i={};for(let o of Object.values(e.attributes)){let s=this._deduceAttributeName(o,n);o.name=s;let{value:a,size:c}=this._getAttributeValues(r,o);i[s]={value:a,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return i}_getTriangleListIndices(e){let n=e.num_faces()*3,i=n*KM,o=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),$M(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=YM[r.data_type],i=r.num_components,s=e.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=ZM(this.draco,n),u,l=this.draco._malloc(a);try{let f=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,f,c,a,l),u=new n(this.draco.HEAPF32.buffer,l,s).slice()}finally{this.draco._free(l)}return{value:u,size:i}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=e.attribute_type;for(let s in Ly)if(this.draco[s]===i)return Ly[s];let o=r.attributeNameEntry||"name";return e.metadata[o]?e.metadata[o].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(e,i);r[o]=this._getDracoMetadataField(e,o)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let i=QM(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(a=>s.min_value(a))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}};function ZM(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function QM(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function $M(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var eI="1.5.6",tI="1.4.1",of=`https://www.gstatic.com/draco/versioned/decoders/${eI}`,je={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},sf={[je.DECODER]:`${of}/${je.DECODER}`,[je.DECODER_WASM]:`${of}/${je.DECODER_WASM}`,[je.FALLBACK_DECODER]:`${of}/${je.FALLBACK_DECODER}`,[je.ENCODER]:`https://raw.githubusercontent.com/google/draco/${tI}/javascript/${je.ENCODER}`},Ji;async function Dy(t){let e=t.modules||{};return e.draco3d?Ji=Ji||e.draco3d.createDecoderModule({}).then(r=>({draco:r})):Ji=Ji||rI(t),await Ji}async function rI(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await xt(sf[je.FALLBACK_DECODER],"draco",t,je.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await xt(sf[je.DECODER],"draco",t,je.DECODER),await xt(sf[je.DECODER_WASM],"draco",t,je.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await nI(e,r)}function nI(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:i=>n({draco:i})})})}var Sa={...My,parse:iI};async function iI(t,e){let{draco:r}=await Dy(e),n=new Xi(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var oI={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},xe={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},j={...oI,...xe};var af={[xe.DOUBLE]:Float64Array,[xe.FLOAT]:Float32Array,[xe.UNSIGNED_SHORT]:Uint16Array,[xe.UNSIGNED_INT]:Uint32Array,[xe.UNSIGNED_BYTE]:Uint8Array,[xe.BYTE]:Int8Array,[xe.SHORT]:Int16Array,[xe.INT]:Int32Array},sI={DOUBLE:xe.DOUBLE,FLOAT:xe.FLOAT,UNSIGNED_SHORT:xe.UNSIGNED_SHORT,UNSIGNED_INT:xe.UNSIGNED_INT,UNSIGNED_BYTE:xe.UNSIGNED_BYTE,BYTE:xe.BYTE,SHORT:xe.SHORT,INT:xe.INT},cf="Failed to convert GL type",Fe=class{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let r in af)if(af[r]===e)return r;throw new Error(cf)}static fromName(e){let r=sI[e];if(!r)throw new Error(cf);return r}static getArrayType(e){switch(e){case xe.UNSIGNED_SHORT_5_6_5:case xe.UNSIGNED_SHORT_4_4_4_4:case xe.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=af[e];if(!r)throw new Error(cf);return r}}static getByteSize(e){return Fe.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Fe.getArrayType(e))}static createTypedArray(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;i===void 0&&(i=(r.byteLength-n)/Fe.getByteSize(e));let o=Fe.getArrayType(e);return new o(r,n,i)}};function Ny(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}function uf(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],r=t>>11&31,n=t>>5&63,i=t&31;return e[0]=r<<3,e[1]=n<<2,e[2]=i<<3,e}var M5=1/256;var I5=new Cr,O5=new E,R5=new Cr,P5=new Cr,F5=new Uint8Array(1);function Gy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:255;return Mo(t,0,e)/e*2-1}function Uy(t){return t<0?-1:1}function Hy(t,e,r,n){if(Ny(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=Gy(t,r),n.y=Gy(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*Uy(i),n.y=(1-Math.abs(i))*Uy(n.y)}return n.normalize()}function lf(t,e,r){return Hy(t,e,255,r)}function wa(t){return(t%1+1)%1}var zt=class{constructor(e,r){this.json=void 0,this.buffer=void 0,this.featuresLength=0,this._cachedTypedArrays={},this.json=e,this.buffer=r}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j.UNSIGNED_INT,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=this.json[e];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(e,r,n,1,i.byteOffset):i}getPropertyArray(e,r,n){let i=this.json[e];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=Fe.fromName(i.componentType)),this._getTypedArrayFromBinary(e,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(e,r,i)}getProperty(e,r,n,i,o){let s=this.json[e];if(!s)return s;let a=this.getPropertyArray(e,r,n);if(n===1)return a[i];for(let c=0;c<n;++c)o[c]=a[n*i+c];return o}_getTypedArrayFromBinary(e,r,n,i,o){let s=this._cachedTypedArrays,a=s[e];return a||(a=Fe.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+o,i*n),s[e]=a),a}_getTypedArrayFromArray(e,r,n){let i=this._cachedTypedArrays,o=i[e];return o||(o=Fe.createTypedArray(r,n),i[e]=o),o}};var aI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cI={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},uI={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};function Vy(t,e,r,n){let{componentType:i}=t;Q(t.componentType);let o=typeof i=="string"?Fe.fromName(i):i,s=aI[t.type],a=cI[t.type],c=uI[t.type];return r+=t.byteOffset,{values:Fe.createTypedArray(o,e,r,s*n),type:o,size:s,unpacker:a,packer:c}}var Rt=t=>t!==void 0;function zy(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy"),i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?lI(n,r):null}function lI(t,e){let r,n,i,o=t.instancesLength,s=t.classes,a=t.classIds,c=t.parentCounts,u=t.parentIds,l=o;Rt(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,i=getBinaryAccessor(a),a=i.createArrayBufferView(e.buffer,e.byteOffset+a.byteOffset,o));let f;if(Rt(c))for(Rt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),f=new Uint16Array(o),l=0,r=0;r<o;++r)f[r]=l,l+=c[r];Rt(u)&&Rt(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,l));let h=s.length;for(r=0;r<h;++r){let g=s[r].length,A=s[r].instances,_=getBinaryProperties(g,A,e);s[r].instances=combine(_,A)}let d=new Array(h).fill(0),p=new Uint16Array(o);for(r=0;r<o;++r)n=a[r],p[r]=d[n],++d[n];let m={classes:s,classIds:a,classIndexes:p,parentCounts:c,parentIndexes:f,parentIds:u};return dI(m),m}function Ln(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?fI(t,e,r):hI(t,e,r)}function fI(t,e,r){let n=t.classIds,i=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);let u=++marker,l=scratchStack;for(l.length=0,l.push(e);l.length>0;){if(e=l.pop(),c[e]===u)continue;c[e]=u;let f=r(t,e);if(Rt(f))return f;let h=i[e],d=s[e];for(let p=0;p<h;++p){let m=o[d+p];m!==e&&l.push(m)}}return null}function hI(t,e,r){let n=!0;for(;n;){let i=r(t,e);if(Rt(i))return i;let o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}function dI(t){let e=[],n=t.classIds.length;for(let i=0;i<n;++i)jy(t,i,stack)}function jy(t,e,r){let n=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(!Rt(i))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(r.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(e);let c=Rt(n)?n[e]:1,u=Rt(n)?o[e]:e;for(let l=0;l<c;++l){let f=i[u+l];f!==e&&jy(t,f,r)}r.pop(e)}function ke(t){return t!=null}var Ba=(t,e)=>t,pI={HIERARCHY:!0,extensions:!0,extras:!0},Xr=class{constructor(e,r,n){var i;let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.json=void 0,this.binary=void 0,this.featureCount=void 0,this._extensions=void 0,this._properties=void 0,this._binaryProperties=void 0,this._hierarchy=void 0,Q(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=((i=this.json)===null||i===void 0?void 0:i.extensions)||{},this._properties={};for(let s in this.json)pI[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=zy(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,r){if(this._checkBatchId(e),Q(typeof r=="string",r),this._hierarchy){let n=Ln(this._hierarchy,e,(i,o)=>{let s=i.classIds[o];return i.classes[s].name===r});return ke(n)}return!1}isExactClass(e,r){return Q(typeof r=="string",r),this.getExactClassName(e)===r}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let r=this._hierarchy.classIds[e];return this._hierarchy.classes[r].name}}hasProperty(e,r){return this._checkBatchId(e),Q(typeof r=="string",r),ke(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=ke(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,r),r}getProperty(e,r){if(this._checkBatchId(e),Q(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(ke(i))return this._getBinaryProperty(i,e)}let n=this._properties[r];if(ke(n))return Ba(n[e],!0);if(this._hierarchy){let i=this._getHierarchyProperty(e,r);if(ke(i))return i}}setProperty(e,r,n){let i=this.featureCount;if(this._checkBatchId(e),Q(typeof r=="string",r),this._binaryProperties){let s=this._binaryProperties[r];if(s){this._setBinaryProperty(s,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,r,n))return;let o=this._properties[r];ke(o)||(this._properties[r]=new Array(i),o=this._properties[r]),o[e]=Ba(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(e=e||{},e[r]=i)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;Q(this.binary,`Property ${e} requires a batch table binary.`),Q(n.type,`Property ${e} requires a type.`);let i=Vy(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(e,r){if(!this._hierarchy)return!1;let n=Ln(this._hierarchy,e,(i,o)=>{let s=i.classIds[o],a=i.classes[s].instances;return ke(a[r])});return ke(n)}_getPropertyNamesInHierarchy(e,r){Ln(this._hierarchy,e,(n,i)=>{let o=n.classIds[i],s=n.classes[o].instances;for(let a in s)s.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(e,r){return Ln(this._hierarchy,e,(n,i)=>{let o=n.classIds[i],s=n.classes[o],a=n.classIndexes[i],c=s.instances[r];return ke(c)?ke(c.typedArray)?this._getBinaryProperty(c,a):Ba(c[a],!0):null})}_setHierarchyProperty(e,r,n,i){let o=Ln(this._hierarchy,r,(s,a)=>{let c=s.classIds[a],u=s.classes[c],l=s.classIndexes[a],f=u.instances[n];return ke(f)?(Q(a===r,`Inherited property "${n}" is read-only.`),ke(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=Ba(i,!0),!0):!1});return ke(o)}};function pr(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,t.version!==1)throw new Error(`3D Tile Version ${t.version} not supported`);return r}var Dn=4,ky="b3dm tile in legacy format.";function Nn(t,e,r){let n=new DataView(e),i;t.header=t.header||{};let o=n.getUint32(r,!0);r+=Dn;let s=n.getUint32(r,!0);r+=Dn;let a=n.getUint32(r,!0);r+=Dn;let c=n.getUint32(r,!0);return r+=Dn,a>=570425344?(r-=Dn*2,i=o,a=s,c=0,o=0,s=0,console.warn(ky)):c>=570425344&&(r-=Dn,i=a,a=o,c=s,o=0,s=0,console.warn(ky)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=s,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=c,t.header.batchLength=i,r}function Gn(t,e,r,n){return r=mI(t,e,r,n),r=gI(t,e,r,n),r}function mI(t,e,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:o,batchLength:s}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:s||0},i&&i>0){let a=rf(e,r,i);t.featureTableJson=JSON.parse(a)}return r+=i||0,t.featureTableBinary=new Uint8Array(e,r,o),r+=o||0,r}function gI(t,e,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:o}=t.header||{};if(i&&i>0){let s=rf(e,r,i);t.batchTableJson=JSON.parse(s),r+=i,o&&o>0&&(t.batchTableBinary=new Uint8Array(e,r,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=o)}return r}function ff(t,e,r){if(!e&&(!t||!t.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:o=0}=t;if(n&&r){let s=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let c=n[a],l=r.getProperty(c,"dimensions").map(f=>f*255);s[a*3]=l[0],s[a*3+1]=l[1],s[a*3+2]=l[2]}return{type:j.UNSIGNED_BYTE,value:s,size:3,normalized:!0}}if(e&&i){let s=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let c=uf(e[a]);s[a*3]=c[0],s[a*3+1]=c[1],s[a*3+2]=c[2]}return{type:j.UNSIGNED_BYTE,value:s,size:3,normalized:!0}}return e&&e.length===o*3?{type:j.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:j.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var Wy=new E;function Xy(t,e){if(!e)return null;if(t.isOctEncoded16P){let r=new Float32Array((t.pointsLength||0)*3);for(let n=0;n<(t.pointsLength||0);n++)lf(e[n*2],e[n*2+1],Wy),Wy.toArray(r,n*3);return{type:j.FLOAT,size:2,value:r}}return{type:j.FLOAT,size:2,value:e}}function Jy(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,yI(t,e)):{type:j.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function yI(t,e){let r=new E,n=new Float32Array(t.pointCount*3);for(let i=0;i<t.pointCount;i++)r.set(e[i*3],e[i*3+1],e[i*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,i*3);return n}async function qy(t,e,r,n,i){r=pr(t,e,r),r=Nn(t,e,r),r=Gn(t,e,r,n),AI(t);let{featureTable:o,batchTable:s}=vI(t);return await EI(t,o,s,n,i),_I(t,o,n),bI(t,o,s),xI(t,o),r}function AI(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function vI(t){let e=new zt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",j.FLOAT,3);let n=TI(t,e);return{featureTable:e,batchTable:n}}function _I(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions){if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",j.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",j.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",j.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Jy(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function bI(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",j.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",j.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",j.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=ff(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",j.UNSIGNED_BYTE,4))}function xI(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",j.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",j.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=Xy(t,r)}}function TI(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",j.UNSIGNED_SHORT,1),t.batchIds)){let n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:o}=t;r=new Xr(i,o,n)}return r}async function EI(t,e,r,n,i){let o,s,a,c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);let u=e.getExtension("3DTILES_draco_point_compression");if(u){s=u.properties;let f=u.byteOffset,h=u.byteLength;if(!s||!Number.isFinite(f)||!h)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(t.featureTableBinary||[]).slice(f,f+h),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA)}if(!o)return!0;let l={buffer:o,properties:{...s,...a},featureTableProperties:s,batchTableProperties:a,dequantizeInShader:!1};return await SI(t,l,n,i)}async function SI(t,e,r,n){if(!n)return;let i={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete i["3d-tiles"];let o=await Xe(e.buffer,Sa,i,n),s=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,c=o.attributes.NORMAL&&o.attributes.NORMAL.value,u=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,l=s&&o.attributes.POSITION.value.quantization,f=c&&o.attributes.NORMAL.value.quantization;if(l){let d=o.POSITION.data.quantization,p=d.range;t.quantizedVolumeScale=new E(p,p,p),t.quantizedVolumeOffset=new E(d.minValues),t.quantizedRange=(1<<d.quantizationBits)-1,t.isQuantizedDraco=!0}f&&(t.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);let h={};if(e.batchTableProperties)for(let d of Object.keys(e.batchTableProperties))o.attributes[d]&&o.attributes[d].value&&(h[d.toLowerCase()]=o.attributes[d].value);t.attributes={positions:s,colors:ff(t,a,void 0),normals:c,batchIds:u,...h}}var hf={};Oe(hf,{decode:()=>NI,name:()=>DI});function we(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Ca={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ma={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var wI=1.33,Yy=["SCALAR","VEC2","VEC3","VEC4"],BI=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],CI=new Map(BI),MI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},II={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},OI={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Ia(t){return Yy[t-1]||Yy[0]}function Un(t){let e=CI.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Hn(t,e){let r=OI[t.componentType],n=MI[t.type],i=II[t.componentType],o=t.count*n,s=t.count*n*i;we(s>=0&&s<=e.byteLength);let a=Ma[t.componentType],c=Ca[t.type];return{ArrayType:r,length:o,byteLength:s,componentByteSize:a,numberOfComponentsInElement:c}}function qi(t){let{images:e,bufferViews:r}=t;e=e||[],r=r||[];let n=e.map(s=>s.bufferView);r=r.filter(s=>!n.includes(s));let i=r.reduce((s,a)=>s+a.byteLength,0),o=e.reduce((s,a)=>{let{width:c,height:u}=a.image;return s+c*u},0);return i+Math.ceil(4*o*wI)}function Ky(t,e,r){let n=t.bufferViews[r];we(n);let i=n.buffer,o=e[i];we(o);let s=(n.byteOffset||0)+o.byteOffset;return new Uint8Array(o.arrayBuffer,s,n.byteLength)}function Zy(t,e,r){var n,i;let o=typeof r=="number"?(n=t.accessors)===null||n===void 0?void 0:n[r]:r;if(!o)throw new Error(`No gltf accessor ${r}`);let s=(i=t.bufferViews)===null||i===void 0?void 0:i[o.bufferView||0];if(!s)throw new Error(`No gltf buffer view for accessor ${s}`);let{arrayBuffer:a,byteOffset:c}=e[s.buffer],u=(c||0)+(o.byteOffset||0)+(s.byteOffset||0),{ArrayType:l,length:f,componentByteSize:h,numberOfComponentsInElement:d}=Hn(o,s),p=h*d,m=s.byteStride||p;if(typeof s.byteStride>"u"||s.byteStride===p)return new l(a,u,f);let g=new l(f);for(let A=0;A<o.count;A++){let _=new l(a,u+A*m,d);g.set(_,A*d)}return g}function RI(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var ce=class{constructor(e){this.gltf=void 0,this.sourceBuffers=void 0,this.byteLength=void 0,this.gltf={json:e?.json||RI(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(i=>i===e),n=this.getRequiredExtensions().find(i=>i===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(i=>i===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let r=e.buffer,n=this.gltf.buffers[r];we(n);let i=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,e.byteLength)}getTypedArrayForAccessor(e){let r=this.getAccessor(e);return Zy(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),i=this.getBuffer(r.buffer).data,o=r.byteOffset||0;return new Uint8Array(i,o,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let i=e.extensions||{};i[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return we(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return we(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){var r;if((r=this.json.extensions)!==null&&r!==void 0&&r[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(e)||n.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:i,mode:o=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:o}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(i)&&(a.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=Br(e),i=r||n?.mimeType,s={bufferView:this.addBufferView(e),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.byteLength,i=e.byteLength;we(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let o={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=qt(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(o),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Ia(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{size:3},n=this.addBufferView(e),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,r.size));let o={size:r.size,componentType:Un(e),count:Math.round(e.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(o,r))}addTexture(e){let{imageIndex:r}=e,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,r;this.gltf.buffers=[];let n=this.byteLength,i=new ArrayBuffer(n),o=new Uint8Array(i),s=0;for(let a of this.sourceBuffers||[])s=Uc(a,o,s);(e=this.json)!==null&&e!==void 0&&(r=e.buffers)!==null&&r!==void 0&&r[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(e,r){let n=!0;for(;n;){let i=e.indexOf(r);i>-1?e.splice(i,1):n=!1}}_addAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={};for(let n in e){let i=e[n],o=this._getGltfAttributeName(n),s=this.addBinaryBuffer(i.value,i);r[o]=s}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let i=e.subarray(0,r);for(let o of i)n.min.push(o),n.max.push(o);for(let o=r;o<e.length;o+=r)for(let s=0;s<r;s++)n.min[0+s]=Math.min(n.min[0+s],e[o+s]),n.max[0+s]=Math.max(n.max[0+s],e[o+s]);return n}};var Qy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},PI={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},$y={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Yi(t,e){return $y[e]*Qy[t]}function Vn(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=t.getTypedArrayForBufferView(e),o=zn(i,"SCALAR",r,n+1);return o instanceof BigInt64Array||o instanceof BigUint64Array?null:o}function zn(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=Qy[e],o=PI[r],s=$y[r],a=n*i,c=a*s,u=t.buffer,l=t.byteOffset;return l%s!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new o(u,l,a)}function jn(t,e,r){var n,i;let o=`TEXCOORD_${e.texCoord||0}`,s=r.attributes[o],a=t.getTypedArrayForAccessor(s),c=t.gltf.json,u=e.index,l=(n=c.textures)===null||n===void 0||(i=n[u])===null||i===void 0?void 0:i.source;if(typeof l<"u"){var f,h,d;let p=(f=c.images)===null||f===void 0||(h=f[l])===null||h===void 0?void 0:h.mimeType,m=(d=t.gltf.images)===null||d===void 0?void 0:d[l];if(m&&typeof m.width<"u"){let g=[];for(let A=0;A<a.length;A+=2){let _=FI(m,p,a,A,e.channels);g.push(_)}return g}}return[]}function Oa(t,e,r,n,i){if(!(r!=null&&r.length))return;let o=[];for(let l of r){let f=n.findIndex(h=>h===l);f===-1&&(f=n.push(l)-1),o.push(f)}let s=new Uint32Array(o),a=t.gltf.buffers.push({arrayBuffer:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength})-1,c=t.addBufferView(s,a,0),u=t.addAccessor(c,{size:1,componentType:Un(s),count:s.length});i.attributes[e]=u}function FI(t,e,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[0],o={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},s=r[n],a=r[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=LI(s,a,t,c),l=0;for(let f of i){let h=typeof f=="number"?Object.values(o)[f]:o[f],d=u+h.offset,p=di(t);if(p.data.length<=d)throw new Error(`${p.data.length} <= ${d}`);let m=p.data[d];l|=m<<h.shift}return l}function LI(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=r.width,o=wa(t)*(i-1),s=Math.round(o),a=r.height,c=wa(e)*(a-1),u=Math.round(c),l=r.components?r.components:n;return(u*i+s)*l}function Ra(t,e,r,n,i){let o=[];for(let s=0;s<e;s++){let a=r[s],c=r[s+1]-r[s];if(c+a>n)break;let u=a/i,l=c/i;o.push(t.slice(u,u+l))}return o}function Pa(t,e,r){let n=[];for(let i=0;i<e;i++){let o=i*r;n.push(t.slice(o,o+r))}return n}function Fa(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],o=new TextDecoder("utf8"),s=0;for(let a=0;a<t;a++){let c=n[a+1]-n[a];if(c+s<=e.length){let u=e.subarray(s,c+s),l=o.decode(u);i.push(l),s+=c}}return i}return[]}var eA="EXT_mesh_features",DI=eA;async function NI(t,e){let r=new ce(t);GI(r,e)}function GI(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)UI(t,i,e)}function UI(t,e,r){var n,i;if(!(r!=null&&(n=r.gltf)!==null&&n!==void 0&&n.loadBuffers))return;let o=(i=e.extensions)===null||i===void 0?void 0:i[eA],s=o?.featureIds;if(s)for(let c of s){var a;let u;if(typeof c.attribute<"u"){let l=`_FEATURE_ID_${c.attribute}`,f=e.attributes[l];u=t.getTypedArrayForAccessor(f)}else typeof c.texture<"u"&&r!==null&&r!==void 0&&(a=r.gltf)!==null&&a!==void 0&&a.loadImages?u=jn(t,c.texture,e):u=[];c.data=u}}var mf={};Oe(mf,{decode:()=>VI,name:()=>HI});var df="EXT_structural_metadata",HI=df;async function VI(t,e){let r=new ce(t);zI(r,e)}function zI(t,e){var r,n;if(!((r=e.gltf)!==null&&r!==void 0&&r.loadBuffers))return;let i=t.getExtension(df);i&&((n=e.gltf)!==null&&n!==void 0&&n.loadImages&&jI(t,i),kI(t,i))}function jI(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let o of i.primitives)XI(t,r,o,e)}function kI(t,e){let r=e.schema;if(!r)return;let n=r.classes,i=e.propertyTables;if(n&&i)for(let o in n){let s=WI(i,o);s&&qI(t,r,s)}}function WI(t,e){for(let r of t)if(r.class===e)return r;return null}function XI(t,e,r,n){var i;if(!e)return;let o=(i=r.extensions)===null||i===void 0?void 0:i[df],s=o?.propertyTextures;if(s)for(let a of s){let c=e[a];JI(t,c,r,n)}}function JI(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=e.class;for(let s in e.properties){var o;let a=`${i}_${s}`,c=(o=e.properties)===null||o===void 0?void 0:o[s];if(!c)continue;c.data||(c.data=[]);let u=c.data,l=jn(t,c,r);l!==null&&(Oa(t,a,l,u,r),c.data=u,n.dataAttributeNames.push(a))}}function qI(t,e,r){var n;let i=(n=e.classes)===null||n===void 0?void 0:n[r.class];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let a in i.properties){var s;let c=i.properties[a],u=(s=r.properties)===null||s===void 0?void 0:s[a];if(u){let l=YI(t,e,c,o,u);u.data=l}}}function YI(t,e,r,n,i){let o=[],s=i.values,a=t.getTypedArrayForBufferView(s),c=KI(t,r,i,n),u=ZI(t,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{o=QI(r,n,a,c);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{o=Fa(n,a,c,u);break}case"ENUM":{o=$I(e,r,n,a,c);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function KI(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?Vn(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function ZI(t,e,r){return typeof e.stringOffsets<"u"?Vn(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function QI(t,e,r,n){let i=t.array,o=t.count,s=Yi(t.type,t.componentType),a=r.byteLength/s,c;return t.componentType?c=zn(r,t.type,t.componentType,a):c=r,i?n?Ra(c,e,n,r.length,s):o?Pa(c,e,o):[]:c}function $I(t,e,r,n,i){var o;let s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let a=(o=t.enums)===null||o===void 0?void 0:o[s];if(!a)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let c=a.valueType||"UINT16",u=Yi(e.type,c),l=n.byteLength/u,f=zn(n,e.type,c,l);if(f||(f=n),e.array){if(i)return eO({valuesData:f,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:a});let h=e.count;return h?tO(f,r,h,a):[]}return pf(f,0,r,a)}function eO(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:o,enumEntry:s}=t,a=[];for(let c=0;c<r;c++){let u=n[c],l=n[c+1]-n[c];if(l+u>i)break;let f=u/o,h=l/o,d=pf(e,f,h,s);a.push(d)}return a}function tO(t,e,r,n){let i=[];for(let o=0;o<e;o++){let s=r*o,a=pf(t,s,r,n);i.push(a)}return i}function pf(t,e,r,n){let i=[];for(let o=0;o<r;o++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)i.push("");else{let s=t[e+o],a=rO(n,s);a?i.push(a.name):i.push("")}return i}function rO(t,e){for(let r of t.values)if(r.value===e)return r;return null}var gf={};Oe(gf,{decode:()=>iO,name:()=>nO});var tA="EXT_feature_metadata",nO=tA;async function iO(t,e){let r=new ce(t);oO(r,e)}function oO(t,e){var r,n;if(!((r=e.gltf)!==null&&r!==void 0&&r.loadBuffers))return;let i=t.getExtension(tA);i&&((n=e.gltf)!==null&&n!==void 0&&n.loadImages&&sO(t,i),aO(t,i))}function sO(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:i}=e;if(n&&i)for(let o in n){let s=n[o],a=uO(i,o);a&&fO(t,a,s)}}function aO(t,e){let r=e.schema;if(!r)return;let n=r.classes,i=e.featureTables;if(n&&i)for(let o in n){let s=cO(i,o);s&&lO(t,r,s)}}function cO(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function uO(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function lO(t,e,r){var n;if(!r.class)return;let i=(n=e.classes)===null||n===void 0?void 0:n[r.class];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let a in i.properties){var s;let c=i.properties[a],u=(s=r.properties)===null||s===void 0?void 0:s[a];if(u){let l=hO(t,e,c,o,u);u.data=l}}}function fO(t,e,r){let n=e.class;for(let o in r.properties){var i;let s=e==null||(i=e.properties)===null||i===void 0?void 0:i[o];if(s){let a=yO(t,s,n);s.data=a}}}function hO(t,e,r,n,i){let o=[],s=i.bufferView,a=t.getTypedArrayForBufferView(s),c=dO(t,r,i,n),u=pO(t,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?o=Fa(n,a,c,u):mO(r)&&(o=gO(r,n,a,c)),o}function dO(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Vn(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function pO(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?Vn(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function mO(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function gO(t,e,r,n){let i=t.type==="ARRAY",o=t.componentCount,s="SCALAR",a=t.componentType||t.type,c=Yi(s,a),u=r.byteLength/c,l=zn(r,s,a,u);return i?n?Ra(l,e,n,r.length,c):o?Pa(l,e,o):[]:l}function yO(t,e,r){let n=t.gltf.json;if(!n.meshes)return[];let i=[];for(let o of n.meshes)for(let s of o.primitives)AO(t,r,e,i,s);return i}function AO(t,e,r,n,i){let o={channels:r.channels,...r.texture},s=jn(t,o,i);s&&Oa(t,e,s,n,i)}var rA=typeof __VERSION__<"u"?__VERSION__:"latest";var nA=typeof __VERSION__<"u"?__VERSION__:"beta";var La={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},yf;async function vf(t){let e=t.modules||{};return e.basis?e.basis:(yf=yf||vO(t),await yf)}async function vO(t){let e=null,r=null;return[e,r]=await Promise.all([await xt(La.TRANSCODER,"textures",t),await xt(La.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await _O(e,r)}function _O(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,initializeBasis:s}=i;s(),n({BasisFile:o})})})}var Af;async function _f(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(Af=Af||bO(t),await Af)}async function bO(t){let e=null,r=null;return[e,r]=await Promise.all([await xt(La.ENCODER,"textures",t),await xt(La.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await xO(e,r)}function xO(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,KTX2File:s,initializeBasis:a,BasisEncoder:c}=i;a(),n({BasisFile:o,KTX2File:s,BasisEncoder:c})})})}var Jr={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var TO=["","WEBKIT_","MOZ_"],iA={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Da=null;function oA(t){if(!Da){t=t||EO()||void 0,Da=new Set;for(let e of TO)for(let r in iA)if(t&&t.getExtension(`${e}${r}`)){let n=iA[r];Da.add(n)}}return Da}function EO(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var fX=new Uint8Array([0]);var sA,aA,cA,uA,lA,fA,hA,dA;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(sA||(sA={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(aA||(aA={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(cA||(cA={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(uA||(uA={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(lA||(lA={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(fA||(fA={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(hA||(hA={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(dA||(dA={}));var Ze=[171,75,84,88,32,50,48,187,13,10,26,10];function pA(t){let e=new Uint8Array(t);return!(e.byteLength<Ze.length||e[0]!==Ze[0]||e[1]!==Ze[1]||e[2]!==Ze[2]||e[3]!==Ze[3]||e[4]!==Ze[4]||e[5]!==Ze[5]||e[6]!==Ze[6]||e[7]!==Ze[7]||e[8]!==Ze[8]||e[9]!==Ze[9]||e[10]!==Ze[10]||e[11]!==Ze[11])}var SO={etc1:{basisFormat:0,compressed:!0,format:Jr.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Jr.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Jr.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Jr.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Jr.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Jr.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function xf(t,e){if(e.basis.containerFormat==="auto"){if(pA(t)){let n=await _f(e);return mA(n.KTX2File,t,e)}let{BasisFile:r}=await vf(e);return bf(r,t,e)}switch(e.basis.module){case"encoder":let r=await _f(e);switch(e.basis.containerFormat){case"ktx2":return mA(r.KTX2File,t,e);case"basis":default:return bf(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await vf(e);return bf(n,t,e)}}function bf(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),o=[];for(let s=0;s<i;s++){let a=n.getNumLevels(s),c=[];for(let u=0;u<a;u++)c.push(wO(n,s,u,r));o.push(c)}return o}finally{n.close(),n.delete()}}function wO(t,e,r,n){let i=t.getImageWidth(e,r),o=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:a,format:c,basisFormat:u}=gA(n,s),l=t.getImageTranscodedSizeInBytes(e,r,u),f=new Uint8Array(l);if(!t.transcodeImage(f,e,r,u,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:f,compressed:a,format:c,hasAlpha:s}}function mA(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),o=[];for(let s=0;s<i;s++){o.push(BO(n,s,r));break}return[o]}finally{n.close(),n.delete()}}function BO(t,e,r){let{alphaFlag:n,height:i,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:c}=gA(r,n),u=t.getImageTranscodedSizeInBytes(e,0,0,c),l=new Uint8Array(u);if(!t.transcodeImage(l,e,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:i,data:l,compressed:s,levelSize:u,hasAlpha:n,format:a}}function gA(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Na()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),SO[r]}function Na(){let t=oA();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var yA={name:"Basis",id:"basis",module:"textures",version:nA,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Tf={...yA,parse:xf};var kn=!0,AA=1735152710,wf=12,Ga=8,CO=1313821514,MO=5130562,IO=0,OO=0,RO=1;function PO(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function vA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new DataView(t),{magic:i=AA}=r,o=n.getUint32(e,!1);return o===i||o===AA}function _A(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=new DataView(e),o=PO(i,r+0),s=i.getUint32(r+4,kn),a=i.getUint32(r+8,kn);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),r+=wf,t.version){case 1:return FO(t,i,r);case 2:return LO(t,i,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function FO(t,e,r){Q(t.header.byteLength>wf+Ga);let n=e.getUint32(r+0,kn),i=e.getUint32(r+4,kn);return r+=Ga,Q(i===IO),Ef(t,e,r,n),r+=n,r+=Sf(t,e,r,t.header.byteLength),r}function LO(t,e,r,n){return Q(t.header.byteLength>wf+Ga),DO(t,e,r,n),r+t.header.byteLength}function DO(t,e,r,n){for(;r+8<=t.header.byteLength;){let i=e.getUint32(r+0,kn),o=e.getUint32(r+4,kn);switch(r+=Ga,o){case CO:Ef(t,e,r,i);break;case MO:Sf(t,e,r,i);break;case OO:n.strict||Ef(t,e,r,i);break;case RO:n.strict||Sf(t,e,r,i);break;default:break}r+=qt(i,4)}return r}function Ef(t,e,r,n){let i=new Uint8Array(e.buffer,r,n),s=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(s),qt(n,4)}function Sf(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),qt(n,4)}function Bf(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;let n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var Mf={};Oe(Mf,{decode:()=>qO,name:()=>JO});var NO="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",GO="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",UO=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),HO=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),VO={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},zO={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function bA(t,e,r,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"NONE",s=await jO();XO(s,s.exports[zO[i]],t,e,r,n,s.exports[VO[o||"NONE"]])}var Cf;async function jO(){return Cf||(Cf=kO()),Cf}async function kO(){let t=NO;WebAssembly.validate(UO)&&(t=GO,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(WO(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function WO(t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){let i=t.charCodeAt(n);e[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<t.length;++n)e[r++]=e[n]<60?HO[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function XO(t,e,r,n,i,o,s){let a=t.exports.sbrk,c=n+3&-4,u=a(c*i),l=a(o.length),f=new Uint8Array(t.exports.memory.buffer);f.set(o,l);let h=e(u,n,i,l,o.length);if(h===0&&s&&s(u,c,i),r.set(f.subarray(u,u+n*i)),a(u-a(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}var Ua="EXT_meshopt_compression",JO=Ua;async function qO(t,e){var r,n;let i=new ce(t);if(!(e!=null&&(r=e.gltf)!==null&&r!==void 0&&r.decompressMeshes)||!((n=e.gltf)!==null&&n!==void 0&&n.loadBuffers))return;let o=[];for(let s of t.json.bufferViews||[])o.push(YO(i,s));await Promise.all(o),i.removeExtension(Ua)}async function YO(t,e){let r=t.getObjectExtension(e,Ua);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:o,count:s,mode:a,filter:c="NONE",buffer:u}=r,l=t.gltf.buffers[u],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),h=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await bA(h,s,o,f,a,c),t.removeObjectExtension(e,Ua)}}var If={};Oe(If,{name:()=>KO,preprocess:()=>ZO});var Wn="EXT_texture_webp",KO=Wn;function ZO(t,e){let r=new ce(t);if(!Zc("image/webp")){if(r.getRequiredExtensions().includes(Wn))throw new Error(`gltf: Required extension ${Wn} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let o=r.getObjectExtension(i,Wn);o&&(i.source=o.source),r.removeObjectExtension(i,Wn)}r.removeExtension(Wn)}var Of={};Oe(Of,{name:()=>QO,preprocess:()=>$O});var Ha="KHR_texture_basisu",QO=Ha;function $O(t,e){let r=new ce(t),{json:n}=r;for(let i of n.textures||[]){let o=r.getObjectExtension(i,Ha);o&&(i.source=o.source,r.removeObjectExtension(i,Ha))}r.removeExtension(Ha)}var Pf={};Oe(Pf,{decode:()=>i3,encode:()=>o3,name:()=>r3,preprocess:()=>n3});function xA(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let i=Rf(n);e[r]=i}}return e}function Rf(t){let{buffer:e,size:r,count:n}=e3(t);return{value:e,size:r,byteOffset:0,count:n,type:Ia(r),componentType:Un(e)}}function e3(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=t3(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function t3(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var mr="KHR_draco_mesh_compression",r3=mr;function n3(t,e,r){let n=new ce(t);for(let i of TA(n))n.getObjectExtension(i,mr)}async function i3(t,e,r){var n;if(!(e!=null&&(n=e.gltf)!==null&&n!==void 0&&n.decompressMeshes))return;let i=new ce(t),o=[];for(let s of TA(i))i.getObjectExtension(s,mr)&&o.push(s3(i,s,e,r));await Promise.all(o),i.removeExtension(mr)}function o3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new ce(t);for(let n of r.json.meshes||[])a3(n,e),r.addRequiredExtension(mr)}async function s3(t,e,r,n){let i=t.getObjectExtension(e,mr);if(!i)return;let o=t.getTypedArrayForBufferView(i.bufferView),s=xr(o.buffer,o.byteOffset),a={...r};delete a["3d-tiles"];let c=await Xe(s,Sa,a,n),u=xA(c.attributes);for(let[l,f]of Object.entries(u))if(l in e.attributes){let h=e.attributes[l],d=t.getAccessor(h);d!=null&&d.min&&d!==null&&d!==void 0&&d.max&&(f.min=d.min,f.max=d.max)}e.attributes=u,c.indices&&(e.indices=Rf(c.indices)),t.removeObjectExtension(e,mr),c3(e)}function a3(t,e){var r;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=i.DracoWriter.encodeSync({attributes:t}),a=o==null||(r=o.parseSync)===null||r===void 0?void 0:r.call(o,{attributes:t}),c=i._addFauxAttributes(a.attributes),u=i.addBufferView(s);return{primitives:[{attributes:c,mode:n,extensions:{[mr]:{bufferView:u,attributes:c}}}]}}function c3(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*TA(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var Lf={};Oe(Lf,{decode:()=>h3,name:()=>u3});var Ff="KHR_texture_transform",u3=Ff,Va=new E,l3=new ne,f3=new ne;async function h3(t,e){var r;if(!new ce(t).hasExtension(Ff)||!((r=e.gltf)!==null&&r!==void 0&&r.loadBuffers))return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)d3(s,t)}function d3(t,e){var r,n,i;let o=[],s=(r=e.json.materials)===null||r===void 0?void 0:r[t],a=s==null||(n=s.pbrMetallicRoughness)===null||n===void 0?void 0:n.baseColorTexture;a&&Ki(e,t,a,o);let c=s?.emissiveTexture;c&&Ki(e,t,c,o);let u=s?.normalTexture;u&&Ki(e,t,u,o);let l=s?.occlusionTexture;l&&Ki(e,t,l,o);let f=s==null||(i=s.pbrMetallicRoughness)===null||i===void 0?void 0:i.metallicRoughnessTexture;f&&Ki(e,t,f,o)}function Ki(t,e,r,n){let i=p3(r,n);if(!i)return;let o=t.json.meshes||[];for(let s of o)for(let a of s.primitives){let c=a.material;Number.isFinite(c)&&e===c&&m3(t,a,i)}}function p3(t,e){var r;let n=(r=t.extensions)===null||r===void 0?void 0:r[Ff],{texCoord:i=0}=t,{texCoord:o=i}=n;if(!(e.findIndex(a=>{let[c,u]=a;return c===i&&u===o})!==-1)){let a=A3(n);return i!==o&&(t.texCoord=o),e.push([i,o]),{originalTexCoord:i,texCoord:o,matrix:a}}return null}function m3(t,e,r){let{originalTexCoord:n,texCoord:i,matrix:o}=r,s=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(s)){var a;let u=(a=t.json.accessors)===null||a===void 0?void 0:a[s];if(u&&u.bufferView){var c;let l=(c=t.json.bufferViews)===null||c===void 0?void 0:c[u.bufferView];if(l){let{arrayBuffer:f,byteOffset:h}=t.buffers[l.buffer],d=(h||0)+(u.byteOffset||0)+(l.byteOffset||0),{ArrayType:p,length:m}=Hn(u,l),g=Ma[u.componentType],A=Ca[u.type],_=l.byteStride||g*A,v=new Float32Array(m);for(let x=0;x<u.count;x++){let w=new p(f,d+x*_,2);Va.set(w[0],w[1],1),Va.transformByMatrix3(o),v.set([Va[0],Va[1]],x*A)}n===i?g3(u,l,t.buffers,v):y3(i,u,e,t,v)}}}}function g3(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function y3(t,e,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let s=n.json.accessors;s&&(s.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=s.length-1)}function A3(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,i=new ne().set(1,0,0,0,1,0,e[0],e[1],1),o=l3.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),s=f3.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(o).multiplyRight(s)}var Df={};Oe(Df,{decode:()=>_3,encode:()=>b3,name:()=>v3});var qr="KHR_lights_punctual",v3=qr;async function _3(t){let e=new ce(t),{json:r}=e,n=e.getExtension(qr);n&&(e.json.lights=n.lights,e.removeExtension(qr));for(let i of r.nodes||[]){let o=e.getObjectExtension(i,qr);o&&(i.light=o.light),e.removeObjectExtension(i,qr)}}async function b3(t){let e=new ce(t),{json:r}=e;if(r.lights){let n=e.addExtension(qr);we(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let i=n.node;e.addObjectExtension(i,qr,n)}delete e.json.lights}}var Nf={};Oe(Nf,{decode:()=>T3,encode:()=>E3,name:()=>x3});var Zi="KHR_materials_unlit",x3=Zi;async function T3(t){let e=new ce(t),{json:r}=e;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,Zi);e.removeExtension(Zi)}function E3(t){let e=new ce(t),{json:r}=e;if(e.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,Zi,{}),e.addExtension(Zi))}var Gf={};Oe(Gf,{decode:()=>w3,encode:()=>B3,name:()=>S3});var Qi="KHR_techniques_webgl",S3=Qi;async function w3(t){let e=new ce(t),{json:r}=e,n=e.getExtension(Qi);if(n){let i=C3(n,e);for(let o of r.materials||[]){let s=e.getObjectExtension(o,Qi);s&&(o.technique=Object.assign({},s,i[s.technique]),o.technique.values=M3(o.technique,e)),e.removeObjectExtension(o,Qi)}e.removeExtension(Qi)}}async function B3(t,e){}function C3(t,e){let{programs:r=[],shaders:n=[],techniques:i=[]}=t,o=new TextDecoder;return n.forEach(s=>{if(Number.isFinite(s.bufferView))s.code=o.decode(e.getTypedArrayForBufferView(s.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(s=>{s.fragmentShader=n[s.fragmentShader],s.vertexShader=n[s.vertexShader]}),i.forEach(s=>{s.program=r[s.program]}),i}function M3(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.getTexture(r[n].index))}),r}var EA=[mf,hf,Mf,If,Of,Pf,Df,Nf,Gf,Lf,gf];function SA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=EA.filter(o=>BA(o.name,e));for(let o of n){var i;(i=o.preprocess)===null||i===void 0||i.call(o,t,e,r)}}async function wA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=EA.filter(o=>BA(o.name,e));for(let o of n){var i;await((i=o.decode)===null||i===void 0?void 0:i.call(o,t,e,r))}}function BA(t,e){var r;let n=(e==null||(r=e.gltf)===null||r===void 0?void 0:r.excludeExtensions)||{};return!(t in n&&!n[t])}var Uf="KHR_binary_glTF";function CA(t){let e=new ce(t),{json:r}=e;for(let n of r.images||[]){let i=e.getObjectExtension(n,Uf);i&&Object.assign(n,i),e.removeObjectExtension(n,Uf)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(Uf)}var MA={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},O3={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Hf=class{constructor(){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}},this.json=void 0}normalize(e,r){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),CA(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(let r in MA)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!(!n||Array.isArray(n))){e[r]=[];for(let i in n){let o=n[i];o.id=o.id||i;let s=e[r].length;e[r].push(o),this.idToIndexMap[r][i]=s}}}_convertObjectIdsToArrayIndices(e){for(let r in MA)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:i,material:o}=r;for(let s in n)n[s]=this._convertIdToIndex(n[s],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),o&&(r.material=this._convertIdToIndex(o,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),e[r]=[]);for(let n of e[r])for(let i in n){let o=n[i],s=this._convertIdToIndex(o,i);n[i]=s}}_convertIdToIndex(e,r){let n=O3[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][e];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return i}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateMaterial(e){for(let o of e.materials){var r,n,i;o.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let s=((r=o.values)===null||r===void 0?void 0:r.tex)||((n=o.values)===null||n===void 0?void 0:n.texture2d_0)||((i=o.values)===null||i===void 0?void 0:i.diffuseTex),a=e.textures.findIndex(c=>c.id===s);a!==-1&&(o.pbrMetallicRoughness.baseColorTexture={index:a})}}};function IA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Hf().normalize(t,e)}async function OA(t,e){var r,n,i;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return R3(t,e,o,s),IA(t,{normalize:s==null||(r=s.gltf)===null||r===void 0?void 0:r.normalize}),SA(t,s,a),s!=null&&(n=s.gltf)!==null&&n!==void 0&&n.loadBuffers&&t.json.buffers&&await P3(t,s,a),s!=null&&(i=s.gltf)!==null&&i!==void 0&&i.loadImages&&await F3(t,s,a),await wA(t,s,a),t}function R3(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!vA(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Gc(e);else if(e instanceof ArrayBuffer){let s={};r=_A(s,e,r,n.glb),we(s.type==="glTF",`Invalid GLB magic string ${s.type}`),t._glb=s,t.json=s.json}else we(!1,"GLTF: must be ArrayBuffer or string");let i=t.json.buffers||[];if(t.buffers=new Array(i.length).fill(null),t._glb&&t._glb.header.hasBinChunk){let{binChunks:s}=t._glb;t.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}let o=t.json.images||[];t.images=new Array(o.length).fill({})}async function P3(t,e,r){let n=t.json.buffers||[];for(let s=0;s<n.length;++s){let a=n[s];if(a.uri){var i,o;let{fetch:c}=r;we(c);let u=Bf(a.uri,e),l=await(r==null||(i=r.fetch)===null||i===void 0?void 0:i.call(r,u)),f=await(l==null||(o=l.arrayBuffer)===null||o===void 0?void 0:o.call(l));t.buffers[s]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}else t.buffers[s]===null&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function F3(t,e,r){let n=L3(t),i=t.json.images||[],o=[];for(let s of n)o.push(D3(t,i[s],s,e,r));return await Promise.all(o)}function L3(t){let e=new Set,r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function D3(t,e,r,n,i){let o;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=Bf(e.uri,n),{fetch:c}=i;o=await(await c(a)).arrayBuffer(),e.bufferView={data:o}}if(Number.isFinite(e.bufferView)){let a=Ky(t.json,t.buffers,e.bufferView);o=xr(a.buffer,a.byteOffset,a.byteLength)}we(o,"glTF image has no data");let s=await Xe(o,[Zt,Tf],{...n,mimeType:e.mimeType,basis:n.basis||{format:Na()}},i);s&&s[0]&&(s={compressed:!0,mipmaps:!1,width:s[0].width,height:s[0].height,data:s[0]}),t.images=t.images||[],t.images[r]=s}var Yr={name:"glTF",id:"gltf",module:"gltf",version:rA,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:N3,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function N3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;e={...Yr.options,...e},e.gltf={...Yr.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await OA({},t,n,e,r)}var G3={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},U3={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},it={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},H3={magFilter:it.TEXTURE_MAG_FILTER,minFilter:it.TEXTURE_MIN_FILTER,wrapS:it.TEXTURE_WRAP_S,wrapT:it.TEXTURE_WRAP_T},V3={[it.TEXTURE_MAG_FILTER]:it.LINEAR,[it.TEXTURE_MIN_FILTER]:it.NEAREST_MIPMAP_LINEAR,[it.TEXTURE_WRAP_S]:it.REPEAT,[it.TEXTURE_WRAP_T]:it.REPEAT};function z3(){return{id:"default-sampler",parameters:V3}}function j3(t){return U3[t]}function k3(t){return G3[t]}var Vf=class{constructor(){this.baseUri="",this.jsonUnprocessed=void 0,this.json=void 0,this.buffers=[],this.images=[]}postProcess(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{json:n,buffers:i=[],images:o=[]}=e,{baseUri:s=""}=e;return we(n),this.baseUri=s,this.buffers=i,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,r),this.json}_resolveTree(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((i,o)=>this._resolveBufferView(i,o))),e.images&&(n.images=e.images.map((i,o)=>this._resolveImage(i,o))),e.samplers&&(n.samplers=e.samplers.map((i,o)=>this._resolveSampler(i,o))),e.textures&&(n.textures=e.textures.map((i,o)=>this._resolveTexture(i,o))),e.accessors&&(n.accessors=e.accessors.map((i,o)=>this._resolveAccessor(i,o))),e.materials&&(n.materials=e.materials.map((i,o)=>this._resolveMaterial(i,o))),e.meshes&&(n.meshes=e.meshes.map((i,o)=>this._resolveMesh(i,o))),e.nodes&&(n.nodes=e.nodes.map((i,o)=>this._resolveNode(i,o)),n.nodes=n.nodes.map((i,o)=>this._resolveNodeChildren(i))),e.skins&&(n.skins=e.skins.map((i,o)=>this._resolveSkin(i,o))),e.scenes&&(n.scenes=e.scenes.map((i,o)=>this._resolveScene(i,o))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,r){if(typeof r=="object")return r;let n=e&&e[r];return n||console.warn(`glTF file error: Could not find ${e}[${r}]`),n}_resolveScene(e,r){return{...e,id:e.id||`scene-${r}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,r){let n={...e,id:e?.id||`node-${r}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((i,o)=>{let s=this.getMesh(o);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(r=>this.getNode(r))),e}_resolveSkin(e,r){let n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(e,r){let n={...e,id:e.id||`mesh-${r}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(i=>{let o={...i,attributes:{},indices:void 0,material:void 0},s=i.attributes;for(let a in s)o.attributes[a]=this.getAccessor(s[a]);return i.indices!==void 0&&(o.indices=this.getAccessor(i.indices)),i.material!==void 0&&(o.material=this.getMaterial(i.material)),o})),n}_resolveMaterial(e,r){let n={...e,id:e.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,r){let n=j3(e.componentType),i=k3(e.type),o=n*i,s={...e,id:e.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:o,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(s.bufferView=this.getBufferView(e.bufferView)),s.bufferView){let a=s.bufferView.buffer,{ArrayType:c,byteLength:u}=Hn(s,s.bufferView),l=(s.bufferView.byteOffset||0)+(s.byteOffset||0)+a.byteOffset,f=a.arrayBuffer.slice(l,l+u);s.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(a,l,s.bufferView.byteStride,s.bytesPerElement,s.count)),s.value=new c(f)}return s}_getValueFromInterleavedBuffer(e,r,n,i,o){let s=new Uint8Array(o*i);for(let a=0;a<o;a++){let c=r+a*n;s.set(new Uint8Array(e.arrayBuffer.slice(c,c+i)),a*i)}return s.buffer}_resolveTexture(e,r){return{...e,id:e.id||`texture-${r}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):z3(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,r){let n={id:e.id||`sampler-${r}`,...e,parameters:{}};for(let i in n){let o=this._enumSamplerParameter(i);o!==void 0&&(n.parameters[o]=n[i])}return n}_enumSamplerParameter(e){return H3[e]}_resolveImage(e,r){let n={...e,id:e.id||`image-${r}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(e,r){let n=e.buffer,i=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return e.byteOffset&&(o+=e.byteOffset),{id:`bufferView-${r}`,...e,buffer:this.buffers[n],data:new Uint8Array(i,o,e.byteLength)}}_resolveCamera(e,r){let n={...e,id:e.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function $i(t,e){return new Vf().postProcess(t,e)}var za={URI:0,EMBEDDED:1};function ja(t,e,r,n){t.rotateYtoZ=!0;let i=(t.byteOffset||0)+(t.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=xr(e,r,i),t.gltfByteOffset=0,t.gltfByteLength=i,r%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function ka(t,e,r,n){let i=r?.["3d-tiles"]||{};if(W3(t,e,r),i.loadGLTF){if(!n)return;if(t.gltfUrl){let{fetch:o}=n,s=await o(t.gltfUrl,r);t.gltfArrayBuffer=await s.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){let o=await Xe(t.gltfArrayBuffer,Yr,r,n);t.gltf=$i(o),t.gpuMemoryUsageInBytes=qi(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function W3(t,e,r){switch(e){case za.URI:if(t.gltfArrayBuffer){let n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),o=new TextDecoder().decode(n);t.gltfUrl=o.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case za.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function RA(t,e,r,n,i){var o;r=X3(t,e,r,n,i),await ka(t,za.EMBEDDED,n,i);let s=t==null||(o=t.gltf)===null||o===void 0?void 0:o.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function X3(t,e,r,n,i){r=pr(t,e,r),r=Nn(t,e,r),r=Gn(t,e,r,n),r=ja(t,e,r,n);let o=new zt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",j.FLOAT,3),r}async function PA(t,e,r,n,i){return r=J3(t,e,r,n,i),await ka(t,t.gltfFormat||0,n,i),r}function J3(t,e,r,n,i){var o;if(r=pr(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Nn(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Gn(t,e,r,n),r=ja(t,e,r,n),!(t!=null&&(o=t.header)!==null&&o!==void 0&&o.featureTableJsonByteLength)||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let a=new zt(t.featureTableJson,t.featureTableBinary),c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!Number.isFinite(c))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",j.FLOAT,3);let u=new Xr(t.batchTableJson,t.batchTableBinary,c);return q3(t,a,u,c),r}function q3(t,e,r,n){let i=new Array(n),o=new E,s=new E,a=new E,c=new E,u=new ne,l=new Et,f=new E,h={},d=new k,p=[],m=[],g=[],A=[];for(let _=0;_<n;_++){let v;if(e.hasProperty("POSITION"))v=e.getProperty("POSITION",j.FLOAT,3,_,o);else if(e.hasProperty("POSITION_QUANTIZED")){v=e.getProperty("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3,_,o);let y=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",j.FLOAT,3);if(!y)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let M=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",j.FLOAT,3);if(!M)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let P=65535;for(let F=0;F<3;F++)v[F]=v[F]/P*M[F]+y[F]}if(!v)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(v),h.translation=o,t.normalUp=e.getProperty("NORMAL_UP",j.FLOAT,3,_,p),t.normalRight=e.getProperty("NORMAL_RIGHT",j.FLOAT,3,_,m);let x=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",j.UNSIGNED_SHORT,2,_,p),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",j.UNSIGNED_SHORT,2,_,m),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(J.WGS84.eastNorthUpToFixedFrame(o,d),d.getRotationMatrix3(u)):u.identity()}x&&(c.copy(s).cross(a).normalize(),u.setColumn(0,s),u.setColumn(1,a),u.setColumn(2,c)),l.fromMatrix3(u),h.rotation=l,f.set(1,1,1);let w=e.getProperty("SCALE",j.FLOAT,1,_,g);Number.isFinite(w)&&f.multiplyByScalar(w);let S=e.getProperty("SCALE_NON_UNIFORM",j.FLOAT,3,_,p);S&&f.scale(S),h.scale=f;let C=e.getProperty("BATCH_ID",j.UNSIGNED_SHORT,1,_,A);C===void 0&&(C=_);let B=new k().fromQuaternion(h.rotation);d.identity(),d.translate(h.translation),d.multiplyRight(B),d.scale(h.scale);let T=d.clone();i[_]={modelMatrix:T,batchId:C}}t.instances=i}async function FA(t,e,r,n,i,o){r=pr(t,e,r);let s=new DataView(e);for(t.tilesLength=s.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-r>12;){let a={shape:"tile3d"};t.tiles.push(a),r=await o(e,r,n,i,a)}return r}async function LA(t,e,r,n){var i,o;if(t.rotateYtoZ=!0,t.gltfUpAxis=r!=null&&(i=r["3d-tiles"])!==null&&i!==void 0&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r!=null&&(o=r["3d-tiles"])!==null&&o!==void 0&&o.loadGLTF){if(!n)return e.byteLength;let s=await Xe(e,Yr,r,n);t.gltf=$i(s),t.gpuMemoryUsageInBytes=qi(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function zf(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{shape:"tile3d"};switch(i.byteOffset=e,i.type=By(t,e),i.type){case kr.COMPOSITE:return await FA(i,t,e,r,n,zf);case kr.BATCHED_3D_MODEL:return await RA(i,t,e,r,n);case kr.GLTF:return await LA(i,t,r,n);case kr.INSTANCED_3D_MODEL:return await PA(i,t,e,r,n);case kr.POINT_CLOUD:return await qy(i,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function jf(t,e,r){if(new Uint32Array(t.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(t.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let o=DA(t.slice(8,16)),s=new Uint8Array(t,24,o),c=new TextDecoder("utf8").decode(s),u=JSON.parse(c),l=DA(t.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=t.slice(24+o)),await Wa(u,u.tileAvailability,f,r),Array.isArray(u.contentAvailability))for(let h of u.contentAvailability)await Wa(u,h,f,r);else await Wa(u,u.contentAvailability,f,r);return await Wa(u,u.childSubtreeAvailability,f,r),u}async function Wa(t,e,r,n){let i=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof i!="number")return;let o=t.bufferViews[i],s=t.buffers[o.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(s.uri){let a=`${n?.baseUrl||""}/${s.uri}`,u=await(await n.fetch(a)).arrayBuffer();e.explicitBitstream=new Uint8Array(u,o.byteOffset,o.byteLength);return}e.explicitBitstream=new Uint8Array(r,o.byteOffset,o.byteLength)}function DA(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Xa={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Ea,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:jf,options:{}};var dv=X(On(),1);var uv=X(On(),1);function kf(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function gt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||kf()}var Y3=globalThis.self||globalThis.window||globalThis.global,Xn=globalThis.window||globalThis.self||globalThis.global,K3=globalThis.document||{},Kr=globalThis.process||{},Z3=globalThis.console,nq=globalThis.navigator||{};var Ja=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",sq=gt();function Q3(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var qa=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Q3(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function NA(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function GA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function Ya(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let o=t.width*r,s=t.height*r,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}var Ka;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ka||(Ka={}));var $3=10;function UA(t){return typeof t!="string"?t:(t=t.toUpperCase(),Ka[t]||Ka.WHITE)}function HA(t,e,r){if(!gt&&typeof t=="string"){if(e){let n=UA(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=UA(r);t="\x1B[".concat(n+$3,"m").concat(t,"\x1B[49m")}}return t}function VA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),i=t;for(let o of n){let s=i[o];typeof s=="function"&&(e.find(a=>o===a)||(i[o]=s.bind(t)))}}function Jn(t,e){if(!t)throw new Error(e||"Assertion failed")}function Zr(){let t;if(gt()&&Xn.performance){var e,r;t=Xn===null||Xn===void 0||(e=Xn.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in Kr){var n;let i=Kr===null||Kr===void 0||(n=Kr.hrtime)===null||n===void 0?void 0:n.call(Kr);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}var qn={debug:gt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},eR={enabled:!0,level:0};function ot(){}var zA={},jA={once:!0},eo=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ja,this._startTs=Zr(),this._deltaTs=Zr(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new qa("__probe-".concat(this.id,"__"),eR),this.timeStamp("".concat(this.id," started")),VA(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Zr()-this._startTs).toPrecision(10))}getDelta(){return Number((Zr()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){Jn(e,r)}warn(e){return this._getLogFunction(0,e,qn.warn,arguments,jA)}error(e){return this._getLogFunction(0,e,qn.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,qn.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,qn.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,qn.debug||qn.info,arguments,jA)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||ot,n&&[n],{tag:iR(r)}):ot}image(e){let{logLevel:r,priority:n,image:i,message:o="",scale:s=1}=e;return this._shouldLog(r||n)?gt()?nR({image:i,message:o,scale:s}):rR({image:i,message:o,scale:s}):ot}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||ot)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=kA({logLevel:e,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||ot)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=WA(e)}_getLogFunction(e,r,n,i,o){if(this._shouldLog(e)){o=kA({logLevel:e,message:r,args:i,opts:o}),n=n||o.method,Jn(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Zr();let s=o.tag||o.message;if(o.once&&s)if(!zA[s])zA[s]=Zr();else return ot;return r=tR(this.id,o.message,o),n.bind(console,r,...o.args)}return ot}};eo.VERSION=Ja;function WA(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Jn(Number.isFinite(e)&&e>=0),e}function kA(t){let{logLevel:e,message:r}=t;t.logLevel=WA(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let i=typeof t.message;return Jn(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}function tR(t,e,r){if(typeof e=="string"){let n=r.time?GA(NA(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=HA(e,r.color,r.background)}return e}function rR(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),ot}function nR(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let o=new Image;return o.onload=()=>{let s=Ya(o,r,n);console.log(...s)},o.src=e,ot}let i=e.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Ya(e,r,n)),ot;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Ya(o,r,n)),o.src=e.toDataURL(),ot}return ot}function iR(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Wf=new eo({id:"@probe.gl/log"});var st=null;try{st=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function fe(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}fe.prototype.__isLong__;Object.defineProperty(fe.prototype,"__isLong__",{value:!0});function Le(t){return(t&&t.__isLong__)===!0}function XA(t){var e=Math.clz32(t&-t);return t?31-e:e}fe.isLong=Le;var JA={},qA={};function Qr(t,e){var r,n,i;return e?(t>>>=0,(i=0<=t&&t<256)&&(n=qA[t],n)?n:(r=re(t,0,!0),i&&(qA[t]=r),r)):(t|=0,(i=-128<=t&&t<128)&&(n=JA[t],n)?n:(r=re(t,t<0?-1:0,!1),i&&(JA[t]=r),r))}fe.fromInt=Qr;function at(t,e){if(isNaN(t))return e?jt:yt;if(e){if(t<0)return jt;if(t>=QA)return tv}else{if(t<=-KA)return We;if(t+1>=KA)return ev}return t<0?at(-t,e).neg():re(t%Kn|0,t/Kn|0,e)}fe.fromNumber=at;function re(t,e,r){return new fe(t,e,r)}fe.fromBits=re;var Za=Math.pow;function Jf(t,e,r){if(t.length===0)throw Error("empty string");if(typeof e=="number"?(r=e,e=!1):e=!!e,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e?jt:yt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Jf(t.substring(1),e,r).neg();for(var i=at(Za(r,8)),o=yt,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),c=parseInt(t.substring(s,s+a),r);if(a<8){var u=at(Za(r,a));o=o.mul(u).add(at(c))}else o=o.mul(i),o=o.add(at(c))}return o.unsigned=e,o}fe.fromString=Jf;function At(t,e){return typeof t=="number"?at(t,e):typeof t=="string"?Jf(t,e):re(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}fe.fromValue=At;var YA=1<<16,oR=1<<24,Kn=YA*YA,QA=Kn*Kn,KA=QA/2,ZA=Qr(oR),yt=Qr(0);fe.ZERO=yt;var jt=Qr(0,!0);fe.UZERO=jt;var Yn=Qr(1);fe.ONE=Yn;var $A=Qr(1,!0);fe.UONE=$A;var Xf=Qr(-1);fe.NEG_ONE=Xf;var ev=re(-1,2147483647,!1);fe.MAX_VALUE=ev;var tv=re(-1,-1,!0);fe.MAX_UNSIGNED_VALUE=tv;var We=re(0,-2147483648,!1);fe.MIN_VALUE=We;var R=fe.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low};R.toNumber=function(){return this.unsigned?(this.high>>>0)*Kn+(this.low>>>0):this.high*Kn+(this.low>>>0)};R.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(We)){var r=at(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var o=at(Za(e,6),this.unsigned),s=this,a="";;){var c=s.div(o),u=s.sub(c.mul(o)).toInt()>>>0,l=u.toString(e);if(s=c,s.isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}};R.getHighBits=function(){return this.high};R.getHighBitsUnsigned=function(){return this.high>>>0};R.getLowBits=function(){return this.low};R.getLowBitsUnsigned=function(){return this.low>>>0};R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(We)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&!(e&1<<r);r--);return this.high!=0?r+33:r+1};R.isZero=function(){return this.high===0&&this.low===0};R.eqz=R.isZero;R.isNegative=function(){return!this.unsigned&&this.high<0};R.isPositive=function(){return this.unsigned||this.high>=0};R.isOdd=function(){return(this.low&1)===1};R.isEven=function(){return(this.low&1)===0};R.equals=function(e){return Le(e)||(e=At(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};R.eq=R.equals;R.notEquals=function(e){return!this.eq(e)};R.neq=R.notEquals;R.ne=R.notEquals;R.lessThan=function(e){return this.comp(e)<0};R.lt=R.lessThan;R.lessThanOrEqual=function(e){return this.comp(e)<=0};R.lte=R.lessThanOrEqual;R.le=R.lessThanOrEqual;R.greaterThan=function(e){return this.comp(e)>0};R.gt=R.greaterThan;R.greaterThanOrEqual=function(e){return this.comp(e)>=0};R.gte=R.greaterThanOrEqual;R.ge=R.greaterThanOrEqual;R.compare=function(e){if(Le(e)||(e=At(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};R.comp=R.compare;R.negate=function(){return!this.unsigned&&this.eq(We)?We:this.not().add(Yn)};R.neg=R.negate;R.add=function(e){Le(e)||(e=At(e));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,o=this.low&65535,s=e.high>>>16,a=e.high&65535,c=e.low>>>16,u=e.low&65535,l=0,f=0,h=0,d=0;return d+=o+u,h+=d>>>16,d&=65535,h+=i+c,f+=h>>>16,h&=65535,f+=n+a,l+=f>>>16,f&=65535,l+=r+s,l&=65535,re(h<<16|d,l<<16|f,this.unsigned)};R.subtract=function(e){return Le(e)||(e=At(e)),this.add(e.neg())};R.sub=R.subtract;R.multiply=function(e){if(this.isZero())return this;if(Le(e)||(e=At(e)),st){var r=st.mul(this.low,this.high,e.low,e.high);return re(r,st.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?jt:yt;if(this.eq(We))return e.isOdd()?We:yt;if(e.eq(We))return this.isOdd()?We:yt;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(ZA)&&e.lt(ZA))return at(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,o=this.low>>>16,s=this.low&65535,a=e.high>>>16,c=e.high&65535,u=e.low>>>16,l=e.low&65535,f=0,h=0,d=0,p=0;return p+=s*l,d+=p>>>16,p&=65535,d+=o*l,h+=d>>>16,d&=65535,d+=s*u,h+=d>>>16,d&=65535,h+=i*l,f+=h>>>16,h&=65535,h+=o*u,f+=h>>>16,h&=65535,h+=s*c,f+=h>>>16,h&=65535,f+=n*l+i*u+o*c+s*a,f&=65535,re(d<<16|p,f<<16|h,this.unsigned)};R.mul=R.multiply;R.divide=function(e){if(Le(e)||(e=At(e)),e.isZero())throw Error("division by zero");if(st){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?st.div_u:st.div_s)(this.low,this.high,e.low,e.high);return re(r,st.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?jt:yt;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return jt;if(e.gt(this.shru(1)))return $A;o=jt}else{if(this.eq(We)){if(e.eq(Yn)||e.eq(Xf))return We;if(e.eq(We))return Yn;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(yt)?e.isNegative()?Yn:Xf:(i=this.sub(e.mul(n)),o=n.add(i.div(e)),o)}else if(e.eq(We))return this.unsigned?jt:yt;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=yt}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:Za(2,a-48),u=at(n),l=u.mul(e);l.isNegative()||l.gt(i);)n-=c,u=at(n,this.unsigned),l=u.mul(e);u.isZero()&&(u=Yn),o=o.add(u),i=i.sub(l)}return o};R.div=R.divide;R.modulo=function(e){if(Le(e)||(e=At(e)),st){var r=(this.unsigned?st.rem_u:st.rem_s)(this.low,this.high,e.low,e.high);return re(r,st.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};R.mod=R.modulo;R.rem=R.modulo;R.not=function(){return re(~this.low,~this.high,this.unsigned)};R.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};R.clz=R.countLeadingZeros;R.countTrailingZeros=function(){return this.low?XA(this.low):XA(this.high)+32};R.ctz=R.countTrailingZeros;R.and=function(e){return Le(e)||(e=At(e)),re(this.low&e.low,this.high&e.high,this.unsigned)};R.or=function(e){return Le(e)||(e=At(e)),re(this.low|e.low,this.high|e.high,this.unsigned)};R.xor=function(e){return Le(e)||(e=At(e)),re(this.low^e.low,this.high^e.high,this.unsigned)};R.shiftLeft=function(e){return Le(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?re(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):re(0,this.low<<e-32,this.unsigned)};R.shl=R.shiftLeft;R.shiftRight=function(e){return Le(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?re(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):re(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};R.shr=R.shiftRight;R.shiftRightUnsigned=function(e){return Le(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?re(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?re(this.high,0,this.unsigned):re(this.high>>>e-32,0,this.unsigned)};R.shru=R.shiftRightUnsigned;R.shr_u=R.shiftRightUnsigned;R.rotateLeft=function(e){var r;return Le(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?re(this.high,this.low,this.unsigned):e<32?(r=32-e,re(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,re(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};R.rotl=R.rotateLeft;R.rotateRight=function(e){var r;return Le(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?re(this.high,this.low,this.unsigned):e<32?(r=32-e,re(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,re(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};R.rotr=R.rotateRight;R.toSigned=function(){return this.unsigned?re(this.low,this.high,!1):this};R.toUnsigned=function(){return this.unsigned?this:re(this.low,this.high,!0)};R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};R.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};R.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};fe.fromBytes=function(e,r,n){return n?fe.fromBytesLE(e,r):fe.fromBytesBE(e,r)};fe.fromBytesLE=function(e,r){return new fe(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};fe.fromBytesBE=function(e,r){return new fe(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)};var Zn=fe;var sR=16;function to(t){t==="X"&&(t="");let e=t.padEnd(sR,"0");return Zn.fromString(e,!0,16)}function qf(t){if(t.isZero())return"X";let e=t.countTrailingZeros(),r=e%4;e=(e-r)/4;let n=e;e*=4;let o=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-o.length).join("0")+o}function Yf(t,e){let r=aR(t).shiftRightUnsigned(2);return t.add(Zn.fromNumber(2*e+1-4).multiply(r))}function aR(t){return t.and(t.not().add(1))}var cR=3,uR=30,lR=2*uR+1,rv=180/Math.PI;function iv(t){if(t.length===0)throw new Error(`Invalid Hilbert quad key ${t}`);let e=t.split("/"),r=parseInt(e[0],10),n=e[1],i=n.length,o=0,s=[0,0];for(let a=i-1;a>=0;a--){o=i-a;let c=n[a],u=0,l=0;c==="1"?l=1:c==="2"?(u=1,l=1):c==="3"&&(u=1);let f=Math.pow(2,o-1);fR(f,s,u,l),s[0]+=f*u,s[1]+=f*l}if(r%2===1){let a=s[0];s[0]=s[1],s[1]=a}return{face:r,ij:s,level:o}}function ov(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<cR+lR;)e="0"+e;let r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,s=Zn.fromString(n,!0,2).toString(10),a="";if(o!==0)for(a=Zn.fromString(i,!0,2).toString(4);a.length<o;)a="0"+a;return`${s}/${a}`}function Kf(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function nv(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Zf(t){return[nv(t[0]),nv(t[1])]}function Qf(t,e){let[r,n]=e;switch(t){case 0:return[1,r,n];case 1:return[-r,1,n];case 2:return[-r,-n,1];case 3:return[-1,-n,-r];case 4:return[n,-1,-r];case 5:return[n,r,-1];default:throw new Error("Invalid face")}}function $f(t){let[e,r,n]=t,i=Math.atan2(n,Math.sqrt(e*e+r*r));return[Math.atan2(r,e)*rv,i*rv]}function fR(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);let i=e[0];e[0]=e[1],e[1]=i}}function sv(t){let e=Kf(t.ij,t.level,[.5,.5]),r=Zf(e),n=Qf(t.face,r);return $f(n)}var hR=100;function eh(t){let{face:e,ij:r,level:n}=t,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(hR*Math.pow(2,-n))),s=new Float64Array(4*o*2+2),a=0,c=0;for(let u=0;u<4;u++){let l=i[u].slice(0),f=i[u+1],h=(f[0]-l[0])/o,d=(f[1]-l[1])/o;for(let p=0;p<o;p++){l[0]+=h,l[1]+=d;let m=Kf(r,n,l),g=Zf(m),A=Qf(e,g),_=$f(A);Math.abs(_[1])>89.999&&(_[0]=c);let v=_[0]-c;_[0]+=v>180?-360:v<-180?360:0,s[a++]=_[0],s[a++]=_[1],c=_[0]}}return s[a++]=s[0],s[a++]=s[1],s}function Qn(t){let e=dR(t);return iv(e)}function dR(t){if(t.indexOf("/")>0)return t;let e=to(t);return ov(e)}function th(t){let e=Qn(t);return sv(e)}function cv(t){let e;if(t.face===2||t.face===5){let r=null,n=0;for(let i=0;i<4;i++){let o=`${t.face}/${i}`,s=Qn(o),a=eh(s);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=av(r)}else{let r=eh(t);e=av(r)}return e}function av(t){if(t.length%2!==0)throw new Error("Invalid corners");let e=[],r=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),r.push(t[n+1]);return e.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:e[0],east:e[e.length-1],north:r[r.length-1],south:r[0]}}function rh(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,i=Qn(t),o=cv(i),s=o.west,a=o.south,c=o.east,u=o.north,l=[];return l.push(new E(s,u,r)),l.push(new E(c,u,r)),l.push(new E(c,a,r)),l.push(new E(s,a,r)),l.push(new E(s,u,n)),l.push(new E(c,u,n)),l.push(new E(c,a,n)),l.push(new E(s,a,n)),l}function Qa(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=rh(e,r),i=th(e),o=i[0],s=i[1],a=J.WGS84.cartographicToCartesian([o,s,r.maximumHeight]),c=new E(a[0],a[1],a[2]);n.push(c);let u=Si(n);return[...u.center,...u.halfAxes]}var pR=4,mR=8,gR={QUADTREE:pR,OCTREE:mR};function yR(t,e,r){if(t!=null&&t.box){let n=to(t.s2VolumeInfo.token),i=Yf(n,e),o=qf(i),s={...t.s2VolumeInfo};switch(s.token=o,r){case"OCTREE":let u=t.s2VolumeInfo,l=u.maximumHeight-u.minimumHeight,f=l/2,h=u.minimumHeight+l/2;u.minimumHeight=h-f,u.maximumHeight=h+f;break;default:break}return{box:Qa(s),s2VolumeInfo:s}}}async function ih(t){let{implicitOptions:e,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:o,loaderOptions:s}=t,{subtree:a,level:c=0}=t,{subdivisionScheme:u,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:h,subtreesUriTemplate:d,basePath:p}=e,m={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Wf.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),m;let g=c+i.level;if(g>f)return m;let A=gR[u],_=Math.log2(A),v=n&1,x=n>>1&1,w=n>>2&1,S=(A**c-1)/(A-1),C=$r(r.mortonIndex,n,_),B=S+C,T=$r(r.x,v,1),y=$r(r.y,x,1),M=$r(r.z,w,1),P=!1;c>=l&&(P=nh(a.childSubtreeAvailability,C));let F=$r(i.x,T,c*_),I=$r(i.y,y,c*_),N=$r(i.z,M,c*_);if(P){let ee=`${p}/${d}`,oe=$a(ee,g,F,I,N);a=await(0,uv.load)(oe,Xa,s),i.mortonIndex=C,i.x=T,i.y=y,i.z=M,i.level=c,C=0,B=0,T=0,y=0,M=0,c=0}if(!nh(a.tileAvailability,B))return m;nh(a.contentAvailability,B)&&(m.contentUrl=$a(h,g,F,I,N));let V=c+1,Y={mortonIndex:C,x:T,y,z:M};for(let ee=0;ee<A;ee++){let oe=yR(o,ee,u),me=await ih({subtree:a,implicitOptions:e,loaderOptions:s,parentData:Y,childIndex:ee,level:V,globalData:{...i},s2VolumeBox:oe});if(me.contentUrl||me.children.length){let vr=g+1,Wt=AR(me,vr,{childTileX:T,childTileY:y,childTileZ:M},e,o);m.children.push(Wt)}}return m}function nh(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&Wf.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?bR(e,r.explicitBitstream):!1}function AR(t,e,r,n,i){let{basePath:o,refine:s,getRefine:a,lodMetricType:c,getTileType:u,rootLodMetricValue:l,rootBoundingVolume:f}=n,h=t.contentUrl&&t.contentUrl.replace(`${o}/`,""),d=l/2**e,p=i!=null&&i.box?{box:i.box}:f,m=vR(e,p,r);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:a(s),type:u(t),lodMetricType:c,lodMetricValue:d,geometricError:d,transform:t.transform,boundingVolume:m}}function vR(t,e,r){if(e.region){let{childTileX:n,childTileY:i,childTileZ:o}=r,[s,a,c,u,l,f]=e.region,h=2**t,d=(c-s)/h,p=(u-a)/h,m=(f-l)/h,[g,A]=[s+d*n,s+d*(n+1)],[_,v]=[a+p*i,a+p*(i+1)],[x,w]=[l+m*o,l+m*(o+1)];return{region:[g,_,A,v,x,w]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${e}`)}function $r(t,e,r){return(t<<r)+e}function $a(t,e,r,n,i){let o=_R({level:e,x:r,y:n,z:i});return t.replace(/{level}|{x}|{y}|{z}/gi,s=>o[s])}function _R(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function bR(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function sh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(!e)return It.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return It.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return It.SCENEGRAPH;default:return n||It.EMPTY}}function ah(t){switch(t){case"REPLACE":case"replace":return ze.REPLACE;case"ADD":case"add":return ze.ADD;default:return t}}function oh(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(/^[a-z][0-9a-z+.-]*:/i.test(e)){let n=new URL(t,`${e}/`);return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return Kt.resolve(e,t)}function lv(t,e){if(!t)return null;let r;if(t.content){var n;let o=t.content.uri||((n=t.content)===null||n===void 0?void 0:n.url);r=oh(o,e)}return{...t,id:r,contentUrl:r,lodMetricType:Vr.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:sh(t,r),refine:ah(t.refine)}}async function pv(t,e,r){let n=null,i=hv(t.root);i&&t.root?n=await fv(t.root,t,e,i,r):n=lv(t.root,e);let o=[];for(o.push(n);o.length>0;){let s=o.pop()||{},a=s.children||[],c=[];for(let u of a){let l=hv(u),f;l?f=await fv(u,t,e,l,r):f=lv(u,e),f&&(c.push(f),o.push(f))}s.children=c}return n}async function fv(t,e,r,n,i){var o,s,a;let{subdivisionScheme:c,maximumLevel:u,availableLevels:l,subtreeLevels:f,subtrees:{uri:h}}=n,d=$a(h,0,0,0,0),p=oh(d,r),m=await(0,dv.load)(p,Xa,i),g=oh((o=t.content)===null||o===void 0?void 0:o.uri,r),A=e==null||(s=e.root)===null||s===void 0?void 0:s.refine,_=t.geometricError,v=(a=t.boundingVolume.extensions)===null||a===void 0?void 0:a["3DTILES_bounding_volume_S2"];if(v){let C={box:Qa(v),s2VolumeInfo:v};t.boundingVolume=C}let x=t.boundingVolume,w={contentUrlTemplate:g,subtreesUriTemplate:h,subdivisionScheme:c,subtreeLevels:f,maximumLevel:Number.isFinite(l)?l-1:u,refine:A,basePath:r,lodMetricType:Vr.GEOMETRIC_ERROR,rootLodMetricValue:_,rootBoundingVolume:x,getTileType:sh,getRefine:ah};return await xR(t,r,m,w,i)}async function xR(t,e,r,n,i){if(!t)return null;let{children:o,contentUrl:s}=await ih({subtree:r,implicitOptions:n,loaderOptions:i}),a,c=null;return s&&(a=s,c={uri:s.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:Vr.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:sh(t,a),refine:ah(t.refine),content:c||t.content,children:o}}function hv(t){var e;return(t==null||(e=t.extensions)===null||e===void 0?void 0:e["3DTILES_implicit_tiling"])||t?.implicitTiling}var ec={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Ea,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:TR,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function TR(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=e["3d-tiles"]||{},i;return n.isTileset==="auto"?i=r?.url&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?ER(t,e,r):SR(t,e,r)}async function ER(t,e,r){var n;let i=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=wR(o),a=await pv(i,s,e||{});return{...i,shape:"tileset3d",loader:ec,url:o,queryString:r?.queryString||"",basePath:s,root:a||i.root,type:Re.TILES3D,lodMetricType:Vr.GEOMETRIC_ERROR,lodMetricValue:((n=i.root)===null||n===void 0?void 0:n.geometricError)||0}}async function SR(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await zf(t,0,e,r,n.content),n.content}function wR(t){return Kt.dirname(t)}function tc(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tc=function(r){return typeof r}:tc=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},tc(t)}function mv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function $n(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mv(Object(r),!0).forEach(function(n){BR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function BR(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gv(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(n,i)}function CR(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){gv(o,n,i,s,a,"next",c)}function a(c){gv(o,n,i,s,a,"throw",c)}s(void 0)})}}function MR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yv(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function IR(t,e,r){return e&&yv(t.prototype,e),r&&yv(t,r),t}function OR(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ch(t,e)}function ch(t,e){return ch=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ch(t,e)}function RR(t){var e=LR();return function(){var n=rc(t),i;if(e){var o=rc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return PR(this,i)}}function PR(t,e){if(e&&(tc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FR(t)}function FR(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function LR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rc(t){return rc=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},rc(t)}var Av=[0],DR={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:ec,onTilesetLoad:{type:"function",value:function(e){}},onTileLoad:{type:"function",value:function(e){}},onTileUnload:{type:"function",value:function(e){}},onTileError:{type:"function",value:function(e,r,n){}},_getMeshColor:{type:"function",value:function(e){return[255,255,255]}}},nc=function(t){OR(r,t);var e=RR(r);function r(){var i;MR(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){"onTileLoadFail"in this.props&&gr.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}},n.shouldUpdateState=function(o){var s=o.changeFlags;return s.somethingChanged},n.updateState=function(o){var s=o.props,a=o.oldProps,c=o.changeFlags;if(s.data&&s.data!==a.data&&this._loadTileset(s.data),c.viewportChanged){var u=this.state.activeViewports,l=Object.keys(u).length;l&&(this._updateTileset(u),this.state.lastUpdatedViewports=u,this.state.activeViewports={})}if(c.propsChanged){var f=this.state.layerMap;for(var h in f)f[h].needsUpdate=!0}},n.activateViewport=function(o){var s=this.state,a=s.activeViewports,c=s.lastUpdatedViewports;this.internalState.viewport=o,a[o.id]=o;var u=c?.[o.id];(!u||!o.equals(u))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())},n.getPickingInfo=function(o){var s=o.info,a=o.sourceLayer,c=a&&a.props.tile;return s.picked&&(s.object=c),s.sourceTile=c,s},n.filterSubLayer=function(o){var s=o.layer,a=o.viewport,c=s.props,u=c.tile,l=a.id;return u.selected&&u.viewportIds.includes(l)},n._updateAutoHighlight=function(o){var s=o.sourceTile,a=this.state.layerMap[s?.id];a&&a.layer&&a.layer.updateAutoHighlight(o)},n._loadTileset=function(){var i=CR(regeneratorRuntime.mark(function s(a){var c,u,l,f,h,d,p,m;return regeneratorRuntime.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(c=this.props.loadOptions,u=c===void 0?{}:c,l=this.props.loader||this.props.loaders,Array.isArray(l)&&(l=l[0]),f={loadOptions:$n({},u)},h=a,!l.preload){A.next=12;break}return A.next=8,l.preload(a,u);case 8:d=A.sent,d.url&&(h=d.url),d.headers&&(f.loadOptions.fetch=$n($n({},f.loadOptions.fetch),{},{headers:d.headers})),Object.assign(f,d);case 12:return A.next=14,(0,xv.load)(h,l,f.loadOptions);case 14:p=A.sent,m=new Wi(p,$n({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},f)),this.setState({tileset3d:m,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(m);case 19:case"end":return A.stop()}},s,this)}));function o(s){return i.apply(this,arguments)}return o}(),n._onTileLoad=function(o){var s=this.state.lastUpdatedViewports;this.props.onTileLoad(o),this._updateTileset(s),this.setNeedsUpdate()},n._onTileUnload=function(o){delete this.state.layerMap[o.id],this.props.onTileUnload(o)},n._updateTileset=function(o){var s=this;if(o){var a=this.state.tileset3d,c=this.context.timeline,u=Object.keys(o).length;!c||!u||!a||a.selectTiles(Object.values(o)).then(function(l){var f=s.state.frameNumber!==l;f&&s.setState({frameNumber:l})})}},n._getSubLayer=function(o,s){if(!o.content)return null;switch(o.type){case It.POINTCLOUD:return this._makePointCloudLayer(o,s);case It.SCENEGRAPH:return this._make3DModelLayer(o);case It.MESH:return this._makeSimpleMeshLayer(o,s);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(o.content.type))}},n._makePointCloudLayer=function(o,s){var a=o.content,c=a.attributes,u=a.pointCount,l=a.constantRGBA,f=a.cartographicOrigin,h=a.modelMatrix,d=c.positions,p=c.normals,m=c.colors;if(!d)return null;var g=s&&s.props.data||{header:{vertexCount:u},attributes:{POSITION:d,NORMAL:p,COLOR_0:m}},A=this.props,_=A.pointSize,v=A.getPointColor,x=this.getSubLayerClass("pointcloud",_v.PointCloudLayer);return new x({pointSize:_},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(o.id),tile:o,data:g,coordinateSystem:gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:f,modelMatrix:h,getColor:l||v,_offset:0})},n._make3DModelLayer=function(o){var s=o.content,a=s.gltf,c=s.instances,u=s.cartographicOrigin,l=s.modelMatrix,f=this.getSubLayerClass("scenegraph",bv.ScenegraphLayer);return new f({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(o.id),tile:o,data:c||Av,scenegraph:a,coordinateSystem:gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:u,modelMatrix:l,getTransformMatrix:function(d){return d.modelMatrix},getPosition:[0,0,0],_offset:0})},n._makeSimpleMeshLayer=function(o,s){var a=o.content,c=a.attributes,u=a.indices,l=a.modelMatrix,f=a.cartographicOrigin,h=a.coordinateSystem,d=h===void 0?gr.COORDINATE_SYSTEM.METER_OFFSETS:h,p=a.material,m=a.featureIds,g=this.props._getMeshColor,A=s&&s.props.mesh||new vv.Geometry({drawMode:4,attributes:NR(c),indices:u}),_=this.getSubLayerClass("mesh",ua);return new _(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(o.id),tile:o,mesh:A,data:Av,getColor:g(o),pbrMaterial:p,modelMatrix:l,coordinateOrigin:f,coordinateSystem:d,featureIds:m,_offset:0})},n.renderLayers=function(){var o=this,s=this.state,a=s.tileset3d,c=s.layerMap;return a?a.tiles.map(function(u){var l=c[u.id]=c[u.id]||{tile:u},f=l.layer;return u.selected&&(f?l.needsUpdate&&(f=o._getSubLayer(u,f),l.needsUpdate=!1):f=o._getSubLayer(u)),l.layer=f,f}).filter(Boolean):null},IR(r,[{key:"isLoaded",get:function(){var o=this.state.tileset3d;return o!==null&&o.isLoaded()}}]),r}(gr.CompositeLayer);nc.defaultProps=DR;nc.layerName="Tile3DLayer";function NR(t){var e={};return e.positions=$n($n({},t.positions),{},{value:new Float32Array(t.positions.value)}),t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}var lc=X(lt()),mh=X(Is()),Rv=X(lt());var GR=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function uh(t){return t>>1^-(t&1)}function UR(t){let e=0,r={};for(let[n,i]of GR){let o=i===8?t.getFloat64:t.getFloat32;r[n]=o.call(t,e,!0),e+=i}return{header:r,headerEndPosition:e}}function HR(t,e){let r=e,n=3,i=t.getUint32(r,!0),o=new Uint16Array(i*n);r+=Uint32Array.BYTES_PER_ELEMENT;let s=Uint16Array.BYTES_PER_ELEMENT,a=i*s,c=r,u=c+a,l=u+a,f=0,h=0,d=0;for(let p=0;p<i;p++)f+=uh(t.getUint16(c+s*p,!0)),h+=uh(t.getUint16(u+s*p,!0)),d+=uh(t.getUint16(l+s*p,!0)),o[p]=f,o[p+i]=h,o[p+i*2]=d;return r+=a*3,{vertexData:o,vertexDataEndPosition:r}}function ro(t,e,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o;if(n===2?o=new Uint16Array(t,e,r):o=new Uint32Array(t,e,r),!i)return o;let s=0;for(let a=0;a<o.length;++a){let c=o[a];o[a]=s-c,c===0&&++s}return o}function VR(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%s!==0&&(n+=s-n%s);let a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=a*3,u=ro(t.buffer,n,c,s);return n+=c*s,{triangleIndicesEndPosition:n,triangleIndices:u}}function zR(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=ro(t.buffer,n,a,s,!1);n+=a*s;let u=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let l=ro(t.buffer,n,u,s,!1);n+=u*s;let f=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let h=ro(t.buffer,n,f,s,!1);n+=f*s;let d=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let p=ro(t.buffer,n,d,s,!1);return n+=d*s,{edgeIndicesEndPosition:n,westIndices:c,southIndices:l,eastIndices:h,northIndices:p}}function jR(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function kR(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function WR(t,e){let r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};let n=e;for(;n<t.byteLength;){let i=t.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;let o=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let s=new DataView(t.buffer,n,o);switch(i){case 1:{r.vertexNormals=jR(s);break}case 2:{r.waterMask=kR(s);break}default:}n+=o}return{extensions:r,extensionsEndPosition:n}}var en={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},XR={maxDecodingStep:en.extensions};function lh(t,e){let r=Object.assign({},XR,e),n=new DataView(t),{header:i,headerEndPosition:o}=UR(n);if(r.maxDecodingStep<en.vertices)return{header:i};let{vertexData:s,vertexDataEndPosition:a}=HR(n,o);if(r.maxDecodingStep<en.triangleIndices)return{header:i,vertexData:s};let{triangleIndices:c,triangleIndicesEndPosition:u}=VR(n,s,a);if(r.maxDecodingStep<en.edgeIndices)return{header:i,vertexData:s,triangleIndices:c};let{westIndices:l,southIndices:f,eastIndices:h,northIndices:d,edgeIndicesEndPosition:p}=zR(n,s,u);if(r.maxDecodingStep<en.extensions)return{header:i,vertexData:s,triangleIndices:c,westIndices:l,northIndices:d,eastIndices:h,southIndices:f};let{extensions:m}=WR(n,p);return{header:i,vertexData:s,triangleIndices:c,westIndices:l,northIndices:d,eastIndices:h,southIndices:f,extensions:m}}function ic(t,e,r,n){let i=n?qR(n,t.POSITION.value):JR(e),o=new t.POSITION.value.constructor(i.length*6),s=new t.TEXCOORD_0.value.constructor(i.length*4),a=new e.constructor(i.length*6);for(let u=0;u<i.length;u++){let l=i[u];YR({edge:l,edgeIndex:u,attributes:t,skirtHeight:r,newPosition:o,newTexcoord0:s,newTriangles:a})}t.POSITION.value=ci(t.POSITION.value,o),t.TEXCOORD_0.value=ci(t.TEXCOORD_0.value,s);let c=e instanceof Array?e.concat(a):ci(e,a);return{attributes:t,triangles:c}}function JR(t){let e=[];for(let s=0;s<t.length;s+=3)e.push([t[s],t[s+1]]),e.push([t[s+1],t[s+2]]),e.push([t[s+2],t[s]]);e.sort((s,a)=>Math.min(...s)-Math.min(...a)||Math.max(...s)-Math.max(...a));let r=[],n=0;for(;n<e.length;){var i,o;e[n][0]===((i=e[n+1])===null||i===void 0?void 0:i[1])&&e[n][1]===((o=e[n+1])===null||o===void 0?void 0:o[0])?n+=2:(r.push(e[n]),n++)}return r}function qR(t,e){t.westIndices.sort((n,i)=>e[3*n+1]-e[3*i+1]),t.eastIndices.sort((n,i)=>e[3*i+1]-e[3*n+1]),t.southIndices.sort((n,i)=>e[3*i]-e[3*n]),t.northIndices.sort((n,i)=>e[3*n]-e[3*i]);let r=[];for(let n in t){let i=t[n];for(let o=0;o<i.length-1;o++)r.push([i[o],i[o+1]])}return r}function YR(t){let{edge:e,edgeIndex:r,attributes:n,skirtHeight:i,newPosition:o,newTexcoord0:s,newTriangles:a}=t,c=n.POSITION.value.length,u=r*2,l=r*2+1;o.set(n.POSITION.value.subarray(e[0]*3,e[0]*3+3),u*3),o[u*3+2]=o[u*3+2]-i,o.set(n.POSITION.value.subarray(e[1]*3,e[1]*3+3),l*3),o[l*3+2]=o[l*3+2]-i,s.set(n.TEXCOORD_0.value.subarray(e[0]*2,e[0]*2+2),u*2),s.set(n.TEXCOORD_0.value.subarray(e[1]*2,e[1]*2+2),l*2);let f=r*2*3;a[f]=e[0],a[f+1]=c/3+l,a[f+2]=e[1],a[f+3]=c/3+l,a[f+4]=e[0],a[f+5]=c/3+u}function fh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{bounds:r}=e,{header:n,vertexData:i,triangleIndices:o,westIndices:s,northIndices:a,eastIndices:c,southIndices:u}=lh(t,en.triangleIndices),l=o,f=KR(i,n,r),h=Wr(f);if(e!=null&&e.skirtHeight){let{attributes:d,triangles:p}=ic(f,l,e.skirtHeight,{westIndices:s,northIndices:a,eastIndices:c,southIndices:u});f=d,l=p}return{loaderData:{header:{}},header:{vertexCount:l.length,boundingBox:h},schema:void 0,topology:"triangle-list",mode:4,indices:{value:l,size:1},attributes:f}}function KR(t,e,r){let{minHeight:n,maxHeight:i}=e,[o,s,a,c]=r||[0,0,1,1],u=a-o,l=c-s,f=i-n,h=t.length/3,d=new Float32Array(h*3),p=new Float32Array(h*2);for(let m=0;m<h;m++){let g=t[m]/32767,A=t[m+h]/32767,_=t[m+h*2]/32767;d[3*m+0]=g*u+o,d[3*m+1]=A*l+s,d[3*m+2]=_*f+n,p[2*m+0]=g,p[2*m+1]=A}return{POSITION:{value:d,size:3},TEXCOORD_0:{value:p,size:2}}}var no=class{constructor(e=257){this.gridSize=e;let r=e-1;if(r&r-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=r*r*2-2,this.numParentTriangles=this.numTriangles-r*r,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,o=0,s=0,a=0,c=0,u=0,l=0;for(i&1?a=c=u=r:o=s=l=r;(i>>=1)>1;){let h=o+a>>1,d=s+c>>1;i&1?(a=o,c=s,o=u,s=l):(o=a,s=c,a=u,c=l),u=h,l=d}let f=n*4;this.coords[f+0]=o,this.coords[f+1]=s,this.coords[f+2]=a,this.coords[f+3]=c}}createTile(e){return new hh(e,this)}},hh=class{constructor(e,r){let n=r.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=r,this.errors=new Float32Array(e.length),this.update()}update(){let{numTriangles:e,numParentTriangles:r,coords:n,gridSize:i}=this.martini,{terrain:o,errors:s}=this;for(let a=e-1;a>=0;a--){let c=a*4,u=n[c+0],l=n[c+1],f=n[c+2],h=n[c+3],d=u+f>>1,p=l+h>>1,m=d+p-l,g=p+u-d,A=(o[l*i+u]+o[h*i+f])/2,_=p*i+d,v=Math.abs(A-o[_]);if(s[_]=Math.max(s[_],v),a<r){let x=(l+g>>1)*i+(u+m>>1),w=(h+g>>1)*i+(f+m>>1);s[_]=Math.max(s[_],s[x],s[w])}}}getMesh(e=0){let{gridSize:r,indices:n}=this.martini,{errors:i}=this,o=0,s=0,a=r-1;n.fill(0);function c(d,p,m,g,A,_){let v=d+m>>1,x=p+g>>1;Math.abs(d-A)+Math.abs(p-_)>1&&i[x*r+v]>e?(c(A,_,d,p,v,x),c(m,g,A,_,v,x)):(n[p*r+d]=n[p*r+d]||++o,n[g*r+m]=n[g*r+m]||++o,n[_*r+A]=n[_*r+A]||++o,s++)}c(0,0,a,a,a,0),c(a,a,0,0,0,a);let u=new Uint16Array(o*2),l=new Uint32Array(s*3),f=0;function h(d,p,m,g,A,_){let v=d+m>>1,x=p+g>>1;if(Math.abs(d-A)+Math.abs(p-_)>1&&i[x*r+v]>e)h(A,_,d,p,v,x),h(m,g,A,_,v,x);else{let w=n[p*r+d]-1,S=n[g*r+m]-1,C=n[_*r+A]-1;u[2*w]=d,u[2*w+1]=p,u[2*S]=m,u[2*S+1]=g,u[2*C]=A,u[2*C+1]=_,l[f++]=w,l[f++]=S,l[f++]=C}}return h(0,0,a,a,a,0),h(a,a,0,0,0,a),{vertices:u,triangles:l}}};var io=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;this.data=e,this.width=r,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;let i=r-1,o=n-1,s=this._addPoint(0,0),a=this._addPoint(i,0),c=this._addPoint(0,o),u=this._addPoint(i,o),l=this._addTriangle(u,s,c,-1,-1,-1);this._addTriangle(s,u,a,l,-1,-1),this._flush()}run(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;for(;this.getMaxError()>e;)this.refine()}refine(){this._step(),this._flush()}getMaxError(){return this._errors[0]}getRMSD(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}heightAt(e,r){return this.data[this.width*r+e]}_flush(){let e=this.coords;for(let r=0;r<this._pendingLen;r++){let n=this._pending[r],i=2*this.triangles[n*3+0],o=2*this.triangles[n*3+1],s=2*this.triangles[n*3+2];this._findCandidate(e[i],e[i+1],e[o],e[o+1],e[s],e[s+1],n)}this._pendingLen=0}_findCandidate(e,r,n,i,o,s,a){let c=Math.min(e,n,o),u=Math.min(r,i,s),l=Math.max(e,n,o),f=Math.max(r,i,s),h=tn(n,i,o,s,c,u),d=tn(o,s,e,r,c,u),p=tn(e,r,n,i,c,u),m=i-r,g=e-n,A=s-i,_=n-o,v=r-s,x=o-e,w=tn(e,r,n,i,o,s),S=this.heightAt(e,r)/w,C=this.heightAt(n,i)/w,B=this.heightAt(o,s)/w,T=0,y=0,M=0,P=0;for(let F=u;F<=f;F++){let I=0;h<0&&A!==0&&(I=Math.max(I,Math.floor(-h/A))),d<0&&v!==0&&(I=Math.max(I,Math.floor(-d/v))),p<0&&m!==0&&(I=Math.max(I,Math.floor(-p/m)));let N=h+A*I,q=d+v*I,U=p+m*I,V=!1;for(let Y=c+I;Y<=l;Y++){if(N>=0&&q>=0&&U>=0){V=!0;let ee=S*N+C*q+B*U,oe=Math.abs(ee-this.heightAt(Y,F));P+=oe*oe,oe>T&&(T=oe,y=Y,M=F)}else if(V)break;N+=A,q+=v,U+=m}h+=_,d+=x,p+=g}(y===e&&M===r||y===n&&M===i||y===o&&M===s)&&(T=0),this._candidates[2*a]=y,this._candidates[2*a+1]=M,this._rms[a]=P,this._queuePush(a,T,P)}_step(){let e=this._queuePop(),r=e*3+0,n=e*3+1,i=e*3+2,o=this.triangles[r],s=this.triangles[n],a=this.triangles[i],c=this.coords[2*o],u=this.coords[2*o+1],l=this.coords[2*s],f=this.coords[2*s+1],h=this.coords[2*a],d=this.coords[2*a+1],p=this._candidates[2*e],m=this._candidates[2*e+1],g=this._addPoint(p,m);if(tn(c,u,l,f,p,m)===0)this._handleCollinear(g,r);else if(tn(l,f,h,d,p,m)===0)this._handleCollinear(g,n);else if(tn(h,d,c,u,p,m)===0)this._handleCollinear(g,i);else{let A=this._halfedges[r],_=this._halfedges[n],v=this._halfedges[i],x=this._addTriangle(o,s,g,A,-1,-1,r),w=this._addTriangle(s,a,g,_,-1,x+1),S=this._addTriangle(a,o,g,v,x+2,w+1);this._legalize(x),this._legalize(w),this._legalize(S)}}_addPoint(e,r){let n=this.coords.length>>1;return this.coords.push(e,r),n}_addTriangle(e,r,n,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,c=a/3;return this.triangles[a+0]=e,this.triangles[a+1]=r,this.triangles[a+2]=n,this._halfedges[a+0]=i,this._halfedges[a+1]=o,this._halfedges[a+2]=s,i>=0&&(this._halfedges[i]=a+0),o>=0&&(this._halfedges[o]=a+1),s>=0&&(this._halfedges[s]=a+2),this._candidates[2*c+0]=0,this._candidates[2*c+1]=0,this._queueIndices[c]=-1,this._rms[c]=0,this._pending[this._pendingLen++]=c,a}_legalize(e){let r=this._halfedges[e];if(r<0)return;let n=e-e%3,i=r-r%3,o=n+(e+1)%3,s=n+(e+2)%3,a=i+(r+2)%3,c=i+(r+1)%3,u=this.triangles[s],l=this.triangles[e],f=this.triangles[o],h=this.triangles[a],d=this.coords;if(!ZR(d[2*u],d[2*u+1],d[2*l],d[2*l+1],d[2*f],d[2*f+1],d[2*h],d[2*h+1]))return;let p=this._halfedges[o],m=this._halfedges[s],g=this._halfedges[a],A=this._halfedges[c];this._queueRemove(n/3),this._queueRemove(i/3);let _=this._addTriangle(u,h,f,-1,g,p,n),v=this._addTriangle(h,u,l,_,m,A,i);this._legalize(_+1),this._legalize(v+2)}_handleCollinear(e,r){let n=r-r%3,i=n+(r+1)%3,o=n+(r+2)%3,s=this.triangles[o],a=this.triangles[r],c=this.triangles[i],u=this._halfedges[i],l=this._halfedges[o],f=this._halfedges[r];if(f<0){let S=this._addTriangle(e,s,a,-1,l,-1,n),C=this._addTriangle(s,e,c,S,-1,u);this._legalize(S+1),this._legalize(C+2);return}let h=f-f%3,d=h+(f+2)%3,p=h+(f+1)%3,m=this.triangles[d],g=this._halfedges[d],A=this._halfedges[p];this._queueRemove(h/3);let _=this._addTriangle(s,a,e,l,-1,-1,n),v=this._addTriangle(a,m,e,A,-1,_+1,h),x=this._addTriangle(m,c,e,g,-1,v+1),w=this._addTriangle(c,s,e,u,_+2,x+1);this._legalize(_),this._legalize(v),this._legalize(x),this._legalize(w)}_queuePush(e,r,n){let i=this._queue.length;this._queueIndices[e]=i,this._queue.push(e),this._errors.push(r),this._rmsSum+=n,this._queueUp(i)}_queuePop(){let e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}_queuePopBack(){let e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}_queueRemove(e){let r=this._queueIndices[e];if(r<0){let i=this._pending.indexOf(e);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}let n=this._queue.length-1;n!==r&&(this._queueSwap(r,n),this._queueDown(r,n)||this._queueUp(r)),this._queuePopBack()}_queueLess(e,r){return this._errors[e]>this._errors[r]}_queueSwap(e,r){let n=this._queue[e],i=this._queue[r];this._queue[e]=i,this._queue[r]=n,this._queueIndices[n]=r,this._queueIndices[i]=e;let o=this._errors[e];this._errors[e]=this._errors[r],this._errors[r]=o}_queueUp(e){let r=e;for(;;){let n=r-1>>1;if(n===r||!this._queueLess(r,n))break;this._queueSwap(n,r),r=n}}_queueDown(e,r){let n=e;for(;;){let i=2*n+1;if(i>=r||i<0)break;let o=i+1,s=i;if(o<r&&this._queueLess(o,i)&&(s=o),!this._queueLess(s,n))break;this._queueSwap(n,s),n=s}return n>e}};function tn(t,e,r,n,i,o){return(r-i)*(e-o)-(n-o)*(t-i)}function ZR(t,e,r,n,i,o,s,a){let c=t-s,u=e-a,l=r-s,f=n-a,h=i-s,d=o-a,p=c*c+u*u,m=l*l+f*f,g=h*h+d*d;return c*(f*g-m*d)-u*(l*g-m*h)+p*(l*d-f*h)<0}function Sv(t,e){let{meshMaxError:r,bounds:n,elevationDecoder:i}=e,{data:o,width:s,height:a}=t,c,u;switch(e.tesselator){case"martini":c=oc(o,s,a,i,e.tesselator),u=Tv(r,s,c);break;case"delatin":c=oc(o,s,a,i,e.tesselator),u=Ev(r,s,a,c);break;default:s===a&&!(a&s-1)?(c=oc(o,s,a,i,"martini"),u=Tv(r,s,c)):(c=oc(o,s,a,i,"delatin"),u=Ev(r,s,a,c));break}let{vertices:l}=u,{triangles:f}=u,h=QR(l,c,s,a,n),d=Wr(h);if(e.skirtHeight){let{attributes:p,triangles:m}=ic(h,f,e.skirtHeight);h=p,f=m}return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:d},mode:4,indices:{value:Uint32Array.from(f),size:1},attributes:h}}function Tv(t,e,r){let n=e+1,o=new no(n).createTile(r),{vertices:s,triangles:a}=o.getMesh(t);return{vertices:s,triangles:a}}function Ev(t,e,r,n){let i=new io(n,e+1,r+1);i.run(t);let{coords:o,triangles:s}=i;return{vertices:o,triangles:s}}function oc(t,e,r,n,i){let{rScaler:o,bScaler:s,gScaler:a,offset:c}=n,u=new Float32Array((e+1)*(r+1));for(let l=0,f=0;f<r;f++)for(let h=0;h<e;h++,l++){let d=l*4,p=t[d+0],m=t[d+1],g=t[d+2];u[l+f]=p*o+m*a+g*s+c}if(i==="martini"){for(let l=(e+1)*e,f=0;f<e;f++,l++)u[l]=u[l-e-1];for(let l=r,f=0;f<r+1;f++,l+=r+1)u[l]=u[l-1]}return u}function QR(t,e,r,n,i){let o=r+1,s=t.length/2,a=new Float32Array(s*3),c=new Float32Array(s*2),[u,l,f,h]=i||[0,0,r,n],d=(f-u)/r,p=(h-l)/n;for(let m=0;m<s;m++){let g=t[m*2],A=t[m*2+1],_=A*o+g;a[3*m+0]=g*d+u,a[3*m+1]=-A*p+h,a[3*m+2]=e[_],c[2*m+0]=g/r,c[2*m+1]=A/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}var sc=typeof __VERSION__<"u"?__VERSION__:"latest";var ac={name:"Terrain",id:"terrain",module:"terrain",version:sc,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};var wv={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:sc,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};var $R={...ac,parse:eP};async function eP(t,e,r){let n={...e,mimeType:"application/x.image",image:{...e?.image,type:"data"}},i=await Xe(t,[],n,r),o={...$R.options.terrain,...e?.terrain};return Sv(i,o)}var rY={...wv,parseSync:(t,e)=>fh(t,e?.["quantized-mesh"]),parse:async(t,e)=>fh(t,e?.["quantized-mesh"])};function cc(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cc=function(r){return typeof r}:cc=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},cc(t)}function Bv(t){return nP(t)||rP(t)||Ov(t)||tP()}function tP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
176
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rP(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function nP(t){if(Array.isArray(t))return dh(t)}function iP(t,e){return aP(t)||sP(t,e)||Ov(t,e)||oP()}function oP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
177
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ov(t,e){if(t){if(typeof t=="string")return dh(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dh(t,e)}}function dh(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sP(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function aP(t){if(Array.isArray(t))return t}function cP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uP(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ph(t,e)}function ph(t,e){return ph=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ph(t,e)}function lP(t){var e=dP();return function(){var n=uc(t),i;if(e){var o=uc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fP(this,i)}}function fP(t,e){if(e&&(cc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hP(t)}function hP(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uc(t){return uc=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},uc(t)}function Cv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cv(Object(r),!0).forEach(function(n){pP(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pP(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Mv=[1],mP=yr(yr({},Ut.defaultProps),{},{elevationData:ir,texture:yr(yr({},ir),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[ac]});function Iv(t){return Array.isArray(t)?t.join(";"):t||""}var fc=function(t){uP(r,t);var e=lP(r);function r(){var i;cP(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.updateState=function(o){var s=o.props,a=o.oldProps,c=s.elevationData!==a.elevationData;if(c){var u=s.elevationData,l=u&&(Array.isArray(u)||u.includes("{x}")&&u.includes("{y}"));this.setState({isTiled:l})}var f=c||s.meshMaxError!==a.meshMaxError||s.elevationDecoder!==a.elevationDecoder||s.bounds!==a.bounds;if(!this.state.isTiled&&f){var h=this.loadTerrain(s);this.setState({terrain:h})}s.workerUrl&&lc.log.removed("workerUrl","loadOptions.terrain.workerUrl")()},n.loadTerrain=function(o){var s,a=o.elevationData,c=o.bounds,u=o.elevationDecoder,l=o.meshMaxError,f=o.signal;if(!a)return null;var h=this.getLoadOptions();h=yr(yr({},h),{},{terrain:yr(yr({skirtHeight:this.state.isTiled?l*2:0},(s=h)===null||s===void 0?void 0:s.terrain),{},{bounds:c,meshMaxError:l,elevationDecoder:u})});var d=this.props.fetch;return d(a,{propName:"elevationData",layer:this,loadOptions:h,signal:f})},n.getTiledTerrainData=function(o){var s=this.props,a=s.elevationData,c=s.fetch,u=s.texture,l=s.elevationDecoder,f=s.meshMaxError,h=this.context.viewport,d=wt(a,o),p=u&&wt(u,o),m=o.signal,g=[0,0],A=[0,0];if(h.isGeospatial){var _=o.bbox;g=h.projectFlat([_.west,_.south]),A=h.projectFlat([_.east,_.north])}else{var v=o.bbox;g=[v.left,v.bottom],A=[v.right,v.top]}var x=[g[0],g[1],A[0],A[1]],w=this.loadTerrain({elevationData:d,bounds:x,elevationDecoder:l,meshMaxError:f,signal:m}),S=p?c(p,{propName:"texture",layer:this,loaders:[],signal:m}).catch(function(C){return null}):Promise.resolve(null);return Promise.all([w,S])},n.renderSubLayers=function(o){var s=this.getSubLayerClass("mesh",mh.SimpleMeshLayer),a=this.props,c=a.color,u=a.wireframe,l=a.material,f=o.data;if(!f)return null;var h=iP(f,2),d=h[0],p=h[1];return new s(o,{data:Mv,mesh:d,texture:p,_instanced:!1,coordinateSystem:Rv.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(g){return[0,0,0]},getColor:c,wireframe:u,material:l})},n.onViewportLoad=function(o){if(o){var s=this.state.zRange,a=o.map(function(l){return l.content}).filter(Boolean).map(function(l){var f=l[0].header.boundingBox;return f.map(function(h){return h[2]})});if(a.length!==0){var c=Math.min.apply(Math,Bv(a.map(function(l){return l[0]}))),u=Math.max.apply(Math,Bv(a.map(function(l){return l[1]})));(!s||c<s[0]||u>s[1])&&this.setState({zRange:[c,u]})}}},n.renderLayers=function(){var o=this.props,s=o.color,a=o.material,c=o.elevationData,u=o.texture,l=o.wireframe,f=o.meshMaxError,h=o.elevationDecoder,d=o.tileSize,p=o.maxZoom,m=o.minZoom,g=o.extent,A=o.maxRequests,_=o.onTileLoad,v=o.onTileUnload,x=o.onTileError,w=o.maxCacheSize,S=o.maxCacheByteSize,C=o.refinementStrategy;if(this.state.isTiled)return new Ut(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Iv(c),texture:Iv(u),meshMaxError:f,elevationDecoder:h}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:d,maxZoom:p,minZoom:m,extent:g,maxRequests:A,onTileLoad:_,onTileUnload:v,onTileError:x,maxCacheSize:w,maxCacheByteSize:S,refinementStrategy:C});var B=this.getSubLayerClass("mesh",mh.SimpleMeshLayer);return new B(this.getSubLayerProps({id:"mesh"}),{data:Mv,mesh:this.state.terrain,texture:u,_instanced:!1,getPosition:function(y){return[0,0,0]},getColor:s,material:a,wireframe:l})},r}(lc.CompositeLayer);fc.defaultProps=mP;fc.layerName="TerrainLayer";var Ec=X(lt()),Lh=X(ut()),b_=X(Fv());var oo={x:0,y:1,z:2};function rn(t,e={}){let{start:r=0,end:n=t.length,plane:i="xy"}=e,o=e.size||2,s=0,a=oo[i[0]],c=oo[i[1]];for(let u=r,l=n-o;u<n;u+=o)s+=(t[u+a]-t[l+a])*(t[u+c]+t[l+c]),l=u;return s/2}function yh(t,e,r=2,n,i="xy"){let o=e&&e.length,s=o?e[0]*r:t.length,a=Dv(t,0,s,r,!0,n&&n[0],i),c=[];if(!a||a.next===a.prev)return c;let u,l,f,h,d,p,m;if(o&&(a=xP(t,e,a,r,n,i)),t.length>80*r){h=l=t[0],d=f=t[1];for(let g=r;g<s;g+=r)p=t[g],m=t[g+1],p<h&&(h=p),m<d&&(d=m),p>l&&(l=p),m>f&&(f=m);u=Math.max(l-h,f-d),u=u!==0?32767/u:0}return so(a,c,r,h,d,u,0),c}function Dv(t,e,r,n,i,o,s){let a,c;o===void 0&&(o=rn(t,{start:e,end:r,size:n,plane:s}));let u=oo[s[0]],l=oo[s[1]];if(i===o<0)for(a=e;a<r;a+=n)c=Lv(a,t[a+u],t[a+l],c);else for(a=r-n;a>=e;a-=n)c=Lv(a,t[a+u],t[a+l],c);return c&&pc(c,c.next)&&(co(c),c=c.next),c}function nn(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(pc(r,r.next)||ye(r.prev,r,r.next)===0)){if(co(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function so(t,e,r,n,i,o,s){if(!t)return;!s&&o&&BP(t,n,i,o);let a=t,c,u;for(;t.prev!==t.next;){if(c=t.prev,u=t.next,o?vP(t,n,i,o):AP(t)){e.push(c.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),co(t),t=u.next,a=u.next;continue}if(t=u,t===a){s?s===1?(t=_P(nn(t),e,r),so(t,e,r,n,i,o,2)):s===2&&bP(t,e,r,n,i,o):so(nn(t),e,r,n,i,o,1);break}}}function AP(t){let e=t.prev,r=t,n=t.next;if(ye(e,r,n)>=0)return!1;let i=e.x,o=r.x,s=n.x,a=e.y,c=r.y,u=n.y,l=i<o?i<s?i:s:o<s?o:s,f=a<c?a<u?a:u:c<u?c:u,h=i>o?i>s?i:s:o>s?o:s,d=a>c?a>u?a:u:c>u?c:u,p=n.next;for(;p!==e;){if(p.x>=l&&p.x<=h&&p.y>=f&&p.y<=d&&ei(i,a,o,c,s,u,p.x,p.y)&&ye(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function vP(t,e,r,n){let i=t.prev,o=t,s=t.next;if(ye(i,o,s)>=0)return!1;let a=i.x,c=o.x,u=s.x,l=i.y,f=o.y,h=s.y,d=a<c?a<u?a:u:c<u?c:u,p=l<f?l<h?l:h:f<h?f:h,m=a>c?a>u?a:u:c>u?c:u,g=l>f?l>h?l:h:f>h?f:h,A=gh(d,p,e,r,n),_=gh(m,g,e,r,n),v=t.prevZ,x=t.nextZ;for(;v&&v.z>=A&&x&&x.z<=_;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==i&&v!==s&&ei(a,l,c,f,u,h,v.x,v.y)&&ye(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=d&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==s&&ei(a,l,c,f,u,h,x.x,x.y)&&ye(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==i&&v!==s&&ei(a,l,c,f,u,h,v.x,v.y)&&ye(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=_;){if(x.x>=d&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==s&&ei(a,l,c,f,u,h,x.x,x.y)&&ye(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function _P(t,e,r){let n=t;do{let i=n.prev,o=n.next.next;!pc(i,o)&&Nv(i,n,n.next,o)&&ao(i,o)&&ao(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),co(n),co(n.next),n=t=o),n=n.next}while(n!==t);return nn(n)}function bP(t,e,r,n,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&IP(s,a)){let c=Gv(s,a);s=nn(s,s.next),c=nn(c,c.next),so(s,e,r,n,i,o,0),so(c,e,r,n,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function xP(t,e,r,n,i,o){let s=[],a,c,u,l,f;for(a=0,c=e.length;a<c;a++)u=e[a]*n,l=a<c-1?e[a+1]*n:t.length,f=Dv(t,u,l,n,!1,i&&i[a+1],o),f===f.next&&(f.steiner=!0),s.push(MP(f));for(s.sort(TP),a=0;a<s.length;a++)r=EP(s[a],r);return r}function TP(t,e){return t.x-e.x}function EP(t,e){let r=SP(t,e);if(!r)return e;let n=Gv(r,t);return nn(n,n.next),nn(r,r.next)}function SP(t,e){let r=e,n=t.x,i=t.y,o=-1/0,s;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let h=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(h<=n&&h>o&&(o=h,s=r.x<r.next.x?r:r.next,h===n))return s}r=r.next}while(r!==e);if(!s)return null;let a=s,c=s.x,u=s.y,l=1/0,f;r=s;do n>=r.x&&r.x>=c&&n!==r.x&&ei(i<u?n:o,i,c,u,i<u?o:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),ao(r,t)&&(f<l||f===l&&(r.x>s.x||r.x===s.x&&wP(s,r)))&&(s=r,l=f)),r=r.next;while(r!==a);return s}function wP(t,e){return ye(t.prev,t,e.prev)<0&&ye(e.next,t,t.next)<0}function BP(t,e,r,n){let i=t;do i.z===0&&(i.z=gh(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,CP(i)}function CP(t){let e,r,n=1,i,o,s,a,c,u;do{for(o=t,t=null,u=null,i=0;o;){for(i++,a=o,s=0,r=0;r<n&&(s++,a=a.nextZ,!!a);r++);for(c=n;s>0||c>0&&a;)s!==0&&(c===0||!a||o.z<=a.z)?(e=o,o=o.nextZ,s--):(e=a,a=a.nextZ,c--),u?u.nextZ=e:t=e,e.prevZ=u,u=e;o=a}u.nextZ=null,n*=2}while(i>1);return t}function gh(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function MP(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ei(t,e,r,n,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function IP(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!OP(t,e)&&(ao(t,e)&&ao(e,t)&&RP(t,e)&&(ye(t.prev,t,e.prev)||ye(t,e.prev,e))||pc(t,e)&&ye(t.prev,t,t.next)>0&&ye(e.prev,e,e.next)>0)}function ye(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function pc(t,e){return t.x===e.x&&t.y===e.y}function Nv(t,e,r,n){let i=dc(ye(t,e,r)),o=dc(ye(t,e,n)),s=dc(ye(r,n,t)),a=dc(ye(r,n,e));return!!(i!==o&&s!==a||i===0&&hc(t,r,e)||o===0&&hc(t,n,e)||s===0&&hc(r,t,n)||a===0&&hc(r,e,n))}function hc(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function dc(t){return t>0?1:t<0?-1:0}function OP(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Nv(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function ao(t,e){return ye(t.prev,t,t.next)<0?ye(t,e,t.next)>=0&&ye(t,t.prev,e)>=0:ye(t,e,t.prev)<0||ye(t,t.next,e)<0}function RP(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function Gv(t,e){let r=new uo(t.i,t.x,t.y),n=new uo(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Lv(t,e,r,n){let i=new uo(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function co(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}var uo=class{constructor(e,r,n){L(this,"i",void 0),L(this,"x",void 0),L(this,"y",void 0),L(this,"prev",null),L(this,"next",null),L(this,"z",0),L(this,"prevZ",null),L(this,"nextZ",null),L(this,"steiner",!1),this.i=e,this.x=r,this.y=n}};function _h(t,e,r){let n=NP(t),i=Object.keys(n).filter(o=>n[o]!==Array);return GP(t,{propArrayTypes:n,...e},{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function NP(t){let e={};for(let r of t)if(r.properties)for(let n in r.properties){let i=r.properties[n];e[n]=kP(i,e[n])}return e}function GP(t,e,r){let{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:c,polygonObjectsCount:u,polygonRingsCount:l,polygonFeaturesCount:f,propArrayTypes:h,coordLength:d}=e,{numericPropKeys:p=[],PositionDataType:m=Float32Array,triangulate:g=!0}=r,A=t[0]&&"id"in t[0],_=t.length>65535?Uint32Array:Uint16Array,v={type:"Point",positions:new m(n*d),globalFeatureIds:new _(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},x={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new m(o*d),globalFeatureIds:new _(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},w={type:"Polygon",polygonIndices:c>65535?new Uint32Array(u+1):new Uint16Array(u+1),primitivePolygonIndices:c>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new m(c*d),globalFeatureIds:new _(c),featureIds:f>65535?new Uint32Array(c):new Uint16Array(c),numericProps:{},properties:[],fields:[]};g&&(w.triangles=[]);for(let C of[v,x,w])for(let B of p){let T=h[B];C.numericProps[B]=new T(C.positions.length/d)}x.pathIndices[s]=o,w.polygonIndices[u]=c,w.primitivePolygonIndices[l]=c;let S={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let C of t){let B=C.geometry,T=C.properties||{};switch(B.type){case"Point":UP(B,v,S,d,T),v.properties.push(vh(T,p)),A&&v.fields.push({id:C.id}),S.pointFeature++;break;case"LineString":HP(B,x,S,d,T),x.properties.push(vh(T,p)),A&&x.fields.push({id:C.id}),S.lineFeature++;break;case"Polygon":VP(B,w,S,d,T),w.properties.push(vh(T,p)),A&&w.fields.push({id:C.id}),S.polygonFeature++;break;default:throw new Error("Invalid geometry type")}S.feature++}return jP(v,x,w,d)}function UP(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);let o=t.data.length/n;bh(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function HP(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);let o=t.data.length/n;bh(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=t.indices[s],u=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(u-c)/n}}function VP(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);let o=t.data.length/n;bh(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=r.polygonPosition;e.polygonIndices[r.polygonObject++]=c;let u=t.areas[s],l=t.indices[s],f=t.indices[s+1];for(let d=0,p=l.length;d<p;++d){let m=l[d],g=d===p-1?f===void 0?t.data.length:f[0]:l[d+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(g-m)/n}let h=r.polygonPosition;zP(e,u,l,{startPosition:c,endPosition:h,coordLength:n})}}function zP(t,e,r,n){let{startPosition:i,endPosition:o,coordLength:s}=n;if(!t.triangles)return;let a=i*s,c=o*s,u=t.positions.subarray(a,c),l=r[0],f=r.slice(1).map(d=>(d-l)/s),h=yh(u,f,s,e);for(let d=0,p=h.length;d<p;++d)t.triangles.push(i+h[d])}function Ah(t,e){let r={};for(let n in t)r[n]={value:t[n],size:e};return r}function jP(t,e,r,n){let i={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Ah(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Ah(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:Ah(r.numericProps,1)}};return i.polygons&&r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function bh(t,e,r,n){for(let i in t.numericProps)if(i in e){let o=e[i];t.numericProps[i].fill(o,r,r+n)}}function vh(t,e){let r={};for(let n in t)e.includes(n)||(r[n]=t[n]);return r}function kP(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function yc(t,e){let r=e?.globalFeatureId;return r!==void 0?WP(t,r):XP(t,e?.type)}function WP(t,e){let r=zv(t);for(let n of r){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){let a=n.featureIds.value[s];if(a!==o){if(e===n.globalFeatureIds.value[i])return mc(n,i,s);i=s,o=a}}if(e===n.globalFeatureIds.value[i])return mc(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function XP(t,e){let r=zv(t,e);return JP(r)}function Vv(t,e,r){switch(t.type){case"Point":return ZP(t,e,r);case"LineString":return KP(t,e,r);case"Polygon":return jv(t,e,r);default:let n=t;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function zv(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function JP(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==i&&(e.push(mc(r,n,o)),n=o,i=s)}e.push(mc(r,n,r.featureIds.value.length))}return e}function mc(t,e,r){let n=Vv(t,e,r),i=YP(t,e,r),o=qP(t,e,r);return{type:"Feature",geometry:n,properties:i,...o}}function qP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function YP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=Object.assign({},t.properties[t.featureIds.value[e]]);for(let i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}function jv(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.polygonIndices.value.filter(c=>c>=e&&c<=r),o=t.primitivePolygonIndices.value.filter(c=>c>=e&&c<=r);if(!(i.length>2)){let c=[];for(let u=0;u<o.length-1;u++){let l=o[u],f=o[u+1],h=gc(n,l,f);c.push(h)}return{type:"Polygon",coordinates:c}}let a=[];for(let c=0;c<i.length-1;c++){let u=i[c],l=i[c+1],f=jv(t,u,l).coordinates;a.push(f)}return{type:"MultiPolygon",coordinates:a}}function KP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.pathIndices.value.filter(a=>a>=e&&a<=r);if(!(i.length>2))return{type:"LineString",coordinates:gc(n,i[0],i[1])};let s=[];for(let a=0;a<i.length-1;a++){let c=gc(n,i[a],i[a+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}function ZP(t,e,r){let{positions:n}=t,i=gc(n,e,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function gc(t,e,r){e=e||0,r=r||t.value.length/t.size;let n=[];for(let i=e;i<r;i++){let o=Array();for(let s=i*t.size;s<(i+1)*t.size;s++)o.push(Number(t.value[s]));n.push(o)}return n}var Ch=X(Kv(),1);function Zv(t){let e=t.length;if(e<=1)return[t];let r=[],n,i;for(let o=0;o<e;o++){let s=mF(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&r.push(n),r}function mF(t){let e=0;for(let r=0,n=t.length-1,i,o;r<t.length;n=r++)i=t[r],o=t[n],e+=(o[0]-i[0])*(i[1]+o[1]);return e}function Qv(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?gF(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function gF(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var on=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,n,i,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(Qv,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=[],c;for(;e.pos<r;){if(i<=0){let u=e.readVarint();n=u&7,i=u>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),n===1&&(c&&a.push(c),c=[]),c&&c.push([o,s]);else if(n===7)c&&c.push(c[0].slice());else throw new Error(`unknown command ${n}`)}return c&&a.push(c),a}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=1/0,c=-1/0,u=1/0,l=-1/0;for(;e.pos<r;){if(i<=0){let f=e.readVarint();n=f&7,i=f>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),o<a&&(a=o),o>c&&(c=o),s<u&&(u=s),s>l&&(l=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[a,u,c,l]}_toGeoJSON(e){let r=this.loadGeometry(),n=on.types[this.type],i,o;switch(this.type){case 1:let a=[];for(i=0;i<r.length;i++)a[i]=r[i][0];r=a,e(r,this);break;case 2:for(i=0;i<r.length;i++)e(r[i],this);break;case 3:for(r=Zv(r),i=0;i<r.length;i++)for(o=0;o<r[i].length;o++)e(r[i][o],this);break}r.length===1?r=r[0]:n=`Multi${n}`;let s={type:"Feature",geometry:{type:n,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;function c(u){for(let l=0;l<u.length;l++){let f=u[l];f[0]=(f[0]+s)*360/o-180;let h=180-(f[1]+a)*360/o;f[1]=360/Math.PI*Math.atan(Math.exp(h*Math.PI/180))-90}}return this._toGeoJSON(c)}};var lo=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(yF,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new on(this._pbf,r,this.extent,this._keys,this._values)}};function yF(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(AF(r)))}function AF(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var fo=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(vF,{},r)}};function vF(t,e,r){if(t===3&&r){let n=new lo(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function $v(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[rn(t.data)]],indices:[t.indices]};let n=[],i=[],o=[],s=[],a,c=0;for(let u,l=0,f;l<e;l++){f=t.indices[l]-c,u=t.indices[l+1]-c||t.data.length;let h=t.data.slice(f,u),d=rn(h);if(d===0){let p=t.data.slice(0,f),m=t.data.slice(u);t.data=p.concat(m),c+=u-f;continue}a===void 0&&(a=d<0),a===d<0?(s.length&&(n.push(o),i.push(s)),s=[f],o=[d]):(o.push(d),s.push(f))}return o&&n.push(o),s.length&&i.push(s),{type:r,areas:n,indices:i,data:t.data}}function e_(t,e,r,n){for(let i=0,o=t.length;i<o;i+=2){t[i]=(t[i]+e)*360/n-180;let s=180-(t[i+1]+r)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function t_(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?_F(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function _F(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var r_,sn,Eh,_c,Sh,wh,ho;var po=class{constructor(e,r,n,i,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=s,e.readFields(t_,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,r_=e.readVarint()+e.pos,sn=1,_c=0,Sh=0,wh=0,ho=0;let r=[],n=[];for(;e.pos<r_;)if(_c<=0&&(Eh=e.readVarint(),sn=Eh&7,_c=Eh>>3),_c--,sn===1||sn===2)Sh+=e.readSVarint(),wh+=e.readSVarint(),sn===1&&r.push(ho),n.push(Sh,wh),ho+=2;else if(sn===7){if(ho>0){let i=r[r.length-1];n.push(n[i],n[i+1]),ho+=2}}else throw new Error(`unknown command ${sn}`);return{data:n,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),n;e(r.data,this);let i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,n={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/i,n={type:"LineString",...r};break;case 3:n=$v(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/i;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:n,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;return this._toBinaryCoordinates(c=>e_(c,s,a,o))}};var mo=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(bF,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let n=this._pbf.readVarint()+this._pbf.pos;return new po(this._pbf,n,this.extent,this._keys,this._values,r)}};function bF(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(xF(r)))}function xF(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var go=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(TF,{},r)}};function TF(t,e,r){if(t===3&&r){let n=new mo(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function bc(t,e){var r,n;let i=SF(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(n=e.mvt)===null||n===void 0?void 0:n.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:Bh(t,i)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:n_(t,i)};case"geojson":return n_(t,i);case"binary-geometry":return Bh(t,i);case"binary":return Bh(t,i);default:throw new Error(o||"undefined shape")}}function Bh(t,e){let[r,n]=EF(t,e),i=_h(r,n);return i.byteLength=t.byteLength,i}function EF(t,e){let r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,n];let i=new go(new Ch.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(s=>{let a=i.layers[s];if(a)for(let c=0;c<a.length;c++){let u=a.feature(c,n),l=BF(u,e,s);r.push(l)}}),[r,n]}function n_(t,e){if(t.byteLength<=0)return[];let r=[],n=new fo(new Ch.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(o=>{let s=n.layers[o];if(s)for(let a=0;a<s.length;a++){let c=s.feature(a),u=wF(c,e,o);r.push(u)}}),r}function SF(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:n}=t.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function wF(t,e,r){let n=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:CF);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function BF(t,e,r){let n=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:MF);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function CF(t,e){let{extent:r}=e;for(let n=0;n<t.length;n++){let i=t[n];i[0]/=r,i[1]/=r}}function MF(t,e){let{extent:r}=e;for(let n=0,i=t.length;n<i;++n)t[n]/=r}var IF=typeof __VERSION__<"u"?__VERSION__:"latest",xc={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:IF,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},OF={...xc,parse:async(t,e)=>bc(t,e),parseSync:bc,binary:!0};function i_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function o_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?i_(Object(r),!0).forEach(function(n){RF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RF(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s_(t,e){return DF(t)||LF(t,e)||FF(t,e)||PF()}function PF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
178
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FF(t,e){if(t){if(typeof t=="string")return a_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a_(t,e)}}function a_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function LF(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function DF(t){if(Array.isArray(t))return t}var NF={Point:c_,MultiPoint:GF,LineString:u_,MultiLineString:UF,Polygon:l_,MultiPolygon:HF};function c_(t,e,r){var n=s_(t,2),i=n[0],o=n[1],s=s_(e,2),a=s[0],c=s[1],u=Qt(a[0],c[0],i),l=Qt(a[1],c[1],o);return r.unprojectFlat([u,l])}function Mh(t,e,r){return t.map(function(n){return c_(n,e,r)})}function GF(t,e,r){return Mh(t,e,r)}function u_(t,e,r){return Mh(t,e,r)}function UF(t,e,r){return t.map(function(n){return u_(n,e,r)})}function l_(t,e,r){return t.map(function(n){return Mh(n,e,r)})}function HF(t,e,r){return t.map(function(n){return l_(n,e,r)})}function f_(t,e,r){var n=r.projectFlat([e.west,e.north]),i=r.projectFlat([e.east,e.south]),o=[n,i];return o_(o_({},t),{},{coordinates:NF[t.type](t.coordinates,o,r)})}function VF(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=zF(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
179
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function zF(t,e){if(t){if(typeof t=="string")return h_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h_(t,e)}}function h_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var jF=["points","lines","polygons"];function Ih(t,e,r,n){var i=VF(jF),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,a=t[s]&&kF(t[s],e,r,n);if(a>=0)return a}}catch(c){i.e(c)}finally{i.f()}return-1}function kF(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,s=i[i.length-1]+1;if(n){var a=WF(t,n);if(a)o=a[0],s=a[1]+1;else return-1}var c=-1;if(e in t.numericProps){var u=t.numericProps[e].value.findIndex(function(l,f){return l===r&&i[f]>=o&&i[f]<s});return u>=0?t.globalFeatureIds.value[u]:-1}else e?c=d_(t.properties,function(l){return l[e]===r},o,s):t.fields&&(c=d_(t.fields,function(l){return l.id===r},o,s));return c>=0?XF(t,c):-1}function WF(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i],s=o.layerName;s&&(r[s]?r[s][1]=i:r[s]=[i,i])}t.__layers=r}return t.__layers[e]}function XF(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}function d_(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function Tc(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Tc=function(r){return typeof r}:Tc=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Tc(t)}function JF(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=__(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
180
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function qF(t){return ZF(t)||KF(t)||__(t)||YF()}function YF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
181
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function __(t,e){if(t){if(typeof t=="string")return Ph(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ph(t,e)}}function KF(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ZF(t){if(Array.isArray(t))return Ph(t)}function Ph(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p_(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(n,i)}function QF(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){p_(o,n,i,s,a,"next",c)}function a(c){p_(o,n,i,s,a,"throw",c)}s(void 0)})}}function $F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function eL(t,e,r){return e&&m_(t.prototype,e),r&&m_(t,r),t}function Pt(t,e,r){return typeof Reflect<"u"&&Reflect.get?Pt=Reflect.get:Pt=function(i,o,s){var a=tL(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},Pt(t,e,r||t)}function tL(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=ct(t),t!==null););return t}function rL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fh(t,e)}function Fh(t,e){return Fh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Fh(t,e)}function nL(t){var e=sL();return function(){var n=ct(t),i;if(e){var o=ct(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return iL(this,i)}}function iL(t,e){if(e&&(Tc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oL(t)}function oL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ct(t)}function g_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?g_(Object(r),!0).forEach(function(n){aL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aL(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Oh=512,cL=Ar(Ar({},Lh.GeoJsonLayer.defaultProps),{},{data:ir,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[xc],binary:!0}),Sc=function(t){rL(r,t);var e=nL(r);function r(){return $F(this,r),e.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){Pt(ct(r.prototype),"initializeState",this).call(this);var o=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:o,data:null,tileJSON:null})},n.updateState=function(o){var s,a=o.props,c=o.oldProps,u=o.context,l=o.changeFlags;l.dataChanged&&this._updateTileData(),(s=this.state)!==null&&s!==void 0&&s.data&&(Pt(ct(r.prototype),"updateState",this).call(this,{props:a,oldProps:c,context:u,changeFlags:l}),this._setWGS84PropertyForTiles());var f=a.highlightColor;f!==c.highlightColor&&Array.isArray(f)&&this.setState({highlightColor:f})},n._updateTileData=function(){var i=QF(regeneratorRuntime.mark(function s(){var a,c,u,l,f;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=this.props.data,c=null,!(typeof a=="string"&&!rl(a))){d.next=18;break}return u=this.props,l=u.onDataLoad,f=u.fetch,this.setState({data:null,tileJSON:null}),d.prev=5,d.next=8,f(a,{propName:"data",layer:this,loaders:[]});case 8:c=d.sent,d.next=15;break;case 11:d.prev=11,d.t0=d.catch(5),this.raiseError(d.t0,"loading TileJSON"),a=null;case 15:l&&l(c,{propName:"data",layer:this}),d.next=19;break;case 18:a.tilejson&&(c=a);case 19:c&&(a=c.tiles),this.setState({data:a,tileJSON:c});case 21:case"end":return d.stop()}},s,this,[[5,11]])}));function o(){return i.apply(this,arguments)}return o}(),n._getTilesetOptions=function(){var o=Pt(ct(r.prototype),"_getTilesetOptions",this).call(this),s=this.state.tileJSON,a=this.props,c=a.minZoom,u=a.maxZoom;return s&&(Number.isFinite(s.minzoom)&&s.minzoom>c&&(o.minZoom=s.minzoom),Number.isFinite(s.maxzoom)&&(!Number.isFinite(u)||s.maxzoom<u)&&(o.maxZoom=s.maxzoom)),o},n.renderLayers=function(){var o;return(o=this.state)!==null&&o!==void 0&&o.data?Pt(ct(r.prototype),"renderLayers",this).call(this):null},n.getTileData=function(o){var s,a=this.state,c=a.data,u=a.binary,l=o.index,f=o.signal,h=wt(c,o);if(!h)return Promise.reject("Invalid URL");var d=this.getLoadOptions(),p=this.props.fetch;return d=Ar(Ar({},d),{},{mimeType:"application/x-protobuf",mvt:Ar(Ar({},(s=d)===null||s===void 0?void 0:s.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:l}),gis:u?{format:"binary"}:{}}),p(h,{propName:"data",layer:this,loadOptions:d,signal:f})},n.renderSubLayers=function(o){var s=o.tile.index,a=s.x,c=s.y,u=s.z,l=Math.pow(2,u),f=Oh/l,h=-f,d=Oh*a/l,p=Oh*(1-c/l),m=new k().scale([f,h,1]);o.autoHighlight=!1,this.context.viewport.resolution||(o.modelMatrix=m,o.coordinateOrigin=[d,p,0],o.coordinateSystem=Ec.COORDINATE_SYSTEM.CARTESIAN,o.extensions=[].concat(qF(o.extensions||[]),[new b_.ClipExtension]));var g=Pt(ct(r.prototype),"renderSubLayers",this).call(this,o);return this.state.binary&&!(g instanceof Lh.GeoJsonLayer)&&Ec.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),g},n._updateAutoHighlight=function(o){var s=this.props.uniqueIdProperty,a=this.state,c=a.hoveredFeatureId,u=a.hoveredFeatureLayerName,l=o.object,f,h;l&&(f=Rh(l,s),h=y_(l));var d=this.props.highlightColor;typeof d=="function"&&(d=d(o)),(c!==f||u!==h)&&this.setState({highlightColor:d,hoveredFeatureId:f,hoveredFeatureLayerName:h})},n.getPickingInfo=function(o){var s=Pt(ct(r.prototype),"getPickingInfo",this).call(this,o),a=Boolean(this.context.viewport.resolution);if(this.state.binary&&s.index!==-1){var c=o.sourceLayer.props.data;s.object=yc(c,{globalFeatureId:s.index})}return s.object&&!a&&(s.object=v_(s.object,s.tile.bbox,this.context.viewport)),s},n.getSubLayerPropsByTile=function(o){return{highlightedObjectIndex:this.getHighlightedObjectIndex(o),highlightColor:this.state.highlightColor}},n.getHighlightedObjectIndex=function(o){var s=this.state,a=s.hoveredFeatureId,c=s.hoveredFeatureLayerName,u=s.binary,l=this.props,f=l.uniqueIdProperty,h=l.highlightedFeatureId,d=o.content,p=A_(h),m=A_(a)||p;if(!m)return-1;var g=p?h:a;return Array.isArray(d)?d.findIndex(function(A){var _=Rh(A,f)===g,v=p||y_(A)===c;return _&&v}):d&&u?Ih(d,f,g,p?"":c):-1},n._pickObjects=function(o){var s=this.context,a=s.deck,c=s.viewport,u=c.width,l=c.height,f=c.x,h=c.y,d=[this.id];return a.pickObjects({x:f,y:h,width:u,height:l,layerIds:d,maxObjects:o})},n.getRenderedFeatures=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=this._pickObjects(o),a=new Set,c=[],u=JF(s),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,h=Rh(f.object,this.props.uniqueIdProperty);h===void 0?c.push(f.object):a.has(h)||(a.add(h),c.push(f.object))}}catch(d){u.e(d)}finally{u.f()}return c},n._setWGS84PropertyForTiles=function(){var o=this,s="dataInWGS84",a=this.state.tileset;a.selectedTiles.forEach(function(c){c.hasOwnProperty(s)||Object.defineProperty(c,s,{get:function(){if(!c.content)return null;if(o.state.binary&&Array.isArray(c.content)&&!c.content.length)return[];var l=c.bbox;if(c._contentWGS84===void 0&&nl(l)){var f=o.state.binary?yc(c.content):c.content;c._contentWGS84=f.map(function(h){return v_(h,l,o.context.viewport)})}return c._contentWGS84}})})},eL(r,[{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&Pt(ct(r.prototype),"isLoaded",this)}}]),r}(Ut);Sc.layerName="MVTLayer";Sc.defaultProps=cL;function Rh(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function y_(t){var e;return((e=t.properties)===null||e===void 0?void 0:e.layerName)||null}function A_(t){return t!=null&&t!==""}function v_(t,e,r){var n=Ar(Ar({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var o=f_(t.geometry,e,r);return o.coordinates}}),n}function uL(t,e){return dL(t)||hL(t,e)||fL(t,e)||lL()}function lL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
182
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fL(t,e){if(t){if(typeof t=="string")return x_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x_(t,e)}}function x_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hL(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function dL(t){if(Array.isArray(t))return t}var T_="0123456789bcdefghjkmnpqrstuvwxyz",E_={};for(yo=0;yo<T_.length;yo++)E_[T_.charAt(yo)]=yo;var yo,pL=-90,mL=90,gL=-180,yL=180;function AL(t){for(var e=!0,r=mL,n=pL,i=yL,o=gL,s,a=0,c=0,u=t.length;c<u;c++){var l=t[c].toLowerCase();a=E_[l];for(var f=4;f>=0;f--){var h=a>>f&1;e?(s=(i+o)/2,h===1?o=s:i=s):(s=(r+n)/2,h===1?n=s:r=s),e=!e}}return[n,o,r,i]}function S_(t){var e=AL(t),r=uL(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return[s,o,s,n,i,n,i,o,s,o]}function wc(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wc=function(r){return typeof r}:wc=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wc(t)}function vL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _L(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dh(t,e)}function Dh(t,e){return Dh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Dh(t,e)}function bL(t){var e=EL();return function(){var n=Bc(t),i;if(e){var o=Bc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xL(this,i)}}function xL(t,e){if(e&&(wc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TL(t)}function TL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function EL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bc(t){return Bc=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(t)}var SL={getGeohash:{type:"accessor",value:function(e){return e.geohash}}},Cc=function(t){_L(r,t);var e=bL(r);function r(){return vL(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getGeohash;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(u,l){return S_(a(u,l))}}},r}($e);Cc.layerName="GeohashLayer";Cc.defaultProps=SL;return P_(Ao);})();
38
+ `},o},n.initializeState=function(){me(zt(r.prototype),"initializeState",this).call(this);var o=this.getAttributeManager();o.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})},n.draw=function(o){var s=this.props,a=s.fadeTrail,c=s.trailLength,l=s.currentTime;o.uniforms=Kc(Kc({},o.uniforms),{},{fadeTrail:a,trailLength:c,currentTime:l}),me(zt(r.prototype),"draw",this).call(this,o)},r}(Jc.PathLayer);nn.layerName="TripsLayer";nn.defaultProps=tg;var hl=B(on()),dl=B(ut());var it=B(on()),ln=B(ut()),je=B(ct());var qe=B(on());function rl(t,e){return ng(t)||rg(t,e)||il(t,e)||eg()}function eg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function ng(t){if(Array.isArray(t))return t}function nl(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=il(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function il(t,e){if(t){if(typeof t=="string")return el(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return el(t,e)}}function el(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sn(t,e){e=e===void 0?t[0][0]:e;var r=nl(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(s){r.e(s)}finally{r.f()}}function ig(t,e,r){var n=(0,qe.cellToLatLng)(t),i=rl(n,2),o=i[0],s=i[1],a=e.length;sn(e,s);for(var c=e[0]===e[a-1]?a-1:a,l=0;l<c;l++)e[l][0]=It(s,e[l][0],r),e[l][1]=It(o,e[l][1],r)}function ol(t,e,r){var n=t(e,r),i=(0,qe.cellToLatLng)(n),o=rl(i,2),s=o[0],a=o[1];return[a,s]}function co(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=(0,qe.cellToBoundary)(t,!0);return e!==1?ig(t,r,e):sn(r),r}function sl(t){var e=new Float64Array(t.length*2),r=0,n=nl(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;e[r++]=o[0],e[r++]=o[1]}}catch(s){n.e(s)}finally{n.f()}return e}function al(t,e){return ag(t)||sg(t,e)||ul(t,e)||og()}function og(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function ag(t){if(Array.isArray(t))return t}function cg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ul(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function ul(t,e){if(t){if(typeof t=="string")return cl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cl(t,e)}}function cl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ug(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lo(t,e)}function lo(t,e){return lo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},lo(t,e)}function fg(t){var e=pg();return function(){var n=an(t),i;if(e){var o=an(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hg(this,i)}}function hg(t,e){if(e&&(Ue(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dg(t)}function dg(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function an(t){return an=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},an(t)}function ll(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ll(Object(r),!0).forEach(function(n){mg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ll(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ue(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ue=function(r){return typeof r}:Ue=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ue(t)}var gg=10;function yg(t,e){var r;return t==null?r=e:Ue(t)==="object"?r=cn(cn({},t),{},{coverage:e}):r={getHexagon:t,coverage:e},r}var vg=cn(cn({},je.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0}),Xt=function(t){ug(r,t);var e=fg(r);function r(){var i;lg(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}},n.shouldUpdateState=function(o){var s=o.changeFlags;return this._shouldUseHighPrecision()?s.propsOrDataChanged:s.somethingChanged},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(s.highPrecision!==!0&&(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagon)){var c=this._calculateH3DataProps();this.setState(c)}this._updateVertices(this.context.viewport)},n._calculateH3DataProps=function(){var o=-1,s=!1,a=!1,c=(0,ln.createIterable)(this.props.data),l=c.iterable,u=c.objectInfo,f=cg(l),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;u.index++;var p=this.props.getHexagon(d,u),g=(0,it.getResolution)(p);if(o<0){if(o=g,!this.props.highPrecision)break}else if(o!==g){a=!0;break}if((0,it.isPentagon)(p)){s=!0;break}}}catch(m){f.e(m)}finally{f.f()}return{resolution:o,edgeLengthKM:o>=0?(0,it.getHexagonEdgeLengthAvg)(o,"km"):0,hasMultipleRes:a,hasPentagon:s}},n._shouldUseHighPrecision=function(){if(this.props.highPrecision==="auto"){var o=this.state,s=o.resolution,a=o.hasPentagon,c=o.hasMultipleRes,l=this.context.viewport;return Boolean(l?.resolution)||c||a||s>=0&&s<=5}return this.props.highPrecision},n._updateVertices=function(o){if(!this._shouldUseHighPrecision()){var s=this.state,a=s.resolution,c=s.edgeLengthKM,l=s.centerHex;if(!(a<0)){var u=this.props.centerHexagon||(0,it.latLngToCell)(o.latitude,o.longitude,a);if(l!==u){if(l)try{var f=(0,it.gridDistance)(l,u);if(f*c<gg)return}catch{}var h=o.distanceScales.unitsPerMeter,d=co(u),p=(0,it.cellToLatLng)(u),g=al(p,2),m=g[0],v=g[1],w=o.projectFlat([v,m]),x=al(w,2),b=x[0],T=x[1];d=d.map(function(S){var P=o.projectFlat(S);return[(P[0]-b)/h[0],(P[1]-T)/h[1]]}),this.setState({centerHex:u,vertices:d})}}}},n.renderLayers=function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()},n._getForwardProps=function(){var o=this.props,s=o.elevationScale,a=o.material,c=o.coverage,l=o.extruded,u=o.wireframe,f=o.stroked,h=o.filled,d=o.lineWidthUnits,p=o.lineWidthScale,g=o.lineWidthMinPixels,m=o.lineWidthMaxPixels,v=o.getFillColor,w=o.getElevation,x=o.getLineColor,b=o.getLineWidth,T=o.transitions,S=o.updateTriggers;return{elevationScale:s,extruded:l,coverage:c,wireframe:u,stroked:f,filled:h,lineWidthUnits:d,lineWidthScale:p,lineWidthMinPixels:g,lineWidthMaxPixels:m,material:a,getElevation:w,getFillColor:v,getLineColor:x,getLineWidth:b,transitions:T,updateTriggers:{getFillColor:S.getFillColor,getElevation:S.getElevation,getLineColor:S.getLineColor,getLineWidth:S.getLineWidth}}},n._renderPolygonLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,l=o.coverage,u=this.getSubLayerClass("hexagon-cell-hifi",je.PolygonLayer),f=this._getForwardProps();return f.updateTriggers.getPolygon=yg(c.getHexagon,l),new u(f,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:f.updateTriggers}),{data:s,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(d,p){var g=a(d,p);return sl(co(g,l))}})},n._renderColumnLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,l=this.getSubLayerClass("hexagon-cell",je.ColumnLayer),u=this._getForwardProps();return u.updateTriggers.getPosition=c.getHexagon,new l(u,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:u.updateTriggers}),{data:s,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:ol.bind(null,a)})},r}(ln.CompositeLayer);Xt.defaultProps=vg;Xt.layerName="H3HexagonLayer";Xt._checkH3Lib=function(){};function un(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?un=function(r){return typeof r}:un=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},un(t)}function uo(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function xg(t,e){if(t){if(typeof t=="string")return fl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fl(t,e)}}function fl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fo(t,e)}function fo(t,e){return fo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},fo(t,e)}function wg(t){var e=Tg();return function(){var n=fn(t),i;if(e){var o=fn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Mg(this,i)}}function Mg(t,e){if(e&&(un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sg(t)}function Sg(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fn(t){return fn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},fn(t)}var Pg={getHexagons:{type:"accessor",value:function(e){return e.hexagons}}},hn=function(t){bg(r,t);var e=wg(r);function r(){var i;_g(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){Xt._checkH3Lib()},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagons){var c=s.data,l=s.getHexagons,u=[],f=(0,dl.createIterable)(c),h=f.iterable,d=f.objectInfo,p=uo(h),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;d.index++;var v=l(m,d),w=(0,hl.cellsToMultiPolygon)(v,!0),x=uo(w),b;try{for(x.s();!(b=x.n()).done;){var T=b.value,S=uo(T),P;try{for(S.s();!(P=S.n()).done;){var M=P.value;sn(M)}}catch(_){S.e(_)}finally{S.f()}u.push(this.getSubLayerRow({polygon:T},m,d.index))}}catch(_){x.e(_)}finally{x.f()}}}catch(_){p.e(_)}finally{p.f()}this.setState({polygons:u})}},n.indexToBounds=function(){var o=this.props,s=o.getElevation,a=o.getFillColor,c=o.getLineColor,l=o.getLineWidth;return{data:this.state.polygons,getPolygon:function(f){return f.polygon},getElevation:this.getSubLayerAccessor(s),getFillColor:this.getSubLayerAccessor(a),getLineColor:this.getSubLayerAccessor(c),getLineWidth:this.getSubLayerAccessor(l)}},r}(nt);hn.layerName="H3ClusterLayer";hn.defaultProps=Pg;var xn=B(ut()),xo=B(ml()),Tl=B(ut());function Ve(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let u=a[l],f=a[l+1],h=a[l+2];e=u<e?u:e,r=f<r?f:r,n=h<n?h:n,i=u>i?u:i,o=f>o?f:o,s=h>s?h:s}return[[e,r,n],[i,o,s]]}var Eg=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function ho(t){return t>>1^-(t&1)}function Og(t){let e=0,r={};for(let[n,i]of Eg){let o=i===8?t.getFloat64:t.getFloat32;r[n]=o.call(t,e,!0),e+=i}return{header:r,headerEndPosition:e}}function Ig(t,e){let r=e,n=3,i=t.getUint32(r,!0),o=new Uint16Array(i*n);r+=Uint32Array.BYTES_PER_ELEMENT;let s=Uint16Array.BYTES_PER_ELEMENT,a=i*s,c=r,l=c+a,u=l+a,f=0,h=0,d=0;for(let p=0;p<i;p++)f+=ho(t.getUint16(c+s*p,!0)),h+=ho(t.getUint16(l+s*p,!0)),d+=ho(t.getUint16(u+s*p,!0)),o[p]=f,o[p+i]=h,o[p+i*2]=d;return r+=a*3,{vertexData:o,vertexDataEndPosition:r}}function We(t,e,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o;if(n===2?o=new Uint16Array(t,e,r):o=new Uint32Array(t,e,r),!i)return o;let s=0;for(let a=0;a<o.length;++a){let c=o[a];o[a]=s-c,c===0&&++s}return o}function Ag(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%s!==0&&(n+=s-n%s);let a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=a*3,l=We(t.buffer,n,c,s);return n+=c*s,{triangleIndicesEndPosition:n,triangleIndices:l}}function Lg(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=We(t.buffer,n,a,s,!1);n+=a*s;let l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let u=We(t.buffer,n,l,s,!1);n+=l*s;let f=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let h=We(t.buffer,n,f,s,!1);n+=f*s;let d=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let p=We(t.buffer,n,d,s,!1);return n+=d*s,{edgeIndicesEndPosition:n,westIndices:c,southIndices:u,eastIndices:h,northIndices:p}}function Rg(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function Fg(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function Ng(t,e){let r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};let n=e;for(;n<t.byteLength;){let i=t.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;let o=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let s=new DataView(t.buffer,n,o);switch(i){case 1:{r.vertexNormals=Rg(s);break}case 2:{r.waterMask=Fg(s);break}default:}n+=o}return{extensions:r,extensionsEndPosition:n}}var Yt={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},Cg={maxDecodingStep:Yt.extensions};function po(t,e){let r=Object.assign({},Cg,e),n=new DataView(t),{header:i,headerEndPosition:o}=Og(n);if(r.maxDecodingStep<Yt.vertices)return{header:i};let{vertexData:s,vertexDataEndPosition:a}=Ig(n,o);if(r.maxDecodingStep<Yt.triangleIndices)return{header:i,vertexData:s};let{triangleIndices:c,triangleIndicesEndPosition:l}=Ag(n,s,a);if(r.maxDecodingStep<Yt.edgeIndices)return{header:i,vertexData:s,triangleIndices:c};let{westIndices:u,southIndices:f,eastIndices:h,northIndices:d,edgeIndicesEndPosition:p}=Lg(n,s,l);if(r.maxDecodingStep<Yt.extensions)return{header:i,vertexData:s,triangleIndices:c,westIndices:u,northIndices:d,eastIndices:h,southIndices:f};let{extensions:g}=Ng(n,p);return{header:i,vertexData:s,triangleIndices:c,westIndices:u,northIndices:d,eastIndices:h,southIndices:f,extensions:g}}function dn(t,e,r,n){let i=n?Bg(n,t.POSITION.value):zg(e),o=new t.POSITION.value.constructor(i.length*6),s=new t.TEXCOORD_0.value.constructor(i.length*4),a=new e.constructor(i.length*6);for(let l=0;l<i.length;l++){let u=i[l];kg({edge:u,edgeIndex:l,attributes:t,skirtHeight:r,newPosition:o,newTexcoord0:s,newTriangles:a})}t.POSITION.value=Me(t.POSITION.value,o),t.TEXCOORD_0.value=Me(t.TEXCOORD_0.value,s);let c=e instanceof Array?e.concat(a):Me(e,a);return{attributes:t,triangles:c}}function zg(t){let e=[];for(let s=0;s<t.length;s+=3)e.push([t[s],t[s+1]]),e.push([t[s+1],t[s+2]]),e.push([t[s+2],t[s]]);e.sort((s,a)=>Math.min(...s)-Math.min(...a)||Math.max(...s)-Math.max(...a));let r=[],n=0;for(;n<e.length;){var i,o;e[n][0]===((i=e[n+1])===null||i===void 0?void 0:i[1])&&e[n][1]===((o=e[n+1])===null||o===void 0?void 0:o[0])?n+=2:(r.push(e[n]),n++)}return r}function Bg(t,e){t.westIndices.sort((n,i)=>e[3*n+1]-e[3*i+1]),t.eastIndices.sort((n,i)=>e[3*i+1]-e[3*n+1]),t.southIndices.sort((n,i)=>e[3*i]-e[3*n]),t.northIndices.sort((n,i)=>e[3*n]-e[3*i]);let r=[];for(let n in t){let i=t[n];for(let o=0;o<i.length-1;o++)r.push([i[o],i[o+1]])}return r}function kg(t){let{edge:e,edgeIndex:r,attributes:n,skirtHeight:i,newPosition:o,newTexcoord0:s,newTriangles:a}=t,c=n.POSITION.value.length,l=r*2,u=r*2+1;o.set(n.POSITION.value.subarray(e[0]*3,e[0]*3+3),l*3),o[l*3+2]=o[l*3+2]-i,o.set(n.POSITION.value.subarray(e[1]*3,e[1]*3+3),u*3),o[u*3+2]=o[u*3+2]-i,s.set(n.TEXCOORD_0.value.subarray(e[0]*2,e[0]*2+2),l*2),s.set(n.TEXCOORD_0.value.subarray(e[1]*2,e[1]*2+2),u*2);let f=r*2*3;a[f]=e[0],a[f+1]=c/3+u,a[f+2]=e[1],a[f+3]=c/3+u,a[f+4]=e[0],a[f+5]=c/3+l}function mo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{bounds:r}=e,{header:n,vertexData:i,triangleIndices:o,westIndices:s,northIndices:a,eastIndices:c,southIndices:l}=po(t,Yt.triangleIndices),u=o,f=qg(i,n,r),h=Ve(f);if(e!=null&&e.skirtHeight){let{attributes:d,triangles:p}=dn(f,u,e.skirtHeight,{westIndices:s,northIndices:a,eastIndices:c,southIndices:l});f=d,u=p}return{loaderData:{header:{}},header:{vertexCount:u.length,boundingBox:h},schema:void 0,topology:"triangle-list",mode:4,indices:{value:u,size:1},attributes:f}}function qg(t,e,r){let{minHeight:n,maxHeight:i}=e,[o,s,a,c]=r||[0,0,1,1],l=a-o,u=c-s,f=i-n,h=t.length/3,d=new Float32Array(h*3),p=new Float32Array(h*2);for(let g=0;g<h;g++){let m=t[g]/32767,v=t[g+h]/32767,w=t[g+h*2]/32767;d[3*g+0]=m*l+o,d[3*g+1]=v*u+s,d[3*g+2]=w*f+n,p[2*g+0]=m,p[2*g+1]=v}return{POSITION:{value:d,size:3},TEXCOORD_0:{value:p,size:2}}}var De=class{constructor(e=257){this.gridSize=e;let r=e-1;if(r&r-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=r*r*2-2,this.numParentTriangles=this.numTriangles-r*r,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,o=0,s=0,a=0,c=0,l=0,u=0;for(i&1?a=c=l=r:o=s=u=r;(i>>=1)>1;){let h=o+a>>1,d=s+c>>1;i&1?(a=o,c=s,o=l,s=u):(o=a,s=c,a=l,c=u),l=h,u=d}let f=n*4;this.coords[f+0]=o,this.coords[f+1]=s,this.coords[f+2]=a,this.coords[f+3]=c}}createTile(e){return new go(e,this)}},go=class{constructor(e,r){let n=r.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=r,this.errors=new Float32Array(e.length),this.update()}update(){let{numTriangles:e,numParentTriangles:r,coords:n,gridSize:i}=this.martini,{terrain:o,errors:s}=this;for(let a=e-1;a>=0;a--){let c=a*4,l=n[c+0],u=n[c+1],f=n[c+2],h=n[c+3],d=l+f>>1,p=u+h>>1,g=d+p-u,m=p+l-d,v=(o[u*i+l]+o[h*i+f])/2,w=p*i+d,x=Math.abs(v-o[w]);if(s[w]=Math.max(s[w],x),a<r){let b=(u+m>>1)*i+(l+g>>1),T=(h+m>>1)*i+(f+g>>1);s[w]=Math.max(s[w],s[b],s[T])}}}getMesh(e=0){let{gridSize:r,indices:n}=this.martini,{errors:i}=this,o=0,s=0,a=r-1;n.fill(0);function c(d,p,g,m,v,w){let x=d+g>>1,b=p+m>>1;Math.abs(d-v)+Math.abs(p-w)>1&&i[b*r+x]>e?(c(v,w,d,p,x,b),c(g,m,v,w,x,b)):(n[p*r+d]=n[p*r+d]||++o,n[m*r+g]=n[m*r+g]||++o,n[w*r+v]=n[w*r+v]||++o,s++)}c(0,0,a,a,a,0),c(a,a,0,0,0,a);let l=new Uint16Array(o*2),u=new Uint32Array(s*3),f=0;function h(d,p,g,m,v,w){let x=d+g>>1,b=p+m>>1;if(Math.abs(d-v)+Math.abs(p-w)>1&&i[b*r+x]>e)h(v,w,d,p,x,b),h(g,m,v,w,x,b);else{let T=n[p*r+d]-1,S=n[m*r+g]-1,P=n[w*r+v]-1;l[2*T]=d,l[2*T+1]=p,l[2*S]=g,l[2*S+1]=m,l[2*P]=v,l[2*P+1]=w,u[f++]=T,u[f++]=S,u[f++]=P}}return h(0,0,a,a,a,0),h(a,a,0,0,0,a),{vertices:l,triangles:u}}};var Ge=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;this.data=e,this.width=r,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;let i=r-1,o=n-1,s=this._addPoint(0,0),a=this._addPoint(i,0),c=this._addPoint(0,o),l=this._addPoint(i,o),u=this._addTriangle(l,s,c,-1,-1,-1);this._addTriangle(s,l,a,u,-1,-1),this._flush()}run(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;for(;this.getMaxError()>e;)this.refine()}refine(){this._step(),this._flush()}getMaxError(){return this._errors[0]}getRMSD(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}heightAt(e,r){return this.data[this.width*r+e]}_flush(){let e=this.coords;for(let r=0;r<this._pendingLen;r++){let n=this._pending[r],i=2*this.triangles[n*3+0],o=2*this.triangles[n*3+1],s=2*this.triangles[n*3+2];this._findCandidate(e[i],e[i+1],e[o],e[o+1],e[s],e[s+1],n)}this._pendingLen=0}_findCandidate(e,r,n,i,o,s,a){let c=Math.min(e,n,o),l=Math.min(r,i,s),u=Math.max(e,n,o),f=Math.max(r,i,s),h=Ht(n,i,o,s,c,l),d=Ht(o,s,e,r,c,l),p=Ht(e,r,n,i,c,l),g=i-r,m=e-n,v=s-i,w=n-o,x=r-s,b=o-e,T=Ht(e,r,n,i,o,s),S=this.heightAt(e,r)/T,P=this.heightAt(n,i)/T,M=this.heightAt(o,s)/T,_=0,y=0,E=0,A=0;for(let L=l;L<=f;L++){let I=0;h<0&&v!==0&&(I=Math.max(I,Math.floor(-h/v))),d<0&&x!==0&&(I=Math.max(I,Math.floor(-d/x))),p<0&&g!==0&&(I=Math.max(I,Math.floor(-p/g)));let R=h+v*I,U=d+x*I,z=p+g*I,D=!1;for(let q=c+I;q<=u;q++){if(R>=0&&U>=0&&z>=0){D=!0;let X=S*R+P*U+M*z,$=Math.abs(X-this.heightAt(q,L));A+=$*$,$>_&&(_=$,y=q,E=L)}else if(D)break;R+=v,U+=x,z+=g}h+=w,d+=b,p+=m}(y===e&&E===r||y===n&&E===i||y===o&&E===s)&&(_=0),this._candidates[2*a]=y,this._candidates[2*a+1]=E,this._rms[a]=A,this._queuePush(a,_,A)}_step(){let e=this._queuePop(),r=e*3+0,n=e*3+1,i=e*3+2,o=this.triangles[r],s=this.triangles[n],a=this.triangles[i],c=this.coords[2*o],l=this.coords[2*o+1],u=this.coords[2*s],f=this.coords[2*s+1],h=this.coords[2*a],d=this.coords[2*a+1],p=this._candidates[2*e],g=this._candidates[2*e+1],m=this._addPoint(p,g);if(Ht(c,l,u,f,p,g)===0)this._handleCollinear(m,r);else if(Ht(u,f,h,d,p,g)===0)this._handleCollinear(m,n);else if(Ht(h,d,c,l,p,g)===0)this._handleCollinear(m,i);else{let v=this._halfedges[r],w=this._halfedges[n],x=this._halfedges[i],b=this._addTriangle(o,s,m,v,-1,-1,r),T=this._addTriangle(s,a,m,w,-1,b+1),S=this._addTriangle(a,o,m,x,b+2,T+1);this._legalize(b),this._legalize(T),this._legalize(S)}}_addPoint(e,r){let n=this.coords.length>>1;return this.coords.push(e,r),n}_addTriangle(e,r,n,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,c=a/3;return this.triangles[a+0]=e,this.triangles[a+1]=r,this.triangles[a+2]=n,this._halfedges[a+0]=i,this._halfedges[a+1]=o,this._halfedges[a+2]=s,i>=0&&(this._halfedges[i]=a+0),o>=0&&(this._halfedges[o]=a+1),s>=0&&(this._halfedges[s]=a+2),this._candidates[2*c+0]=0,this._candidates[2*c+1]=0,this._queueIndices[c]=-1,this._rms[c]=0,this._pending[this._pendingLen++]=c,a}_legalize(e){let r=this._halfedges[e];if(r<0)return;let n=e-e%3,i=r-r%3,o=n+(e+1)%3,s=n+(e+2)%3,a=i+(r+2)%3,c=i+(r+1)%3,l=this.triangles[s],u=this.triangles[e],f=this.triangles[o],h=this.triangles[a],d=this.coords;if(!Ug(d[2*l],d[2*l+1],d[2*u],d[2*u+1],d[2*f],d[2*f+1],d[2*h],d[2*h+1]))return;let p=this._halfedges[o],g=this._halfedges[s],m=this._halfedges[a],v=this._halfedges[c];this._queueRemove(n/3),this._queueRemove(i/3);let w=this._addTriangle(l,h,f,-1,m,p,n),x=this._addTriangle(h,l,u,w,g,v,i);this._legalize(w+1),this._legalize(x+2)}_handleCollinear(e,r){let n=r-r%3,i=n+(r+1)%3,o=n+(r+2)%3,s=this.triangles[o],a=this.triangles[r],c=this.triangles[i],l=this._halfedges[i],u=this._halfedges[o],f=this._halfedges[r];if(f<0){let S=this._addTriangle(e,s,a,-1,u,-1,n),P=this._addTriangle(s,e,c,S,-1,l);this._legalize(S+1),this._legalize(P+2);return}let h=f-f%3,d=h+(f+2)%3,p=h+(f+1)%3,g=this.triangles[d],m=this._halfedges[d],v=this._halfedges[p];this._queueRemove(h/3);let w=this._addTriangle(s,a,e,u,-1,-1,n),x=this._addTriangle(a,g,e,v,-1,w+1,h),b=this._addTriangle(g,c,e,m,-1,x+1),T=this._addTriangle(c,s,e,l,w+2,b+1);this._legalize(w),this._legalize(x),this._legalize(b),this._legalize(T)}_queuePush(e,r,n){let i=this._queue.length;this._queueIndices[e]=i,this._queue.push(e),this._errors.push(r),this._rmsSum+=n,this._queueUp(i)}_queuePop(){let e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}_queuePopBack(){let e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}_queueRemove(e){let r=this._queueIndices[e];if(r<0){let i=this._pending.indexOf(e);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}let n=this._queue.length-1;n!==r&&(this._queueSwap(r,n),this._queueDown(r,n)||this._queueUp(r)),this._queuePopBack()}_queueLess(e,r){return this._errors[e]>this._errors[r]}_queueSwap(e,r){let n=this._queue[e],i=this._queue[r];this._queue[e]=i,this._queue[r]=n,this._queueIndices[n]=r,this._queueIndices[i]=e;let o=this._errors[e];this._errors[e]=this._errors[r],this._errors[r]=o}_queueUp(e){let r=e;for(;;){let n=r-1>>1;if(n===r||!this._queueLess(r,n))break;this._queueSwap(n,r),r=n}}_queueDown(e,r){let n=e;for(;;){let i=2*n+1;if(i>=r||i<0)break;let o=i+1,s=i;if(o<r&&this._queueLess(o,i)&&(s=o),!this._queueLess(s,n))break;this._queueSwap(n,s),n=s}return n>e}};function Ht(t,e,r,n,i,o){return(r-i)*(e-o)-(n-o)*(t-i)}function Ug(t,e,r,n,i,o,s,a){let c=t-s,l=e-a,u=r-s,f=n-a,h=i-s,d=o-a,p=c*c+l*l,g=u*u+f*f,m=h*h+d*d;return c*(f*m-g*d)-l*(u*m-g*h)+p*(u*d-f*h)<0}function vl(t,e){let{meshMaxError:r,bounds:n,elevationDecoder:i}=e,{data:o,width:s,height:a}=t,c,l;switch(e.tesselator){case"martini":c=pn(o,s,a,i,e.tesselator),l=gl(r,s,c);break;case"delatin":c=pn(o,s,a,i,e.tesselator),l=yl(r,s,a,c);break;default:s===a&&!(a&s-1)?(c=pn(o,s,a,i,"martini"),l=gl(r,s,c)):(c=pn(o,s,a,i,"delatin"),l=yl(r,s,a,c));break}let{vertices:u}=l,{triangles:f}=l,h=jg(u,c,s,a,n),d=Ve(h);if(e.skirtHeight){let{attributes:p,triangles:g}=dn(h,f,e.skirtHeight);h=p,f=g}return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:d},mode:4,indices:{value:Uint32Array.from(f),size:1},attributes:h}}function gl(t,e,r){let n=e+1,o=new De(n).createTile(r),{vertices:s,triangles:a}=o.getMesh(t);return{vertices:s,triangles:a}}function yl(t,e,r,n){let i=new Ge(n,e+1,r+1);i.run(t);let{coords:o,triangles:s}=i;return{vertices:o,triangles:s}}function pn(t,e,r,n,i){let{rScaler:o,bScaler:s,gScaler:a,offset:c}=n,l=new Float32Array((e+1)*(r+1));for(let u=0,f=0;f<r;f++)for(let h=0;h<e;h++,u++){let d=u*4,p=t[d+0],g=t[d+1],m=t[d+2];l[u+f]=p*o+g*a+m*s+c}if(i==="martini"){for(let u=(e+1)*e,f=0;f<e;f++,u++)l[u]=l[u-e-1];for(let u=r,f=0;f<r+1;f++,u+=r+1)l[u]=l[u-1]}return l}function jg(t,e,r,n,i){let o=r+1,s=t.length/2,a=new Float32Array(s*3),c=new Float32Array(s*2),[l,u,f,h]=i||[0,0,r,n],d=(f-l)/r,p=(h-u)/n;for(let g=0;g<s;g++){let m=t[g*2],v=t[g*2+1],w=v*o+m;a[3*g+0]=m*d+l,a[3*g+1]=-v*p+h,a[3*g+2]=e[w],c[2*g+0]=m/r,c[2*g+1]=v/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}var mn=typeof __VERSION__<"u"?__VERSION__:"latest";var gn={name:"Terrain",id:"terrain",module:"terrain",version:mn,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};var xl={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:mn,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};var Vg={...gn,parse:Wg};async function Wg(t,e,r){let n={...e,mimeType:"application/x.image",image:{...e?.image,type:"data"}},i=await Zn(t,[],n,r),o={...Vg.options.terrain,...e?.terrain};return vl(i,o)}var DS={...xl,parseSync:(t,e)=>mo(t,e?.["quantized-mesh"]),parse:async(t,e)=>mo(t,e?.["quantized-mesh"])};function yn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yn=function(r){return typeof r}:yn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yn(t)}function _l(t){return Zg(t)||Gg(t)||Sl(t)||Dg()}function Dg(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
44
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gg(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Zg(t){if(Array.isArray(t))return yo(t)}function Xg(t,e){return $g(t)||Hg(t,e)||Sl(t,e)||Yg()}function Yg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sl(t,e){if(t){if(typeof t=="string")return yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yo(t,e)}}function yo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function $g(t){if(Array.isArray(t))return t}function Qg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vo(t,e)}function vo(t,e){return vo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vo(t,e)}function Jg(t){var e=ry();return function(){var n=vn(t),i;if(e){var o=vn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ty(this,i)}}function ty(t,e){if(e&&(yn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ey(t)}function ey(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ry(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vn(t){return vn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},vn(t)}function bl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bl(Object(r),!0).forEach(function(n){ny(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bl(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ny(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wl=[1],iy=Bt(Bt({},Tt.defaultProps),{},{elevationData:Ct,texture:Bt(Bt({},Ct),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[gn]});function Ml(t){return Array.isArray(t)?t.join(";"):t||""}var _n=function(t){Kg(r,t);var e=Jg(r);function r(){var i;Qg(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.updateState=function(o){var s=o.props,a=o.oldProps,c=s.elevationData!==a.elevationData;if(c){var l=s.elevationData,u=l&&(Array.isArray(l)||l.includes("{x}")&&l.includes("{y}"));this.setState({isTiled:u})}var f=c||s.meshMaxError!==a.meshMaxError||s.elevationDecoder!==a.elevationDecoder||s.bounds!==a.bounds;if(!this.state.isTiled&&f){var h=this.loadTerrain(s);this.setState({terrain:h})}s.workerUrl&&xn.log.removed("workerUrl","loadOptions.terrain.workerUrl")()},n.loadTerrain=function(o){var s,a=o.elevationData,c=o.bounds,l=o.elevationDecoder,u=o.meshMaxError,f=o.signal;if(!a)return null;var h=this.getLoadOptions();h=Bt(Bt({},h),{},{terrain:Bt(Bt({skirtHeight:this.state.isTiled?u*2:0},(s=h)===null||s===void 0?void 0:s.terrain),{},{bounds:c,meshMaxError:u,elevationDecoder:l})});var d=this.props.fetch;return d(a,{propName:"elevationData",layer:this,loadOptions:h,signal:f})},n.getTiledTerrainData=function(o){var s=this.props,a=s.elevationData,c=s.fetch,l=s.texture,u=s.elevationDecoder,f=s.meshMaxError,h=this.context.viewport,d=yt(a,o),p=l&&yt(l,o),g=o.signal,m=[0,0],v=[0,0];if(h.isGeospatial){var w=o.bbox;m=h.projectFlat([w.west,w.south]),v=h.projectFlat([w.east,w.north])}else{var x=o.bbox;m=[x.left,x.bottom],v=[x.right,x.top]}var b=[m[0],m[1],v[0],v[1]],T=this.loadTerrain({elevationData:d,bounds:b,elevationDecoder:u,meshMaxError:f,signal:g}),S=p?c(p,{propName:"texture",layer:this,loaders:[],signal:g}).catch(function(P){return null}):Promise.resolve(null);return Promise.all([T,S])},n.renderSubLayers=function(o){var s=this.getSubLayerClass("mesh",xo.SimpleMeshLayer),a=this.props,c=a.color,l=a.wireframe,u=a.material,f=o.data;if(!f)return null;var h=Xg(f,2),d=h[0],p=h[1];return new s(o,{data:wl,mesh:d,texture:p,_instanced:!1,coordinateSystem:Tl.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(m){return[0,0,0]},getColor:c,wireframe:l,material:u})},n.onViewportLoad=function(o){if(o){var s=this.state.zRange,a=o.map(function(u){return u.content}).filter(Boolean).map(function(u){var f=u[0].header.boundingBox;return f.map(function(h){return h[2]})});if(a.length!==0){var c=Math.min.apply(Math,_l(a.map(function(u){return u[0]}))),l=Math.max.apply(Math,_l(a.map(function(u){return u[1]})));(!s||c<s[0]||l>s[1])&&this.setState({zRange:[c,l]})}}},n.renderLayers=function(){var o=this.props,s=o.color,a=o.material,c=o.elevationData,l=o.texture,u=o.wireframe,f=o.meshMaxError,h=o.elevationDecoder,d=o.tileSize,p=o.maxZoom,g=o.minZoom,m=o.extent,v=o.maxRequests,w=o.onTileLoad,x=o.onTileUnload,b=o.onTileError,T=o.maxCacheSize,S=o.maxCacheByteSize,P=o.refinementStrategy;if(this.state.isTiled)return new Tt(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Ml(c),texture:Ml(l),meshMaxError:f,elevationDecoder:h}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:d,maxZoom:p,minZoom:g,extent:m,maxRequests:v,onTileLoad:w,onTileUnload:x,onTileError:b,maxCacheSize:T,maxCacheByteSize:S,refinementStrategy:P});var M=this.getSubLayerClass("mesh",xo.SimpleMeshLayer);return new M(this.getSubLayerProps({id:"mesh"}),{data:wl,mesh:this.state.terrain,texture:l,_instanced:!1,getPosition:function(y){return[0,0,0]},getColor:s,material:a,wireframe:u})},r}(xn.CompositeLayer);_n.defaultProps=iy;_n.layerName="TerrainLayer";var Fn=B(ut()),qo=B(ct()),pu=B(El());var Ze={x:0,y:1,z:2};function $t(t,e={}){let{start:r=0,end:n=t.length,plane:i="xy"}=e,o=e.size||2,s=0,a=Ze[i[0]],c=Ze[i[1]];for(let l=r,u=n-o;l<n;l+=o)s+=(t[l+a]-t[u+a])*(t[l+c]+t[u+c]),u=l;return s/2}function bo(t,e,r=2,n,i="xy"){let o=e&&e.length,s=o?e[0]*r:t.length,a=Il(t,0,s,r,!0,n&&n[0],i),c=[];if(!a||a.next===a.prev)return c;let l,u,f,h,d,p,g;if(o&&(a=fy(t,e,a,r,n,i)),t.length>80*r){h=u=t[0],d=f=t[1];for(let m=r;m<s;m+=r)p=t[m],g=t[m+1],p<h&&(h=p),g<d&&(d=g),p>u&&(u=p),g>f&&(f=g);l=Math.max(u-h,f-d),l=l!==0?32767/l:0}return Xe(a,c,r,h,d,l,0),c}function Il(t,e,r,n,i,o,s){let a,c;o===void 0&&(o=$t(t,{start:e,end:r,size:n,plane:s}));let l=Ze[s[0]],u=Ze[s[1]];if(i===o<0)for(a=e;a<r;a+=n)c=Ol(a,t[a+l],t[a+u],c);else for(a=r-n;a>=e;a-=n)c=Ol(a,t[a+l],t[a+u],c);return c&&Mn(c,c.next)&&(He(c),c=c.next),c}function Qt(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(Mn(r,r.next)||W(r.prev,r,r.next)===0)){if(He(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Xe(t,e,r,n,i,o,s){if(!t)return;!s&&o&&gy(t,n,i,o);let a=t,c,l;for(;t.prev!==t.next;){if(c=t.prev,l=t.next,o?cy(t,n,i,o):ay(t)){e.push(c.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),He(t),t=l.next,a=l.next;continue}if(t=l,t===a){s?s===1?(t=ly(Qt(t),e,r),Xe(t,e,r,n,i,o,2)):s===2&&uy(t,e,r,n,i,o):Xe(Qt(t),e,r,n,i,o,1);break}}}function ay(t){let e=t.prev,r=t,n=t.next;if(W(e,r,n)>=0)return!1;let i=e.x,o=r.x,s=n.x,a=e.y,c=r.y,l=n.y,u=i<o?i<s?i:s:o<s?o:s,f=a<c?a<l?a:l:c<l?c:l,h=i>o?i>s?i:s:o>s?o:s,d=a>c?a>l?a:l:c>l?c:l,p=n.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&ge(i,a,o,c,s,l,p.x,p.y)&&W(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function cy(t,e,r,n){let i=t.prev,o=t,s=t.next;if(W(i,o,s)>=0)return!1;let a=i.x,c=o.x,l=s.x,u=i.y,f=o.y,h=s.y,d=a<c?a<l?a:l:c<l?c:l,p=u<f?u<h?u:h:f<h?f:h,g=a>c?a>l?a:l:c>l?c:l,m=u>f?u>h?u:h:f>h?f:h,v=_o(d,p,e,r,n),w=_o(g,m,e,r,n),x=t.prevZ,b=t.nextZ;for(;x&&x.z>=v&&b&&b.z<=w;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==i&&x!==s&&ge(a,u,c,f,l,h,x.x,x.y)&&W(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=d&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&ge(a,u,c,f,l,h,b.x,b.y)&&W(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=v;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==i&&x!==s&&ge(a,u,c,f,l,h,x.x,x.y)&&W(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=w;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&ge(a,u,c,f,l,h,b.x,b.y)&&W(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function ly(t,e,r){let n=t;do{let i=n.prev,o=n.next.next;!Mn(i,o)&&Al(i,n,n.next,o)&&Ye(i,o)&&Ye(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),He(n),He(n.next),n=t=o),n=n.next}while(n!==t);return Qt(n)}function uy(t,e,r,n,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&xy(s,a)){let c=Ll(s,a);s=Qt(s,s.next),c=Qt(c,c.next),Xe(s,e,r,n,i,o,0),Xe(c,e,r,n,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function fy(t,e,r,n,i,o){let s=[],a,c,l,u,f;for(a=0,c=e.length;a<c;a++)l=e[a]*n,u=a<c-1?e[a+1]*n:t.length,f=Il(t,l,u,n,!1,i&&i[a+1],o),f===f.next&&(f.steiner=!0),s.push(vy(f));for(s.sort(hy),a=0;a<s.length;a++)r=dy(s[a],r);return r}function hy(t,e){return t.x-e.x}function dy(t,e){let r=py(t,e);if(!r)return e;let n=Ll(r,t);return Qt(n,n.next),Qt(r,r.next)}function py(t,e){let r=e,n=t.x,i=t.y,o=-1/0,s;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let h=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(h<=n&&h>o&&(o=h,s=r.x<r.next.x?r:r.next,h===n))return s}r=r.next}while(r!==e);if(!s)return null;let a=s,c=s.x,l=s.y,u=1/0,f;r=s;do n>=r.x&&r.x>=c&&n!==r.x&&ge(i<l?n:o,i,c,l,i<l?o:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),Ye(r,t)&&(f<u||f===u&&(r.x>s.x||r.x===s.x&&my(s,r)))&&(s=r,u=f)),r=r.next;while(r!==a);return s}function my(t,e){return W(t.prev,t,e.prev)<0&&W(e.next,t,t.next)<0}function gy(t,e,r,n){let i=t;do i.z===0&&(i.z=_o(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,yy(i)}function yy(t){let e,r,n=1,i,o,s,a,c,l;do{for(o=t,t=null,l=null,i=0;o;){for(i++,a=o,s=0,r=0;r<n&&(s++,a=a.nextZ,!!a);r++);for(c=n;s>0||c>0&&a;)s!==0&&(c===0||!a||o.z<=a.z)?(e=o,o=o.nextZ,s--):(e=a,a=a.nextZ,c--),l?l.nextZ=e:t=e,e.prevZ=l,l=e;o=a}l.nextZ=null,n*=2}while(i>1);return t}function _o(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vy(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ge(t,e,r,n,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function xy(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!_y(t,e)&&(Ye(t,e)&&Ye(e,t)&&by(t,e)&&(W(t.prev,t,e.prev)||W(t,e.prev,e))||Mn(t,e)&&W(t.prev,t,t.next)>0&&W(e.prev,e,e.next)>0)}function W(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Mn(t,e){return t.x===e.x&&t.y===e.y}function Al(t,e,r,n){let i=wn(W(t,e,r)),o=wn(W(t,e,n)),s=wn(W(r,n,t)),a=wn(W(r,n,e));return!!(i!==o&&s!==a||i===0&&bn(t,r,e)||o===0&&bn(t,n,e)||s===0&&bn(r,t,n)||a===0&&bn(r,e,n))}function bn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function wn(t){return t>0?1:t<0?-1:0}function _y(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Al(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Ye(t,e){return W(t.prev,t,t.next)<0?W(t,e,t.next)>=0&&W(t,t.prev,e)>=0:W(t,e,t.prev)<0||W(t,t.next,e)<0}function by(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function Ll(t,e){let r=new $e(t.i,t.x,t.y),n=new $e(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ol(t,e,r,n){let i=new $e(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function He(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}var $e=class{constructor(e,r,n){F(this,"i",void 0),F(this,"x",void 0),F(this,"y",void 0),F(this,"prev",null),F(this,"next",null),F(this,"z",0),F(this,"prevZ",null),F(this,"nextZ",null),F(this,"steiner",!1),this.i=e,this.x=r,this.y=n}};function So(t,e,r){let n=Py(t),i=Object.keys(n).filter(o=>n[o]!==Array);return Ey(t,{propArrayTypes:n,...e},{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function Py(t){let e={};for(let r of t)if(r.properties)for(let n in r.properties){let i=r.properties[n];e[n]=Fy(i,e[n])}return e}function Ey(t,e,r){let{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:c,polygonObjectsCount:l,polygonRingsCount:u,polygonFeaturesCount:f,propArrayTypes:h,coordLength:d}=e,{numericPropKeys:p=[],PositionDataType:g=Float32Array,triangulate:m=!0}=r,v=t[0]&&"id"in t[0],w=t.length>65535?Uint32Array:Uint16Array,x={type:"Point",positions:new g(n*d),globalFeatureIds:new w(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},b={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new g(o*d),globalFeatureIds:new w(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},T={type:"Polygon",polygonIndices:c>65535?new Uint32Array(l+1):new Uint16Array(l+1),primitivePolygonIndices:c>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new g(c*d),globalFeatureIds:new w(c),featureIds:f>65535?new Uint32Array(c):new Uint16Array(c),numericProps:{},properties:[],fields:[]};m&&(T.triangles=[]);for(let P of[x,b,T])for(let M of p){let _=h[M];P.numericProps[M]=new _(P.positions.length/d)}b.pathIndices[s]=o,T.polygonIndices[l]=c,T.primitivePolygonIndices[u]=c;let S={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let P of t){let M=P.geometry,_=P.properties||{};switch(M.type){case"Point":Oy(M,x,S,d,_),x.properties.push(Mo(_,p)),v&&x.fields.push({id:P.id}),S.pointFeature++;break;case"LineString":Iy(M,b,S,d,_),b.properties.push(Mo(_,p)),v&&b.fields.push({id:P.id}),S.lineFeature++;break;case"Polygon":Ay(M,T,S,d,_),T.properties.push(Mo(_,p)),v&&T.fields.push({id:P.id}),S.polygonFeature++;break;default:throw new Error("Invalid geometry type")}S.feature++}return Ry(x,b,T,d)}function Oy(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);let o=t.data.length/n;To(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function Iy(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);let o=t.data.length/n;To(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=t.indices[s],l=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(l-c)/n}}function Ay(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);let o=t.data.length/n;To(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=r.polygonPosition;e.polygonIndices[r.polygonObject++]=c;let l=t.areas[s],u=t.indices[s],f=t.indices[s+1];for(let d=0,p=u.length;d<p;++d){let g=u[d],m=d===p-1?f===void 0?t.data.length:f[0]:u[d+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(m-g)/n}let h=r.polygonPosition;Ly(e,l,u,{startPosition:c,endPosition:h,coordLength:n})}}function Ly(t,e,r,n){let{startPosition:i,endPosition:o,coordLength:s}=n;if(!t.triangles)return;let a=i*s,c=o*s,l=t.positions.subarray(a,c),u=r[0],f=r.slice(1).map(d=>(d-u)/s),h=bo(l,f,s,e);for(let d=0,p=h.length;d<p;++d)t.triangles.push(i+h[d])}function wo(t,e){let r={};for(let n in t)r[n]={value:t[n],size:e};return r}function Ry(t,e,r,n){let i={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:wo(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:wo(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:wo(r.numericProps,1)}};return i.polygons&&r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function To(t,e,r,n){for(let i in t.numericProps)if(i in e){let o=e[i];t.numericProps[i].fill(o,r,r+n)}}function Mo(t,e){let r={};for(let n in t)e.includes(n)||(r[n]=t[n]);return r}function Fy(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function Pn(t,e){let r=e?.globalFeatureId;return r!==void 0?Ny(t,r):Cy(t,e?.type)}function Ny(t,e){let r=Cl(t);for(let n of r){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){let a=n.featureIds.value[s];if(a!==o){if(e===n.globalFeatureIds.value[i])return Sn(n,i,s);i=s,o=a}}if(e===n.globalFeatureIds.value[i])return Sn(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function Cy(t,e){let r=Cl(t,e);return zy(r)}function Nl(t,e,r){switch(t.type){case"Point":return Uy(t,e,r);case"LineString":return qy(t,e,r);case"Polygon":return zl(t,e,r);default:let n=t;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function zy(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==i&&(e.push(Sn(r,n,o)),n=o,i=s)}e.push(Sn(r,n,r.featureIds.value.length))}return e}function Sn(t,e,r){let n=Nl(t,e,r),i=ky(t,e,r),o=By(t,e,r);return{type:"Feature",geometry:n,properties:i,...o}}function By(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function ky(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=Object.assign({},t.properties[t.featureIds.value[e]]);for(let i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}function zl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.polygonIndices.value.filter(c=>c>=e&&c<=r),o=t.primitivePolygonIndices.value.filter(c=>c>=e&&c<=r);if(!(i.length>2)){let c=[];for(let l=0;l<o.length-1;l++){let u=o[l],f=o[l+1],h=Tn(n,u,f);c.push(h)}return{type:"Polygon",coordinates:c}}let a=[];for(let c=0;c<i.length-1;c++){let l=i[c],u=i[c+1],f=zl(t,l,u).coordinates;a.push(f)}return{type:"MultiPolygon",coordinates:a}}function qy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.pathIndices.value.filter(a=>a>=e&&a<=r);if(!(i.length>2))return{type:"LineString",coordinates:Tn(n,i[0],i[1])};let s=[];for(let a=0;a<i.length-1;a++){let c=Tn(n,i[a],i[a+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}function Uy(t,e,r){let{positions:n}=t,i=Tn(n,e,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Tn(t,e,r){e=e||0,r=r||t.value.length/t.size;let n=[];for(let i=e;i<r;i++){let o=Array();for(let s=i*t.size;s<(i+1)*t.size;s++)o.push(Number(t.value[s]));n.push(o)}return n}var Ro=B(Wl(),1);function Dl(t){let e=t.length;if(e<=1)return[t];let r=[],n,i;for(let o=0;o<e;o++){let s=i1(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&r.push(n),r}function i1(t){let e=0;for(let r=0,n=t.length-1,i,o;r<t.length;n=r++)i=t[r],o=t[n],e+=(o[0]-i[0])*(i[1]+o[1]);return e}function Gl(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?o1(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function o1(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Kt=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,n,i,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(Gl,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=[],c;for(;e.pos<r;){if(i<=0){let l=e.readVarint();n=l&7,i=l>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),n===1&&(c&&a.push(c),c=[]),c&&c.push([o,s]);else if(n===7)c&&c.push(c[0].slice());else throw new Error(`unknown command ${n}`)}return c&&a.push(c),a}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=1/0,c=-1/0,l=1/0,u=-1/0;for(;e.pos<r;){if(i<=0){let f=e.readVarint();n=f&7,i=f>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),o<a&&(a=o),o>c&&(c=o),s<l&&(l=s),s>u&&(u=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[a,l,c,u]}_toGeoJSON(e){let r=this.loadGeometry(),n=Kt.types[this.type],i,o;switch(this.type){case 1:let a=[];for(i=0;i<r.length;i++)a[i]=r[i][0];r=a,e(r,this);break;case 2:for(i=0;i<r.length;i++)e(r[i],this);break;case 3:for(r=Dl(r),i=0;i<r.length;i++)for(o=0;o<r[i].length;o++)e(r[i][o],this);break}r.length===1?r=r[0]:n=`Multi${n}`;let s={type:"Feature",geometry:{type:n,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;function c(l){for(let u=0;u<l.length;u++){let f=l[u];f[0]=(f[0]+s)*360/o-180;let h=180-(f[1]+a)*360/o;f[1]=360/Math.PI*Math.atan(Math.exp(h*Math.PI/180))-90}}return this._toGeoJSON(c)}};var Qe=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(s1,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new Kt(this._pbf,r,this.extent,this._keys,this._values)}};function s1(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(a1(r)))}function a1(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var Ke=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(c1,{},r)}};function c1(t,e,r){if(t===3&&r){let n=new Qe(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Zl(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[$t(t.data)]],indices:[t.indices]};let n=[],i=[],o=[],s=[],a,c=0;for(let l,u=0,f;u<e;u++){f=t.indices[u]-c,l=t.indices[u+1]-c||t.data.length;let h=t.data.slice(f,l),d=$t(h);if(d===0){let p=t.data.slice(0,f),g=t.data.slice(l);t.data=p.concat(g),c+=l-f;continue}a===void 0&&(a=d<0),a===d<0?(s.length&&(n.push(o),i.push(s)),s=[f],o=[d]):(o.push(d),s.push(f))}return o&&n.push(o),s.length&&i.push(s),{type:r,areas:n,indices:i,data:t.data}}function Xl(t,e,r,n){for(let i=0,o=t.length;i<o;i+=2){t[i]=(t[i]+e)*360/n-180;let s=180-(t[i+1]+r)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function Yl(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?l1(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function l1(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Hl,Jt,Oo,In,Io,Ao,Je;var tr=class{constructor(e,r,n,i,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=s,e.readFields(Yl,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,Hl=e.readVarint()+e.pos,Jt=1,In=0,Io=0,Ao=0,Je=0;let r=[],n=[];for(;e.pos<Hl;)if(In<=0&&(Oo=e.readVarint(),Jt=Oo&7,In=Oo>>3),In--,Jt===1||Jt===2)Io+=e.readSVarint(),Ao+=e.readSVarint(),Jt===1&&r.push(Je),n.push(Io,Ao),Je+=2;else if(Jt===7){if(Je>0){let i=r[r.length-1];n.push(n[i],n[i+1]),Je+=2}}else throw new Error(`unknown command ${Jt}`);return{data:n,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),n;e(r.data,this);let i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,n={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/i,n={type:"LineString",...r};break;case 3:n=Zl(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/i;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:n,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;return this._toBinaryCoordinates(c=>Xl(c,s,a,o))}};var er=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(u1,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let n=this._pbf.readVarint()+this._pbf.pos;return new tr(this._pbf,n,this.extent,this._keys,this._values,r)}};function u1(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(f1(r)))}function f1(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var rr=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(h1,{},r)}};function h1(t,e,r){if(t===3&&r){let n=new er(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function An(t,e){var r,n;let i=p1(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(n=e.mvt)===null||n===void 0?void 0:n.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:Lo(t,i)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:$l(t,i)};case"geojson":return $l(t,i);case"binary-geometry":return Lo(t,i);case"binary":return Lo(t,i);default:throw new Error(o||"undefined shape")}}function Lo(t,e){let[r,n]=d1(t,e),i=So(r,n);return i.byteLength=t.byteLength,i}function d1(t,e){let r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,n];let i=new rr(new Ro.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(s=>{let a=i.layers[s];if(a)for(let c=0;c<a.length;c++){let l=a.feature(c,n),u=g1(l,e,s);r.push(u)}}),[r,n]}function $l(t,e){if(t.byteLength<=0)return[];let r=[],n=new Ke(new Ro.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(o=>{let s=n.layers[o];if(s)for(let a=0;a<s.length;a++){let c=s.feature(a),l=m1(c,e,o);r.push(l)}}),r}function p1(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:n}=t.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function m1(t,e,r){let n=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:y1);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function g1(t,e,r){let n=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:v1);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function y1(t,e){let{extent:r}=e;for(let n=0;n<t.length;n++){let i=t[n];i[0]/=r,i[1]/=r}}function v1(t,e){let{extent:r}=e;for(let n=0,i=t.length;n<i;++n)t[n]/=r}var x1=typeof __VERSION__<"u"?__VERSION__:"latest",Ln={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:x1,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},_1={...Ln,parse:async(t,e)=>An(t,e),parseSync:An,binary:!0};function Ql(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kl(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ql(Object(r),!0).forEach(function(n){b1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ql(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function b1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jl(t,e){return T1(t)||S1(t,e)||M1(t,e)||w1()}function w1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M1(t,e){if(t){if(typeof t=="string")return tu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tu(t,e)}}function tu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function S1(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function T1(t){if(Array.isArray(t))return t}var P1={Point:eu,MultiPoint:E1,LineString:ru,MultiLineString:O1,Polygon:nu,MultiPolygon:I1};function eu(t,e,r){var n=Jl(t,2),i=n[0],o=n[1],s=Jl(e,2),a=s[0],c=s[1],l=It(a[0],c[0],i),u=It(a[1],c[1],o);return r.unprojectFlat([l,u])}function Fo(t,e,r){return t.map(function(n){return eu(n,e,r)})}function E1(t,e,r){return Fo(t,e,r)}function ru(t,e,r){return Fo(t,e,r)}function O1(t,e,r){return t.map(function(n){return ru(n,e,r)})}function nu(t,e,r){return t.map(function(n){return Fo(n,e,r)})}function I1(t,e,r){return t.map(function(n){return nu(n,e,r)})}function iu(t,e,r){var n=r.projectFlat([e.west,e.north]),i=r.projectFlat([e.east,e.south]),o=[n,i];return Kl(Kl({},t),{},{coordinates:P1[t.type](t.coordinates,o,r)})}function A1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=L1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
47
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function L1(t,e){if(t){if(typeof t=="string")return ou(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ou(t,e)}}function ou(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var R1=["points","lines","polygons"];function No(t,e,r,n){var i=A1(R1),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,a=t[s]&&F1(t[s],e,r,n);if(a>=0)return a}}catch(c){i.e(c)}finally{i.f()}return-1}function F1(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,s=i[i.length-1]+1;if(n){var a=N1(t,n);if(a)o=a[0],s=a[1]+1;else return-1}var c=-1;if(e in t.numericProps){var l=t.numericProps[e].value.findIndex(function(u,f){return u===r&&i[f]>=o&&i[f]<s});return l>=0?t.globalFeatureIds.value[l]:-1}else e?c=su(t.properties,function(u){return u[e]===r},o,s):t.fields&&(c=su(t.fields,function(u){return u.id===r},o,s));return c>=0?C1(t,c):-1}function N1(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i],s=o.layerName;s&&(r[s]?r[s][1]=i:r[s]=[i,i])}t.__layers=r}return t.__layers[e]}function C1(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}function su(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function Rn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rn=function(r){return typeof r}:Rn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rn(t)}function z1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=du(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
48
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function B1(t){return U1(t)||q1(t)||du(t)||k1()}function k1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function du(t,e){if(t){if(typeof t=="string")return Bo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bo(t,e)}}function q1(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function U1(t){if(Array.isArray(t))return Bo(t)}function Bo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function au(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function j1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){au(o,n,i,s,a,"next",c)}function a(c){au(o,n,i,s,a,"throw",c)}s(void 0)})}}function V1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function W1(t,e,r){return e&&cu(t.prototype,e),r&&cu(t,r),t}function vt(t,e,r){return typeof Reflect<"u"&&Reflect.get?vt=Reflect.get:vt=function(i,o,s){var a=D1(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},vt(t,e,r||t)}function D1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=ot(t),t!==null););return t}function G1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ko(t,e)}function ko(t,e){return ko=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ko(t,e)}function Z1(t){var e=H1();return function(){var n=ot(t),i;if(e){var o=ot(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return X1(this,i)}}function X1(t,e){if(e&&(Rn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y1(t)}function Y1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ot(t)}function lu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(r),!0).forEach(function(n){$1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Co=512,Q1=kt(kt({},qo.GeoJsonLayer.defaultProps),{},{data:Ct,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Ln],binary:!0}),Nn=function(t){G1(r,t);var e=Z1(r);function r(){var i;V1(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){vt(ot(r.prototype),"initializeState",this).call(this);var o=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:o,data:null,tileJSON:null})},n.updateState=function(o){var s,a=o.props,c=o.oldProps,l=o.context,u=o.changeFlags;u.dataChanged&&this._updateTileData(),(s=this.state)!==null&&s!==void 0&&s.data&&(vt(ot(r.prototype),"updateState",this).call(this,{props:a,oldProps:c,context:l,changeFlags:u}),this._setWGS84PropertyForTiles());var f=a.highlightColor;f!==c.highlightColor&&Array.isArray(f)&&this.setState({highlightColor:f})},n._updateTileData=function(){var i=j1(regeneratorRuntime.mark(function s(){var a,c,l,u,f;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=this.props.data,c=null,!(typeof a=="string"&&!no(a))){d.next=18;break}return l=this.props,u=l.onDataLoad,f=l.fetch,this.setState({data:null,tileJSON:null}),d.prev=5,d.next=8,f(a,{propName:"data",layer:this,loaders:[]});case 8:c=d.sent,d.next=15;break;case 11:d.prev=11,d.t0=d.catch(5),this.raiseError(d.t0,"loading TileJSON"),a=null;case 15:u&&u(c,{propName:"data",layer:this}),d.next=19;break;case 18:a.tilejson&&(c=a);case 19:c&&(a=c.tiles),this.setState({data:a,tileJSON:c});case 21:case"end":return d.stop()}},s,this,[[5,11]])}));function o(){return i.apply(this,arguments)}return o}(),n._getTilesetOptions=function(){var o=vt(ot(r.prototype),"_getTilesetOptions",this).call(this),s=this.state.tileJSON,a=this.props,c=a.minZoom,l=a.maxZoom;return s&&(Number.isFinite(s.minzoom)&&s.minzoom>c&&(o.minZoom=s.minzoom),Number.isFinite(s.maxzoom)&&(!Number.isFinite(l)||s.maxzoom<l)&&(o.maxZoom=s.maxzoom)),o},n.renderLayers=function(){var o;return(o=this.state)!==null&&o!==void 0&&o.data?vt(ot(r.prototype),"renderLayers",this).call(this):null},n.getTileData=function(o){var s,a=this.state,c=a.data,l=a.binary,u=o.index,f=o.signal,h=yt(c,o);if(!h)return Promise.reject("Invalid URL");var d=this.getLoadOptions(),p=this.props.fetch;return d=kt(kt({},d),{},{mimeType:"application/x-protobuf",mvt:kt(kt({},(s=d)===null||s===void 0?void 0:s.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:u}),gis:l?{format:"binary"}:{}}),p(h,{propName:"data",layer:this,loadOptions:d,signal:f})},n.renderSubLayers=function(o){var s=o.tile.index,a=s.x,c=s.y,l=s.z,u=Math.pow(2,l),f=Co/u,h=-f,d=Co*a/u,p=Co*(1-c/u),g=new et().scale([f,h,1]);o.autoHighlight=!1,this.context.viewport.resolution||(o.modelMatrix=g,o.coordinateOrigin=[d,p,0],o.coordinateSystem=Fn.COORDINATE_SYSTEM.CARTESIAN,o.extensions=[].concat(B1(o.extensions||[]),[new pu.ClipExtension]));var m=vt(ot(r.prototype),"renderSubLayers",this).call(this,o);return this.state.binary&&!(m instanceof qo.GeoJsonLayer)&&Fn.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),m},n._updateAutoHighlight=function(o){var s=this.props.uniqueIdProperty,a=this.state,c=a.hoveredFeatureId,l=a.hoveredFeatureLayerName,u=o.object,f,h;u&&(f=zo(u,s),h=uu(u));var d=this.props.highlightColor;typeof d=="function"&&(d=d(o)),(c!==f||l!==h)&&this.setState({highlightColor:d,hoveredFeatureId:f,hoveredFeatureLayerName:h})},n.getPickingInfo=function(o){var s=vt(ot(r.prototype),"getPickingInfo",this).call(this,o),a=Boolean(this.context.viewport.resolution);if(this.state.binary&&s.index!==-1){var c=o.sourceLayer.props.data;s.object=Pn(c,{globalFeatureId:s.index})}return s.object&&!a&&(s.object=hu(s.object,s.tile.bbox,this.context.viewport)),s},n.getSubLayerPropsByTile=function(o){return{highlightedObjectIndex:this.getHighlightedObjectIndex(o),highlightColor:this.state.highlightColor}},n.getHighlightedObjectIndex=function(o){var s=this.state,a=s.hoveredFeatureId,c=s.hoveredFeatureLayerName,l=s.binary,u=this.props,f=u.uniqueIdProperty,h=u.highlightedFeatureId,d=o.content,p=fu(h),g=fu(a)||p;if(!g)return-1;var m=p?h:a;return Array.isArray(d)?d.findIndex(function(v){var w=zo(v,f)===m,x=p||uu(v)===c;return w&&x}):d&&l?No(d,f,m,p?"":c):-1},n._pickObjects=function(o){var s=this.context,a=s.deck,c=s.viewport,l=c.width,u=c.height,f=c.x,h=c.y,d=[this.id];return a.pickObjects({x:f,y:h,width:l,height:u,layerIds:d,maxObjects:o})},n.getRenderedFeatures=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=this._pickObjects(o),a=new Set,c=[],l=z1(s),u;try{for(l.s();!(u=l.n()).done;){var f=u.value,h=zo(f.object,this.props.uniqueIdProperty);h===void 0?c.push(f.object):a.has(h)||(a.add(h),c.push(f.object))}}catch(d){l.e(d)}finally{l.f()}return c},n._setWGS84PropertyForTiles=function(){var o=this,s="dataInWGS84",a=this.state.tileset;a.selectedTiles.forEach(function(c){c.hasOwnProperty(s)||Object.defineProperty(c,s,{get:function(){if(!c.content)return null;if(o.state.binary&&Array.isArray(c.content)&&!c.content.length)return[];var u=c.bbox;if(c._contentWGS84===void 0&&io(u)){var f=o.state.binary?Pn(c.content):c.content;c._contentWGS84=f.map(function(h){return hu(h,u,o.context.viewport)})}return c._contentWGS84}})})},W1(r,[{key:"isLoaded",get:function(){return Boolean(this.state&&this.state.data&&this.state.tileset&&vt(ot(r.prototype),"isLoaded",this))}}]),r}(Tt);Nn.layerName="MVTLayer";Nn.defaultProps=Q1;function zo(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function uu(t){var e;return((e=t.properties)===null||e===void 0?void 0:e.layerName)||null}function fu(t){return t!=null&&t!==""}function hu(t,e,r){var n=kt(kt({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var o=iu(t.geometry,e,r);return o.coordinates}}),n}function K1(t,e){return rv(t)||ev(t,e)||tv(t,e)||J1()}function J1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tv(t,e){if(t){if(typeof t=="string")return mu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mu(t,e)}}function mu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ev(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function rv(t){if(Array.isArray(t))return t}var gu="0123456789bcdefghjkmnpqrstuvwxyz",yu={};for(nr=0;nr<gu.length;nr++)yu[gu.charAt(nr)]=nr;var nr,nv=-90,iv=90,ov=-180,sv=180;function av(t){for(var e=!0,r=iv,n=nv,i=sv,o=ov,s,a=0,c=0,l=t.length;c<l;c++){var u=t[c].toLowerCase();a=yu[u];for(var f=4;f>=0;f--){var h=a>>f&1;e?(s=(i+o)/2,h===1?o=s:i=s):(s=(r+n)/2,h===1?n=s:r=s),e=!e}}return[n,o,r,i]}function vu(t){var e=av(t),r=K1(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return[s,o,s,n,i,n,i,o,s,o]}function Cn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cn=function(r){return typeof r}:Cn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Cn(t)}function cv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uo(t,e)}function Uo(t,e){return Uo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Uo(t,e)}function uv(t){var e=dv();return function(){var n=zn(t),i;if(e){var o=zn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fv(this,i)}}function fv(t,e){if(e&&(Cn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hv(t)}function hv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}var pv={getGeohash:{type:"accessor",value:function(e){return e.geohash}}},Bn=function(t){lv(r,t);var e=uv(r);function r(){return cv(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getGeohash;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(l,u){return vu(a(l,u))}}},r}(nt);Bn.layerName="GeohashLayer";Bn.defaultProps=pv;return Su(ir);})();
183
51
  return __exports__;
184
52
  });