tangram-core 0.2.0__cp313-cp313-win_amd64.whl

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 (171) hide show
  1. tangram_core/App.vue +335 -0
  2. tangram_core/__init__.py +5 -0
  3. tangram_core/__main__.py +141 -0
  4. tangram_core/_core.cp313-win_amd64.pyd +0 -0
  5. tangram_core/_core.pyi +38 -0
  6. tangram_core/api.ts +456 -0
  7. tangram_core/backend.py +335 -0
  8. tangram_core/colour.ts +71 -0
  9. tangram_core/config.py +122 -0
  10. tangram_core/dist-frontend/aggregation-layers.js +521 -0
  11. tangram_core/dist-frontend/aggregation-layers.js.map +1 -0
  12. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  13. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  14. tangram_core/dist-frontend/assets/array-utils-flat-wyE8tIYR.js +11 -0
  15. tangram_core/dist-frontend/assets/array-utils-flat-wyE8tIYR.js.map +1 -0
  16. tangram_core/dist-frontend/assets/assert-hrfsarFU.js +3 -0
  17. tangram_core/dist-frontend/assets/assert-hrfsarFU.js.map +1 -0
  18. tangram_core/dist-frontend/assets/b612-latin-400-italic-DePNXA0a.woff +0 -0
  19. tangram_core/dist-frontend/assets/b612-latin-400-italic-a-4GLPtl.woff2 +0 -0
  20. tangram_core/dist-frontend/assets/b612-latin-400-normal-CC98FVm_.woff2 +0 -0
  21. tangram_core/dist-frontend/assets/b612-latin-400-normal-JbZ7xwUX.woff +0 -0
  22. tangram_core/dist-frontend/assets/b612-latin-700-normal-B_Snq1wd.woff +0 -0
  23. tangram_core/dist-frontend/assets/b612-latin-700-normal-BinQrnoB.woff2 +0 -0
  24. tangram_core/dist-frontend/assets/clip-extension-DTCP51Ak.js +26 -0
  25. tangram_core/dist-frontend/assets/clip-extension-DTCP51Ak.js.map +1 -0
  26. tangram_core/dist-frontend/assets/color-CUNNsFV-.js +17 -0
  27. tangram_core/dist-frontend/assets/color-CUNNsFV-.js.map +1 -0
  28. tangram_core/dist-frontend/assets/cube-geometry-CzJ_uBWa.js +2 -0
  29. tangram_core/dist-frontend/assets/cube-geometry-CzJ_uBWa.js.map +1 -0
  30. tangram_core/dist-frontend/assets/deep-equal-uriyKJca.js +2 -0
  31. tangram_core/dist-frontend/assets/deep-equal-uriyKJca.js.map +1 -0
  32. tangram_core/dist-frontend/assets/fly-to-interpolator-DlKiy9_S.js +2 -0
  33. tangram_core/dist-frontend/assets/fly-to-interpolator-DlKiy9_S.js.map +1 -0
  34. tangram_core/dist-frontend/assets/geojson-layer-CLhXLxdI.js +1010 -0
  35. tangram_core/dist-frontend/assets/geojson-layer-CLhXLxdI.js.map +1 -0
  36. tangram_core/dist-frontend/assets/globe-view-DKhftlA1.js +94 -0
  37. tangram_core/dist-frontend/assets/globe-view-DKhftlA1.js.map +1 -0
  38. tangram_core/dist-frontend/assets/globe-viewport-CPES4D4P.js +2 -0
  39. tangram_core/dist-frontend/assets/globe-viewport-CPES4D4P.js.map +1 -0
  40. tangram_core/dist-frontend/assets/image-loader-ClbNCMXW.js +2 -0
  41. tangram_core/dist-frontend/assets/image-loader-ClbNCMXW.js.map +1 -0
  42. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-DTZQ6lD6.woff2 +0 -0
  43. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-HYADljCo.woff +0 -0
  44. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-ByjKuJjN.woff2 +0 -0
  45. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-DzgUY3Rl.woff +0 -0
  46. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-BaHVOdFB.woff2 +0 -0
  47. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-yvPjCxxx.woff +0 -0
  48. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-D0Kpgs_9.woff2 +0 -0
  49. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-Dlt-daqV.woff +0 -0
  50. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-ByiM2lek.woff +0 -0
  51. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-DfC_iMic.woff2 +0 -0
  52. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DLCFFAUf.woff +0 -0
  53. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DuasYmn8.woff2 +0 -0
  54. tangram_core/dist-frontend/assets/index-UPPakSLR.css +1 -0
  55. tangram_core/dist-frontend/assets/index-r8T0kY2p.js +821 -0
  56. tangram_core/dist-frontend/assets/index-r8T0kY2p.js.map +1 -0
  57. tangram_core/dist-frontend/assets/layer-DO63TrsS.js +555 -0
  58. tangram_core/dist-frontend/assets/layer-DO63TrsS.js.map +1 -0
  59. tangram_core/dist-frontend/assets/layer-extension-CZ3zsHuN.js +2 -0
  60. tangram_core/dist-frontend/assets/layer-extension-CZ3zsHuN.js.map +1 -0
  61. tangram_core/dist-frontend/assets/mesh-layers-BSECKarm.js +1123 -0
  62. tangram_core/dist-frontend/assets/mesh-layers-BSECKarm.js.map +1 -0
  63. tangram_core/dist-frontend/assets/orthographic-viewport-CzZmHDEZ.js +2 -0
  64. tangram_core/dist-frontend/assets/orthographic-viewport-CzZmHDEZ.js.map +1 -0
  65. tangram_core/dist-frontend/assets/pick-layers-pass-xhWsgZtf.js +2 -0
  66. tangram_core/dist-frontend/assets/pick-layers-pass-xhWsgZtf.js.map +1 -0
  67. tangram_core/dist-frontend/assets/project-CrvReKGW.js +760 -0
  68. tangram_core/dist-frontend/assets/project-CrvReKGW.js.map +1 -0
  69. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-4qS3_zkX.woff2 +0 -0
  70. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-CDK-EZBY.woff +0 -0
  71. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-Bgns473E.woff +0 -0
  72. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-_T2aQlWs.woff2 +0 -0
  73. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-CvEVpWxD.woff +0 -0
  74. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-s4PklZE0.woff2 +0 -0
  75. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-9RN-Z7cI.woff2 +0 -0
  76. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-BGMkBBYx.woff +0 -0
  77. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-C7erd-g8.woff +0 -0
  78. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-DR5R5TWx.woff2 +0 -0
  79. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-DGo1Ayjq.woff2 +0 -0
  80. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-WtM1l1qc.woff +0 -0
  81. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-C8FNIdXm.woff2 +0 -0
  82. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-TLDmfi3Q.woff +0 -0
  83. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CTXjXnze.woff2 +0 -0
  84. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CWPRiRXS.woff +0 -0
  85. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-CR6qj4Z4.woff2 +0 -0
  86. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-DHRaIs10.woff +0 -0
  87. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-D5vBSIyg.woff2 +0 -0
  88. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-FabMgVmk.woff +0 -0
  89. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-BIN62cw9.woff +0 -0
  90. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-Hsn-wDIp.woff2 +0 -0
  91. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-89Up2Xly.woff +0 -0
  92. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-DWMOA2VK.woff2 +0 -0
  93. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-D_BR-3LG.woff2 +0 -0
  94. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-om57GXsO.woff +0 -0
  95. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-BICmKrXV.woff2 +0 -0
  96. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-D2e7XwB1.woff +0 -0
  97. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-3p2daRJW.woff2 +0 -0
  98. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-Dc9bsamC.woff +0 -0
  99. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-BOl6B_hI.woff +0 -0
  100. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-DRbp0YnP.woff2 +0 -0
  101. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-BXrkWnoY.woff +0 -0
  102. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-Bhem1d5z.woff2 +0 -0
  103. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-DT8nEsYA.woff +0 -0
  104. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-OHaX69iP.woff2 +0 -0
  105. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-CcSTXKtO.woff2 +0 -0
  106. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-JgPl2bDS.woff +0 -0
  107. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-B004qtqu.woff2 +0 -0
  108. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-O6H_RRvN.woff +0 -0
  109. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-BwUYFJ2t.woff2 +0 -0
  110. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-DV8QogUk.woff +0 -0
  111. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-0o1laQ-g.woff2 +0 -0
  112. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-CPsdS8_S.woff +0 -0
  113. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-G9shSJ2z.woff +0 -0
  114. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-TFWhjk13.woff2 +0 -0
  115. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-BtNeb9D6.woff +0 -0
  116. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-D35V1G0s.woff2 +0 -0
  117. tangram_core/dist-frontend/assets/shader-BJmsOfPx.js +843 -0
  118. tangram_core/dist-frontend/assets/shader-BJmsOfPx.js.map +1 -0
  119. tangram_core/dist-frontend/assets/solid-polygon-layer-DiarVGxh.js +392 -0
  120. tangram_core/dist-frontend/assets/solid-polygon-layer-DiarVGxh.js.map +1 -0
  121. tangram_core/dist-frontend/assets/tesselator-49Dw9L5A.js +2 -0
  122. tangram_core/dist-frontend/assets/tesselator-49Dw9L5A.js.map +1 -0
  123. tangram_core/dist-frontend/assets/webgl-developer-tools-CZl8qVFg.js +7 -0
  124. tangram_core/dist-frontend/assets/webgl-developer-tools-CZl8qVFg.js.map +1 -0
  125. tangram_core/dist-frontend/assets/webgl-device-BY0-CUP6.js +3 -0
  126. tangram_core/dist-frontend/assets/webgl-device-BY0-CUP6.js.map +1 -0
  127. tangram_core/dist-frontend/assets/widget-BbOeHGj0.js +2 -0
  128. tangram_core/dist-frontend/assets/widget-BbOeHGj0.js.map +1 -0
  129. tangram_core/dist-frontend/core.js +60 -0
  130. tangram_core/dist-frontend/core.js.map +1 -0
  131. tangram_core/dist-frontend/extensions.js +609 -0
  132. tangram_core/dist-frontend/extensions.js.map +1 -0
  133. tangram_core/dist-frontend/favicon.ico +0 -0
  134. tangram_core/dist-frontend/favicon.png +0 -0
  135. tangram_core/dist-frontend/font-awesome.min.css +4 -0
  136. tangram_core/dist-frontend/fonts/FontAwesome.otf +0 -0
  137. tangram_core/dist-frontend/fonts/fontawesome-webfont.eot +0 -0
  138. tangram_core/dist-frontend/fonts/fontawesome-webfont.svg +2671 -0
  139. tangram_core/dist-frontend/fonts/fontawesome-webfont.ttf +0 -0
  140. tangram_core/dist-frontend/fonts/fontawesome-webfont.woff +0 -0
  141. tangram_core/dist-frontend/fonts/fontawesome-webfont.woff2 +0 -0
  142. tangram_core/dist-frontend/geo-layers.js +115 -0
  143. tangram_core/dist-frontend/geo-layers.js.map +1 -0
  144. tangram_core/dist-frontend/index.html +38 -0
  145. tangram_core/dist-frontend/json.js +3 -0
  146. tangram_core/dist-frontend/json.js.map +1 -0
  147. tangram_core/dist-frontend/layers.js +268 -0
  148. tangram_core/dist-frontend/layers.js.map +1 -0
  149. tangram_core/dist-frontend/lit-html.js +7 -0
  150. tangram_core/dist-frontend/lit-html.js.map +1 -0
  151. tangram_core/dist-frontend/mapbox.js +2 -0
  152. tangram_core/dist-frontend/mapbox.js.map +1 -0
  153. tangram_core/dist-frontend/maplibre-gl.js +59 -0
  154. tangram_core/dist-frontend/maplibre-gl.js.map +1 -0
  155. tangram_core/dist-frontend/mesh-layers.js +2 -0
  156. tangram_core/dist-frontend/mesh-layers.js.map +1 -0
  157. tangram_core/dist-frontend/rs1090_wasm.js +813 -0
  158. tangram_core/dist-frontend/rs1090_wasm_bg.wasm +0 -0
  159. tangram_core/dist-frontend/vue.esm-browser.prod.js +13 -0
  160. tangram_core/dist-frontend/widgets.js +3 -0
  161. tangram_core/dist-frontend/widgets.js.map +1 -0
  162. tangram_core/main.ts +16 -0
  163. tangram_core/plugin.py +70 -0
  164. tangram_core/plugin.ts +41 -0
  165. tangram_core/redis.py +89 -0
  166. tangram_core/user.css +114 -0
  167. tangram_core/vite-plugin-tangram.mjs +88 -0
  168. tangram_core-0.2.0.dist-info/METADATA +37 -0
  169. tangram_core-0.2.0.dist-info/RECORD +171 -0
  170. tangram_core-0.2.0.dist-info/WHEEL +4 -0
  171. tangram_core-0.2.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,2 @@
1
+ const It=globalThis,kt=globalThis.process||{},ks=globalThis.navigator||{};function Le(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function Nt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Le()}const ie="4.1.0";function Re(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch{return null}}class Se{constructor(t,n,s="sessionStorage"){this.storage=Re(s),this.id=t,this.config=n,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}}_loadConfiguration(){let t={};if(this.storage){const n=this.storage.getItem(this.id);t=n?JSON.parse(n):{}}return Object.assign(this.config,t),this}}function we(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Ne(e,t=8){const n=Math.max(t-e.length,0);return`${" ".repeat(n)}${e}`}var rt;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(rt||(rt={}));const ve=10;function $t(e){return typeof e!="string"?e:(e=e.toUpperCase(),rt[e]||rt.WHITE)}function Fe(e,t,n){return!Nt&&typeof e=="string"&&(t&&(e=`\x1B[${$t(t)}m${e}\x1B[39m`),n&&(e=`\x1B[${$t(n)+ve}m${e}\x1B[49m`)),e}function Pe(e,t=["constructor"]){const n=Object.getPrototypeOf(e),s=Object.getOwnPropertyNames(n),i=e;for(const r of s){const o=i[r];typeof o=="function"&&(t.find(c=>r===c)||(i[r]=o.bind(e)))}}function vt(e,t){if(!e)throw new Error("Assertion failed")}function Y(){let e;if(Nt()&&It.performance)e=It?.performance?.now?.();else if("hrtime"in kt){const t=kt?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}const U={debug:Nt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Oe={enabled:!0,level:0};function W(){}const Dt={},Bt={once:!0};class Ft{constructor({id:t}={id:""}){this.VERSION=ie,this._startTs=Y(),this._deltaTs=Y(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Se(`__probe-${this.id}__`,Oe),this.timeStamp(`${this.id} started`),Pe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Y()-this._startTs).toPrecision(10))}getDelta(){return Number((Y()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,n){this._storage.setConfiguration({[t]:n})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,n){if(!t)throw new Error(n||"Assertion failed")}warn(t){return this._getLogFunction(0,t,U.warn,arguments,Bt)}error(t){return this._getLogFunction(0,t,U.error,arguments)}deprecated(t,n){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${n}\` instead`)}removed(t,n){return this.error(`\`${t}\` has been removed. Use \`${n}\` instead`)}probe(t,n){return this._getLogFunction(t,n,U.log,arguments,{time:!0,once:!0})}log(t,n){return this._getLogFunction(t,n,U.debug,arguments)}info(t,n){return this._getLogFunction(t,n,console.info,arguments)}once(t,n){return this._getLogFunction(t,n,U.debug||U.info,arguments,Bt)}table(t,n,s){return n?this._getLogFunction(t,n,console.table||W,s&&[s],{tag:Ie(n)}):W}time(t,n){return this._getLogFunction(t,n,console.time?console.time:console.info)}timeEnd(t,n){return this._getLogFunction(t,n,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,n){return this._getLogFunction(t,n,console.timeStamp||W)}group(t,n,s={collapsed:!1}){const i=zt({logLevel:t,message:n,opts:s}),{collapsed:r}=s;return i.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,n,s={}){return this.group(t,n,Object.assign({},s,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||W)}withGroup(t,n,s){this.group(t,n)();try{s()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=re(t)}_getLogFunction(t,n,s,i,r){if(this._shouldLog(t)){r=zt({logLevel:t,message:n,args:i,opts:r}),s=s||r.method,vt(s),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Y();const o=r.tag||r.message;if(r.once&&o)if(!Dt[o])Dt[o]=Y();else return W;return n=Ce(this.id,r.message,r),s.bind(console,n,...r.args)}return W}}Ft.VERSION=ie;function re(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return vt(Number.isFinite(t)&&t>=0),t}function zt(e){const{logLevel:t,message:n}=e;e.logLevel=re(t);const s=e.args?Array.from(e.args):[];for(;s.length&&s.shift()!==n;);switch(typeof t){case"string":case"function":n!==void 0&&s.unshift(n),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const i=typeof e.message;return vt(i==="string"||i==="object"),Object.assign(e,{args:s},e.opts)}function Ce(e,t,n){if(typeof t=="string"){const s=n.time?Ne(we(n.total)):"";t=n.time?`${e}: ${s} ${t}`:`${e}: ${t}`,t=Fe(t,n.color,n.background)}return t}function Ie(e){for(const t in e)for(const n in e[t])return n||"untitled";return"empty"}const oe=new Ft({id:"deck"}),$s=new Ft({id:"luma.gl"}),mt={};function ke(e="id"){mt[e]=mt[e]||1;const t=mt[e]++;return`${e}-${t}`}class Yt{static defaultProps={id:"undefined",handle:void 0,userData:void 0};toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(t,n,s){if(!t)throw new Error("no device");this._device=t,this.props=$e(n,s);const i=this.props.id!=="undefined"?this.props.id:ke(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(t){this._attachedResources.add(t)}detachResource(t){this._attachedResources.delete(t)}destroyAttachedResource(t){this._attachedResources.delete(t)&&t.destroy()}destroyAttachedResources(){for(const t of Object.values(this._attachedResources))t.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const t=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];t.get(`${n}s Active`).decrementCount()}trackAllocatedMemory(t,n=this[Symbol.toStringTag]){const s=this._device.statsManager.getStats("Resource Counts");s.get("GPU Memory").addCount(t),s.get(`${n} Memory`).addCount(t),this.allocatedBytes=t}trackDeallocatedMemory(t=this[Symbol.toStringTag]){const n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").subtractCount(this.allocatedBytes),n.get(`${t} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const t=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];t.get("Resources Created").incrementCount(),t.get(`${n}s Created`).incrementCount(),t.get(`${n}s Active`).incrementCount()}}function $e(e,t){const n={...t};for(const s in e)e[s]!==void 0&&(n[s]=e[s]);return n}class st extends Yt{static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(t,n){const s={...n};(n.usage||0)&st.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?s.indexType="uint32":n.data instanceof Uint16Array&&(s.indexType="uint16")),delete s.data,super(t,s,st.defaultProps),this.usage=s.usage||0,this.indexType=s.indexType,this.updateTimestamp=t.incrementTimestamp()}clone(t){return this.device.createBuffer({...this.props,...t})}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(t,n,s){const i=ArrayBuffer.isView(t)?t.buffer:t,r=Math.min(t?t.byteLength:s,st.DEBUG_DATA_MAX_LENGTH);i===null?this.debugData=new ArrayBuffer(r):n===0&&s===i.byteLength?this.debugData=i.slice(0,r):this.debugData=i.slice(n,n+r)}static defaultProps={...Yt.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",onMapped:void 0}}function De(e){const[t,n,s]=Pt[e],i=e.includes("norm"),r=!i&&!e.startsWith("float"),o=e.startsWith("s");return{signedType:t,primitiveType:n,byteLength:s,normalized:i,integer:r,signed:o}}function Be(e){const t=e;switch(t){case"uint8":return"unorm8";case"sint8":return"snorm8";case"uint16":return"unorm16";case"sint16":return"snorm16";default:return t}}function Ds(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}function ze(e){const t=ArrayBuffer.isView(e)?e.constructor:e;if(t===Uint8ClampedArray)return"uint8";const n=Object.values(Pt).find(s=>t===s[4]);if(!n)throw new Error(t.name);return n[0]}function Bs(e){const[,,,,t]=Pt[e];return t}const Pt={uint8:["uint8","u32",1,!1,Uint8Array],sint8:["sint8","i32",1,!1,Int8Array],unorm8:["uint8","f32",1,!0,Uint8Array],snorm8:["sint8","f32",1,!0,Int8Array],uint16:["uint16","u32",2,!1,Uint16Array],sint16:["sint16","i32",2,!1,Int16Array],unorm16:["uint16","u32",2,!0,Uint16Array],snorm16:["sint16","i32",2,!0,Int16Array],float16:["float16","f16",2,!1,Uint16Array],float32:["float32","f32",4,!1,Float32Array],uint32:["uint32","u32",4,!1,Uint32Array],sint32:["sint32","i32",4,!1,Int32Array]};function zs(e){let t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);const[n,s]=e.split("x"),i=n,r=s?parseInt(s):1,o=De(i),c={type:i,components:r,byteLength:o.byteLength*r,integer:o.integer,signed:o.signed,normalized:o.normalized};return t&&(c.webglOnly=!0),c}function Ye(e,t,n){const s=n?Be(e):e;switch(s){case"unorm8":return t===1?"unorm8":t===3?"unorm8x3-webgl":`${s}x${t}`;case"snorm8":case"uint8":case"sint8":case"uint16":case"sint16":case"unorm16":case"snorm16":case"float16":if(t===1||t===3)throw new Error(`size: ${t}`);return`${s}x${t}`;default:return t===1?s:`${s}x${t}`}}function Ys(e,t,n){if(!t||t>4)throw new Error(`size ${t}`);const s=t,i=ze(e);return Ye(i,s,n)}function Us(e){let t;switch(e.primitiveType){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return e.components<=2?"float16x2":"float16x4"}return e.components===1?t:`${t}x${e.components}`}const Ue=1/Math.PI*180,We=1/180*Math.PI,Ve={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Ve}};const O=globalThis.mathgl.config;function qe(e,{precision:t=O.precision}={}){return e=je(e),`${parseFloat(e.toPrecision(t))}`}function G(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ws(e){return Ge(e)}function Vs(e){return Xe(e)}function Ge(e,t){return Ot(e,n=>n*We,t)}function Xe(e,t){return Ot(e,n=>n*Ue,t)}function ot(e,t,n){return Ot(e,s=>Math.max(t,Math.min(n,s)))}function He(e,t,n){return G(e)?e.map((s,i)=>He(s,t[i],n)):n*t+(1-n)*e}function ct(e,t,n){const s=O.EPSILON;n&&(O.EPSILON=n);try{if(e===t)return!0;if(G(e)&&G(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!ct(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=O.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{O.EPSILON=s}}function je(e){return Math.round(e/O.EPSILON)*O.EPSILON}function Ze(e){return e.clone?e.clone():new Array(e.length)}function Ot(e,t,n){if(G(e)){const s=e;n=n||Ze(s);for(let i=0;i<n.length&&i<s.length;++i){const r=typeof e=="number"?e:e[i];n[i]=t(r,i,n)}return n}return t(e)}class ce extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,n=0){for(let s=0;s<this.ELEMENTS;++s)this[s]=t[s+n];return this.check()}toArray(t=[],n=0){for(let s=0;s<this.ELEMENTS;++s)t[n+s]=this[s];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:G(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(O)}formatString(t){let n="";for(let s=0;s<this.ELEMENTS;++s)n+=(s>0?", ":"")+qe(this[s],t);return`${t.printTypes?this.constructor.name:""}[${n}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(!ct(this[n],t[n]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(this[n]!==t[n])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,n,s){if(s===void 0)return this.lerp(this,t,n);for(let i=0;i<this.ELEMENTS;++i){const r=t[i],o=typeof n=="number"?n:n[i];this[i]=r+s*(o-r)}return this.check()}min(t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(t[n],this[n]);return this.check()}max(t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.max(t[n],this[n]);return this.check()}clamp(t,n){for(let s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t[s]),n[s]);return this.check()}add(...t){for(const n of t)for(let s=0;s<this.ELEMENTS;++s)this[s]+=n[s];return this.check()}subtract(...t){for(const n of t)for(let s=0;s<this.ELEMENTS;++s)this[s]-=n[s];return this.check()}scale(t){if(typeof t=="number")for(let n=0;n<this.ELEMENTS;++n)this[n]*=t;else for(let n=0;n<this.ELEMENTS&&n<t.length;++n)this[n]*=t[n];return this.check()}multiplyByScalar(t){for(let n=0;n<this.ELEMENTS;++n)this[n]*=t;return this.check()}check(){if(O.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let n=0;n<this.ELEMENTS;++n)t=t&&Number.isFinite(this[n]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let n=0;n<this.ELEMENTS;++n)this[n]=t;return this.check()}addScalar(t){for(let n=0;n<this.ELEMENTS;++n)this[n]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let n=0;n<this.ELEMENTS;++n)this[n]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,n){for(let s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t),n);return this.check()}get elements(){return this}}function Ke(e,t){if(e.length!==t)return!1;for(let n=0;n<e.length;++n)if(!Number.isFinite(e[n]))return!1;return!0}function P(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function pt(e,t,n=""){if(O.debug&&!Ke(e,t))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return e}function Ut(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}class Qe extends ce{get x(){return this[0]}set x(t){this[0]=P(t)}get y(){return this[1]}set y(t){this[1]=P(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*this[n];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let n=0;for(let s=0;s<this.ELEMENTS;++s){const i=this[s]-t[s];n+=i*i}return P(n)}dot(t){let n=0;for(let s=0;s<this.ELEMENTS;++s)n+=this[s]*t[s];return P(n)}normalize(){const t=this.magnitude();if(t!==0)for(let n=0;n<this.ELEMENTS;++n)this[n]/=t;return this.check()}multiply(...t){for(const n of t)for(let s=0;s<this.ELEMENTS;++s)this[s]*=n[s];return this.check()}divide(...t){for(const n of t)for(let s=0;s<this.ELEMENTS;++s)this[s]/=n[s];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ut(t>=0&&t<this.ELEMENTS,"index is out of range"),P(this[t])}setComponent(t,n){return Ut(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=n,this.check()}addVectors(t,n){return this.copy(t).add(n)}subVectors(t,n){return this.copy(t).subtract(n)}multiplyVectors(t,n){return this.copy(t).multiply(n)}addScaledVector(t,n){return this.add(new this.constructor(t).multiplyScalar(n))}}const it=1e-6;let B=typeof Float32Array<"u"?Float32Array:Array;function Je(){const e=new B(2);return B!=Float32Array&&(e[0]=0,e[1]=0),e}function Wt(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function tn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function qs(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function Gs(e){const t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function en(e,t){return e[0]=-t[0],e[1]=-t[1],e}function ae(e,t,n,s){const i=t[0],r=t[1];return e[0]=i+s*(n[0]-i),e[1]=r+s*(n[1]-r),e}function Xs(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[2]*i,e[1]=n[1]*s+n[3]*i,e}function Hs(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[2]*i+n[4],e[1]=n[1]*s+n[3]*i+n[5],e}function js(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[3]*i+n[6],e[1]=n[1]*s+n[4]*i+n[7],e}function nn(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[4]*i+n[12],e[1]=n[1]*s+n[5]*i+n[13],e}const Zs=tn;(function(){const e=Je();return function(t,n,s,i,r,o){let c,a;for(n||(n=2),s||(s=0),i?a=Math.min(i*n+s,t.length):a=t.length,c=s;c<a;c+=n)e[0]=t[c],e[1]=t[c+1],r(e,e,o),t[c]=e[0],t[c+1]=e[1];return t}})();function sn(e,t,n){const s=t[0],i=t[1],r=n[3]*s+n[7]*i||1;return e[0]=(n[0]*s+n[4]*i)/r,e[1]=(n[1]*s+n[5]*i)/r,e}function he(e,t,n){const s=t[0],i=t[1],r=t[2],o=n[3]*s+n[7]*i+n[11]*r||1;return e[0]=(n[0]*s+n[4]*i+n[8]*r)/o,e[1]=(n[1]*s+n[5]*i+n[9]*r)/o,e[2]=(n[2]*s+n[6]*i+n[10]*r)/o,e}function rn(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[2]*i,e[1]=n[1]*s+n[3]*i,e[2]=t[2],e}function Ks(e,t,n){const s=t[0],i=t[1];return e[0]=n[0]*s+n[2]*i,e[1]=n[1]*s+n[3]*i,e[2]=t[2],e[3]=t[3],e}function Qs(e,t,n){const s=t[0],i=t[1],r=t[2];return e[0]=n[0]*s+n[3]*i+n[6]*r,e[1]=n[1]*s+n[4]*i+n[7]*r,e[2]=n[2]*s+n[5]*i+n[8]*r,e[3]=t[3],e}function on(){const e=new B(3);return B!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function cn(e){const t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}function Js(e,t,n){const s=new B(3);return s[0]=e,s[1]=t,s[2]=n,s}function an(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function hn(e,t){const n=t[0]-e[0],s=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+s*s+i*i)}function ln(e){const t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}function fn(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ti(e,t){const n=t[0],s=t[1],i=t[2];let r=n*n+s*s+i*i;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function un(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function dn(e,t,n){const s=t[0],i=t[1],r=t[2],o=n[0],c=n[1],a=n[2];return e[0]=i*a-r*c,e[1]=r*o-s*a,e[2]=s*c-i*o,e}function ei(e,t,n,s){const i=t[0],r=t[1],o=t[2];return e[0]=i+s*(n[0]-i),e[1]=r+s*(n[1]-r),e[2]=o+s*(n[2]-o),e}function le(e,t,n){const s=t[0],i=t[1],r=t[2];let o=n[3]*s+n[7]*i+n[11]*r+n[15];return o=o||1,e[0]=(n[0]*s+n[4]*i+n[8]*r+n[12])/o,e[1]=(n[1]*s+n[5]*i+n[9]*r+n[13])/o,e[2]=(n[2]*s+n[6]*i+n[10]*r+n[14])/o,e}function gn(e,t,n){const s=t[0],i=t[1],r=t[2];return e[0]=s*n[0]+i*n[3]+r*n[6],e[1]=s*n[1]+i*n[4]+r*n[7],e[2]=s*n[2]+i*n[5]+r*n[8],e}function mn(e,t,n){const s=n[0],i=n[1],r=n[2],o=n[3],c=t[0],a=t[1],h=t[2];let l=i*h-r*a,f=r*c-s*h,u=s*a-i*c,d=i*u-r*f,g=r*l-s*u,m=s*f-i*l;const E=o*2;return l*=E,f*=E,u*=E,d*=2,g*=2,m*=2,e[0]=c+l+d,e[1]=a+f+g,e[2]=h+u+m,e}function pn(e,t,n,s){const i=[],r=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],r[0]=i[0],r[1]=i[1]*Math.cos(s)-i[2]*Math.sin(s),r[2]=i[1]*Math.sin(s)+i[2]*Math.cos(s),e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e}function En(e,t,n,s){const i=[],r=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],r[0]=i[2]*Math.sin(s)+i[0]*Math.cos(s),r[1]=i[1],r[2]=i[2]*Math.cos(s)-i[0]*Math.sin(s),e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e}function yn(e,t,n,s){const i=[],r=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],r[0]=i[0]*Math.cos(s)-i[1]*Math.sin(s),r[1]=i[0]*Math.sin(s)+i[1]*Math.cos(s),r[2]=i[2],e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e}function Tn(e,t){const n=e[0],s=e[1],i=e[2],r=t[0],o=t[1],c=t[2],a=Math.sqrt((n*n+s*s+i*i)*(r*r+o*o+c*c)),h=a&&un(e,t)/a;return Math.acos(Math.min(Math.max(h,-1),1))}const ni=an,si=hn,ii=cn,ri=ln;(function(){const e=on();return function(t,n,s,i,r,o){let c,a;for(n||(n=3),s||(s=0),i?a=Math.min(i*n+s,t.length):a=t.length,c=s;c<a;c+=n)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],r(e,e,o),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2];return t}})();const Et=[0,0,0];let J;class X extends Qe{static get ZERO(){return J||(J=new X(0,0,0),Object.freeze(J)),J}constructor(t=0,n=0,s=0){super(-0,-0,-0),arguments.length===1&&G(t)?this.copy(t):(O.debug&&(P(t),P(n),P(s)),this[0]=t,this[1]=n,this[2]=s)}set(t,n,s){return this[0]=t,this[1]=n,this[2]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return O.debug&&(P(t.x),P(t.y),P(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=P(t)}angle(t){return Tn(this,t)}cross(t){return dn(this,this,t),this.check()}rotateX({radians:t,origin:n=Et}){return pn(this,this,n,t),this.check()}rotateY({radians:t,origin:n=Et}){return En(this,this,n,t),this.check()}rotateZ({radians:t,origin:n=Et}){return yn(this,this,n,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return le(this,this,t),this.check()}transformAsVector(t){return he(this,this,t),this.check()}transformByMatrix3(t){return gn(this,this,t),this.check()}transformByMatrix2(t){return rn(this,this,t),this.check()}transformByQuaternion(t){return mn(this,this,t),this.check()}}class Mn extends ce{toString(){let t="[";if(O.printRowMajor){t+="row-major:";for(let n=0;n<this.RANK;++n)for(let s=0;s<this.RANK;++s)t+=` ${this[s*this.RANK+n]}`}else{t+="column-major:";for(let n=0;n<this.ELEMENTS;++n)t+=` ${this[n]}`}return t+="]",t}getElementIndex(t,n){return n*this.RANK+t}getElement(t,n){return this[n*this.RANK+t]}setElement(t,n,s){return this[n*this.RANK+t]=P(s),this}getColumn(t,n=new Array(this.RANK).fill(-0)){const s=t*this.RANK;for(let i=0;i<this.RANK;++i)n[i]=this[s+i];return n}setColumn(t,n){const s=t*this.RANK;for(let i=0;i<this.RANK;++i)this[s+i]=n[i];return this}}function An(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _n(e,t){if(e===t){const n=t[1],s=t[2],i=t[3],r=t[6],o=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=r,e[11]=t[14],e[12]=i,e[13]=o,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function xt(e,t){const n=t[0],s=t[1],i=t[2],r=t[3],o=t[4],c=t[5],a=t[6],h=t[7],l=t[8],f=t[9],u=t[10],d=t[11],g=t[12],m=t[13],E=t[14],_=t[15],b=n*c-s*o,p=n*a-i*o,T=n*h-r*o,M=s*a-i*c,y=s*h-r*c,S=i*h-r*a,w=l*m-f*g,N=l*E-u*g,v=l*_-d*g,F=f*E-u*m,I=f*_-d*m,k=u*_-d*E;let x=b*k-p*I+T*F+M*v-y*N+S*w;return x?(x=1/x,e[0]=(c*k-a*I+h*F)*x,e[1]=(i*I-s*k-r*F)*x,e[2]=(m*S-E*y+_*M)*x,e[3]=(u*y-f*S-d*M)*x,e[4]=(a*v-o*k-h*N)*x,e[5]=(n*k-i*v+r*N)*x,e[6]=(E*T-g*S-_*p)*x,e[7]=(l*S-u*T+d*p)*x,e[8]=(o*I-c*v+h*w)*x,e[9]=(s*v-n*I-r*w)*x,e[10]=(g*y-m*T+_*b)*x,e[11]=(f*T-l*y-d*b)*x,e[12]=(c*N-o*F-a*w)*x,e[13]=(n*F-s*N+i*w)*x,e[14]=(m*p-g*M-E*b)*x,e[15]=(l*M-f*p+u*b)*x,e):null}function bn(e){const t=e[0],n=e[1],s=e[2],i=e[3],r=e[4],o=e[5],c=e[6],a=e[7],h=e[8],l=e[9],f=e[10],u=e[11],d=e[12],g=e[13],m=e[14],E=e[15],_=t*o-n*r,b=t*c-s*r,p=n*c-s*o,T=h*g-l*d,M=h*m-f*d,y=l*m-f*g,S=t*y-n*M+s*T,w=r*y-o*M+c*T,N=h*p-l*b+f*_,v=d*p-g*b+m*_;return a*S-i*w+E*N-u*v}function Q(e,t,n){const s=t[0],i=t[1],r=t[2],o=t[3],c=t[4],a=t[5],h=t[6],l=t[7],f=t[8],u=t[9],d=t[10],g=t[11],m=t[12],E=t[13],_=t[14],b=t[15];let p=n[0],T=n[1],M=n[2],y=n[3];return e[0]=p*s+T*c+M*f+y*m,e[1]=p*i+T*a+M*u+y*E,e[2]=p*r+T*h+M*d+y*_,e[3]=p*o+T*l+M*g+y*b,p=n[4],T=n[5],M=n[6],y=n[7],e[4]=p*s+T*c+M*f+y*m,e[5]=p*i+T*a+M*u+y*E,e[6]=p*r+T*h+M*d+y*_,e[7]=p*o+T*l+M*g+y*b,p=n[8],T=n[9],M=n[10],y=n[11],e[8]=p*s+T*c+M*f+y*m,e[9]=p*i+T*a+M*u+y*E,e[10]=p*r+T*h+M*d+y*_,e[11]=p*o+T*l+M*g+y*b,p=n[12],T=n[13],M=n[14],y=n[15],e[12]=p*s+T*c+M*f+y*m,e[13]=p*i+T*a+M*u+y*E,e[14]=p*r+T*h+M*d+y*_,e[15]=p*o+T*l+M*g+y*b,e}function at(e,t,n){const s=n[0],i=n[1],r=n[2];let o,c,a,h,l,f,u,d,g,m,E,_;return t===e?(e[12]=t[0]*s+t[4]*i+t[8]*r+t[12],e[13]=t[1]*s+t[5]*i+t[9]*r+t[13],e[14]=t[2]*s+t[6]*i+t[10]*r+t[14],e[15]=t[3]*s+t[7]*i+t[11]*r+t[15]):(o=t[0],c=t[1],a=t[2],h=t[3],l=t[4],f=t[5],u=t[6],d=t[7],g=t[8],m=t[9],E=t[10],_=t[11],e[0]=o,e[1]=c,e[2]=a,e[3]=h,e[4]=l,e[5]=f,e[6]=u,e[7]=d,e[8]=g,e[9]=m,e[10]=E,e[11]=_,e[12]=o*s+l*i+g*r+t[12],e[13]=c*s+f*i+m*r+t[13],e[14]=a*s+u*i+E*r+t[14],e[15]=h*s+d*i+_*r+t[15]),e}function Ct(e,t,n){const s=n[0],i=n[1],r=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function xn(e,t,n,s){let i=s[0],r=s[1],o=s[2],c=Math.sqrt(i*i+r*r+o*o),a,h,l,f,u,d,g,m,E,_,b,p,T,M,y,S,w,N,v,F,I,k,x,j;return c<it?null:(c=1/c,i*=c,r*=c,o*=c,h=Math.sin(n),a=Math.cos(n),l=1-a,f=t[0],u=t[1],d=t[2],g=t[3],m=t[4],E=t[5],_=t[6],b=t[7],p=t[8],T=t[9],M=t[10],y=t[11],S=i*i*l+a,w=r*i*l+o*h,N=o*i*l-r*h,v=i*r*l-o*h,F=r*r*l+a,I=o*r*l+i*h,k=i*o*l+r*h,x=r*o*l-i*h,j=o*o*l+a,e[0]=f*S+m*w+p*N,e[1]=u*S+E*w+T*N,e[2]=d*S+_*w+M*N,e[3]=g*S+b*w+y*N,e[4]=f*v+m*F+p*I,e[5]=u*v+E*F+T*I,e[6]=d*v+_*F+M*I,e[7]=g*v+b*F+y*I,e[8]=f*k+m*x+p*j,e[9]=u*k+E*x+T*j,e[10]=d*k+_*x+M*j,e[11]=g*k+b*x+y*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function fe(e,t,n){const s=Math.sin(n),i=Math.cos(n),r=t[4],o=t[5],c=t[6],a=t[7],h=t[8],l=t[9],f=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=r*i+h*s,e[5]=o*i+l*s,e[6]=c*i+f*s,e[7]=a*i+u*s,e[8]=h*i-r*s,e[9]=l*i-o*s,e[10]=f*i-c*s,e[11]=u*i-a*s,e}function Ln(e,t,n){const s=Math.sin(n),i=Math.cos(n),r=t[0],o=t[1],c=t[2],a=t[3],h=t[8],l=t[9],f=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*i-h*s,e[1]=o*i-l*s,e[2]=c*i-f*s,e[3]=a*i-u*s,e[8]=r*s+h*i,e[9]=o*s+l*i,e[10]=c*s+f*i,e[11]=a*s+u*i,e}function ue(e,t,n){const s=Math.sin(n),i=Math.cos(n),r=t[0],o=t[1],c=t[2],a=t[3],h=t[4],l=t[5],f=t[6],u=t[7];return t!==e&&(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[0]=r*i+h*s,e[1]=o*i+l*s,e[2]=c*i+f*s,e[3]=a*i+u*s,e[4]=h*i-r*s,e[5]=l*i-o*s,e[6]=f*i-c*s,e[7]=u*i-a*s,e}function oi(e,t){const n=t[0],s=t[1],i=t[2],r=t[4],o=t[5],c=t[6],a=t[8],h=t[9],l=t[10];return e[0]=Math.sqrt(n*n+s*s+i*i),e[1]=Math.sqrt(r*r+o*o+c*c),e[2]=Math.sqrt(a*a+h*h+l*l),e}function Rn(e,t){const n=t[0],s=t[1],i=t[2],r=t[3],o=n+n,c=s+s,a=i+i,h=n*o,l=s*o,f=s*c,u=i*o,d=i*c,g=i*a,m=r*o,E=r*c,_=r*a;return e[0]=1-f-g,e[1]=l+_,e[2]=u-E,e[3]=0,e[4]=l-_,e[5]=1-h-g,e[6]=d+m,e[7]=0,e[8]=u+E,e[9]=d-m,e[10]=1-h-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Sn(e,t,n,s,i,r,o){const c=1/(n-t),a=1/(i-s),h=1/(r-o);return e[0]=r*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r*2*a,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(i+s)*a,e[10]=(o+r)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*r*2*h,e[15]=0,e}function wn(e,t,n,s,i){const r=1/Math.tan(t/2);if(e[0]=r/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){const o=1/(s-i);e[10]=(i+s)*o,e[14]=2*i*s*o}else e[10]=-1,e[14]=-2*s;return e}const Nn=wn;function vn(e,t,n,s,i,r,o){const c=1/(t-n),a=1/(s-i),h=1/(r-o);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+n)*c,e[13]=(i+s)*a,e[14]=(o+r)*h,e[15]=1,e}const Fn=vn;function Pn(e,t,n,s){let i,r,o,c,a,h,l,f,u,d;const g=t[0],m=t[1],E=t[2],_=s[0],b=s[1],p=s[2],T=n[0],M=n[1],y=n[2];return Math.abs(g-T)<it&&Math.abs(m-M)<it&&Math.abs(E-y)<it?An(e):(f=g-T,u=m-M,d=E-y,i=1/Math.sqrt(f*f+u*u+d*d),f*=i,u*=i,d*=i,r=b*d-p*u,o=p*f-_*d,c=_*u-b*f,i=Math.sqrt(r*r+o*o+c*c),i?(i=1/i,r*=i,o*=i,c*=i):(r=0,o=0,c=0),a=u*c-d*o,h=d*r-f*c,l=f*o-u*r,i=Math.sqrt(a*a+h*h+l*l),i?(i=1/i,a*=i,h*=i,l*=i):(a=0,h=0,l=0),e[0]=r,e[1]=a,e[2]=f,e[3]=0,e[4]=o,e[5]=h,e[6]=u,e[7]=0,e[8]=c,e[9]=l,e[10]=d,e[11]=0,e[12]=-(r*g+o*m+c*E),e[13]=-(a*g+h*m+l*E),e[14]=-(f*g+u*m+d*E),e[15]=1,e)}function On(){const e=new B(4);return B!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ci(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function Cn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function ai(e){const t=e[0],n=e[1],s=e[2],i=e[3];return Math.sqrt(t*t+n*n+s*s+i*i)}function hi(e){const t=e[0],n=e[1],s=e[2],i=e[3];return t*t+n*n+s*s+i*i}function li(e,t){const n=t[0],s=t[1],i=t[2],r=t[3];let o=n*n+s*s+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=s*o,e[2]=i*o,e[3]=r*o,e}function fi(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function ui(e,t,n,s){const i=t[0],r=t[1],o=t[2],c=t[3];return e[0]=i+s*(n[0]-i),e[1]=r+s*(n[1]-r),e[2]=o+s*(n[2]-o),e[3]=c+s*(n[3]-c),e}function de(e,t,n){const s=t[0],i=t[1],r=t[2],o=t[3];return e[0]=n[0]*s+n[4]*i+n[8]*r+n[12]*o,e[1]=n[1]*s+n[5]*i+n[9]*r+n[13]*o,e[2]=n[2]*s+n[6]*i+n[10]*r+n[14]*o,e[3]=n[3]*s+n[7]*i+n[11]*r+n[15]*o,e}function di(e,t,n){const s=t[0],i=t[1],r=t[2],o=n[0],c=n[1],a=n[2],h=n[3],l=h*s+c*r-a*i,f=h*i+a*s-o*r,u=h*r+o*i-c*s,d=-o*s-c*i-a*r;return e[0]=l*h+d*-o+f*-a-u*-c,e[1]=f*h+d*-c+u*-o-l*-a,e[2]=u*h+d*-a+l*-c-f*-o,e[3]=t[3],e}(function(){const e=On();return function(t,n,s,i,r,o){let c,a;for(n||(n=4),s||(s=0),i?a=Math.min(i*n+s,t.length):a=t.length,c=s;c<a;c+=n)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],e[3]=t[c+3],r(e,e,o),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2],t[c+3]=e[3];return t}})();var Lt;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Lt||(Lt={}));const In=45*Math.PI/180,kn=1,yt=.1,Tt=500,$n=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class z extends Mn{static get IDENTITY(){return Bn()}static get ZERO(){return Dn()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Lt}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,n,s,i,r,o,c,a,h,l,f,u,d,g,m,E){return this[0]=t,this[1]=n,this[2]=s,this[3]=i,this[4]=r,this[5]=o,this[6]=c,this[7]=a,this[8]=h,this[9]=l,this[10]=f,this[11]=u,this[12]=d,this[13]=g,this[14]=m,this[15]=E,this.check()}setRowMajor(t,n,s,i,r,o,c,a,h,l,f,u,d,g,m,E){return this[0]=t,this[1]=r,this[2]=h,this[3]=d,this[4]=n,this[5]=o,this[6]=l,this[7]=g,this[8]=s,this[9]=c,this[10]=f,this[11]=m,this[12]=i,this[13]=a,this[14]=u,this[15]=E,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy($n)}fromObject(t){return this.check()}fromQuaternion(t){return Rn(this,t),this.check()}frustum(t){const{left:n,right:s,bottom:i,top:r,near:o=yt,far:c=Tt}=t;return c===1/0?zn(this,n,s,i,r,o):Sn(this,n,s,i,r,o,c),this.check()}lookAt(t){const{eye:n,center:s=[0,0,0],up:i=[0,1,0]}=t;return Pn(this,n,s,i),this.check()}ortho(t){const{left:n,right:s,bottom:i,top:r,near:o=yt,far:c=Tt}=t;return Fn(this,n,s,i,r,o,c),this.check()}orthographic(t){const{fovy:n=In,aspect:s=kn,focalDistance:i=1,near:r=yt,far:o=Tt}=t;Vt(n);const c=n/2,a=i*Math.tan(c),h=a*s;return this.ortho({left:-h,right:h,bottom:-a,top:a,near:r,far:o})}perspective(t){const{fovy:n=45*Math.PI/180,aspect:s=1,near:i=.1,far:r=500}=t;return Vt(n),Nn(this,n,s,i,r),this.check()}determinant(){return bn(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,n){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const s=this.getScale(n),i=1/s[0],r=1/s[1],o=1/s[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,n){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const s=this.getScale(n),i=1/s[0],r=1/s[1],o=1/s[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*o,t}transpose(){return _n(this,this),this.check()}invert(){return xt(this,this),this.check()}multiplyLeft(t){return Q(this,t,this),this.check()}multiplyRight(t){return Q(this,this,t),this.check()}rotateX(t){return fe(this,this,t),this.check()}rotateY(t){return Ln(this,this,t),this.check()}rotateZ(t){return ue(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,n){return xn(this,this,t,n),this.check()}scale(t){return Ct(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return at(this,this,t),this.check()}transform(t,n){return t.length===4?(n=de(n||[-0,-0,-0,-0],t,this),pt(n,4),n):this.transformAsPoint(t,n)}transformAsPoint(t,n){const{length:s}=t;let i;switch(s){case 2:i=nn(n||[-0,-0],t,this);break;case 3:i=le(n||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return pt(i,t.length),i}transformAsVector(t,n){let s;switch(t.length){case 2:s=sn(n||[-0,-0],t,this);break;case 3:s=he(n||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return pt(s,t.length),s}transformPoint(t,n){return this.transformAsPoint(t,n)}transformVector(t,n){return this.transformAsPoint(t,n)}transformDirection(t,n){return this.transformAsVector(t,n)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,n,s){return this.identity().translate([t,n,s])}}let tt,et;function Dn(){return tt||(tt=new z([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(tt)),tt}function Bn(){return et||(et=new z,Object.freeze(et)),et}function Vt(e){if(e>Math.PI*2)throw Error("expected radians")}function zn(e,t,n,s,i,r){const o=2*r/(n-t),c=2*r/(i-s),a=(n+t)/(n-t),h=(i+s)/(i-s),l=-1,f=-1,u=-2*r;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=a,e[9]=h,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}const Yn=25;var L;(function(e){e[e.Start=1]="Start",e[e.Move=2]="Move",e[e.End=4]="End",e[e.Cancel=8]="Cancel"})(L||(L={}));var R;(function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.Up=4]="Up",e[e.Down=8]="Down",e[e.Horizontal=3]="Horizontal",e[e.Vertical=12]="Vertical",e[e.All=15]="All"})(R||(R={}));var A;(function(e){e[e.Possible=1]="Possible",e[e.Began=2]="Began",e[e.Changed=4]="Changed",e[e.Ended=8]="Ended",e[e.Recognized=8]="Recognized",e[e.Cancelled=16]="Cancelled",e[e.Failed=32]="Failed"})(A||(A={}));const gi="compute",mi="auto",Un="manipulation",Wn="none",Vn="pan-x",qn="pan-y";function ge(e){return e.trim().split(/\s+/g)}function Mt(e,t,n){if(e)for(const s of ge(t))e.addEventListener(s,n,!1)}function At(e,t,n){if(e)for(const s of ge(t))e.removeEventListener(s,n,!1)}function qt(e){return(e.ownerDocument||e).defaultView}function Gn(e,t){let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1}function me(e){const t=e.length;if(t===1)return{x:Math.round(e[0].clientX),y:Math.round(e[0].clientY)};let n=0,s=0,i=0;for(;i<t;)n+=e[i].clientX,s+=e[i].clientY,i++;return{x:Math.round(n/t),y:Math.round(s/t)}}function Gt(e){const t=[];let n=0;for(;n<e.pointers.length;)t[n]={clientX:Math.round(e.pointers[n].clientX),clientY:Math.round(e.pointers[n].clientY)},n++;return{timeStamp:Date.now(),pointers:t,center:me(t),deltaX:e.deltaX,deltaY:e.deltaY}}function pe(e,t){const n=t.x-e.x,s=t.y-e.y;return Math.sqrt(n*n+s*s)}function Xt(e,t){const n=t.clientX-e.clientX,s=t.clientY-e.clientY;return Math.sqrt(n*n+s*s)}function Xn(e,t){const n=t.x-e.x,s=t.y-e.y;return Math.atan2(s,n)*180/Math.PI}function Ht(e,t){const n=t.clientX-e.clientX,s=t.clientY-e.clientY;return Math.atan2(s,n)*180/Math.PI}function Ee(e,t){return e===t?R.None:Math.abs(e)>=Math.abs(t)?e<0?R.Left:R.Right:t<0?R.Up:R.Down}function Hn(e,t){const n=t.center;let s=e.offsetDelta,i=e.prevDelta;const r=e.prevInput;return(t.eventType===L.Start||r?.eventType===L.End)&&(i=e.prevDelta={x:r?.deltaX||0,y:r?.deltaY||0},s=e.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-s.x),deltaY:i.y+(n.y-s.y)}}function ye(e,t,n){return{x:t/e||0,y:n/e||0}}function jn(e,t){return Xt(t[0],t[1])/Xt(e[0],e[1])}function Zn(e,t){return Ht(t[1],t[0])-Ht(e[1],e[0])}function Kn(e,t){const n=e.lastInterval||t,s=t.timeStamp-n.timeStamp;let i,r,o,c;if(t.eventType!==L.Cancel&&(s>Yn||n.velocity===void 0)){const a=t.deltaX-n.deltaX,h=t.deltaY-n.deltaY,l=ye(s,a,h);r=l.x,o=l.y,i=Math.abs(l.x)>Math.abs(l.y)?l.x:l.y,c=Ee(a,h),e.lastInterval=t}else i=n.velocity,r=n.velocityX,o=n.velocityY,c=n.direction;t.velocity=i,t.velocityX=r,t.velocityY=o,t.direction=c}function Qn(e,t){const{session:n}=e,{pointers:s}=t,{length:i}=s;n.firstInput||(n.firstInput=Gt(t)),i>1&&!n.firstMultiple?n.firstMultiple=Gt(t):i===1&&(n.firstMultiple=!1);const{firstInput:r,firstMultiple:o}=n,c=o?o.center:r.center,a=t.center=me(s);t.timeStamp=Date.now(),t.deltaTime=t.timeStamp-r.timeStamp,t.angle=Xn(c,a),t.distance=pe(c,a);const{deltaX:h,deltaY:l}=Hn(n,t);t.deltaX=h,t.deltaY=l,t.offsetDirection=Ee(t.deltaX,t.deltaY);const f=ye(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=Math.abs(f.x)>Math.abs(f.y)?f.x:f.y,t.scale=o?jn(o.pointers,s):1,t.rotation=o?Zn(o.pointers,s):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length;let u=e.element;return Gn(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u,Kn(n,t),t}function Jn(e,t,n){const s=n.pointers.length,i=n.changedPointers.length,r=t&L.Start&&s-i===0,o=t&(L.End|L.Cancel)&&s-i===0;n.isFirst=!!r,n.isFinal=!!o,r&&(e.session={}),n.eventType=t;const c=Qn(e,n);e.emit("hammer.input",c),e.recognize(c),e.session.prevInput=c}let ts=class{constructor(t){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=n=>{this.manager.options.enable&&this.handler(n)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,n){Jn(this.manager,t,n)}init(){Mt(this.element,this.evEl,this.domHandler),Mt(this.target,this.evTarget,this.domHandler),Mt(qt(this.element),this.evWin,this.domHandler)}destroy(){At(this.element,this.evEl,this.domHandler),At(this.target,this.evTarget,this.domHandler),At(qt(this.element),this.evWin,this.domHandler)}};const es={pointerdown:L.Start,pointermove:L.Move,pointerup:L.End,pointercancel:L.Cancel,pointerout:L.Cancel},ns="pointerdown",ss="pointermove pointerup pointercancel";class Ei extends ts{constructor(t){super(t),this.evEl=ns,this.evWin=ss,this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){const{store:n}=this;let s=!1;const i=es[t.type],r=t.pointerType,o=r==="touch";let c=n.findIndex(a=>a.pointerId===t.pointerId);i&L.Start&&(t.buttons||o)?c<0&&(n.push(t),c=n.length-1):i&(L.End|L.Cancel)&&(s=!0),!(c<0)&&(n[c]=t,this.callback(i,{pointers:n,changedPointers:[t],eventType:i,pointerType:r,srcEvent:t}),s&&n.splice(c,1))}}let is=1;function rs(){return is++}function jt(e){return e&A.Cancelled?"cancel":e&A.Ended?"end":e&A.Changed?"move":e&A.Began?"start":""}class Te{constructor(t){this.options=t,this.id=rs(),this.state=A.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(const i of t)this.recognizeWith(i);return this}let n;if(typeof t=="string"){if(n=this.manager.get(t),!n)throw new Error(`Cannot find recognizer ${t}`)}else n=t;const{simultaneous:s}=this;return s[n.id]||(s[n.id]=n,n.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(const s of t)this.dropRecognizeWith(s);return this}let n;return typeof t=="string"?n=this.manager.get(t):n=t,n&&delete this.simultaneous[n.id],this}requireFailure(t){if(Array.isArray(t)){for(const i of t)this.requireFailure(i);return this}let n;if(typeof t=="string"){if(n=this.manager.get(t),!n)throw new Error(`Cannot find recognizer ${t}`)}else n=t;const{requireFail:s}=this;return s.indexOf(n)===-1&&(s.push(n),n.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(const s of t)this.dropRequireFailure(s);return this}let n;if(typeof t=="string"?n=this.manager.get(t):n=t,n){const s=this.requireFail.indexOf(n);s>-1&&this.requireFail.splice(s,1)}return this}hasRequireFailures(){return!!this.requireFail.find(t=>t.options.enable)}canRecognizeWith(t){return!!this.simultaneous[t.id]}emit(t){if(!t)return;const{state:n}=this;n<A.Ended&&this.manager.emit(this.options.event+jt(n),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),n>=A.Ended&&this.manager.emit(this.options.event+jt(n),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=A.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(A.Failed|A.Possible)))return!1;t++}return!0}recognize(t){const n={...t};if(!this.options.enable){this.reset(),this.state=A.Failed;return}this.state&(A.Recognized|A.Cancelled|A.Failed)&&(this.state=A.Possible),this.state=this.process(n),this.state&(A.Began|A.Changed|A.Ended|A.Cancelled)&&this.tryEmit(n)}getEventNames(){return[this.options.event]}reset(){}}class Me extends Te{attrTest(t){const n=this.options.pointers;return n===0||t.pointers.length===n}process(t){const{state:n}=this,{eventType:s}=t,i=n&(A.Began|A.Changed),r=this.attrTest(t);return i&&(s&L.Cancel||!r)?n|A.Cancelled:i||r?s&L.End?n|A.Ended:n&A.Began?n|A.Changed:A.Began:A.Failed}}class Zt extends Te{constructor(t={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[Un]}process(t){const{options:n}=this,s=t.pointers.length===n.pointers,i=t.distance<n.threshold,r=t.deltaTime<n.time;if(this.reset(),t.eventType&L.Start&&this.count===0)return this.failTimeout();if(i&&r&&s){if(t.eventType!==L.End)return this.failTimeout();const o=this.pTime?t.timeStamp-this.pTime<n.interval:!0,c=!this.pCenter||pe(this.pCenter,t.center)<n.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,!c||!o?this.count=1:this.count+=1,this._input=t,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=A.Recognized,this.tryEmit(this._input)},n.interval),A.Began):A.Recognized}return A.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=A.Failed},this.options.interval),A.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===A.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}}const os=["","start","move","end","cancel","up","down","left","right"];class Kt extends Me{constructor(t={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:R.All,...t}),this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:t}}=this,n=[];return t&R.Horizontal&&n.push(qn),t&R.Vertical&&n.push(Vn),n}getEventNames(){return os.map(t=>this.options.event+t)}directionTest(t){const{options:n}=this;let s=!0,{distance:i}=t,{direction:r}=t;const o=t.deltaX,c=t.deltaY;return r&n.direction||(n.direction&R.Horizontal?(r=o===0?R.None:o<0?R.Left:R.Right,s=o!==this.pX,i=Math.abs(t.deltaX)):(r=c===0?R.None:c<0?R.Up:R.Down,s=c!==this.pY,i=Math.abs(t.deltaY))),t.direction=r,s&&i>n.threshold&&!!(r&n.direction)}attrTest(t){return super.attrTest(t)&&(!!(this.state&A.Began)||!(this.state&A.Began)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;const n=R[t.direction].toLowerCase();n&&(t.additionalEvent=this.options.event+n),super.emit(t)}}const cs=["","start","move","end","cancel","in","out"];class as extends Me{constructor(t={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...t})}getTouchAction(){return[Wn]}getEventNames(){return cs.map(t=>this.options.event+t)}attrTest(t){return super.attrTest(t)&&(Math.abs(t.scale-1)>this.options.threshold||!!(this.state&A.Began))}emit(t){if(t.scale!==1){const n=t.scale<1?"in":"out";t.additionalEvent=this.options.event+n}super.emit(t)}}class hs{constructor(t,n,s){this.element=t,this.callback=n,this.options=s}}const ls=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",fs=ls.indexOf("firefox")!==-1,Qt=4.000244140625,us=40,ds=.25;class yi extends hs{constructor(t,n,s){super(t,n,{enable:!0,...s}),this.handleEvent=i=>{if(!this.options.enable)return;let r=i.deltaY;globalThis.WheelEvent&&(fs&&i.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(r/=globalThis.devicePixelRatio),i.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(r*=us)),r!==0&&r%Qt===0&&(r=Math.floor(r/Qt)),i.shiftKey&&r&&(r=r*ds),this.callback({type:"wheel",center:{x:i.clientX,y:i.clientY},delta:-r,srcEvent:i,pointerType:"mouse",target:i.target})},t.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(t,n){t==="wheel"&&(this.options.enable=n)}}const gs={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(gs,"IDENTITY",{get:()=>(oe.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const _t={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Ti={common:0,meters:1,pixels:2},Mi={click:"onClick",dblclick:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},Ai={multipan:[Kt,{threshold:10,direction:R.Vertical,pointers:2}],pinch:[as,{},null,["multipan"]],pan:[Kt,{threshold:1},["pinch"],["multipan"]],dblclick:[Zt,{event:"dblclick",taps:2}],click:[Zt,{event:"click"},null,["dblclick"]]},_i={DRAW:"draw",MASK:"mask",TERRAIN:"terrain"};function ms(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function q(e,t){const n=de([],t,e);return Cn(n,n,1/n[3]),n}function bi(e,t){const n=e%t;return n<0?t+n:n}function xi(e,t,n){return n*t+(1-n)*e}function Rt(e,t,n){return e<t?t:e>n?n:e}function ps(e){return Math.log(e)*Math.LOG2E}const Ae=Math.log2||ps;function D(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}const $=Math.PI,_e=$/4,C=$/180,St=180/$,H=512,ht=4003e4,nt=85.051129,Es=1.5;function Li(e){return Math.pow(2,e)}function ys(e){return Ae(e)}function lt(e){const[t,n]=e;D(Number.isFinite(t)),D(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const s=t*C,i=n*C,r=H*(s+$)/(2*$),o=H*($+Math.log(Math.tan(_e+i*.5)))/(2*$);return[r,o]}function dt(e){const[t,n]=e,s=t/H*(2*$)-$,i=2*(Math.atan(Math.exp(n/H*(2*$)-$))-_e);return[s*St,i*St]}function Ts(e){const{latitude:t}=e;D(Number.isFinite(t));const n=Math.cos(t*C);return ys(ht*n)-9}function bt(e){const t=Math.cos(e*C);return H/ht/t}function wt(e){const{latitude:t,longitude:n,highPrecision:s=!1}=e;D(Number.isFinite(t)&&Number.isFinite(n));const i=H,r=Math.cos(t*C),o=i/360,c=o/r,a=i/ht/r,h={unitsPerMeter:[a,a,a],metersPerUnit:[1/a,1/a,1/a],unitsPerDegree:[o,c,a],degreesPerUnit:[1/o,1/c,1/a]};if(s){const l=C*Math.tan(t*C)/r,f=o*l/2,u=i/ht*l,d=u/c*a;h.unitsPerDegree2=[0,f,u],h.unitsPerMeter2=[d,0,d]}return h}function Ms(e,t){const[n,s,i]=e,[r,o,c]=t,{unitsPerMeter:a,unitsPerMeter2:h}=wt({longitude:n,latitude:s,highPrecision:!0}),l=lt(e);l[0]+=r*(a[0]+h[0]*o),l[1]+=o*(a[1]+h[1]*o);const f=dt(l),u=(i||0)+(c||0);return Number.isFinite(i)||Number.isFinite(c)?[f[0],f[1],u]:f}function As(e){const{height:t,pitch:n,bearing:s,altitude:i,scale:r,center:o}=e,c=ms();at(c,c,[0,0,-i]),fe(c,c,-n*C),ue(c,c,s*C);const a=r/t;return Ct(c,c,[a,a,a]),o&&at(c,c,fn([],o)),c}function _s(e){const{width:t,height:n,altitude:s,pitch:i=0,offset:r,center:o,scale:c,nearZMultiplier:a=1,farZMultiplier:h=1}=e;let{fovy:l=ft(Es)}=e;s!==void 0&&(l=ft(s));const f=l*C,u=i*C,d=be(l);let g=d;o&&(g+=o[2]*c/Math.cos(u)/n);const m=f*(.5+(r?r[1]:0)/n),E=Math.sin(m)*g/Math.sin(Rt(Math.PI/2-u-m,.01,Math.PI-.01)),_=Math.sin(u)*E+g,b=g*10,p=Math.min(_*h,b);return{fov:f,aspect:t/n,focalDistance:d,near:a,far:p}}function ft(e){return 2*Math.atan(.5/e)*St}function be(e){return .5/Math.tan(.5*e*C)}function bs(e,t){const[n,s,i=0]=e;return D(Number.isFinite(n)&&Number.isFinite(s)&&Number.isFinite(i)),q(t,[n,s,i,1])}function xe(e,t,n=0){const[s,i,r]=e;if(D(Number.isFinite(s)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(r))return q(t,[s,i,r,1]);const o=q(t,[s,i,0,1]),c=q(t,[s,i,1,1]),a=o[2],h=c[2],l=a===h?0:((n||0)-a)/(h-a);return ae([],o,c,l)}function xs(e){const{width:t,height:n,bounds:s,minExtent:i=0,maxZoom:r=24,offset:o=[0,0]}=e,[[c,a],[h,l]]=s,f=Ls(e.padding),u=lt([c,Rt(l,-nt,nt)]),d=lt([h,Rt(a,-nt,nt)]),g=[Math.max(Math.abs(d[0]-u[0]),i),Math.max(Math.abs(d[1]-u[1]),i)],m=[t-f.left-f.right-Math.abs(o[0])*2,n-f.top-f.bottom-Math.abs(o[1])*2];D(m[0]>0&&m[1]>0);const E=m[0]/g[0],_=m[1]/g[1],b=(f.right-f.left)/2/E,p=(f.top-f.bottom)/2/_,T=[(d[0]+u[0])/2+b,(d[1]+u[1])/2+p],M=dt(T),y=Math.min(r,Ae(Math.abs(Math.min(E,_))));return D(Number.isFinite(y)),{longitude:M[0],latitude:M[1],zoom:y}}function Ls(e=0){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:(D(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}const Jt=Math.PI/180;function Rs(e,t=0){const{width:n,height:s,unproject:i}=e,r={targetZ:t},o=i([0,s],r),c=i([n,s],r);let a,h;const l=e.fovy?.5*e.fovy*Jt:Math.atan(.5/e.altitude),f=(90-e.pitch)*Jt;return l>f-.01?(a=te(e,0,t),h=te(e,n,t)):(a=i([0,0],r),h=i([n,0],r)),[o,c,h,a]}function te(e,t,n){const{pixelUnprojectionMatrix:s}=e,i=q(s,[t,0,1,1]),r=q(s,[t,e.height,1,1]),c=(n*e.distanceScales.unitsPerMeter[2]-i[2])/(r[2]-i[2]),a=ae([],i,r,c),h=dt(a);return h.push(n),h}class Ss{constructor(t={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,n,{size:s=1,type:i,padding:r=0,copy:o=!1,initialize:c=!1,maxCount:a}){const h=i||t&&t.constructor||Float32Array,l=n*s+r;if(ArrayBuffer.isView(t)){if(l<=t.length)return t;if(l*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new h(t.buffer,0,l)}let f=1/0;a&&(f=a*s+r);const u=this._allocate(h,l,c,f);return t&&o?u.set(t):c||u.fill(0,0,4),this._release(t),u}release(t){this._release(t)}_allocate(t,n,s,i){let r=Math.max(Math.ceil(n*this.opts.overAlloc),1);r>i&&(r=i);const o=this._pool,c=t.BYTES_PER_ELEMENT*r,a=o.findIndex(h=>h.byteLength>=c);if(a>=0){const h=new t(o.splice(a,1)[0],0,r);return s&&h.fill(0),h}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const n=this._pool,{buffer:s}=t,{byteLength:i}=s,r=n.findIndex(o=>o.byteLength>=i);r<0?n.push(s):(r>0||n.length<this.opts.poolSize)&&n.splice(r,0,s),n.length>this.opts.poolSize&&n.shift()}}const ws=new Ss;function K(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Ri(e,t){const n=e%t;return n<0?t+n:n}function Ns(e){return[e[12],e[13],e[14]]}function vs(e){return{left:V(e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),right:V(e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),bottom:V(e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),top:V(e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),near:V(e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]),far:V(e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14])}}const ee=new X;function V(e,t,n,s){ee.set(e,t,n);const i=ee.len();return{distance:s/i,normal:new X(-e/i,-t/i,-n/i)}}function Fs(e){return e-Math.fround(e)}let Z;function Si(e,t){const{size:n=1,startIndex:s=0}=t,i=t.endIndex!==void 0?t.endIndex:e.length,r=(i-s)/n;Z=ws.allocate(Z,r,{type:Float32Array,size:n*2});let o=s,c=0;for(;o<i;){for(let a=0;a<n;a++){const h=e[o++];Z[c+a]=h,Z[c+a+n]=Fs(h)}c+=n*2}return Z.subarray(0,r*n*2)}function wi(e){let t=null,n=!1;for(const s of e)s&&(t?(n||(t=[[t[0][0],t[0][1]],[t[1][0],t[1][1]]],n=!0),t[0][0]=Math.min(t[0][0],s[0][0]),t[0][1]=Math.min(t[0][1],s[0][1]),t[1][0]=Math.max(t[1][0],s[1][0]),t[1][1]=Math.max(t[1][1],s[1][1])):t=s);return t}const Ps=Math.PI/180,Os=K(),ne=[0,0,0],Cs={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function Is({width:e,height:t,orthographic:n,fovyRadians:s,focalDistance:i,padding:r,near:o,far:c}){const a=e/t,h=n?new z().orthographic({fovy:s,aspect:a,focalDistance:i,near:o,far:c}):new z().perspective({fovy:s,aspect:a,near:o,far:c});if(r){const{left:l=0,right:f=0,top:u=0,bottom:d=0}=r,g=ot((l+e-f)/2,0,e)-e/2,m=ot((u+t-d)/2,0,t)-t/2;h[8]-=g*2/e,h[9]+=m*2/t}return h}class gt{constructor(t={}){this._frustumPlanes={},this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||Cs,this.focalDistance=t.focalDistance||1,this.position=t.position||ne,this.modelMatrix=t.modelMatrix||null;const{longitude:n,latitude:s}=t;this.isGeospatial=Number.isFinite(s)&&Number.isFinite(n),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?_t.WEB_MERCATOR:_t.WEB_MERCATOR_AUTO_OFFSET:_t.IDENTITY}equals(t){return t instanceof gt?this===t?!0:t.width===this.width&&t.height===this.height&&t.scale===this.scale&&ct(t.projectionMatrix,this.projectionMatrix)&&ct(t.viewMatrix,this.viewMatrix):!1}project(t,{topLeft:n=!0}={}){const s=this.projectPosition(t),i=bs(s,this.pixelProjectionMatrix),[r,o]=i,c=n?o:this.height-o;return t.length===2?[r,c]:[r,c,i[2]]}unproject(t,{topLeft:n=!0,targetZ:s}={}){const[i,r,o]=t,c=n?r:this.height-r,a=s&&s*this.distanceScales.unitsPerMeter[2],h=xe([i,c,o],this.pixelUnprojectionMatrix,a),[l,f,u]=this.unprojectPosition(h);return Number.isFinite(o)?[l,f,u]:Number.isFinite(s)?[l,f,s]:[l,f]}projectPosition(t){const[n,s]=this.projectFlat(t),i=(t[2]||0)*this.distanceScales.unitsPerMeter[2];return[n,s,i]}unprojectPosition(t){const[n,s]=this.unprojectFlat(t),i=(t[2]||0)*this.distanceScales.metersPerUnit[2];return[n,s,i]}projectFlat(t){if(this.isGeospatial){const n=lt(t);return n[1]=ot(n[1],-318,830),n}return t}unprojectFlat(t){return this.isGeospatial?dt(t):t}getBounds(t={}){const n={targetZ:t.z||0},s=this.unproject([0,0],n),i=this.unproject([this.width,0],n),r=this.unproject([0,this.height],n),o=this.unproject([this.width,this.height],n);return[Math.min(s[0],i[0],r[0],o[0]),Math.min(s[1],i[1],r[1],o[1]),Math.max(s[0],i[0],r[0],o[0]),Math.max(s[1],i[1],r[1],o[1])]}getDistanceScales(t){return t&&this.isGeospatial?wt({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:n,width:s=1,height:i=1}){return t<this.x+this.width&&this.x<t+s&&n<this.y+this.height&&this.y<n+i}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,vs(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(t,n){return null}_initProps(t){const n=t.longitude,s=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=Ts({latitude:s})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||wt({latitude:s,longitude:n}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:r,modelMatrix:o}=t;let c=ne;if(r&&(c=o?new z(o).transformAsVector(r,[]):r),this.isGeospatial){const a=this.projectPosition([n,s,0]);this.center=new X(c).scale(this.distanceScales.unitsPerMeter).add(a)}else this.center=this.projectPosition(c)}_initMatrices(t){const{viewMatrix:n=Os,projectionMatrix:s=null,orthographic:i=!1,fovyRadians:r,fovy:o=75,near:c=.1,far:a=1e3,padding:h=null,focalDistance:l=1}=t;this.viewMatrixUncentered=n,this.viewMatrix=new z().multiplyRight(n).translate(new X(this.center).negate()),this.projectionMatrix=s||Is({width:this.width,height:this.height,orthographic:i,fovyRadians:r||o*Ps,focalDistance:l,padding:h,near:c,far:a});const f=K();Q(f,f,this.projectionMatrix),Q(f,f,this.viewMatrix),this.viewProjectionMatrix=f,this.viewMatrixInverse=xt([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=Ns(this.viewMatrixInverse);const u=K(),d=K();Ct(u,u,[this.width/2,-this.height/2,1]),at(u,u,[1,-1,0]),Q(d,u,this.viewProjectionMatrix),this.pixelProjectionMatrix=d,this.pixelUnprojectionMatrix=xt(K(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||oe.warn("Pixel project matrix not invertible")()}}gt.displayName="Viewport";class ut extends gt{constructor(t={}){const{latitude:n=0,longitude:s=0,zoom:i=0,pitch:r=0,bearing:o=0,nearZMultiplier:c=.1,farZMultiplier:a=1.01,nearZ:h,farZ:l,orthographic:f=!1,projectionMatrix:u,repeat:d=!1,worldOffset:g=0,position:m,padding:E,legacyMeterSizes:_=!1}=t;let{width:b,height:p,altitude:T=1.5}=t;const M=Math.pow(2,i);b=b||1,p=p||1;let y,S=null;if(u)T=u[5]/2,y=ft(T);else{t.fovy?(y=t.fovy,T=be(y)):y=ft(T);let N;if(E){const{top:v=0,bottom:F=0}=E;N=[0,ot((v+p-F)/2,0,p)-p/2]}S=_s({width:b,height:p,scale:M,center:m&&[0,0,m[2]*bt(n)],offset:N,pitch:r,fovy:y,nearZMultiplier:c,farZMultiplier:a}),Number.isFinite(h)&&(S.near=h),Number.isFinite(l)&&(S.far=l)}let w=As({height:p,pitch:r,bearing:o,scale:M,altitude:T});g&&(w=new z().translate([512*g,0,0]).multiplyLeft(w)),super({...t,width:b,height:p,viewMatrix:w,longitude:s,latitude:n,zoom:i,...S,fovy:y,focalDistance:T}),this.latitude=n,this.longitude=s,this.zoom=i,this.pitch=r,this.bearing=o,this.altitude=T,this.fovy=y,this.orthographic=f,this._subViewports=d?[]:null,this._pseudoMeters=_,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),n=Math.floor((t[0]+180)/360),s=Math.ceil((t[2]-180)/360);for(let i=n;i<=s;i++){const r=i?new ut({...this,worldOffset:i}):this;this._subViewports.push(r)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[n,s]=this.projectFlat(t),i=(t[2]||0)*bt(t[1]);return[n,s,i]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[n,s]=this.unprojectFlat(t),i=(t[2]||0)/bt(s);return[n,s,i]}addMetersToLngLat(t,n){return Ms(t,n)}panByPosition(t,n){const s=xe(n,this.pixelUnprojectionMatrix),i=this.projectFlat(t),r=Wt([],i,en([],s)),o=Wt([],this.center,r),[c,a]=this.unprojectFlat(o);return{longitude:c,latitude:a}}getBounds(t={}){const n=Rs(this,t.z||0);return[Math.min(n[0][0],n[1][0],n[2][0],n[3][0]),Math.min(n[0][1],n[1][1],n[2][1],n[3][1]),Math.max(n[0][0],n[1][0],n[2][0],n[3][0]),Math.max(n[0][1],n[1][1],n[2][1],n[3][1])]}fitBounds(t,n={}){const{width:s,height:i}=this,{longitude:r,latitude:o,zoom:c}=xs({width:s,height:i,bounds:t,...n});return new ut({width:s,height:i,longitude:r,latitude:o,zoom:c})}}ut.displayName="WebMercatorViewport";function se(e,t,n){if(e===t)return!0;if(!n||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(!se(e[s],t[s],n-1))return!1;return!0}if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(const r of s)if(!t.hasOwnProperty(r)||!se(e[r],t[r],n-1))return!1;return!0}return!1}export{Bs as $,$s as A,st as B,ct as C,De as D,ke as E,zs as F,Us as G,O as H,qe as I,Xe as J,Ge as K,cn as L,nt as M,X as N,gs as O,_t as P,Ts as Q,Yt as R,Ri as S,_i as T,Ti as U,gt as V,ut as W,Fs as X,Q as Y,Ds as Z,Ys as _,ft as a,si as a0,Ms as a1,ze as a2,Si as a3,wi as a4,bs as a5,Nt as a6,Wn as a7,Vn as a8,qn as a9,Ws as aA,un as aB,le as aC,Qs as aD,Ks as aE,mn as aF,B as aG,Mn as aH,gn as aI,pt as aJ,ai as aK,hi as aL,fi as aM,ci as aN,ui as aO,on as aP,Js as aQ,dn as aR,ti as aS,li as aT,it as aU,ce as aV,di as aW,Un as aa,mi as ab,gi as ac,Ei as ad,A as ae,ge as af,hs as ag,yi as ah,bi as ai,Ae as aj,Mi as ak,Ai as al,Le as am,ks as an,Ft as ao,Qe as ap,G as aq,P as ar,nn as as,sn as at,js as au,Hs as av,Xs as aw,oi as ax,Ut as ay,Vs as az,z as b,ni as c,ii as d,Cn as e,be as f,Wt as g,ot as h,se as i,xi as j,qs as k,ei as l,lt as m,en as n,Zs as o,xe as p,ys as q,Gs as r,ri as s,de as t,He as u,ws as v,dt as w,oe as x,bt as y,Li as z};
2
+ //# sourceMappingURL=deep-equal-uriyKJca.js.map