mirage2d 1.1.2 → 1.1.4

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 (196) hide show
  1. package/dist/MirageHttp.es.js +5268 -0
  2. package/dist/MirageHttp.es.js.map +1 -0
  3. package/dist/MirageHttp.umd.js +2 -0
  4. package/dist/MirageHttp.umd.js.map +1 -0
  5. package/dist/assets/js/basedecoder-fa2b8e8d.js +107 -0
  6. package/dist/assets/js/decoder-f19e05cf.js +6 -0
  7. package/dist/assets/js/deflate-adb9a67b.js +8 -0
  8. package/dist/{js/dist/_html2canvas@1.4.1@html2canvas.e8006fee.js → assets/js/html2canvas.esm-3dd231c5.js} +0 -0
  9. package/dist/assets/js/index-3263db85.js +1 -0
  10. package/dist/assets/js/index-a9db46a5.js +212968 -0
  11. package/dist/{js/lib/_canvg@3.0.10@canvg.bd557ac8.js → assets/js/index.es-38f73a27.js} +2179 -351
  12. package/dist/assets/js/jpeg-3bf23728.js +835 -0
  13. package/dist/{js/_lerc@3.0.0@lerc/_lerc@3.0.0@lerc.dc2ff398.js → assets/js/lerc-4c39f39b.js} +26 -1
  14. package/dist/assets/js/lzw-d0cad8af.js +123 -0
  15. package/dist/assets/js/packbits-d75b4cce.js +25 -0
  16. package/dist/{js/_pako@2.0.4@pako/_pako@2.0.4@pako.52d6b320.js → assets/js/pako.esm-49deb4d7.js} +0 -0
  17. package/dist/{js/dist/_dompurify@2.4.0@dompurify.e7ba523e.js → assets/js/purify.es-1915dfae.js} +0 -0
  18. package/dist/assets/js/raw-9656f9cc.js +7 -0
  19. package/dist/assets/js/webimage-edb7156c.js +27 -0
  20. package/package.json +1 -1
  21. package/dist/js/_@babel_runtime@7.18.9@@babel/_@babel_runtime@7.18.9@@babel.e0126ca2.js +0 -51
  22. package/dist/js/_@petamoriken_float16@3.6.6@@petamoriken/_@petamoriken_float16@3.6.6@@petamoriken.c5188241.js +0 -217
  23. package/dist/js/_@turf_along@6.5.0@@turf/_@turf_along@6.5.0@@turf.18dbc1a3.js +0 -31
  24. package/dist/js/_@turf_angle@6.5.0@@turf/_@turf_angle@6.5.0@@turf.554ac9bf.js +0 -1
  25. package/dist/js/_@turf_area@6.5.0@@turf/_@turf_area@6.5.0@@turf.6cbf0cc1.js +0 -74
  26. package/dist/js/_@turf_bbox-clip@6.5.0@@turf/_@turf_bbox-clip@6.5.0@@turf.e491cb90.js +0 -1
  27. package/dist/js/_@turf_bbox-polygon@6.5.0@@turf/_@turf_bbox-polygon@6.5.0@@turf.523f1c20.js +0 -19
  28. package/dist/js/_@turf_bbox@6.5.0@@turf/_@turf_bbox@6.5.0@@turf.4c59feee.js +0 -48
  29. package/dist/js/_@turf_bearing@6.5.0@@turf/_@turf_bearing@6.5.0@@turf.f2555a09.js +0 -25
  30. package/dist/js/_@turf_bezier-spline@6.5.0@@turf/_@turf_bezier-spline@6.5.0@@turf.fa7991dd.js +0 -137
  31. package/dist/js/_@turf_boolean-clockwise@6.5.0@@turf/_@turf_boolean-clockwise@6.5.0@@turf.4031f280.js +0 -1
  32. package/dist/js/_@turf_boolean-contains@6.5.0@@turf/_@turf_boolean-contains@6.5.0@@turf.836d55d8.js +0 -191
  33. package/dist/js/_@turf_boolean-crosses@6.5.0@@turf/_@turf_boolean-crosses@6.5.0@@turf.c5f65a28.js +0 -125
  34. package/dist/js/_@turf_boolean-disjoint@6.5.0@@turf/_@turf_boolean-disjoint@6.5.0@@turf.bbd60872.js +0 -122
  35. package/dist/js/_@turf_boolean-equal@6.5.0@@turf/_@turf_boolean-equal@6.5.0@@turf.341ffa01.js +0 -1
  36. package/dist/js/_@turf_boolean-intersects@6.5.0@@turf/_@turf_boolean-intersects@6.5.0@@turf.05fc28b3.js +0 -15
  37. package/dist/js/_@turf_boolean-overlap@6.5.0@@turf/_@turf_boolean-overlap@6.5.0@@turf.a519db25.js +0 -53
  38. package/dist/js/_@turf_boolean-parallel@6.5.0@@turf/_@turf_boolean-parallel@6.5.0@@turf.dbf2bc2d.js +0 -1
  39. package/dist/js/_@turf_boolean-point-in-polygon@6.5.0@@turf/_@turf_boolean-point-in-polygon@6.5.0@@turf.62a2d48a.js +0 -65
  40. package/dist/js/_@turf_boolean-point-on-line@6.5.0@@turf/_@turf_boolean-point-on-line@6.5.0@@turf.3cf3aaa1.js +0 -69
  41. package/dist/js/_@turf_boolean-within@6.5.0@@turf/_@turf_boolean-within@6.5.0@@turf.d70d6bfc.js +0 -172
  42. package/dist/js/_@turf_buffer@6.5.0@@turf/_@turf_buffer@6.5.0@@turf.88330dfe.js +0 -99
  43. package/dist/js/_@turf_center-mean@6.5.0@@turf/_@turf_center-mean@6.5.0@@turf.b3d7c917.js +0 -1
  44. package/dist/js/_@turf_center-median@6.5.0@@turf/_@turf_center-median@6.5.0@@turf.44c4669e.js +0 -1
  45. package/dist/js/_@turf_center-of-mass@6.5.0@@turf/_@turf_center-of-mass@6.5.0@@turf.63ce279e.js +0 -1
  46. package/dist/js/_@turf_center@6.5.0@@turf/_@turf_center@6.5.0@@turf.a45495b5.js +0 -12
  47. package/dist/js/_@turf_centroid@6.5.0@@turf/_@turf_centroid@6.5.0@@turf.0a5be869.js +0 -17
  48. package/dist/js/_@turf_circle@6.5.0@@turf/_@turf_circle@6.5.0@@turf.0166b8c2.js +0 -16
  49. package/dist/js/_@turf_clean-coords@6.5.0@@turf/_@turf_clean-coords@6.5.0@@turf.8c76bd63.js +0 -111
  50. package/dist/js/_@turf_clone@6.5.0@@turf/_@turf_clone@6.5.0@@turf.cd05b1f8.js +0 -100
  51. package/dist/js/_@turf_clusters-dbscan@6.5.0@@turf/_@turf_clusters-dbscan@6.5.0@@turf.6bbee7e9.js +0 -1
  52. package/dist/js/_@turf_clusters-kmeans@6.5.0@@turf/_@turf_clusters-kmeans@6.5.0@@turf.505415df.js +0 -1
  53. package/dist/js/_@turf_clusters@6.5.0@@turf/_@turf_clusters@6.5.0@@turf.84cb9680.js +0 -1
  54. package/dist/js/_@turf_collect@6.5.0@@turf/_@turf_collect@6.5.0@@turf.93e41b5f.js +0 -1
  55. package/dist/js/_@turf_combine@6.5.0@@turf/_@turf_combine@6.5.0@@turf.33ee6336.js +0 -1
  56. package/dist/js/_@turf_concave@6.5.0@@turf/_@turf_concave@6.5.0@@turf.6fb6a8be.js +0 -179
  57. package/dist/js/_@turf_convex@6.5.0@@turf/_@turf_convex@6.5.0@@turf.24600ac2.js +0 -1
  58. package/dist/js/_@turf_destination@6.5.0@@turf/_@turf_destination@6.5.0@@turf.2621651e.js +0 -18
  59. package/dist/js/_@turf_difference@6.5.0@@turf/_@turf_difference@6.5.0@@turf.70df5e79.js +0 -18
  60. package/dist/js/_@turf_dissolve@6.5.0@@turf/_@turf_dissolve@6.5.0@@turf.edb28fc1.js +0 -1
  61. package/dist/js/_@turf_distance-weight@6.5.0@@turf/_@turf_distance-weight@6.5.0@@turf.e168af7f.js +0 -1
  62. package/dist/js/_@turf_distance@6.5.0@@turf/_@turf_distance@6.5.0@@turf.0c7b8aea.js +0 -22
  63. package/dist/js/_@turf_ellipse@6.5.0@@turf/_@turf_ellipse@6.5.0@@turf.37986056.js +0 -1
  64. package/dist/js/_@turf_envelope@6.5.0@@turf/_@turf_envelope@6.5.0@@turf.599c5772.js +0 -1
  65. package/dist/js/_@turf_explode@6.5.0@@turf/_@turf_explode@6.5.0@@turf.5c768db5.js +0 -24
  66. package/dist/js/_@turf_flatten@6.5.0@@turf/_@turf_flatten@6.5.0@@turf.57e9114c.js +0 -1
  67. package/dist/js/_@turf_flip@6.5.0@@turf/_@turf_flip@6.5.0@@turf.1f02101f.js +0 -1
  68. package/dist/js/_@turf_great-circle@6.5.0@@turf/_@turf_great-circle@6.5.0@@turf.2ca021a8.js +0 -1
  69. package/dist/js/_@turf_helpers@6.5.0@@turf/_@turf_helpers@6.5.0@@turf.f1480aa1.js +0 -364
  70. package/dist/js/_@turf_hex-grid@6.5.0@@turf/_@turf_hex-grid@6.5.0@@turf.a6a45778.js +0 -99
  71. package/dist/js/_@turf_interpolate@6.5.0@@turf/_@turf_interpolate@6.5.0@@turf.4d39bd8c.js +0 -1
  72. package/dist/js/_@turf_intersect@6.5.0@@turf/_@turf_intersect@6.5.0@@turf.34082cdf.js +0 -17
  73. package/dist/js/_@turf_invariant@6.5.0@@turf/_@turf_invariant@6.5.0@@turf.0ef69f8c.js +0 -71
  74. package/dist/js/_@turf_isobands@6.5.0@@turf/_@turf_isobands@6.5.0@@turf.def019df.js +0 -3109
  75. package/dist/js/_@turf_isolines@6.5.0@@turf/_@turf_isolines@6.5.0@@turf.da623b25.js +0 -1
  76. package/dist/js/_@turf_kinks@6.5.0@@turf/_@turf_kinks@6.5.0@@turf.ee61685b.js +0 -87
  77. package/dist/js/_@turf_length@6.5.0@@turf/_@turf_length@6.5.0@@turf.f73f6c98.js +0 -12
  78. package/dist/js/_@turf_line-arc@6.5.0@@turf/_@turf_line-arc@6.5.0@@turf.3dc57055.js +0 -37
  79. package/dist/js/_@turf_line-chunk@6.5.0@@turf/_@turf_line-chunk@6.5.0@@turf.1867af48.js +0 -43
  80. package/dist/js/_@turf_line-intersect@6.5.0@@turf/_@turf_line-intersect@6.5.0@@turf.c4d81948.js +0 -73
  81. package/dist/js/_@turf_line-offset@6.5.0@@turf/_@turf_line-offset@6.5.0@@turf.e6846793.js +0 -116
  82. package/dist/js/_@turf_line-overlap@6.5.0@@turf/_@turf_line-overlap@6.5.0@@turf.addba9a5.js +0 -76
  83. package/dist/js/_@turf_line-segment@6.5.0@@turf/_@turf_line-segment@6.5.0@@turf.18ce3010.js +0 -55
  84. package/dist/js/_@turf_line-slice-along@6.5.0@@turf/_@turf_line-slice-along@6.5.0@@turf.2b802464.js +0 -57
  85. package/dist/js/_@turf_line-slice@6.5.0@@turf/_@turf_line-slice@6.5.0@@turf.6423a053.js +0 -23
  86. package/dist/js/_@turf_line-split@6.5.0@@turf/_@turf_line-split@6.5.0@@turf.2022f104.js +0 -125
  87. package/dist/js/_@turf_line-to-polygon@6.5.0@@turf/_@turf_line-to-polygon@6.5.0@@turf.83f5e69f.js +0 -1
  88. package/dist/js/_@turf_mask@6.5.0@@turf/_@turf_mask@6.5.0@@turf.96cd5a94.js +0 -1
  89. package/dist/js/_@turf_meta@6.5.0@@turf/_@turf_meta@6.5.0@@turf.1b9d5da5.js +0 -611
  90. package/dist/js/_@turf_midpoint@6.5.0@@turf/_@turf_midpoint@6.5.0@@turf.67c14f94.js +0 -1
  91. package/dist/js/_@turf_moran-index@6.5.0@@turf/_@turf_moran-index@6.5.0@@turf.2ad5365a.js +0 -1
  92. package/dist/js/_@turf_nearest-point-on-line@6.5.0@@turf/_@turf_nearest-point-on-line@6.5.0@@turf.095c8c0d.js +0 -57
  93. package/dist/js/_@turf_nearest-point-to-line@6.5.0@@turf/_@turf_nearest-point-to-line@6.5.0@@turf.68484097.js +0 -1
  94. package/dist/js/_@turf_nearest-point@6.5.0@@turf/_@turf_nearest-point@6.5.0@@turf.e0d2f509.js +0 -24
  95. package/dist/js/_@turf_planepoint@6.5.0@@turf/_@turf_planepoint@6.5.0@@turf.56fc70b3.js +0 -1
  96. package/dist/js/_@turf_point-grid@6.5.0@@turf/_@turf_point-grid@6.5.0@@turf.2d278644.js +0 -42
  97. package/dist/js/_@turf_point-on-feature@6.5.0@@turf/_@turf_point-on-feature@6.5.0@@turf.0c740874.js +0 -1
  98. package/dist/js/_@turf_point-to-line-distance@6.5.0@@turf/_@turf_point-to-line-distance@6.5.0@@turf.33105d82.js +0 -1
  99. package/dist/js/_@turf_points-within-polygon@6.5.0@@turf/_@turf_points-within-polygon@6.5.0@@turf.659cd335.js +0 -35
  100. package/dist/js/_@turf_polygon-smooth@6.5.0@@turf/_@turf_polygon-smooth@6.5.0@@turf.43a7c33e.js +0 -1
  101. package/dist/js/_@turf_polygon-tangents@6.5.0@@turf/_@turf_polygon-tangents@6.5.0@@turf.a2c3a7b6.js +0 -1
  102. package/dist/js/_@turf_polygon-to-line@6.5.0@@turf/_@turf_polygon-to-line@6.5.0@@turf.3177cfb1.js +0 -48
  103. package/dist/js/_@turf_polygonize@6.5.0@@turf/_@turf_polygonize@6.5.0@@turf.f7cc4910.js +0 -1
  104. package/dist/js/_@turf_projection@6.5.0@@turf/_@turf_projection@6.5.0@@turf.ffdd3321.js +0 -1
  105. package/dist/js/_@turf_random@6.5.0@@turf/_@turf_random@6.5.0@@turf.f65251e4.js +0 -130
  106. package/dist/js/_@turf_rectangle-grid@6.5.0@@turf/_@turf_rectangle-grid@6.5.0@@turf.7e8b1a1f.js +0 -49
  107. package/dist/js/_@turf_rewind@6.5.0@@turf/_@turf_rewind@6.5.0@@turf.5d137ee9.js +0 -1
  108. package/dist/js/_@turf_rhumb-bearing@6.5.0@@turf/_@turf_rhumb-bearing@6.5.0@@turf.fb8f6ade.js +0 -30
  109. package/dist/js/_@turf_rhumb-destination@6.5.0@@turf/_@turf_rhumb-destination@6.5.0@@turf.dc0e4753.js +0 -36
  110. package/dist/js/_@turf_rhumb-distance@6.5.0@@turf/_@turf_rhumb-distance@6.5.0@@turf.94e475b8.js +0 -30
  111. package/dist/js/_@turf_sample@6.5.0@@turf/_@turf_sample@6.5.0@@turf.7181d7a7.js +0 -1
  112. package/dist/js/_@turf_sector@6.5.0@@turf/_@turf_sector@6.5.0@@turf.04ffddfe.js +0 -39
  113. package/dist/js/_@turf_shortest-path@6.5.0@@turf/_@turf_shortest-path@6.5.0@@turf.0c1b62a8.js +0 -367
  114. package/dist/js/_@turf_simplify@6.5.0@@turf/_@turf_simplify@6.5.0@@turf.46703d2e.js +0 -1
  115. package/dist/js/_@turf_square-grid@6.5.0@@turf/_@turf_square-grid@6.5.0@@turf.38bd2eaa.js +0 -8
  116. package/dist/js/_@turf_square@6.5.0@@turf/_@turf_square@6.5.0@@turf.2705289a.js +0 -27
  117. package/dist/js/_@turf_standard-deviational-ellipse@6.5.0@@turf/_@turf_standard-deviational-ellipse@6.5.0@@turf.7094e432.js +0 -1
  118. package/dist/js/_@turf_tag@6.5.0@@turf/_@turf_tag@6.5.0@@turf.cb60b0c1.js +0 -1
  119. package/dist/js/_@turf_tesselate@6.5.0@@turf/_@turf_tesselate@6.5.0@@turf.330e4aae.js +0 -1
  120. package/dist/js/_@turf_tin@6.5.0@@turf/_@turf_tin@6.5.0@@turf.077204c4.js +0 -173
  121. package/dist/js/_@turf_transform-rotate@6.5.0@@turf/_@turf_transform-rotate@6.5.0@@turf.6d350d36.js +0 -1
  122. package/dist/js/_@turf_transform-scale@6.5.0@@turf/_@turf_transform-scale@6.5.0@@turf.d6f65671.js +0 -90
  123. package/dist/js/_@turf_transform-translate@6.5.0@@turf/_@turf_transform-translate@6.5.0@@turf.9296b81a.js +0 -1
  124. package/dist/js/_@turf_triangle-grid@6.5.0@@turf/_@turf_triangle-grid@6.5.0@@turf.939f94ab.js +0 -107
  125. package/dist/js/_@turf_truncate@6.5.0@@turf/_@turf_truncate@6.5.0@@turf.ed70ebcb.js +0 -33
  126. package/dist/js/_@turf_turf@6.4.0@@turf/_@turf_turf@6.4.0@@turf.34fde8ec.js +0 -1
  127. package/dist/js/_@turf_union@6.5.0@@turf/_@turf_union@6.5.0@@turf.386ee2eb.js +0 -1
  128. package/dist/js/_@turf_unkink-polygon@6.5.0@@turf/_@turf_unkink-polygon@6.5.0@@turf.cb446e47.js +0 -1
  129. package/dist/js/_@turf_voronoi@6.5.0@@turf/_@turf_voronoi@6.5.0@@turf.c30d929e.js +0 -30
  130. package/dist/js/_call-bind@1.0.2@call-bind/_call-bind@1.0.2@call-bind.3811d387.js +0 -53
  131. package/dist/js/_concaveman@1.2.1@concaveman/_concaveman@1.2.1@concaveman.e747f731.js +0 -1
  132. package/dist/js/_core-js@3.25.0@core-js/_core-js@3.25.0@core-js.003355ed.js +0 -5029
  133. package/dist/js/_crypto-js@4.1.1@crypto-js/_crypto-js@4.1.1@crypto-js.e2f7f158.js +0 -1823
  134. package/dist/js/_d3-array@1.2.4@d3-array/_d3-array@1.2.4@d3-array.d606df6b.js +0 -58
  135. package/dist/js/_d3-geo@1.7.1@d3-geo/_d3-geo@1.7.1@d3-geo.7d357be1.js +0 -1094
  136. package/dist/js/_d3-voronoi@1.1.2@d3-voronoi/_d3-voronoi@1.1.2@d3-voronoi.072f12a6.js +0 -816
  137. package/dist/js/_deep-equal@1.1.1@deep-equal/_deep-equal@1.1.1@deep-equal.98576c17.js +0 -108
  138. package/dist/js/_define-properties@1.1.4@define-properties/_define-properties@1.1.4@define-properties.647c3367.js +0 -40
  139. package/dist/js/_density-clustering@1.3.0@density-clustering/_density-clustering@1.3.0@density-clustering.a07fc6ae.js +0 -1
  140. package/dist/js/_earcut@2.2.4@earcut/_earcut@2.2.4@earcut.972ebfd3.js +0 -1
  141. package/dist/js/_echarts-gl@1.1.2@echarts-gl/_echarts-gl@1.1.2@echarts-gl.1e3964b9.js +0 -36533
  142. package/dist/js/_echarts@4.9.0@echarts/_echarts@4.9.0@echarts.7d74ba77.js +0 -44219
  143. package/dist/js/_fflate@0.4.8@fflate/_fflate@0.4.8@fflate.d8111196.js +0 -571
  144. package/dist/js/_function-bind@1.1.1@function-bind/_function-bind@1.1.1@function-bind.de3cf11d.js +0 -46
  145. package/dist/js/_functions-have-names@1.2.3@functions-have-names/_functions-have-names@1.2.3@functions-have-names.7def2408.js +0 -27
  146. package/dist/js/_geojson-equality@0.1.6@geojson-equality/_geojson-equality@0.1.6@geojson-equality.09ffa121.js +0 -133
  147. package/dist/js/_geojson-path-finder@1.5.3@geojson-path-finder/_geojson-path-finder@1.5.3@geojson-path-finder.7a10eb99.js +0 -348
  148. package/dist/js/_geojson-rbush@3.2.0@geojson-rbush/_geojson-rbush@3.2.0@geojson-rbush.2adaeedb.js +0 -93
  149. package/dist/js/_geotiff@2.0.4@geotiff/_geotiff@2.0.4@geotiff.5b08f79e.js +0 -3663
  150. package/dist/js/_get-intrinsic@1.1.2@get-intrinsic/_get-intrinsic@1.1.2@get-intrinsic.a633bd68.js +0 -291
  151. package/dist/js/_has-property-descriptors@1.0.0@has-property-descriptors/_has-property-descriptors@1.0.0@has-property-descriptors.6bd2d302.js +0 -26
  152. package/dist/js/_has-symbols@1.0.3@has-symbols/_has-symbols@1.0.3@has-symbols.70406077.js +0 -63
  153. package/dist/js/_has-tostringtag@1.0.0@has-tostringtag/_has-tostringtag@1.0.0@has-tostringtag.2d502422.js +0 -6
  154. package/dist/js/_has@1.0.3@has/_has@1.0.3@has.ddd2eb68.js +0 -4
  155. package/dist/js/_ieee754@1.2.1@ieee754/_ieee754@1.2.1@ieee754.56426503.js +0 -80
  156. package/dist/js/_is-arguments@1.1.1@is-arguments/_is-arguments@1.1.1@is-arguments.7d77e24a.js +0 -23
  157. package/dist/js/_is-date-object@1.0.5@is-date-object/_is-date-object@1.0.5@is-date-object.08cc2543.js +0 -20
  158. package/dist/js/_is-regex@1.1.4@is-regex/_is-regex@1.1.4@is-regex.6417e007.js +0 -47
  159. package/dist/js/_jspdf@2.5.1@jspdf/_jspdf@2.5.1@jspdf.e927dbd8.js +0 -8494
  160. package/dist/js/_kml-geojson@1.2.0@kml-geojson/_kml-geojson@1.2.0@kml-geojson.f1ae86e4.js +0 -7858
  161. package/dist/js/_lru-cache@6.0.0@lru-cache/_lru-cache@6.0.0@lru-cache.dd72cc1b.js +0 -263
  162. package/dist/js/_mgrs@1.0.0@mgrs/_mgrs@1.0.0@mgrs.12d1da3e.js +0 -432
  163. package/dist/js/_object-assign@4.1.1@object-assign/_object-assign@4.1.1@object-assign.e4009c1c.js +0 -69
  164. package/dist/js/_object-is@1.1.5@object-is/_object-is@1.1.5@object-is.e47f5d65.js +0 -45
  165. package/dist/js/_object-keys@1.1.1@object-keys/_object-keys@1.1.1@object-keys.4b1d0a99.js +0 -151
  166. package/dist/js/_ol-echarts@2.0.6@ol-echarts/_ol-echarts@2.0.6@ol-echarts.658aaf82.js +0 -841
  167. package/dist/js/_ol-ext@3.2.30@ol-ext/_ol-ext@3.2.30@ol-ext.b94220dd.js +0 -4614
  168. package/dist/js/_ol-mapbox-style@8.2.1@ol-mapbox-style/_ol-mapbox-style@8.2.1@ol-mapbox-style.795310f3.js +0 -1
  169. package/dist/js/_ol@6.15.1@ol/_ol@6.15.1@ol.8fd0cbb5.js +0 -31823
  170. package/dist/js/_pbf@3.2.1@pbf/_pbf@3.2.1@pbf.330acf55.js +0 -647
  171. package/dist/js/_performance-now@2.1.0@performance-now/_performance-now@2.1.0@performance-now.a51379c2.js +0 -34
  172. package/dist/js/_point-in-polygon@1.1.0@point-in-polygon/_point-in-polygon@1.1.0@point-in-polygon.2cc4306e.js +0 -1
  173. package/dist/js/_polygon-clipping@0.15.3@polygon-clipping/_polygon-clipping@0.15.3@polygon-clipping.c0e9ec57.js +0 -1363
  174. package/dist/js/_proj4@2.8.0@proj4/_proj4@2.8.0@proj4.1600352c.js +0 -4885
  175. package/dist/js/_quickselect@1.1.1@quickselect/_quickselect@1.1.1@quickselect.8afce154.js +0 -1
  176. package/dist/js/_quickselect@2.0.0@quickselect/_quickselect@2.0.0@quickselect.9f5c1e48.js +0 -51
  177. package/dist/js/_raf@3.4.1@raf/_raf@3.4.1@raf.ac0d6c66.js +0 -60
  178. package/dist/js/_rbush@2.0.2@rbush/_rbush@2.0.2@rbush.7149e620.js +0 -1
  179. package/dist/js/_rbush@3.0.1@rbush/_rbush@3.0.1@rbush.57d33d95.js +0 -402
  180. package/dist/js/_regexp.prototype.flags@1.4.3@regexp.prototype.flags/_regexp.prototype.flags@1.4.3@regexp.prototype.flags.8b6921c6.js +0 -102
  181. package/dist/js/_rgbcolor@1.0.1@rgbcolor/_rgbcolor@1.0.1@rgbcolor.dd87e013.js +0 -272
  182. package/dist/js/_robust-predicates@2.0.4@robust-predicates/_robust-predicates@2.0.4@robust-predicates.564bf2f8.js +0 -1
  183. package/dist/js/_skmeans@0.9.7@skmeans/_skmeans@0.9.7@skmeans.933c6a76.js +0 -1
  184. package/dist/js/_splaytree@3.1.1@splaytree/_splaytree@3.1.1@splaytree.6cb55ed3.js +0 -671
  185. package/dist/js/_stackblur-canvas@2.5.0@stackblur-canvas/_stackblur-canvas@2.5.0@stackblur-canvas.dd883d14.js +0 -214
  186. package/dist/js/_svg-pathdata@6.0.3@svg-pathdata/_svg-pathdata@6.0.3@svg-pathdata.7e858a5f.js +0 -441
  187. package/dist/js/_tinyqueue@2.0.3@tinyqueue/_tinyqueue@2.0.3@tinyqueue.78918532.js +0 -73
  188. package/dist/js/_topojson-client@3.1.0@topojson-client/_topojson-client@3.1.0@topojson-client.aef4e2d5.js +0 -238
  189. package/dist/js/_topojson-server@3.0.1@topojson-server/_topojson-server@3.0.1@topojson-server.b521a412.js +0 -662
  190. package/dist/js/_turf-jsts@1.2.3@turf-jsts/_turf-jsts@1.2.3@turf-jsts.6ef42696.js +0 -18934
  191. package/dist/js/_web-worker@1.2.0@web-worker/_web-worker@1.2.0@web-worker.43288df7.js +0 -2
  192. package/dist/js/_wkt-parser@1.3.2@wkt-parser/_wkt-parser@1.3.2@wkt-parser.0e1cf374.js +0 -461
  193. package/dist/js/_xml-utils@1.2.0@xml-utils/_xml-utils@1.2.0@xml-utils.2a8ae655.js +0 -126
  194. package/dist/js/_yallist@4.0.0@yallist/_yallist@4.0.0@yallist.8350aafe.js +0 -363
  195. package/dist/js/_zrender@4.3.2@zrender/_zrender@4.3.2@zrender.1feea14d.js +0 -12455
  196. package/dist/mirage2d.es.js +0 -15894
@@ -0,0 +1,835 @@
1
+ import { B as BaseDecoder } from "./basedecoder-fa2b8e8d.js";
2
+ const dctZigZag = new Int32Array([
3
+ 0,
4
+ 1,
5
+ 8,
6
+ 16,
7
+ 9,
8
+ 2,
9
+ 3,
10
+ 10,
11
+ 17,
12
+ 24,
13
+ 32,
14
+ 25,
15
+ 18,
16
+ 11,
17
+ 4,
18
+ 5,
19
+ 12,
20
+ 19,
21
+ 26,
22
+ 33,
23
+ 40,
24
+ 48,
25
+ 41,
26
+ 34,
27
+ 27,
28
+ 20,
29
+ 13,
30
+ 6,
31
+ 7,
32
+ 14,
33
+ 21,
34
+ 28,
35
+ 35,
36
+ 42,
37
+ 49,
38
+ 56,
39
+ 57,
40
+ 50,
41
+ 43,
42
+ 36,
43
+ 29,
44
+ 22,
45
+ 15,
46
+ 23,
47
+ 30,
48
+ 37,
49
+ 44,
50
+ 51,
51
+ 58,
52
+ 59,
53
+ 52,
54
+ 45,
55
+ 38,
56
+ 31,
57
+ 39,
58
+ 46,
59
+ 53,
60
+ 60,
61
+ 61,
62
+ 54,
63
+ 47,
64
+ 55,
65
+ 62,
66
+ 63
67
+ ]);
68
+ const dctCos1 = 4017;
69
+ const dctSin1 = 799;
70
+ const dctCos3 = 3406;
71
+ const dctSin3 = 2276;
72
+ const dctCos6 = 1567;
73
+ const dctSin6 = 3784;
74
+ const dctSqrt2 = 5793;
75
+ const dctSqrt1d2 = 2896;
76
+ function buildHuffmanTable(codeLengths, values) {
77
+ let k = 0;
78
+ const code = [];
79
+ let length = 16;
80
+ while (length > 0 && !codeLengths[length - 1]) {
81
+ --length;
82
+ }
83
+ code.push({ children: [], index: 0 });
84
+ let p = code[0];
85
+ let q;
86
+ for (let i = 0; i < length; i++) {
87
+ for (let j = 0; j < codeLengths[i]; j++) {
88
+ p = code.pop();
89
+ p.children[p.index] = values[k];
90
+ while (p.index > 0) {
91
+ p = code.pop();
92
+ }
93
+ p.index++;
94
+ code.push(p);
95
+ while (code.length <= i) {
96
+ code.push(q = { children: [], index: 0 });
97
+ p.children[p.index] = q.children;
98
+ p = q;
99
+ }
100
+ k++;
101
+ }
102
+ if (i + 1 < length) {
103
+ code.push(q = { children: [], index: 0 });
104
+ p.children[p.index] = q.children;
105
+ p = q;
106
+ }
107
+ }
108
+ return code[0].children;
109
+ }
110
+ function decodeScan(data, initialOffset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) {
111
+ const { mcusPerLine, progressive } = frame;
112
+ const startOffset = initialOffset;
113
+ let offset = initialOffset;
114
+ let bitsData = 0;
115
+ let bitsCount = 0;
116
+ function readBit() {
117
+ if (bitsCount > 0) {
118
+ bitsCount--;
119
+ return bitsData >> bitsCount & 1;
120
+ }
121
+ bitsData = data[offset++];
122
+ if (bitsData === 255) {
123
+ const nextByte = data[offset++];
124
+ if (nextByte) {
125
+ throw new Error(`unexpected marker: ${(bitsData << 8 | nextByte).toString(16)}`);
126
+ }
127
+ }
128
+ bitsCount = 7;
129
+ return bitsData >>> 7;
130
+ }
131
+ function decodeHuffman(tree) {
132
+ let node = tree;
133
+ let bit;
134
+ while ((bit = readBit()) !== null) {
135
+ node = node[bit];
136
+ if (typeof node === "number") {
137
+ return node;
138
+ }
139
+ if (typeof node !== "object") {
140
+ throw new Error("invalid huffman sequence");
141
+ }
142
+ }
143
+ return null;
144
+ }
145
+ function receive(initialLength) {
146
+ let length = initialLength;
147
+ let n2 = 0;
148
+ while (length > 0) {
149
+ const bit = readBit();
150
+ if (bit === null) {
151
+ return void 0;
152
+ }
153
+ n2 = n2 << 1 | bit;
154
+ --length;
155
+ }
156
+ return n2;
157
+ }
158
+ function receiveAndExtend(length) {
159
+ const n2 = receive(length);
160
+ if (n2 >= 1 << length - 1) {
161
+ return n2;
162
+ }
163
+ return n2 + (-1 << length) + 1;
164
+ }
165
+ function decodeBaseline(component2, zz) {
166
+ const t = decodeHuffman(component2.huffmanTableDC);
167
+ const diff = t === 0 ? 0 : receiveAndExtend(t);
168
+ component2.pred += diff;
169
+ zz[0] = component2.pred;
170
+ let k2 = 1;
171
+ while (k2 < 64) {
172
+ const rs = decodeHuffman(component2.huffmanTableAC);
173
+ const s = rs & 15;
174
+ const r = rs >> 4;
175
+ if (s === 0) {
176
+ if (r < 15) {
177
+ break;
178
+ }
179
+ k2 += 16;
180
+ } else {
181
+ k2 += r;
182
+ const z = dctZigZag[k2];
183
+ zz[z] = receiveAndExtend(s);
184
+ k2++;
185
+ }
186
+ }
187
+ }
188
+ function decodeDCFirst(component2, zz) {
189
+ const t = decodeHuffman(component2.huffmanTableDC);
190
+ const diff = t === 0 ? 0 : receiveAndExtend(t) << successive;
191
+ component2.pred += diff;
192
+ zz[0] = component2.pred;
193
+ }
194
+ function decodeDCSuccessive(component2, zz) {
195
+ zz[0] |= readBit() << successive;
196
+ }
197
+ let eobrun = 0;
198
+ function decodeACFirst(component2, zz) {
199
+ if (eobrun > 0) {
200
+ eobrun--;
201
+ return;
202
+ }
203
+ let k2 = spectralStart;
204
+ const e = spectralEnd;
205
+ while (k2 <= e) {
206
+ const rs = decodeHuffman(component2.huffmanTableAC);
207
+ const s = rs & 15;
208
+ const r = rs >> 4;
209
+ if (s === 0) {
210
+ if (r < 15) {
211
+ eobrun = receive(r) + (1 << r) - 1;
212
+ break;
213
+ }
214
+ k2 += 16;
215
+ } else {
216
+ k2 += r;
217
+ const z = dctZigZag[k2];
218
+ zz[z] = receiveAndExtend(s) * (1 << successive);
219
+ k2++;
220
+ }
221
+ }
222
+ }
223
+ let successiveACState = 0;
224
+ let successiveACNextValue;
225
+ function decodeACSuccessive(component2, zz) {
226
+ let k2 = spectralStart;
227
+ const e = spectralEnd;
228
+ let r = 0;
229
+ while (k2 <= e) {
230
+ const z = dctZigZag[k2];
231
+ const direction = zz[z] < 0 ? -1 : 1;
232
+ switch (successiveACState) {
233
+ case 0: {
234
+ const rs = decodeHuffman(component2.huffmanTableAC);
235
+ const s = rs & 15;
236
+ r = rs >> 4;
237
+ if (s === 0) {
238
+ if (r < 15) {
239
+ eobrun = receive(r) + (1 << r);
240
+ successiveACState = 4;
241
+ } else {
242
+ r = 16;
243
+ successiveACState = 1;
244
+ }
245
+ } else {
246
+ if (s !== 1) {
247
+ throw new Error("invalid ACn encoding");
248
+ }
249
+ successiveACNextValue = receiveAndExtend(s);
250
+ successiveACState = r ? 2 : 3;
251
+ }
252
+ continue;
253
+ }
254
+ case 1:
255
+ case 2:
256
+ if (zz[z]) {
257
+ zz[z] += (readBit() << successive) * direction;
258
+ } else {
259
+ r--;
260
+ if (r === 0) {
261
+ successiveACState = successiveACState === 2 ? 3 : 0;
262
+ }
263
+ }
264
+ break;
265
+ case 3:
266
+ if (zz[z]) {
267
+ zz[z] += (readBit() << successive) * direction;
268
+ } else {
269
+ zz[z] = successiveACNextValue << successive;
270
+ successiveACState = 0;
271
+ }
272
+ break;
273
+ case 4:
274
+ if (zz[z]) {
275
+ zz[z] += (readBit() << successive) * direction;
276
+ }
277
+ break;
278
+ }
279
+ k2++;
280
+ }
281
+ if (successiveACState === 4) {
282
+ eobrun--;
283
+ if (eobrun === 0) {
284
+ successiveACState = 0;
285
+ }
286
+ }
287
+ }
288
+ function decodeMcu(component2, decodeFunction, mcu2, row, col) {
289
+ const mcuRow = mcu2 / mcusPerLine | 0;
290
+ const mcuCol = mcu2 % mcusPerLine;
291
+ const blockRow = mcuRow * component2.v + row;
292
+ const blockCol = mcuCol * component2.h + col;
293
+ decodeFunction(component2, component2.blocks[blockRow][blockCol]);
294
+ }
295
+ function decodeBlock(component2, decodeFunction, mcu2) {
296
+ const blockRow = mcu2 / component2.blocksPerLine | 0;
297
+ const blockCol = mcu2 % component2.blocksPerLine;
298
+ decodeFunction(component2, component2.blocks[blockRow][blockCol]);
299
+ }
300
+ const componentsLength = components.length;
301
+ let component;
302
+ let i;
303
+ let j;
304
+ let k;
305
+ let n;
306
+ let decodeFn;
307
+ if (progressive) {
308
+ if (spectralStart === 0) {
309
+ decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;
310
+ } else {
311
+ decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;
312
+ }
313
+ } else {
314
+ decodeFn = decodeBaseline;
315
+ }
316
+ let mcu = 0;
317
+ let marker;
318
+ let mcuExpected;
319
+ if (componentsLength === 1) {
320
+ mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn;
321
+ } else {
322
+ mcuExpected = mcusPerLine * frame.mcusPerColumn;
323
+ }
324
+ const usedResetInterval = resetInterval || mcuExpected;
325
+ while (mcu < mcuExpected) {
326
+ for (i = 0; i < componentsLength; i++) {
327
+ components[i].pred = 0;
328
+ }
329
+ eobrun = 0;
330
+ if (componentsLength === 1) {
331
+ component = components[0];
332
+ for (n = 0; n < usedResetInterval; n++) {
333
+ decodeBlock(component, decodeFn, mcu);
334
+ mcu++;
335
+ }
336
+ } else {
337
+ for (n = 0; n < usedResetInterval; n++) {
338
+ for (i = 0; i < componentsLength; i++) {
339
+ component = components[i];
340
+ const { h, v } = component;
341
+ for (j = 0; j < v; j++) {
342
+ for (k = 0; k < h; k++) {
343
+ decodeMcu(component, decodeFn, mcu, j, k);
344
+ }
345
+ }
346
+ }
347
+ mcu++;
348
+ if (mcu === mcuExpected) {
349
+ break;
350
+ }
351
+ }
352
+ }
353
+ bitsCount = 0;
354
+ marker = data[offset] << 8 | data[offset + 1];
355
+ if (marker < 65280) {
356
+ throw new Error("marker was not found");
357
+ }
358
+ if (marker >= 65488 && marker <= 65495) {
359
+ offset += 2;
360
+ } else {
361
+ break;
362
+ }
363
+ }
364
+ return offset - startOffset;
365
+ }
366
+ function buildComponentData(frame, component) {
367
+ const lines = [];
368
+ const { blocksPerLine, blocksPerColumn } = component;
369
+ const samplesPerLine = blocksPerLine << 3;
370
+ const R = new Int32Array(64);
371
+ const r = new Uint8Array(64);
372
+ function quantizeAndInverse(zz, dataOut, dataIn) {
373
+ const qt = component.quantizationTable;
374
+ let v0;
375
+ let v1;
376
+ let v2;
377
+ let v3;
378
+ let v4;
379
+ let v5;
380
+ let v6;
381
+ let v7;
382
+ let t;
383
+ const p = dataIn;
384
+ let i;
385
+ for (i = 0; i < 64; i++) {
386
+ p[i] = zz[i] * qt[i];
387
+ }
388
+ for (i = 0; i < 8; ++i) {
389
+ const row = 8 * i;
390
+ if (p[1 + row] === 0 && p[2 + row] === 0 && p[3 + row] === 0 && p[4 + row] === 0 && p[5 + row] === 0 && p[6 + row] === 0 && p[7 + row] === 0) {
391
+ t = dctSqrt2 * p[0 + row] + 512 >> 10;
392
+ p[0 + row] = t;
393
+ p[1 + row] = t;
394
+ p[2 + row] = t;
395
+ p[3 + row] = t;
396
+ p[4 + row] = t;
397
+ p[5 + row] = t;
398
+ p[6 + row] = t;
399
+ p[7 + row] = t;
400
+ continue;
401
+ }
402
+ v0 = dctSqrt2 * p[0 + row] + 128 >> 8;
403
+ v1 = dctSqrt2 * p[4 + row] + 128 >> 8;
404
+ v2 = p[2 + row];
405
+ v3 = p[6 + row];
406
+ v4 = dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128 >> 8;
407
+ v7 = dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128 >> 8;
408
+ v5 = p[3 + row] << 4;
409
+ v6 = p[5 + row] << 4;
410
+ t = v0 - v1 + 1 >> 1;
411
+ v0 = v0 + v1 + 1 >> 1;
412
+ v1 = t;
413
+ t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8;
414
+ v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8;
415
+ v3 = t;
416
+ t = v4 - v6 + 1 >> 1;
417
+ v4 = v4 + v6 + 1 >> 1;
418
+ v6 = t;
419
+ t = v7 + v5 + 1 >> 1;
420
+ v5 = v7 - v5 + 1 >> 1;
421
+ v7 = t;
422
+ t = v0 - v3 + 1 >> 1;
423
+ v0 = v0 + v3 + 1 >> 1;
424
+ v3 = t;
425
+ t = v1 - v2 + 1 >> 1;
426
+ v1 = v1 + v2 + 1 >> 1;
427
+ v2 = t;
428
+ t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
429
+ v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
430
+ v7 = t;
431
+ t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
432
+ v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
433
+ v6 = t;
434
+ p[0 + row] = v0 + v7;
435
+ p[7 + row] = v0 - v7;
436
+ p[1 + row] = v1 + v6;
437
+ p[6 + row] = v1 - v6;
438
+ p[2 + row] = v2 + v5;
439
+ p[5 + row] = v2 - v5;
440
+ p[3 + row] = v3 + v4;
441
+ p[4 + row] = v3 - v4;
442
+ }
443
+ for (i = 0; i < 8; ++i) {
444
+ const col = i;
445
+ if (p[1 * 8 + col] === 0 && p[2 * 8 + col] === 0 && p[3 * 8 + col] === 0 && p[4 * 8 + col] === 0 && p[5 * 8 + col] === 0 && p[6 * 8 + col] === 0 && p[7 * 8 + col] === 0) {
446
+ t = dctSqrt2 * dataIn[i + 0] + 8192 >> 14;
447
+ p[0 * 8 + col] = t;
448
+ p[1 * 8 + col] = t;
449
+ p[2 * 8 + col] = t;
450
+ p[3 * 8 + col] = t;
451
+ p[4 * 8 + col] = t;
452
+ p[5 * 8 + col] = t;
453
+ p[6 * 8 + col] = t;
454
+ p[7 * 8 + col] = t;
455
+ continue;
456
+ }
457
+ v0 = dctSqrt2 * p[0 * 8 + col] + 2048 >> 12;
458
+ v1 = dctSqrt2 * p[4 * 8 + col] + 2048 >> 12;
459
+ v2 = p[2 * 8 + col];
460
+ v3 = p[6 * 8 + col];
461
+ v4 = dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048 >> 12;
462
+ v7 = dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048 >> 12;
463
+ v5 = p[3 * 8 + col];
464
+ v6 = p[5 * 8 + col];
465
+ t = v0 - v1 + 1 >> 1;
466
+ v0 = v0 + v1 + 1 >> 1;
467
+ v1 = t;
468
+ t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12;
469
+ v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12;
470
+ v3 = t;
471
+ t = v4 - v6 + 1 >> 1;
472
+ v4 = v4 + v6 + 1 >> 1;
473
+ v6 = t;
474
+ t = v7 + v5 + 1 >> 1;
475
+ v5 = v7 - v5 + 1 >> 1;
476
+ v7 = t;
477
+ t = v0 - v3 + 1 >> 1;
478
+ v0 = v0 + v3 + 1 >> 1;
479
+ v3 = t;
480
+ t = v1 - v2 + 1 >> 1;
481
+ v1 = v1 + v2 + 1 >> 1;
482
+ v2 = t;
483
+ t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
484
+ v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
485
+ v7 = t;
486
+ t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
487
+ v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
488
+ v6 = t;
489
+ p[0 * 8 + col] = v0 + v7;
490
+ p[7 * 8 + col] = v0 - v7;
491
+ p[1 * 8 + col] = v1 + v6;
492
+ p[6 * 8 + col] = v1 - v6;
493
+ p[2 * 8 + col] = v2 + v5;
494
+ p[5 * 8 + col] = v2 - v5;
495
+ p[3 * 8 + col] = v3 + v4;
496
+ p[4 * 8 + col] = v3 - v4;
497
+ }
498
+ for (i = 0; i < 64; ++i) {
499
+ const sample = 128 + (p[i] + 8 >> 4);
500
+ if (sample < 0) {
501
+ dataOut[i] = 0;
502
+ } else if (sample > 255) {
503
+ dataOut[i] = 255;
504
+ } else {
505
+ dataOut[i] = sample;
506
+ }
507
+ }
508
+ }
509
+ for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) {
510
+ const scanLine = blockRow << 3;
511
+ for (let i = 0; i < 8; i++) {
512
+ lines.push(new Uint8Array(samplesPerLine));
513
+ }
514
+ for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) {
515
+ quantizeAndInverse(component.blocks[blockRow][blockCol], r, R);
516
+ let offset = 0;
517
+ const sample = blockCol << 3;
518
+ for (let j = 0; j < 8; j++) {
519
+ const line = lines[scanLine + j];
520
+ for (let i = 0; i < 8; i++) {
521
+ line[sample + i] = r[offset++];
522
+ }
523
+ }
524
+ }
525
+ }
526
+ return lines;
527
+ }
528
+ class JpegStreamReader {
529
+ constructor() {
530
+ this.jfif = null;
531
+ this.adobe = null;
532
+ this.quantizationTables = [];
533
+ this.huffmanTablesAC = [];
534
+ this.huffmanTablesDC = [];
535
+ this.resetFrames();
536
+ }
537
+ resetFrames() {
538
+ this.frames = [];
539
+ }
540
+ parse(data) {
541
+ let offset = 0;
542
+ function readUint16() {
543
+ const value = data[offset] << 8 | data[offset + 1];
544
+ offset += 2;
545
+ return value;
546
+ }
547
+ function readDataBlock() {
548
+ const length = readUint16();
549
+ const array = data.subarray(offset, offset + length - 2);
550
+ offset += array.length;
551
+ return array;
552
+ }
553
+ function prepareComponents(frame) {
554
+ let maxH = 0;
555
+ let maxV = 0;
556
+ let component;
557
+ let componentId;
558
+ for (componentId in frame.components) {
559
+ if (frame.components.hasOwnProperty(componentId)) {
560
+ component = frame.components[componentId];
561
+ if (maxH < component.h) {
562
+ maxH = component.h;
563
+ }
564
+ if (maxV < component.v) {
565
+ maxV = component.v;
566
+ }
567
+ }
568
+ }
569
+ const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / maxH);
570
+ const mcusPerColumn = Math.ceil(frame.scanLines / 8 / maxV);
571
+ for (componentId in frame.components) {
572
+ if (frame.components.hasOwnProperty(componentId)) {
573
+ component = frame.components[componentId];
574
+ const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / maxH);
575
+ const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / maxV);
576
+ const blocksPerLineForMcu = mcusPerLine * component.h;
577
+ const blocksPerColumnForMcu = mcusPerColumn * component.v;
578
+ const blocks = [];
579
+ for (let i = 0; i < blocksPerColumnForMcu; i++) {
580
+ const row = [];
581
+ for (let j = 0; j < blocksPerLineForMcu; j++) {
582
+ row.push(new Int32Array(64));
583
+ }
584
+ blocks.push(row);
585
+ }
586
+ component.blocksPerLine = blocksPerLine;
587
+ component.blocksPerColumn = blocksPerColumn;
588
+ component.blocks = blocks;
589
+ }
590
+ }
591
+ frame.maxH = maxH;
592
+ frame.maxV = maxV;
593
+ frame.mcusPerLine = mcusPerLine;
594
+ frame.mcusPerColumn = mcusPerColumn;
595
+ }
596
+ let fileMarker = readUint16();
597
+ if (fileMarker !== 65496) {
598
+ throw new Error("SOI not found");
599
+ }
600
+ fileMarker = readUint16();
601
+ while (fileMarker !== 65497) {
602
+ switch (fileMarker) {
603
+ case 65280:
604
+ break;
605
+ case 65504:
606
+ case 65505:
607
+ case 65506:
608
+ case 65507:
609
+ case 65508:
610
+ case 65509:
611
+ case 65510:
612
+ case 65511:
613
+ case 65512:
614
+ case 65513:
615
+ case 65514:
616
+ case 65515:
617
+ case 65516:
618
+ case 65517:
619
+ case 65518:
620
+ case 65519:
621
+ case 65534: {
622
+ const appData = readDataBlock();
623
+ if (fileMarker === 65504) {
624
+ if (appData[0] === 74 && appData[1] === 70 && appData[2] === 73 && appData[3] === 70 && appData[4] === 0) {
625
+ this.jfif = {
626
+ version: { major: appData[5], minor: appData[6] },
627
+ densityUnits: appData[7],
628
+ xDensity: appData[8] << 8 | appData[9],
629
+ yDensity: appData[10] << 8 | appData[11],
630
+ thumbWidth: appData[12],
631
+ thumbHeight: appData[13],
632
+ thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13])
633
+ };
634
+ }
635
+ }
636
+ if (fileMarker === 65518) {
637
+ if (appData[0] === 65 && appData[1] === 100 && appData[2] === 111 && appData[3] === 98 && appData[4] === 101 && appData[5] === 0) {
638
+ this.adobe = {
639
+ version: appData[6],
640
+ flags0: appData[7] << 8 | appData[8],
641
+ flags1: appData[9] << 8 | appData[10],
642
+ transformCode: appData[11]
643
+ };
644
+ }
645
+ }
646
+ break;
647
+ }
648
+ case 65499: {
649
+ const quantizationTablesLength = readUint16();
650
+ const quantizationTablesEnd = quantizationTablesLength + offset - 2;
651
+ while (offset < quantizationTablesEnd) {
652
+ const quantizationTableSpec = data[offset++];
653
+ const tableData = new Int32Array(64);
654
+ if (quantizationTableSpec >> 4 === 0) {
655
+ for (let j = 0; j < 64; j++) {
656
+ const z = dctZigZag[j];
657
+ tableData[z] = data[offset++];
658
+ }
659
+ } else if (quantizationTableSpec >> 4 === 1) {
660
+ for (let j = 0; j < 64; j++) {
661
+ const z = dctZigZag[j];
662
+ tableData[z] = readUint16();
663
+ }
664
+ } else {
665
+ throw new Error("DQT: invalid table spec");
666
+ }
667
+ this.quantizationTables[quantizationTableSpec & 15] = tableData;
668
+ }
669
+ break;
670
+ }
671
+ case 65472:
672
+ case 65473:
673
+ case 65474: {
674
+ readUint16();
675
+ const frame = {
676
+ extended: fileMarker === 65473,
677
+ progressive: fileMarker === 65474,
678
+ precision: data[offset++],
679
+ scanLines: readUint16(),
680
+ samplesPerLine: readUint16(),
681
+ components: {},
682
+ componentsOrder: []
683
+ };
684
+ const componentsCount = data[offset++];
685
+ let componentId;
686
+ for (let i = 0; i < componentsCount; i++) {
687
+ componentId = data[offset];
688
+ const h = data[offset + 1] >> 4;
689
+ const v = data[offset + 1] & 15;
690
+ const qId = data[offset + 2];
691
+ frame.componentsOrder.push(componentId);
692
+ frame.components[componentId] = {
693
+ h,
694
+ v,
695
+ quantizationIdx: qId
696
+ };
697
+ offset += 3;
698
+ }
699
+ prepareComponents(frame);
700
+ this.frames.push(frame);
701
+ break;
702
+ }
703
+ case 65476: {
704
+ const huffmanLength = readUint16();
705
+ for (let i = 2; i < huffmanLength; ) {
706
+ const huffmanTableSpec = data[offset++];
707
+ const codeLengths = new Uint8Array(16);
708
+ let codeLengthSum = 0;
709
+ for (let j = 0; j < 16; j++, offset++) {
710
+ codeLengths[j] = data[offset];
711
+ codeLengthSum += codeLengths[j];
712
+ }
713
+ const huffmanValues = new Uint8Array(codeLengthSum);
714
+ for (let j = 0; j < codeLengthSum; j++, offset++) {
715
+ huffmanValues[j] = data[offset];
716
+ }
717
+ i += 17 + codeLengthSum;
718
+ if (huffmanTableSpec >> 4 === 0) {
719
+ this.huffmanTablesDC[huffmanTableSpec & 15] = buildHuffmanTable(
720
+ codeLengths,
721
+ huffmanValues
722
+ );
723
+ } else {
724
+ this.huffmanTablesAC[huffmanTableSpec & 15] = buildHuffmanTable(
725
+ codeLengths,
726
+ huffmanValues
727
+ );
728
+ }
729
+ }
730
+ break;
731
+ }
732
+ case 65501:
733
+ readUint16();
734
+ this.resetInterval = readUint16();
735
+ break;
736
+ case 65498: {
737
+ readUint16();
738
+ const selectorsCount = data[offset++];
739
+ const components = [];
740
+ const frame = this.frames[0];
741
+ for (let i = 0; i < selectorsCount; i++) {
742
+ const component = frame.components[data[offset++]];
743
+ const tableSpec = data[offset++];
744
+ component.huffmanTableDC = this.huffmanTablesDC[tableSpec >> 4];
745
+ component.huffmanTableAC = this.huffmanTablesAC[tableSpec & 15];
746
+ components.push(component);
747
+ }
748
+ const spectralStart = data[offset++];
749
+ const spectralEnd = data[offset++];
750
+ const successiveApproximation = data[offset++];
751
+ const processed = decodeScan(
752
+ data,
753
+ offset,
754
+ frame,
755
+ components,
756
+ this.resetInterval,
757
+ spectralStart,
758
+ spectralEnd,
759
+ successiveApproximation >> 4,
760
+ successiveApproximation & 15
761
+ );
762
+ offset += processed;
763
+ break;
764
+ }
765
+ case 65535:
766
+ if (data[offset] !== 255) {
767
+ offset--;
768
+ }
769
+ break;
770
+ default:
771
+ if (data[offset - 3] === 255 && data[offset - 2] >= 192 && data[offset - 2] <= 254) {
772
+ offset -= 3;
773
+ break;
774
+ }
775
+ throw new Error(`unknown JPEG marker ${fileMarker.toString(16)}`);
776
+ }
777
+ fileMarker = readUint16();
778
+ }
779
+ }
780
+ getResult() {
781
+ const { frames } = this;
782
+ if (this.frames.length === 0) {
783
+ throw new Error("no frames were decoded");
784
+ } else if (this.frames.length > 1) {
785
+ console.warn("more than one frame is not supported");
786
+ }
787
+ for (let i = 0; i < this.frames.length; i++) {
788
+ const cp = this.frames[i].components;
789
+ for (const j of Object.keys(cp)) {
790
+ cp[j].quantizationTable = this.quantizationTables[cp[j].quantizationIdx];
791
+ delete cp[j].quantizationIdx;
792
+ }
793
+ }
794
+ const frame = frames[0];
795
+ const { components, componentsOrder } = frame;
796
+ const outComponents = [];
797
+ const width = frame.samplesPerLine;
798
+ const height = frame.scanLines;
799
+ for (let i = 0; i < componentsOrder.length; i++) {
800
+ const component = components[componentsOrder[i]];
801
+ outComponents.push({
802
+ lines: buildComponentData(frame, component),
803
+ scaleX: component.h / frame.maxH,
804
+ scaleY: component.v / frame.maxV
805
+ });
806
+ }
807
+ const out = new Uint8Array(width * height * outComponents.length);
808
+ let oi = 0;
809
+ for (let y = 0; y < height; ++y) {
810
+ for (let x = 0; x < width; ++x) {
811
+ for (let i = 0; i < outComponents.length; ++i) {
812
+ const component = outComponents[i];
813
+ out[oi] = component.lines[0 | y * component.scaleY][0 | x * component.scaleX];
814
+ ++oi;
815
+ }
816
+ }
817
+ }
818
+ return out;
819
+ }
820
+ }
821
+ class JpegDecoder extends BaseDecoder {
822
+ constructor(fileDirectory) {
823
+ super();
824
+ this.reader = new JpegStreamReader();
825
+ if (fileDirectory.JPEGTables) {
826
+ this.reader.parse(fileDirectory.JPEGTables);
827
+ }
828
+ }
829
+ decodeBlock(buffer) {
830
+ this.reader.resetFrames();
831
+ this.reader.parse(new Uint8Array(buffer));
832
+ return this.reader.getResult().buffer;
833
+ }
834
+ }
835
+ export { JpegDecoder as default };