maplibre-gl-components 0.16.2 → 0.17.0

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 (232) hide show
  1. package/README.md +4 -3
  2. package/dist/{ControlGrid-DQ4w_Nf9.js → ControlGrid-C6zp03Vq.js} +125375 -115454
  3. package/dist/ControlGrid-DIAcXRBe.cjs +17278 -0
  4. package/dist/DuckDBConverter-5a2FWwmf.js +354 -0
  5. package/dist/DuckDBConverter-pfXSUi_l.cjs +23 -0
  6. package/dist/ShapefileConverter-DGCXPY_S.cjs +1 -0
  7. package/dist/ShapefileConverter-DN3fVOuo.js +102 -0
  8. package/dist/basedecoder-BliCKuUS.js +62 -0
  9. package/dist/basedecoder-Zw0CbD9L.cjs +1 -0
  10. package/dist/deflate-DBL0msKQ.js +10 -0
  11. package/dist/deflate-DNeBKDsy.cjs +1 -0
  12. package/dist/esm-Bp6m44bk.js +811 -0
  13. package/dist/esm-oEp_aN1n.cjs +1 -0
  14. package/dist/geojson-Bnoe76Pm.js +2002 -0
  15. package/dist/geojson-CxMdRvJX.cjs +1 -0
  16. package/dist/geotiff-Bzy-Zyc2.js +1882 -0
  17. package/dist/geotiff-DYylEFA9.cjs +8 -0
  18. package/dist/globals-B4iCNAg9.cjs +1 -0
  19. package/dist/globals-BKIWameS.js +572 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.mjs +150 -147
  22. package/dist/jpeg-B6Sg6W8k.cjs +1 -0
  23. package/dist/jpeg-CJcNvScS.js +545 -0
  24. package/dist/lerc-2QwcA_K7.js +840 -0
  25. package/dist/lerc-DQRITnja.cjs +1 -0
  26. package/dist/lib-B4jvG7hB.cjs +4 -0
  27. package/dist/lib-CNQtqzfc.js +4060 -0
  28. package/dist/lzw-1HaU0PJK.cjs +1 -0
  29. package/dist/lzw-DF5VHuii.js +76 -0
  30. package/dist/main-dist-CbHNdsir.js +18314 -0
  31. package/dist/main-dist-DOx_Axbx.cjs +2 -0
  32. package/dist/maplibre-geoman.es-C0F1ydoG.cjs +213 -0
  33. package/dist/maplibre-geoman.es-D1CztSQd.js +27213 -0
  34. package/dist/maplibre-gl-components.css +2 -1
  35. package/dist/packbits-CK8RPU_B.js +22 -0
  36. package/dist/packbits-D5Zovac7.cjs +1 -0
  37. package/dist/pako.esm-DFyPB7cO.cjs +1 -0
  38. package/dist/pako.esm-hTfpTBhd.js +1536 -0
  39. package/dist/raw-Brljg6vy.js +9 -0
  40. package/dist/raw-C-CSxCoU.cjs +1 -0
  41. package/dist/react.cjs +1 -1
  42. package/dist/react.mjs +1357 -1004
  43. package/dist/{types → src}/lib/core/CogLayer.d.ts.map +1 -1
  44. package/dist/{types → src}/lib/core/PMTilesLayer.d.ts.map +1 -1
  45. package/dist/{types → src}/lib/core/SpinGlobeControl.d.ts +6 -7
  46. package/dist/src/lib/core/SpinGlobeControl.d.ts.map +1 -0
  47. package/dist/{types → src}/lib/core/StacLayer.d.ts.map +1 -1
  48. package/dist/{types → src}/lib/core/types.d.ts +3 -1
  49. package/dist/{types → src}/lib/core/types.d.ts.map +1 -1
  50. package/dist/{types → src}/lib/utils/color.d.ts +8 -0
  51. package/dist/src/lib/utils/color.d.ts.map +1 -0
  52. package/dist/{types → src}/lib/utils/index.d.ts +1 -1
  53. package/dist/{types → src}/lib/utils/index.d.ts.map +1 -1
  54. package/dist/webimage-Bh2pNwjN.cjs +1 -0
  55. package/dist/webimage-rg-Z9Sbn.js +25 -0
  56. package/dist/zstd-B3Xa90HD.cjs +1 -0
  57. package/dist/zstd-BwwN0X3K.js +51 -0
  58. package/package.json +66 -53
  59. package/dist/ControlGrid-Bukna_at.cjs +0 -17062
  60. package/dist/DuckDBConverter-B98M0DFs.cjs +0 -23
  61. package/dist/DuckDBConverter-RPq48-t0.js +0 -434
  62. package/dist/ShapefileConverter-AjbEjEyq.cjs +0 -1
  63. package/dist/ShapefileConverter-trvt8J3z.js +0 -125
  64. package/dist/decoder-CLokFc0V.js +0 -8
  65. package/dist/decoder-D9LU4bUo.cjs +0 -1
  66. package/dist/deflate-Bay-vzHJ.cjs +0 -1
  67. package/dist/deflate-yeu3ogBn.js +0 -10
  68. package/dist/geojson-BQSVgKFt.cjs +0 -1
  69. package/dist/geojson-BSUuDj5k.js +0 -2551
  70. package/dist/geotiff-BNxc90fm.cjs +0 -8
  71. package/dist/geotiff-BUZniE5g.js +0 -3105
  72. package/dist/index-8ZZtuDTp.js +0 -705
  73. package/dist/index-DQXdX5y1.js +0 -4666
  74. package/dist/index-Dh1kpCb6.cjs +0 -1
  75. package/dist/index-IrsIiQNM.cjs +0 -4
  76. package/dist/jpeg-B7yImnpY.js +0 -533
  77. package/dist/jpeg-BiN8bMT5.cjs +0 -1
  78. package/dist/lerc-BvSjGMM2.cjs +0 -1
  79. package/dist/lerc-CqgA9njy.js +0 -1031
  80. package/dist/lzw-C-_B7Jis.cjs +0 -1
  81. package/dist/lzw-DL9RcHOz.js +0 -84
  82. package/dist/main-dist-Bymiy5aM.cjs +0 -2
  83. package/dist/main-dist-Cv8AKwrY.js +0 -629
  84. package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +0 -129
  85. package/dist/maplibre-geoman.es-CFgM2ajb.js +0 -22827
  86. package/dist/packbits-DRGSjtn-.cjs +0 -1
  87. package/dist/packbits-YEJGULcy.js +0 -24
  88. package/dist/pako.esm-Bx5X36Wo.js +0 -1074
  89. package/dist/pako.esm-DZC2QrbJ.cjs +0 -1
  90. package/dist/raw-CoQHiEnn.js +0 -9
  91. package/dist/raw-D6OidBKc.cjs +0 -1
  92. package/dist/types/lib/core/SpinGlobeControl.d.ts.map +0 -1
  93. package/dist/types/lib/utils/color.d.ts.map +0 -1
  94. package/dist/webimage-BXLN-zu8.js +0 -19
  95. package/dist/webimage-mWTez3Wv.cjs +0 -1
  96. /package/dist/{types → src}/index.d.ts +0 -0
  97. /package/dist/{types → src}/index.d.ts.map +0 -0
  98. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts +0 -0
  99. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts.map +0 -0
  100. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts +0 -0
  101. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts.map +0 -0
  102. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts +0 -0
  103. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts.map +0 -0
  104. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts +0 -0
  105. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts.map +0 -0
  106. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts +0 -0
  107. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts.map +0 -0
  108. /package/dist/{types → src}/lib/adapters/index.d.ts +0 -0
  109. /package/dist/{types → src}/lib/adapters/index.d.ts.map +0 -0
  110. /package/dist/{types → src}/lib/addControlGrid.d.ts +0 -0
  111. /package/dist/{types → src}/lib/addControlGrid.d.ts.map +0 -0
  112. /package/dist/{types → src}/lib/colormaps/diverging.d.ts +0 -0
  113. /package/dist/{types → src}/lib/colormaps/diverging.d.ts.map +0 -0
  114. /package/dist/{types → src}/lib/colormaps/index.d.ts +0 -0
  115. /package/dist/{types → src}/lib/colormaps/index.d.ts.map +0 -0
  116. /package/dist/{types → src}/lib/colormaps/misc.d.ts +0 -0
  117. /package/dist/{types → src}/lib/colormaps/misc.d.ts.map +0 -0
  118. /package/dist/{types → src}/lib/colormaps/sequential.d.ts +0 -0
  119. /package/dist/{types → src}/lib/colormaps/sequential.d.ts.map +0 -0
  120. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts +0 -0
  121. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts.map +0 -0
  122. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts +0 -0
  123. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts.map +0 -0
  124. /package/dist/{types → src}/lib/converters/index.d.ts +0 -0
  125. /package/dist/{types → src}/lib/converters/index.d.ts.map +0 -0
  126. /package/dist/{types → src}/lib/converters/types.d.ts +0 -0
  127. /package/dist/{types → src}/lib/converters/types.d.ts.map +0 -0
  128. /package/dist/{types → src}/lib/core/AddVector.d.ts +0 -0
  129. /package/dist/{types → src}/lib/core/AddVector.d.ts.map +0 -0
  130. /package/dist/{types → src}/lib/core/Basemap.d.ts +0 -0
  131. /package/dist/{types → src}/lib/core/Basemap.d.ts.map +0 -0
  132. /package/dist/{types → src}/lib/core/BasemapReact.d.ts +0 -0
  133. /package/dist/{types → src}/lib/core/BasemapReact.d.ts.map +0 -0
  134. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts +0 -0
  135. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts.map +0 -0
  136. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts +0 -0
  137. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts.map +0 -0
  138. /package/dist/{types → src}/lib/core/CogLayer.d.ts +0 -0
  139. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts +0 -0
  140. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts.map +0 -0
  141. /package/dist/{types → src}/lib/core/Colorbar.d.ts +0 -0
  142. /package/dist/{types → src}/lib/core/Colorbar.d.ts.map +0 -0
  143. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts +0 -0
  144. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts.map +0 -0
  145. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts +0 -0
  146. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts.map +0 -0
  147. /package/dist/{types → src}/lib/core/ControlGrid.d.ts +0 -0
  148. /package/dist/{types → src}/lib/core/ControlGrid.d.ts.map +0 -0
  149. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts +0 -0
  150. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts.map +0 -0
  151. /package/dist/{types → src}/lib/core/HtmlControl.d.ts +0 -0
  152. /package/dist/{types → src}/lib/core/HtmlControl.d.ts.map +0 -0
  153. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts +0 -0
  154. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts.map +0 -0
  155. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts +0 -0
  156. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts.map +0 -0
  157. /package/dist/{types → src}/lib/core/InspectControl.d.ts +0 -0
  158. /package/dist/{types → src}/lib/core/InspectControl.d.ts.map +0 -0
  159. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts +0 -0
  160. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts.map +0 -0
  161. /package/dist/{types → src}/lib/core/Legend.d.ts +0 -0
  162. /package/dist/{types → src}/lib/core/Legend.d.ts.map +0 -0
  163. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts +0 -0
  164. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts.map +0 -0
  165. /package/dist/{types → src}/lib/core/LegendReact.d.ts +0 -0
  166. /package/dist/{types → src}/lib/core/LegendReact.d.ts.map +0 -0
  167. /package/dist/{types → src}/lib/core/MeasureControl.d.ts +0 -0
  168. /package/dist/{types → src}/lib/core/MeasureControl.d.ts.map +0 -0
  169. /package/dist/{types → src}/lib/core/MinimapControl.d.ts +0 -0
  170. /package/dist/{types → src}/lib/core/MinimapControl.d.ts.map +0 -0
  171. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts +0 -0
  172. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts.map +0 -0
  173. /package/dist/{types → src}/lib/core/PMTilesLayer.d.ts +0 -0
  174. /package/dist/{types → src}/lib/core/PrintControl.d.ts +0 -0
  175. /package/dist/{types → src}/lib/core/PrintControl.d.ts.map +0 -0
  176. /package/dist/{types → src}/lib/core/SearchControl.d.ts +0 -0
  177. /package/dist/{types → src}/lib/core/SearchControl.d.ts.map +0 -0
  178. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts +0 -0
  179. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts.map +0 -0
  180. /package/dist/{types → src}/lib/core/StacLayer.d.ts +0 -0
  181. /package/dist/{types → src}/lib/core/StacSearch.d.ts +0 -0
  182. /package/dist/{types → src}/lib/core/StacSearch.d.ts.map +0 -0
  183. /package/dist/{types → src}/lib/core/Terrain.d.ts +0 -0
  184. /package/dist/{types → src}/lib/core/Terrain.d.ts.map +0 -0
  185. /package/dist/{types → src}/lib/core/TerrainReact.d.ts +0 -0
  186. /package/dist/{types → src}/lib/core/TerrainReact.d.ts.map +0 -0
  187. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts +0 -0
  188. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts.map +0 -0
  189. /package/dist/{types → src}/lib/core/VectorDataset.d.ts +0 -0
  190. /package/dist/{types → src}/lib/core/VectorDataset.d.ts.map +0 -0
  191. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts +0 -0
  192. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts.map +0 -0
  193. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts +0 -0
  194. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts.map +0 -0
  195. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts +0 -0
  196. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts.map +0 -0
  197. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts +0 -0
  198. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts.map +0 -0
  199. /package/dist/{types → src}/lib/hooks/index.d.ts +0 -0
  200. /package/dist/{types → src}/lib/hooks/index.d.ts.map +0 -0
  201. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts +0 -0
  202. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts.map +0 -0
  203. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts +0 -0
  204. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts.map +0 -0
  205. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts +0 -0
  206. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts.map +0 -0
  207. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts +0 -0
  208. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts.map +0 -0
  209. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts +0 -0
  210. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts.map +0 -0
  211. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts +0 -0
  212. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts.map +0 -0
  213. /package/dist/{types → src}/lib/hooks/useLegend.d.ts +0 -0
  214. /package/dist/{types → src}/lib/hooks/useLegend.d.ts.map +0 -0
  215. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts +0 -0
  216. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts.map +0 -0
  217. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts +0 -0
  218. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts.map +0 -0
  219. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts +0 -0
  220. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts.map +0 -0
  221. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts +0 -0
  222. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts.map +0 -0
  223. /package/dist/{types → src}/lib/hooks/useViewState.d.ts +0 -0
  224. /package/dist/{types → src}/lib/hooks/useViewState.d.ts.map +0 -0
  225. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts +0 -0
  226. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts.map +0 -0
  227. /package/dist/{types → src}/lib/utils/helpers.d.ts +0 -0
  228. /package/dist/{types → src}/lib/utils/helpers.d.ts.map +0 -0
  229. /package/dist/{types → src}/lib/utils/providers.d.ts +0 -0
  230. /package/dist/{types → src}/lib/utils/providers.d.ts.map +0 -0
  231. /package/dist/{types → src}/react.d.ts +0 -0
  232. /package/dist/{types → src}/react.d.ts.map +0 -0
@@ -0,0 +1 @@
1
+ var U=new Uint8Array([102,103,98,3,102,103,98,0]),O=new Int32Array(2),bt=new Float32Array(O.buffer),ft=new Float64Array(O.buffer),G=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,et;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(et||(et={}));var B=class gt{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new gt(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return O[0]=this.readInt32(t),bt[0]}readFloat64(t){return O[G?0:1]=this.readInt32(t),O[G?1:0]=this.readInt32(t+4),ft[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){bt[0]=e,this.writeInt32(t,O[0])}writeFloat64(t,e){ft[0]=e,this.writeInt32(t,O[G?0:1]),this.writeInt32(t+4,O[G?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t}__offset(t,e){const n=t-this.readInt32(t);return e<this.readInt16(n)?this.readInt16(n+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const n=this.readInt32(t);t+=4;const i=this.bytes_.subarray(t,t+n);return e===et.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length 4");for(let e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}createScalarList(t,e){const n=[];for(let i=0;i<e;++i){const s=t(i);s!==null&&n.push(s)}return n}createObjList(t,e){const n=[];for(let i=0;i<e;++i){const s=t(i);s!==null&&n.push(s.unpack())}return n}},y,g=((y={})[y.Byte=0]="Byte",y[y.UByte=1]="UByte",y[y.Bool=2]="Bool",y[y.Short=3]="Short",y[y.UShort=4]="UShort",y[y.Int=5]="Int",y[y.UInt=6]="UInt",y[y.Long=7]="Long",y[y.ULong=8]="ULong",y[y.Float=9]="Float",y[y.Double=10]="Double",y[y.String=11]="String",y[y.Json=12]="Json",y[y.DateTime=13]="DateTime",y[y.Binary=14]="Binary",y),vt=class m{bb=null;bb_pos=0;__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsColumn(t,e){return(e||new m).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsColumn(t,e){return t.setPosition(t.position()+4),(e||new m).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):g.Byte}title(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}width(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){let t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){let t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){let t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static startColumn(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,g.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static endColumn(t){let e=t.endObject();return t.requiredField(e,4),e}static createColumn(t,e,n,i,s,o,u,h,a,b,f,l){return m.startColumn(t),m.addName(t,e),m.addType(t,n),m.addTitle(t,i),m.addDescription(t,s),m.addWidth(t,o),m.addPrecision(t,u),m.addScale(t,h),m.addNullable(t,a),m.addUnique(t,b),m.addPrimaryKey(t,f),m.addMetadata(t,l),m.endColumn(t)}},_,x=((_={})[_.Unknown=0]="Unknown",_[_.Point=1]="Point",_[_.LineString=2]="LineString",_[_.Polygon=3]="Polygon",_[_.MultiPoint=4]="MultiPoint",_[_.MultiLineString=5]="MultiLineString",_[_.MultiPolygon=6]="MultiPolygon",_[_.GeometryCollection=7]="GeometryCollection",_[_.CircularString=8]="CircularString",_[_.CompoundCurve=9]="CompoundCurve",_[_.CurvePolygon=10]="CurvePolygon",_[_.MultiCurve=11]="MultiCurve",_[_.MultiSurface=12]="MultiSurface",_[_.Curve=13]="Curve",_[_.Surface=14]="Surface",_[_.PolyhedralSurface=15]="PolyhedralSurface",_[_.TIN=16]="TIN",_[_.Triangle=17]="Triangle",_),Ot=class I{bb=null;bb_pos=0;__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGeometry(t,e){return(e||new I).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGeometry(t,e){return t.setPosition(t.position()+4),(e||new I).__init(t.readInt32(t.position())+t.position(),t)}ends(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){let t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){let t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}tmLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):x.Unknown}parts(t,e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new I).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}partsLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGeometry(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addFloat64(e[n]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addFloat64(e[n]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addFloat64(e[n]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addFloat64(e[n]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,x.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static endGeometry(t){return t.endObject()}static createGeometry(t,e,n,i,s,o,u,h,a){return I.startGeometry(t),I.addEnds(t,e),I.addXy(t,n),I.addZ(t,i),I.addM(t,s),I.addT(t,o),I.addTm(t,u),I.addType(t,h),I.addParts(t,a),I.endGeometry(t)}},W=class C{bb=null;bb_pos=0;__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFeature(t,e){return(e||new C).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFeature(t,e){return t.setPosition(t.position()+4),(e||new C).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new Ot).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new vt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}columnsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFeature(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static endFeature(t){return t.endObject()}static finishFeatureBuffer(t,e){t.finish(e)}static finishSizePrefixedFeatureBuffer(t,e){t.finish(e,void 0,!0)}static createFeature(t,e,n,i){return C.startFeature(t),C.addGeometry(t,e),C.addProperties(t,n),C.addColumns(t,i),C.endFeature(t)}};function Q(r,t){let e=[];for(let n=0;n<r.length;n+=2){let i=[r[n],r[n+1]];t&&i.push(t[n>>1]),e.push(i)}return e}var se=new TextEncoder,ct=new TextDecoder;function Tt(r,t){let e={};if(!t||t.length===0)return e;let n=r.propertiesArray();if(!n)return e;let i=new DataView(n.buffer,n.byteOffset),s=r.propertiesLength(),o=0;for(;o<s;){let u=i.getUint16(o,!0);o+=2;let h=t[u],a=h.name;switch(h.type){case g.Bool:e[a]=!!i.getUint8(o),o+=1;break;case g.Byte:e[a]=i.getInt8(o),o+=1;break;case g.UByte:e[a]=i.getUint8(o),o+=1;break;case g.Short:e[a]=i.getInt16(o,!0),o+=2;break;case g.UShort:e[a]=i.getUint16(o,!0),o+=2;break;case g.Int:e[a]=i.getInt32(o,!0),o+=4;break;case g.UInt:e[a]=i.getUint32(o,!0),o+=4;break;case g.Long:e[a]=Number(i.getBigInt64(o,!0)),o+=8;break;case g.ULong:e[a]=Number(i.getBigUint64(o,!0)),o+=8;break;case g.Float:e[a]=i.getFloat32(o,!0),o+=4;break;case g.Double:e[a]=i.getFloat64(o,!0),o+=8;break;case g.DateTime:case g.String:{let b=i.getUint32(o,!0);o+=4,e[a]=ct.decode(n.subarray(o,o+b)),o+=b;break}case g.Json:{let b=i.getUint32(o,!0);o+=4;let f=ct.decode(n.subarray(o,o+b));e[a]=JSON.parse(f),o+=b;break}case g.Binary:{let b=i.getUint32(o,!0);o+=4,e[a]=n.subarray(o,o+b),o+=b;break}default:throw Error(`Unknown type ${h.type}`)}}return e}var at=new Uint8Array(0);function At(){return this._source.cancel()}function Vt(r,t){if(!r.length)return t;if(!t.length)return r;var e=new Uint8Array(r.length+t.length);return e.set(r),e.set(t,r.length),e}function Et(){var r=this,t=r._array.subarray(r._index);return r._source.read().then(function(e){return r._array=at,r._index=0,e.done?t.length>0?{done:!1,value:t}:{done:!0,value:void 0}:{done:!1,value:Vt(t,e.value)}})}function Nt(r){if((r|=0)<0)throw new Error("invalid length");var t=this,e=this._array.length-this._index;if(this._index+r<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=r));var n=new Uint8Array(r);return n.set(this._array.subarray(this._index)),(function i(){return t._source.read().then(function(s){return s.done?(t._array=at,t._index=0,e>0?n.subarray(0,e):null):e+s.value.length>=r?(t._array=s.value,t._index=r-e,n.set(s.value.subarray(0,r-e),e),n):(n.set(s.value,e),e+=s.value.length,i())})})()}function Rt(r){return typeof r.slice=="function"?r:new X(typeof r.read=="function"?r:r.getReader())}function X(r){this._source=r,this._array=at,this._index=0}X.prototype.read=Et;X.prototype.slice=Nt;X.prototype.cancel=At;var Lt=class S{bb=null;bb_pos=0;__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsCrs(t,e){return(e||new S).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsCrs(t,e){return t.setPosition(t.position()+4),(e||new S).__init(t.readInt32(t.position())+t.position(),t)}org(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}codeString(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static startCrs(t){t.startObject(6)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static addCodeString(t,e){t.addFieldOffset(5,e,0)}static endCrs(t){return t.endObject()}static createCrs(t,e,n,i,s,o,u){return S.startCrs(t),S.addOrg(t,e),S.addCode(t,n),S.addName(t,i),S.addDescription(t,s),S.addWkt(t,o),S.addCodeString(t,u),S.endCrs(t)}},zt=class rt{bb=null;bb_pos=0;__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsHeader(t,e){return(e||new rt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsHeader(t,e){return t.setPosition(t.position()+4),(e||new rt).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):x.Unknown}hasZ(){let t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){let t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){let t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTm(){let t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new vt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}columnsLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}indexNodeSize(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){let e=this.bb.__offset(this.bb_pos,24);return e?(t||new Lt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){let e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static startHeader(t){t.startObject(14)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addFloat64(e[n]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,x.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTm(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,BigInt("0"))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,e,0)}static endHeader(t){return t.endObject()}static finishHeaderBuffer(t,e){t.finish(e)}static finishSizePrefixedHeaderBuffer(t,e){t.finish(e,void 0,!0)}};function Z(r){let t=zt.getSizePrefixedRootAsHeader(r),e=t.featuresCount(),n=t.indexNodeSize(),i=[];for(let u=0;u<t.columnsLength();u++){let h=t.columns(u);if(!h)throw Error("Column unexpectedly missing");if(!h.name())throw Error("Column name unexpectedly missing");i.push({name:h.name(),type:h.type(),title:h.title(),description:h.description(),width:h.width(),precision:h.precision(),scale:h.scale(),nullable:h.nullable(),unique:h.unique(),primary_key:h.primaryKey()})}let s=t.crs(),o=s?{org:s.org(),code:s.code(),name:s.name(),description:s.description(),wkt:s.wkt(),code_string:s.codeString()}:null;return{geometryType:t.geometryType(),columns:i,envelope:t.envelopeLength()>0?t.envelopeArray():null,featuresCount:Number(e),indexNodeSize:n,crs:o,title:t.title(),description:t.description(),metadata:t.metadata()}}var wt=class mt{static global=new mt;_extraRequestThreshold=262144;extraRequestThreshold(){return this._extraRequestThreshold}setExtraRequestThreshold(t){if(t<0)throw Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=t}};function Y(r,t){t=Math.min(Math.max(+t,2),65535);let e=r,n=e;do n+=e=Math.ceil(e/t);while(e!==1);return 40*n}function kt(r,t){if(t<2)throw Error("Node size must be at least 2");if(r===0)throw Error("Number of items must be greater than 0");let e=r,n=e,i=[e];do n+=e=Math.ceil(e/t),i.push(e);while(e!==1);let s=[];for(let u of(e=n,i))s.push(e-u),e-=u;let o=[];for(let u=0;u<i.length;u++)o.push([s[u],s[u]+i[u]]);return o}async function*xt(r,t,e,n){class i{_level;nodes;constructor(c,d){this._level=d,this.nodes=c}level(){return this._level}startNodeIdx(){return this.nodes[0]}endNodeIdx(){return this.nodes[1]}extendEndNodeIdx(c){this.nodes[1]=c}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}let{minX:s,minY:o,maxX:u,maxY:h}=e,a=kt(r,t),b=a[0][0],f=[new i([0,1],a.length-1)];for(;f.length!==0;){let l=f.shift(),c=l.startNodeIdx(),d=c>=b,p=(()=>{let[,F]=a[l.level()],w=Math.min(l.endNodeIdx()+t,F);return d&&w<F?w+1:w})(),v=p-c,P=new DataView(await n(40*c,40*v));for(let F=c;F<p;F++){let w=F-c,k=40*w;if(u<P.getFloat64(k+0,!0)||h<P.getFloat64(k+8,!0)||s>P.getFloat64(k+16,!0)||o>P.getFloat64(k+24,!0))continue;let E=P.getBigUint64(k+32,!0);if(d){let K=(()=>{if(F<r-1){let Ct=(w+1)*40;return P.getBigUint64(Ct+32,!0)-E}return null})(),Bt=F-b;yield[Number(E),Bt,Number(K)];continue}let St=wt.global.extraRequestThreshold()/40,N=f[f.length-1];if(N!==void 0&&N.level()===l.level()-1&&E<N.endNodeIdx()+St){N.extendEndNodeIdx(Number(E));continue}let ht=(()=>{let K=l.level()-1;return new i([Number(E),Number(E)+1],K)})();N!==void 0&&(N.level(),ht.level()),f.push(ht)}}}var Mt=class It{bytes;header;headerLength;indexLength;constructor(t,e,n,i){this.bytes=t,this.header=e,this.headerLength=n,this.indexLength=i}static open(t){if(!t.subarray(0,3).every((s,o)=>U[o]===s))throw Error("Not a FlatGeobuf file");let e=new DataView(t.buffer).getUint32(U.length,!0);if(e>10485760||e<8)throw Error("Invalid header size");let n=t.subarray(U.length,U.length+4+e),i=Z(new B(n));return new It(t,i,e,Y(i.featuresCount,i.indexNodeSize))}async*selectBbox(t){let e=this.lengthBeforeTree(),n=async(i,s)=>{let o=e+i;return this.bytes.slice(o,o+s).buffer};for await(let i of xt(this.header.featuresCount,this.header.indexNodeSize,t,n)){let[s,o]=i;yield{id:o,feature:this.readFeature(s)}}}lengthBeforeTree(){return U.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}readFeature(t){let e=t+this.lengthBeforeFeatures(),n=new DataView(this.bytes.buffer).getUint32(e,!0),i=this.bytes.subarray(e+4,e+4+n),s=new Uint8Array(n+4);s.set(i,4);let o=new B(s);return W.getSizePrefixedRootAsFeature(o)}},nt=function(r,t){return nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},nt(r,t)};function qt(r,t){nt(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function L(r,t,e,n){function i(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function u(b){try{a(n.next(b))}catch(f){o(f)}}function h(b){try{a(n.throw(b))}catch(f){o(f)}}function a(b){b.done?s(b.value):i(b.value).then(u,h)}a((n=n.apply(r,t||[])).next())})}function T(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(b){return h([a,b])}}function h(a){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){e.label=a[1];break}if(a[0]===6&&e.label<s[1]){e.label=s[1],s=a;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(a);break}s[2]&&e.ops.pop(),e.trys.pop();continue}a=t.call(r,e)}catch(b){a=[6,b],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function z(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(r){return this instanceof q?(this.v=r,this):new q(r)}function jt(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(l){n[l]&&(i[l]=function(c){return new Promise(function(d,p){s.push([l,c,d,p])>1||u(l,c)})})}function u(l,c){try{h(n[l](c))}catch(d){f(s[0][3],d)}}function h(l){l.value instanceof q?Promise.resolve(l.value.v).then(a,b):f(s[0][2],l)}function a(l){u("next",l)}function b(l){u("throw",l)}function f(l,c){l(c),s.shift(),s.length&&u(s[0][0],s[0][1])}}var Ft=(function(r){qt(t,r);function t(e){var n=r.call(this,e)||this;return Object.defineProperty(n,"name",{value:"RepeaterOverflowError",enumerable:!1}),typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(n,n.constructor.prototype):n.__proto__=n.constructor.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(n,n.constructor),n}return t})(Error),oe=(function(){function r(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}return Object.defineProperty(r.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),r.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},r.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},r})(),ae=(function(){function r(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}return Object.defineProperty(r.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},r.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},r})(),ue=(function(){function r(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}return Object.defineProperty(r.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.add=function(t){this._q.length<this._c&&this._q.push(t)},r.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},r})();function it(r){r!=null&&typeof r.then=="function"&&r.then($,$)}var tt=0,dt=1,V=2,H=3,st=4,Ut=1024,$=function(){};function R(r){var t=r.err,e=Promise.resolve(r.execution).then(function(n){if(t!=null)throw t;return n});return r.err=void 0,r.execution=e.then(function(){},function(){}),r.pending===void 0?e:r.pending.then(function(){return e})}function A(r,t){var e=r.state>=H;return Promise.resolve(t).then(function(n){return!e&&r.state>=st?R(r).then(function(i){return{value:i,done:!0}}):{value:n,done:e}})}function ut(r,t){var e,n;if(!(r.state>=V))if(r.state=V,r.onnext(),r.onstop(),r.err==null&&(r.err=t),r.pushes.length===0&&(typeof r.buffer>"u"||r.buffer.empty))M(r);else try{for(var i=z(r.pushes),s=i.next();!s.done;s=i.next())s.value.resolve()}catch(o){e={error:o}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}function M(r){var t,e;if(!(r.state>=H)){r.state<V&&ut(r),r.state=H,r.buffer=void 0;try{for(var n=z(r.nexts),i=n.next();!i.done;i=n.next()){var s=i.value,o=r.pending===void 0?R(r):r.pending.then(function(){return R(r)});s.resolve(A(r,o))}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}r.pushes=[],r.nexts=[]}}function _t(r){r.state>=st||(r.state<H&&M(r),r.state=st)}function Gt(r,t){if(it(t),r.pushes.length>=1024)throw new Ft("No more than "+Ut+" pending calls to push are allowed on a single repeater.");if(r.state>=V)return Promise.resolve(void 0);var e=r.pending===void 0?Promise.resolve(t):r.pending.then(function(){return t});e=e.catch(function(u){r.state<V&&(r.err=u),_t(r)});var n;r.nexts.length?(r.nexts.shift().resolve(A(r,e)),r.nexts.length?n=Promise.resolve(r.nexts[0].value):typeof r.buffer<"u"&&!r.buffer.full?n=Promise.resolve(void 0):n=new Promise(function(u){return r.onnext=u})):typeof r.buffer<"u"&&!r.buffer.full?(r.buffer.add(e),n=Promise.resolve(void 0)):n=new Promise(function(u){return r.pushes.push({resolve:u,value:e})});var i=!0,s={},o=n.catch(function(u){if(i)throw u});return s.then=function(u,h){return i=!1,Promise.prototype.then.call(n,u,h)},s.catch=function(u){return i=!1,Promise.prototype.catch.call(n,u)},s.finally=n.finally.bind(n),r.pending=e.then(function(){return o}).catch(function(u){r.err=u,_t(r)}),s}function Dt(r){var t=ut.bind(null,r),e=new Promise(function(n){return r.onstop=n});return t.then=e.then.bind(e),t.catch=e.catch.bind(e),t.finally=e.finally.bind(e),t}function Ht(r){if(!(r.state>=dt)){r.state=dt;var t=Gt.bind(null,r),e=Dt(r);r.execution=new Promise(function(n){return n(r.executor(t,e))}),r.execution.catch(function(){return ut(r)})}}var D=new WeakMap,j=(function(){function r(t,e){D.set(this,{executor:t,buffer:e,err:void 0,state:tt,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:$,onstop:$})}return r.prototype.next=function(t){it(t);var e=D.get(this);if(e===void 0)throw new Error("WeakMap error");if(e.nexts.length>=1024)throw new Ft("No more than "+Ut+" pending calls to next are allowed on a single repeater.");if(e.state<=tt&&Ht(e),e.onnext(t),typeof e.buffer<"u"&&!e.buffer.empty){var n=A(e,e.buffer.remove());if(e.pushes.length){var i=e.pushes.shift();e.buffer.add(i.value),e.onnext=i.resolve}return n}else if(e.pushes.length){var s=e.pushes.shift();return e.onnext=s.resolve,A(e,s.value)}else if(e.state>=V)return M(e),A(e,R(e));return new Promise(function(o){return e.nexts.push({resolve:o,value:t})})},r.prototype.return=function(t){it(t);var e=D.get(this);if(e===void 0)throw new Error("WeakMap error");return M(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),A(e,R(e))},r.prototype.throw=function(t){var e=D.get(this);if(e===void 0)throw new Error("WeakMap error");return e.state<=tt||e.state>=V||typeof e.buffer<"u"&&!e.buffer.empty?(M(e),e.err==null&&(e.err=t),A(e,R(e))):this.next(Promise.reject(t))},r.prototype[Symbol.asyncIterator]=function(){return this},r.race=$t,r.merge=Wt,r.zip=Xt,r.latest=Zt,r})();function J(r,t){var e,n,i=[],s=function(a){a!=null&&typeof a[Symbol.asyncIterator]=="function"?i.push(a[Symbol.asyncIterator]()):a!=null&&typeof a[Symbol.iterator]=="function"?i.push(a[Symbol.iterator]()):i.push((function(){return jt(this,arguments,function(){return T(this,function(l){switch(l.label){case 0:return t.yieldValues?[4,q(a)]:[3,3];case 1:return[4,l.sent()];case 2:l.sent(),l.label=3;case 3:return t.returnValues?[4,q(a)]:[3,5];case 4:return[2,l.sent()];case 5:return[2]}})})})())};try{for(var o=z(r),u=o.next();!u.done;u=o.next()){var h=u.value;s(h)}}catch(a){e={error:a}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}function $t(r){var t=this,e=J(r,{returnValues:!0});return new j(function(n,i){return L(t,void 0,void 0,function(){var s,o,u,h,a,b;return T(this,function(f){switch(f.label){case 0:if(!e.length)return i(),[2];o=!1,i.then(function(){s(),o=!0}),f.label=1;case 1:f.trys.push([1,,5,7]),h=void 0,a=0,b=function(){var l,c,d,p,v,P;return T(this,function(F){switch(F.label){case 0:l=a;try{for(c=(v=void 0,z(e)),d=c.next();!d.done;d=c.next())p=d.value,Promise.resolve(p.next()).then(function(w){w.done?(i(),u===void 0&&(u=w)):a===l&&(a++,s(w))},function(w){return i(w)})}catch(w){v={error:w}}finally{try{d&&!d.done&&(P=c.return)&&P.call(c)}finally{if(v)throw v.error}}return[4,new Promise(function(w){return s=w})];case 1:return h=F.sent(),h===void 0?[3,3]:[4,n(h.value)];case 2:F.sent(),F.label=3;case 3:return[2]}})},f.label=2;case 2:return o?[3,4]:[5,b()];case 3:return f.sent(),[3,2];case 4:return[2,u&&u.value];case 5:return i(),[4,Promise.race(e.map(function(l){return l.return&&l.return()}))];case 6:return f.sent(),[7];case 7:return[2]}})})})}function Wt(r){var t=this,e=J(r,{yieldValues:!0});return new j(function(n,i){return L(t,void 0,void 0,function(){var s,o,u,h=this;return T(this,function(a){switch(a.label){case 0:if(!e.length)return i(),[2];s=[],o=!1,i.then(function(){var b,f;o=!0;try{for(var l=z(s),c=l.next();!c.done;c=l.next()){var d=c.value;d()}}catch(p){b={error:p}}finally{try{c&&!c.done&&(f=l.return)&&f.call(l)}finally{if(b)throw b.error}}}),a.label=1;case 1:return a.trys.push([1,,3,4]),[4,Promise.all(e.map(function(b,f){return L(h,void 0,void 0,function(){var l,c;return T(this,function(d){switch(d.label){case 0:d.trys.push([0,,6,9]),d.label=1;case 1:return o?[3,5]:(Promise.resolve(b.next()).then(function(p){return s[f](p)},function(p){return i(p)}),[4,new Promise(function(p){s[f]=p})]);case 2:return l=d.sent(),l===void 0?[3,4]:l.done?(u=l,[2]):[4,n(l.value)];case 3:d.sent(),d.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return c=b.return,c?[4,b.return()]:[3,8];case 7:c=d.sent(),d.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return a.sent(),[2,u&&u.value];case 3:return i(),[7];case 4:return[2]}})})})}function Xt(r){var t=this,e=J(r,{returnValues:!0});return new j(function(n,i){return L(t,void 0,void 0,function(){var s,o,u,h;return T(this,function(a){switch(a.label){case 0:if(!e.length)return i(),[2,[]];o=!1,i.then(function(){s(),o=!0}),a.label=1;case 1:a.trys.push([1,,6,8]),a.label=2;case 2:return o?[3,5]:(Promise.all(e.map(function(b){return b.next()})).then(function(b){return s(b)},function(b){return i(b)}),[4,new Promise(function(b){return s=b})]);case 3:return u=a.sent(),u===void 0?[2]:(h=u.map(function(b){return b.value}),u.some(function(b){return b.done})?[2,h]:[4,n(h)]);case 4:return a.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(e.map(function(b){return b.return&&b.return()}))];case 7:return a.sent(),[7];case 8:return[2]}})})})}function Zt(r){var t=this,e=J(r,{yieldValues:!0,returnValues:!0});return new j(function(n,i){return L(t,void 0,void 0,function(){var s,o,u,h,a,b=this;return T(this,function(f){switch(f.label){case 0:if(!e.length)return i(),[2,[]];o=[],u=!1,i.then(function(){var l,c;s();try{for(var d=z(o),p=d.next();!p.done;p=d.next()){var v=p.value;v()}}catch(P){l={error:P}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(l)throw l.error}}u=!0}),f.label=1;case 1:return f.trys.push([1,,5,7]),Promise.all(e.map(function(l){return l.next()})).then(function(l){return s(l)},function(l){return i(l)}),[4,new Promise(function(l){return s=l})];case 2:return h=f.sent(),h===void 0?[2]:(a=h.map(function(l){return l.value}),h.every(function(l){return l.done})?[2,a]:[4,n(a.slice())]);case 3:return f.sent(),[4,Promise.all(e.map(function(l,c){return L(b,void 0,void 0,function(){var d;return T(this,function(p){switch(p.label){case 0:if(h[c].done)return[2,h[c].value];p.label=1;case 1:return u?[3,4]:(Promise.resolve(l.next()).then(function(v){return o[c](v)},function(v){return i(v)}),[4,new Promise(function(v){return o[c]=v})]);case 2:return d=p.sent(),d===void 0?[2,h[c].value]:d.done?[2,d.value]:(a[c]=d.value,[4,n(a.slice())]);case 3:return p.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,f.sent()];case 5:return i(),[4,Promise.all(e.map(function(l){return l.return&&l.return()}))];case 6:return f.sent(),[7];case 7:return[2]}})})})}var Yt=class Pt{headerClient;header;headerLength;indexLength;nocache;headers;constructor(t,e,n,i,s,o={}){this.headerClient=t,this.header=e,this.headerLength=n,this.indexLength=i,this.nocache=s,this.headers=o}static async open(t,e,n={}){let i,s=new pt(t,e,n),o=2024+(()=>{let b,f=0;for(b=0;b<3;b++)f+=16**b*40;return f})();if(!new Uint8Array(await s.getRange(0,8,o,"header")).subarray(0,3).every((b,f)=>U[f]===b))throw Error("Not a FlatGeobuf file");if((i=new DataView(await s.getRange(8,4,o,"header")).getUint32(0,!0))>10485760||i<8)throw Error("Invalid header size");let u=await s.getRange(U.length,4+i,o,"header"),h=Z(new B(new Uint8Array(u)));if(h.indexNodeSize===0)throw Error("No index found, cannot read features filtered by bbox");let a=Y(h.featuresCount,h.indexNodeSize);return new Pt(s,h,i,a,e,n)}async*selectBbox(t){let e=this.lengthBeforeTree(),n=this.headerClient,i=async(h,a)=>n.getRange(e+h,a,0,"index"),s=[],o=[];for await(let h of xt(this.header.featuresCount,this.header.indexNodeSize,t,i)){let[a,b]=h,[,,f]=h;if(f||(f=4),o.length===0){o.push([a,f,b]);continue}let l=o[o.length-1];a-(l[0]+l[1])>wt.global.extraRequestThreshold()&&(s.push(o),o=[]),o.push([a,f,b])}this.headerClient.logUsage("header+index"),o.length>0&&s.push(o);let u=s.flatMap(h=>this.readFeatureBatch(h,this.nocache));yield*j.merge(u)}lengthBeforeTree(){return U.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}buildFeatureClient(t){return new pt(this.headerClient.httpClient,t,this.headers)}async*readFeatureBatch(t,e){let[n]=t[0],[i,s]=t[t.length-1],o=this.buildFeatureClient(e),u=i+s-n;for(let[h,,a]of t)yield{id:a,feature:await this.readFeature(o,h,u)},u=0;o.logUsage("feature")}async readFeature(t,e,n){let i,s=e+this.lengthBeforeFeatures();i=new DataView(await t.getRange(s,4,n,"feature length")).getUint32(0,!0);let o=new Uint8Array(await t.getRange(s+4,i,n,"feature data")),u=new Uint8Array(i+4);u.set(o,4);let h=new B(u);return W.getSizePrefixedRootAsFeature(h)}},pt=class{httpClient;bytesEverUsed=0;bytesEverFetched=0;buffer=new ArrayBuffer(0);head=0;constructor(r,t,e={}){if(typeof r=="string")this.httpClient=new yt(r,t,e);else if(r instanceof yt)this.httpClient=r;else throw Error("Unknown source")}async getRange(r,t,e,n){this.bytesEverUsed+=t;let i=r-this.head,s=i+t;if(i>=0&&s<=this.buffer.byteLength)return this.buffer.slice(i,s);let o=Math.max(t,e);return this.bytesEverFetched+=o,this.buffer=await this.httpClient.getRange(r,o,n),this.head=r,this.buffer.slice(0,t)}logUsage(r){r.split(" ")[0],(100*this.bytesEverUsed/this.bytesEverFetched).toFixed(2)}},yt=class{url;nocache;headers;requestsEverMade=0;bytesEverRequested=0;constructor(r,t,e={}){this.url=r,this.nocache=t,this.headers=e}async getRange(r,t,e){this.requestsEverMade+=1,this.bytesEverRequested+=t;let n=`bytes=${r}-${r+t-1}`,i=new Headers(this.headers);return i.set("Range",n),this.nocache&&i.set("Cache-Control","no-cache, no-store"),await(await fetch(this.url,{headers:i})).arrayBuffer()}};async function*Jt(r,t,e,n){if(!r.subarray(0,3).every((f,l)=>U[l]===f))throw Error("Not a FlatGeobuf file");if(e){let f=Mt.open(r);for await(let l of f.selectBbox(e))yield t(l.id,l.feature,f.header);return}let i=new B(r),s=i.readUint32(U.length);i.setPosition(U.length);let o=Z(i);n&&n(o);let u=U.length+4+s,{indexNodeSize:h,featuresCount:a}=o;h>0&&(u+=Y(a,h));let b=0;for(;u<i.capacity();){let f=i.readUint32(u);i.setPosition(u);let l=W.getSizePrefixedRootAsFeature(i);yield t(b++,l,o),u+=4+f}}async function*Kt(r,t,e){let n,i=Rt(r),s=async p=>await i.slice(p),o=new Uint8Array(await s(8,"magic bytes"));if(!o.subarray(0,3).every((p,v)=>U[v]===p))throw Error("Not a FlatGeobuf file");let u=new Uint8Array(await s(4,"header length")),h=new B(u),a=h.readUint32(0),b=new Uint8Array(await s(a,"header data"));(o=new Uint8Array(u.length+b.length)).set(u),o.set(b,u.length);let f=Z(h=new B(o));e&&e(f);let{indexNodeSize:l,featuresCount:c}=f;l>0&&await s(Y(c,l),"entire index, w/o rect");let d=0;for(;n=await te(s,f,t,d++);)yield n}async function*Qt(r,t,e,n,i=!1,s={}){let o=await Yt.open(r,i,s);for await(let u of(n&&n(o.header),o.selectBbox(t)))yield e(u.id,u.feature,o.header)}async function te(r,t,e,n){let i=new Uint8Array(await r(4,"feature length"));if(i.byteLength===0)return;let s=new B(i),o=s.readUint32(0);i=new Uint8Array(await r(o,"feature data"));let u=new Uint8Array(o+4);return u.set(i,4),s=new B(u),e(n,W.getSizePrefixedRootAsFeature(s),t)}function ot(r,t){let e=t;if(e===x.Unknown&&(e=r.type()),e===x.GeometryCollection){let i=[];for(let s=0;s<r.partsLength();s++){let o=r.parts(s),u=o.type();i.push(ot(o,u))}return{type:x[e],geometries:i}}if(e===x.MultiPolygon){let i=[];for(let s=0;s<r.partsLength();s++)i.push(ot(r.parts(s),x.Polygon));return{type:x[e],coordinates:i.map(s=>s.coordinates)}}let n=(function(i,s){let o=i.xyArray(),u=i.zArray();switch(s){case x.Point:{let h=Array.from(o);return u&&h.push(u[0]),h}case x.MultiPoint:case x.LineString:return Q(o,u);case x.MultiLineString:case x.Polygon:return(function(h,a,b){let f;if(!b||b.length===0)return[Q(h,a)];let l=0,c=Array.from(b).map(d=>h.slice(l,l=d<<1));return a&&(l=0,f=Array.from(b).map(d=>a.slice(l,l=d))),c.map((d,p)=>Q(d,f?f[p]:void 0))})(o,u,i.endsArray())}})(r,e);return{type:x[e],coordinates:n}}function lt(r,t,e){let n=e.columns;return{type:"Feature",id:r,geometry:ot(t.geometry(),e.geometryType),properties:Tt(t,n)}}async function*ee(r,t,e){yield*Jt(r,lt,t,e)}function re(r,t){return Kt(r,lt,t)}function ne(r,t,e,n=!1,i={}){return Qt(r,t,lt,e,n,i)}function ie(r,t,e,n=!1,i={}){return r instanceof Uint8Array?ee(r,t,e):r instanceof ReadableStream?re(r,e):ne(r,t,e,n,i)}exports.deserialize=ie;