fl-web-component 2.0.19-beta.1 → 2.0.19

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.
@@ -946,6 +946,17 @@ module.exports = !__webpack_require__("4b8b")(function () {
946
946
  }).a != 7;
947
947
  });
948
948
 
949
+ /***/ }),
950
+
951
+ /***/ "0c36":
952
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
953
+
954
+ "use strict";
955
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_607a330c_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("12e8");
956
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_607a330c_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_607a330c_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
957
+ /* unused harmony reexport * */
958
+
959
+
949
960
  /***/ }),
950
961
 
951
962
  /***/ "0e15":
@@ -1471,6 +1482,13 @@ Factory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0.5, (0, Validators_
1471
1482
 
1472
1483
  /***/ }),
1473
1484
 
1485
+ /***/ "12e8":
1486
+ /***/ (function(module, exports, __webpack_require__) {
1487
+
1488
+ // extracted by mini-css-extract-plugin
1489
+
1490
+ /***/ }),
1491
+
1474
1492
  /***/ "12f2":
1475
1493
  /***/ (function(module, exports, __webpack_require__) {
1476
1494
 
@@ -1489,17 +1507,6 @@ exports.default = function (ref) {
1489
1507
  };
1490
1508
  ;
1491
1509
 
1492
- /***/ }),
1493
-
1494
- /***/ "12fb":
1495
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1496
-
1497
- "use strict";
1498
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_46d6866f_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("dd1a");
1499
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_46d6866f_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_46d6866f_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
1500
- /* unused harmony reexport * */
1501
-
1502
-
1503
1510
  /***/ }),
1504
1511
 
1505
1512
  /***/ "14e9":
@@ -56500,7 +56507,7 @@ module.exports = document && document.documentElement;
56500
56507
  /***/ "9224":
56501
56508
  /***/ (function(module) {
56502
56509
 
56503
- module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.0.19-beta.1\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56510
+ module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.0.19\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch\",\"watch\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56504
56511
 
56505
56512
  /***/ }),
56506
56513
 
@@ -59587,6 +59594,13 @@ Factory_1.Factory.addGetterSetter(Node_1.Node, 'noise', 0.2, (0, Validators_1.ge
59587
59594
 
59588
59595
  /***/ }),
59589
59596
 
59597
+ /***/ "bc46":
59598
+ /***/ (function(module, exports, __webpack_require__) {
59599
+
59600
+ // extracted by mini-css-extract-plugin
59601
+
59602
+ /***/ }),
59603
+
59590
59604
  /***/ "bcb1":
59591
59605
  /***/ (function(module, exports, __webpack_require__) {
59592
59606
 
@@ -69128,14 +69142,10 @@ module.exports = function (it) {
69128
69142
 
69129
69143
  /***/ }),
69130
69144
 
69131
- /***/ "cbdd":
69132
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
69133
-
69134
- "use strict";
69135
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_46d6866f_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d5c3");
69136
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_46d6866f_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_46d6866f_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
69137
- /* unused harmony reexport * */
69145
+ /***/ "cbf5":
69146
+ /***/ (function(module) {
69138
69147
 
69148
+ module.exports = JSON.parse("{}");
69139
69149
 
69140
69150
  /***/ }),
69141
69151
 
@@ -69246,6 +69256,17 @@ module.exports = function (it) {
69246
69256
  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
69247
69257
  };
69248
69258
 
69259
+ /***/ }),
69260
+
69261
+ /***/ "d181":
69262
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
69263
+
69264
+ "use strict";
69265
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_607a330c_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bc46");
69266
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_607a330c_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_607a330c_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
69267
+ /* unused harmony reexport * */
69268
+
69269
+
69249
69270
  /***/ }),
69250
69271
 
69251
69272
  /***/ "d397":
@@ -70528,13 +70549,6 @@ module.exports = normalizeWheel;
70528
70549
 
70529
70550
  /***/ }),
70530
70551
 
70531
- /***/ "d5c3":
70532
- /***/ (function(module, exports, __webpack_require__) {
70533
-
70534
- // extracted by mini-css-extract-plugin
70535
-
70536
- /***/ }),
70537
-
70538
70552
  /***/ "d777":
70539
70553
  /***/ (function(module, exports, __webpack_require__) {
70540
70554
 
@@ -72071,13 +72085,6 @@ module.exports = /******/function (modules) {
72071
72085
 
72072
72086
  /***/ }),
72073
72087
 
72074
- /***/ "dd1a":
72075
- /***/ (function(module, exports, __webpack_require__) {
72076
-
72077
- // extracted by mini-css-extract-plugin
72078
-
72079
- /***/ }),
72080
-
72081
72088
  /***/ "df93":
72082
72089
  /***/ (function(module, exports, __webpack_require__) {
72083
72090
 
@@ -78634,8 +78641,8 @@ if (typeof window !== 'undefined') {
78634
78641
  // Indicate to webpack that this file can be concatenated
78635
78642
  /* harmony default export */ var setPublicPath = (null);
78636
78643
 
78637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44f05828-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=46d6866f&scoped=true
78638
- var com_graphicsvue_type_template_id_46d6866f_scoped_true_render = function render() {
78644
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"13819966-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=607a330c&scoped=true
78645
+ var com_graphicsvue_type_template_id_607a330c_scoped_true_render = function render() {
78639
78646
  var _vm = this,
78640
78647
  _c = _vm._self._c;
78641
78648
  return _c('div', {
@@ -78647,7 +78654,7 @@ var com_graphicsvue_type_template_id_46d6866f_scoped_true_render = function rend
78647
78654
  };
78648
78655
  var staticRenderFns = [];
78649
78656
 
78650
- // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=46d6866f&scoped=true
78657
+ // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=607a330c&scoped=true
78651
78658
 
78652
78659
  // CONCATENATED MODULE: ./node_modules/camera-controls/dist/camera-controls.module.js
78653
78660
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -109010,12 +109017,8 @@ function processMeshData(input, options) {
109010
109017
  mergeMaterialByMeshId.set(String(it.id), it);
109011
109018
  }
109012
109019
  }
109013
- var identity = new Matrix4().identity();
109014
- var identityElements = identity.elements;
109015
109020
  input.mesh.forEach(function (meshItem) {
109016
- var _meshItem$matrix;
109017
109021
  var geomList = [];
109018
- var meshMatrix = (_meshItem$matrix = meshItem.matrix) !== null && _meshItem$matrix !== void 0 && _meshItem$matrix.length ? meshItem.matrix : identityElements;
109019
109022
  meshItem.primitives.forEach(function (primitive) {
109020
109023
  var primitiveData = input.primitive.find(function (g) {
109021
109024
  return g.id === primitive.prmid;
@@ -109028,24 +109031,26 @@ function processMeshData(input, options) {
109028
109031
  var mergedMaterial = mergeMaterialByMeshId.get(String(meshItem.id));
109029
109032
  var material = mergedMaterial || baseMaterial;
109030
109033
  var sourceVisible = (mergedMaterial === null || mergedMaterial === void 0 ? void 0 : mergedMaterial.visible) === false || (baseMaterial === null || baseMaterial === void 0 ? void 0 : baseMaterial.visible) === false ? false : true;
109031
- var baseColor = [255, 255, 255, 1];
109032
109034
  var prop = {
109033
- color: material !== null && material !== void 0 && material.color ? material !== null && material !== void 0 && material.color.length ? material.color : baseColor : baseColor,
109035
+ color: (material === null || material === void 0 ? void 0 : material.color) || [255, 255, 255, 1],
109034
109036
  fontsize: (material === null || material === void 0 ? void 0 : material.fontsize) !== undefined ? material === null || material === void 0 ? void 0 : material.fontsize : 20,
109035
109037
  frontname: (material === null || material === void 0 ? void 0 : material.frontname) !== undefined ? material === null || material === void 0 ? void 0 : material.frontname : '',
109036
109038
  italic: material === null || material === void 0 ? void 0 : material.italic,
109037
109039
  linepacing: 1,
109038
109040
  // 默认值
109039
- linewidth: (material === null || material === void 0 ? void 0 : material.linewidth) !== undefined ? material === null || material === void 0 ? void 0 : material.linewidth : 10,
109041
+ linewidth: (material === null || material === void 0 ? void 0 : material.linewidth) !== undefined ? material === null || material === void 0 ? void 0 : material.linewidth : 1,
109040
109042
  // 默认值
109041
109043
  visible: sourceVisible,
109042
109044
  sourceVisible: sourceVisible,
109043
109045
  transparent: (material === null || material === void 0 ? void 0 : material.transp) !== undefined ? material === null || material === void 0 ? void 0 : material.transp : 0
109044
109046
  };
109047
+ var identity = new Matrix4().identity();
109045
109048
  geomList.push({
109046
109049
  matrix: {
109047
- val: (_primitive$matrix = primitive.matrix) !== null && _primitive$matrix !== void 0 && _primitive$matrix.length ? primitive.matrix : identityElements
109050
+ val: (_primitive$matrix = primitive.matrix) !== null && _primitive$matrix !== void 0 && _primitive$matrix.length ? primitive.matrix : identity.elements
109051
+ // val: identity.elements,
109048
109052
  },
109053
+ // originMatrix: meshItem.id == primitive.prmid ? [] : identity.elements,
109049
109054
  prmid: primitive.prmid,
109050
109055
  geomId: primitiveData.id,
109051
109056
  type: primitiveData.geomType,
@@ -109062,9 +109067,6 @@ function processMeshData(input, options) {
109062
109067
  });
109063
109068
  drawObjMap.set(meshItem.id, {
109064
109069
  drawObjId: meshItem.id,
109065
- matrix: {
109066
- val: meshMatrix
109067
- },
109068
109070
  geoms: geomList
109069
109071
  // lodLevel: meshItem.type || 2,
109070
109072
  });
@@ -109144,12 +109146,12 @@ function processNodeData(input, options) {
109144
109146
 
109145
109147
  // 处理一个primitive,生成多个drawObj
109146
109148
  function processOnePrimtiveToMultiMesh(primitive) {
109147
- var _primitive$geoms$;
109149
+ var _primitive$geoms$, _primitive$geoms$2;
109148
109150
  return {
109149
109151
  instanceId: primitive.drawObjId,
109150
109152
  // 实例与drawObj一对多关系
109151
109153
  drawObject: ((_primitive$geoms$ = primitive.geoms[0]) === null || _primitive$geoms$ === void 0 ? void 0 : _primitive$geoms$.prmid) || '',
109152
- matrix: primitive.matrix || {}
109154
+ matrix: ((_primitive$geoms$2 = primitive.geoms[0]) === null || _primitive$geoms$2 === void 0 ? void 0 : _primitive$geoms$2.matrix) || []
109153
109155
  };
109154
109156
  }
109155
109157
 
@@ -109235,19 +109237,14 @@ function parseNode(node, isFlatNode) {
109235
109237
  // 生成默认node节点
109236
109238
  function generateNode(mesh) {
109237
109239
  var nodes = [];
109238
- var identity = new Matrix4().identity();
109239
- var identityElements = identity.elements;
109240
109240
  mesh.forEach(function (item) {
109241
109241
  if (item.primitives.length) {
109242
- var _item$matrix;
109243
109242
  var tempNode = {
109244
109243
  id: item.id,
109245
109244
  _batchId: item.id,
109246
109245
  name: item.id,
109247
109246
  mesh: item.id,
109248
- matrix: {
109249
- val: (_item$matrix = item.matrix) !== null && _item$matrix !== void 0 && _item$matrix.length ? item.matrix : identityElements
109250
- },
109247
+ matrix: {},
109251
109248
  nodeType: 3
109252
109249
  };
109253
109250
  nodes.push(tempNode);
@@ -111431,7 +111428,7 @@ var inline_default = /*#__PURE__*/__webpack_require__.n(inline);
111431
111428
 
111432
111429
 
111433
111430
  function Worker_fn() {
111434
- return inline_default()("/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"f538\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"f538\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./node_modules/fflate/esm/browser.js\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = function wk(c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'], {\n type: 'text/javascript'\n }))));\n w.onmessage = function (e) {\n var d = e.data,\n ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n } else cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array,\n u16 = Uint16Array,\n i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */0, 0, /* impossible */0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function freb(eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = j - b[i] << 5 | i;\n }\n }\n return {\n b: b,\n r: r\n };\n};\nvar _a = freb(fleb, 2),\n fl = _a.b,\n revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0),\n fd = _b.b,\n revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var browser_i = 0; browser_i < 32768; ++browser_i) {\n // reverse table algorithm from SO\n var x = (browser_i & 0xAAAA) >> 1 | (browser_i & 0x5555) << 1;\n x = (x & 0xCCCC) >> 2 | (x & 0x3333) << 2;\n x = (x & 0xF0F0) >> 4 | (x & 0x0F0F) << 4;\n rev[browser_i] = ((x & 0xFF00) >> 8 | (x & 0x00FF) << 8) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = function hMap(cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i]) ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = le[i - 1] + l[i - 1] << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = i << 4 | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | (1 << r_1) - 1; v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n } else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> 15 - cd[i];\n }\n }\n }\n return co;\n};\n// fixed length tree\nvar flt = new u8(288);\nfor (var browser_i = 0; browser_i < 144; ++browser_i) flt[browser_i] = 8;\nfor (var browser_i = 144; browser_i < 256; ++browser_i) flt[browser_i] = 9;\nfor (var browser_i = 256; browser_i < 280; ++browser_i) flt[browser_i] = 7;\nfor (var browser_i = 280; browser_i < 288; ++browser_i) flt[browser_i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var browser_i = 0; browser_i < 32; ++browser_i) fdt[browser_i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/hMap(flt, 9, 0),\n flrm = /*#__PURE__*/hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/hMap(fdt, 5, 0),\n fdrm = /*#__PURE__*/hMap(fdt, 5, 1);\n// find max of array\nvar max = function max(a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m) m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function bits(d, p, m) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8) >> (p & 7) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function bits16(d, p) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);\n};\n// get end of byte\nvar shft = function shft(p) {\n return (p + 7) / 8 | 0;\n};\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function slc(v, s, e) {\n if (s == null || s < 0) s = 0;\n if (e == null || e > v.length) e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nvar FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = ['unexpected EOF', 'invalid block type', 'invalid length/literal', 'invalid distance', 'stream finished', 'no stream handler',, 'no callback', 'invalid UTF-8 data', 'extra field too long', 'date not in range 1980-2099', 'filename too long', 'stream finishing', 'invalid zip data'\n// determined by unknown compression method\n];\n;\nvar _err = function err(ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace) Error.captureStackTrace(e, _err);\n if (!nt) throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function inflt(dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length,\n dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l) return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf) buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function cbuf(l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0,\n pos = st.p || 0,\n bt = st.b || 0,\n lm = st.l,\n dm = st.d,\n lbt = st.m,\n dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4,\n l = dat[s - 4] | dat[s - 3] << 8,\n t = s + l;\n if (t > sl) {\n if (noSt) _err(0);\n break;\n }\n // ensure size\n if (resize) cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n } else if (type == 1) lm = flrm, dm = fdrm, lbt = 9, dbt = 5;else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257,\n hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt),\n clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n } else {\n // copy count\n var c = 0,\n n = 0;\n if (s == 16) n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];else if (s == 17) n = 3 + bits(dat, pos, 7), pos += 3;else if (s == 18) n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--) ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit),\n dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n } else _err(1);\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize) cbuf(bt + 131072);\n var lms = (1 << lbt) - 1,\n dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms],\n sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n if (!c) _err(2);\n if (sym < 256) buf[bt++] = sym;else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n } else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257,\n b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms],\n dsym = d >> 4;\n if (!d) _err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n if (resize) cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt,\n dend = Math.min(dt, end);\n if (shift + bt < 0) _err(3);\n for (; bt < dend; ++bt) buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt) buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm) final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function wbits(d, p, v) {\n v <<= p & 7;\n var o = p / 8 | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function wbits16(d, p, v) {\n v <<= p & 7;\n var o = p / 8 | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function hTree(d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i]) t.push({\n s: i,\n f: d[i]\n });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s) return {\n t: et,\n l: 0\n };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return {\n t: v,\n l: 1\n };\n }\n t.sort(function (a, b) {\n return a.f - b.f;\n });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({\n s: -1,\n f: 25001\n });\n var l = t[0],\n r = t[1],\n i0 = 0,\n i1 = 1,\n i2 = 2;\n t[0] = {\n s: -1,\n f: l.f + r.f,\n l: l,\n r: r\n };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = {\n s: -1,\n f: l.f + r.f,\n l: l,\n r: r\n };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym) maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = _ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0,\n dt = 0;\n // left cost\n var lft = mbt - mb,\n cst = 1 << lft;\n t2.sort(function (a, b) {\n return tr[b.s] - tr[a.s] || a.f - b.f;\n });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << mbt - tr[i2_1]);\n tr[i2_1] = mb;\n } else break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb) dt -= 1 << mb - tr[i2_2]++ - 1;else ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return {\n t: new u8(tr),\n l: mbt\n };\n};\n// get the max length and assign length codes\nvar _ln = function ln(n, l, d) {\n return n.s == -1 ? Math.max(_ln(n.l, l, d + 1), _ln(n.r, l, d + 1)) : l[n.s] = d;\n};\n// length codes generation\nvar lc = function lc(c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s]);\n var cl = new u16(++s);\n // ind num streak\n var cli = 0,\n cln = c[0],\n cls = 1;\n var w = function w(v) {\n cl[cli++] = v;\n };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s) ++cls;else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138) w(32754);\n if (cls > 2) {\n w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);\n cls = 0;\n }\n } else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6) w(8304);\n if (cls > 2) w(cls - 3 << 5 | 8208), cls = 0;\n }\n while (cls--) w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return {\n c: cl.subarray(0, cli),\n n: s\n };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function clen(cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i) l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function wfblk(out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i) out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function wblk(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15),\n dlt = _a.t,\n mlb = _a.l;\n var _b = hTree(df, 15),\n ddt = _b.t,\n mdb = _b.l;\n var _c = lc(dlt),\n lclt = _c.c,\n nlc = _c.n;\n var _d = lc(ddt),\n lcdt = _d.c,\n ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i) ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i) ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7),\n lct = _e.t,\n mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc);\n var flen = bl + 5 << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen) return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i) wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15) wbits(out, p, clct[i] >> 5 & 127), p += clct[i] >> 12;\n }\n }\n } else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = sym >> 18 & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7) wbits(out, p, sym >> 23 & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3) wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];\n } else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function dflt(dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos) w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13,\n c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768),\n head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3),\n bs2_1 = 2 * bs1_1;\n var hsh = function hsh(i) {\n return (dat[i] ^ dat[i + 1] << bs1_1 ^ dat[i + 2] << bs2_1) & msk_1;\n };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288),\n df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0,\n eb = 0,\n i = st.i || 0,\n li = 0,\n wi = st.w || 0,\n bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767,\n pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j) lf[j] = 0;\n for (var j = 0; j < 30; ++j) df[j] = 0;\n }\n // len dist chain\n var l = 2,\n d = 0,\n ch_1 = c,\n dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl);\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn) break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md) md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];\n var lin = revfl[l] & 31,\n din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n } else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = pos & 7 | w[pos / 8 | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n } else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos / 8 | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i,\n k = 9;\n while (--k) c = (c & 1 && -306674912) ^ c >>> 1;\n t[i] = c;\n }\n return t;\n}();\n// CRC32\nvar crc = function crc() {\n var c = -1;\n return {\n p: function p(d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i) cr = crct[cr & 255 ^ d[i]] ^ cr >>> 8;\n c = cr;\n },\n d: function d() {\n return ~c;\n }\n };\n};\n// Adler32\nvar adler = function adler() {\n var a = 1,\n b = 0;\n return {\n p: function p(d) {\n // closures have awful performance\n var n = a,\n m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i) m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function d() {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | b >> 8;\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function dopt(dat, opt, pre, post, st) {\n if (!st) {\n st = {\n l: 1\n };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);\n};\n// Walmart object spread\nvar mrg = function mrg(a, b) {\n var o = {};\n for (var k in a) o[k] = a[k];\n for (var k in b) o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function wcln(fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i],\n k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n } else {\n fnStr += st_1;\n for (var t in v.prototype) fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n } else fnStr += st_1;\n } else td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function cbfs(v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function wrkr(fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '',\n td_1 = {},\n m = fns.length - 1;\n for (var i = 0; i < m; ++i) fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = {\n c: wcln(fns[m], fnStr, td_1),\n e: td_1\n };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function bInflt() {\n return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, _err, inflt, inflateSync, pbf, gopt];\n};\nvar bDflt = function bDflt() {\n return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, _ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf];\n};\n// gzip extra\nvar gze = function gze() {\n return [gzh, gzhl, wbytes, crc, crct];\n};\n// gunzip extra\nvar guze = function guze() {\n return [gzs, gzl];\n};\n// zlib extra\nvar zle = function zle() {\n return [zlh, wbytes, adler];\n};\n// unzlib extra\nvar zule = function zule() {\n return [zls];\n};\n// post buf\nvar pbf = function pbf(msg) {\n return postMessage(msg, [msg.buffer]);\n};\n// get opts\nvar gopt = function gopt(o) {\n return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n };\n};\n// async helper\nvar cbify = function cbify(dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () {\n w.terminate();\n };\n};\n// auto stream\nvar astrm = function astrm(strm) {\n strm.ondata = function (dat, final) {\n return postMessage([dat, final], [dat.buffer]);\n };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n } else strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function astrmify(fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err) w.terminate(), strm.ondata.call(strm, err);else if (!Array.isArray(dat)) ext(dat);else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain) strm.ondrain(dat[0]);\n } else {\n if (dat[1]) w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata) _err(5);\n if (t) strm.ondata(_err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () {\n w.terminate();\n };\n if (flush) {\n strm.flush = function () {\n w.postMessage([]);\n };\n }\n};\n// read 2 bytes\nvar b2 = function b2(d, b) {\n return d[b] | d[b + 1] << 8;\n};\n// read 4 bytes\nvar b4 = function b4(d, b) {\n return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;\n};\nvar b8 = function b8(d, b) {\n return b4(d, b) + b4(d, b + 4) * 4294967296;\n};\n// write bytes\nvar wbytes = function wbytes(d, b, v) {\n for (; v; ++b) d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function gzh(c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0) wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i) c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function gzs(d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8) _err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4) st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]);\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function gzl(d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function gzhl(o) {\n return 10 + (o.filename ? o.filename.length + 1 : 0);\n};\n// zlib header\nvar zlh = function zlh(c, o) {\n var lv = o.level,\n fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = fl << 6 | (o.dictionary && 32);\n c[1] |= 31 - (c[0] << 8 | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function zls(d, dict) {\n if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31) _err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict) _err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = {\n l: 0,\n i: 32768,\n w: 32768,\n z: 32768\n };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (this.s.l) _err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n } else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata) _err(5);\n if (this.s.l) _err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/function () {\n function AsyncDeflate(opts, cb) {\n astrmify([bDflt, function () {\n return [astrm, Deflate];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}();\n\nfunction deflate(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt], function (ev) {\n return pbf(deflateSync(ev.data[0], ev.data[1]));\n }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nfunction deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = {\n i: 0,\n b: dict ? dict.length : 0\n };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict) this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata) _err(5);\n if (this.d) _err(4);\n if (!this.p.length) this.p = c;else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/function () {\n function AsyncInflate(opts, cb) {\n astrmify([bInflt, function () {\n return [astrm, Inflate];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}();\n\nfunction inflate(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt], function (ev) {\n return pbf(inflateSync(ev.data[0], gopt(ev.data[1])));\n }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction inflateSync(data, opts) {\n return inflt(data, {\n i: 2\n }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v) gzh(raw, this.o), this.v = 0;\n if (f) wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}();\n\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/function () {\n function AsyncGzip(opts, cb) {\n astrmify([bDflt, gze, function () {\n return [astrm, Deflate, Gzip];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}();\n\nfunction gzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt, gze, function () {\n return [gzipSync];\n }], function (ev) {\n return pbf(gzipSync(ev.data[0], ev.data[1]));\n }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nfunction gzipSync(data, opts) {\n if (!opts) opts = {};\n var c = crc(),\n l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8),\n s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final) return;\n } else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = {\n i: 0\n };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}();\n\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([bInflt, guze, function () {\n return [astrm, Inflate, Gunzip];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) {\n return postMessage(offset);\n };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) {\n return _this.onmember && _this.onmember(offset);\n });\n }\n return AsyncGunzip;\n}();\n\nfunction gunzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt, guze, function () {\n return [gunzipSync];\n }], function (ev) {\n return pbf(gunzipSync(ev.data[0], ev.data[1]));\n }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length) _err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), {\n i: 2\n }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v) zlh(raw, this.o), this.v = 0;\n if (f) wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}();\n\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/function () {\n function AsyncZlib(opts, cb) {\n astrmify([bDflt, zle, function () {\n return [astrm, Deflate, Zlib];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}();\n\nfunction zlib(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt, zle, function () {\n return [zlibSync];\n }], function (ev) {\n return pbf(zlibSync(ev.data[0], ev.data[1]));\n }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nfunction zlibSync(data, opts) {\n if (!opts) opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final) return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4) _err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}();\n\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([bInflt, zule, function () {\n return [astrm, Inflate, Unzlib];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}();\n\nfunction unzlib(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt, zule, function () {\n return [unzlibSync];\n }], function (ev) {\n return pbf(unzlibSync(ev.data[0], gopt(ev.data[1])));\n }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), {\n i: 2\n }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\n\n\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n } else this.p = chunk;\n if (this.p.length > 2) {\n this.s = this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8 ? new this.G(this.o) : (this.p[0] & 15) != 8 || this.p[0] >> 4 > 7 || (this.p[0] << 8 | this.p[1]) % 31 ? new this.I(this.o) : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n } else this.s.push(chunk, final);\n };\n return Decompress;\n}();\n\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain) _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}();\n\nfunction decompress(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction decompressSync(data, opts) {\n return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar _fltn = function fltn(d, p, t, o) {\n for (var k in d) {\n var val = d[k],\n n = p + k,\n op = o;\n if (Array.isArray(val)) op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8) t[n] = [val, op];else {\n t[n += '/'] = [new u8(0), op];\n _fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, {\n stream: true\n });\n tds = 1;\n} catch (e) {}\n// decode UTF8\nvar dutf8 = function dutf8(d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length) return {\n s: r,\n r: slc(d, i - 1)\n };\n if (!eb) r += String.fromCharCode(c);else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | d[i++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);\n } else if (eb & 1) r += String.fromCharCode((c & 31) << 6 | d[i++] & 63);else r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | d[i++] & 63);\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds) this.t = new TextDecoder();else this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, {\n stream: true\n }), final);\n if (final) {\n if (this.t.decode().length) _err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p) _err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat),\n s = _a.s,\n r = _a.r;\n if (final) {\n if (r.length) _err(8);\n this.p = null;\n } else this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}();\n\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (this.d) _err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}();\n\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nfunction strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i) ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te) return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function w(v) {\n ar[ai++] = v;\n };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + (l - i << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1) w(c);else if (c < 2048) w(192 | c >> 6), w(128 | c & 63);else if (c > 55295 && c < 57344) c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);else w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nfunction strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384) r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n } else if (td) {\n return td.decode(dat);\n } else {\n var _a = dutf8(dat),\n s = _a.s,\n r = _a.r;\n if (r.length) _err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function dbf(l) {\n return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0;\n};\n// skip local zip header\nvar slzh = function slzh(d, b) {\n return b + 30 + b2(d, b + 26) + b2(d, b + 28);\n};\n// read zip header\nvar zh = function zh(d, b, z) {\n var fnl = b2(d, b + 28),\n fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)),\n es = b + 46 + fnl,\n bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)],\n sc = _a[0],\n su = _a[1],\n off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function z64e(d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2));\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function exfl(ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535) _err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function wzh(d, b, f, fn, u, c, ce, co) {\n var fl = fn.length,\n ex = f.extra,\n col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null) d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime),\n y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119) _err(10);\n wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k],\n l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col) d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function wzf(o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final) this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}();\n\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts) opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n } catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts) opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}();\n\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata) _err(5);\n // finishing or finished\n if (this.d & 2) this.ondata(_err(4 + (this.d & 1) * 8, 0, 1), null, false);else {\n var f = strToU8(file.filename),\n fl_1 = f.length;\n var com = file.comment,\n o = com && strToU8(com);\n var u = fl_1 != file.filename.length || o && com.length != o.length;\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535) this.ondata(_err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function pAll_1() {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function t() {\n if (file.terminate) file.terminate();\n },\n r: function r() {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt) nxt.r();else _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n } else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1) uf_1.r();\n tr_1 = 1;\n } else if (tr_1) pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(_err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d) this.e();else this.u.push({\n r: function r() {\n if (!(_this.d & 1)) return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function t() {}\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0,\n l = 0,\n tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}();\n\nfunction zip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n var r = {};\n _fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length,\n o = 0,\n tot = 0;\n var slft = lft,\n files = new Array(lft);\n var term = [];\n var tAll = function tAll() {\n for (var i = 0; i < term.length; ++i) term[i]();\n };\n var cbd = function cbd(a, b) {\n mt(function () {\n cb(a, b);\n });\n };\n mt(function () {\n cbd = cb;\n });\n var cbf = function cbf() {\n var out = new u8(tot + 22),\n oe = o,\n cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n } catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft) cbf();\n var _loop_1 = function _loop_1(i) {\n var fn = k[i];\n var _a = r[fn],\n file = _a[0],\n p = _a[1];\n var c = crc(),\n size = file.length;\n c.p(file);\n var f = strToU8(fn),\n s = f.length;\n var com = p.comment,\n m = com && strToU8(com),\n ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function cbl(e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n } else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || m && com.length != ms,\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (! --lft) cbf();\n }\n };\n if (s > 65535) cbl(_err(11, 0, 1), null);\n if (!compression) cbl(null, file);else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n } catch (e) {\n cbl(e, null);\n }\n } else term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nfunction zipSync(data, opts) {\n if (!opts) opts = {};\n var r = {};\n var files = [];\n _fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn],\n file = _a[0],\n p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn),\n s = f.length;\n var com = p.comment,\n m = com && strToU8(com),\n ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535) _err(11);\n var d = compression ? deflateSync(file, p) : file,\n l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || m && com.length != ms,\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22),\n oe = o,\n cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/function () {\n function UnzipPassThrough() {}\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}();\n\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n } catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n } else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate) data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}();\n\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile) _err(5);\n if (!this.p) _err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d) this.d.push(toAdd, !this.c);else this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length) return this.push(chunk, final);\n } else {\n var f = 0,\n i = 0,\n is = void 0,\n buf = void 0;\n if (!this.p.length) buf = chunk;else if (!chunk.length) buf = this.p;else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length,\n oc = this.c,\n add = oc && this.d;\n var _loop_2 = function _loop_2() {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6),\n cmp_1 = b2(buf, i + 8),\n u = bf & 2048,\n dd = bf & 8,\n fnl = b2(buf, i + 26),\n es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18),\n su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n } else if (dd) sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function start() {\n if (!file_1.ondata) _err(5);\n if (!sc_1) file_1.ondata(null, et, true);else {\n var ctr = _this.o[cmp_1];\n if (!ctr) file_1.ondata(_err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) {\n file_1.ondata(err, dat, final);\n };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c) _this.d = d_1;else d_1.push(et, true);\n }\n },\n terminate: function terminate() {\n if (d_1 && d_1.terminate) d_1.terminate();\n }\n };\n if (sc_1 >= 0) file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n } else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n } else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\") break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add) add.push(dat, !!f);else this.k[+(f == 2)].push(dat);\n }\n if (f & 2) return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c) _err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}();\n\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) {\n fn();\n};\nfunction unzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n var term = [];\n var tAll = function tAll() {\n for (var i = 0; i < term.length; ++i) term[i]();\n };\n var files = {};\n var cbd = function cbd(a, b) {\n mt(function () {\n cb(a, b);\n });\n };\n mt(function () {\n cbd = cb;\n });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(_err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function _loop_3(i) {\n var _a = zh(data, o, z),\n c_1 = _a[0],\n sc = _a[1],\n su = _a[2],\n fn = _a[3],\n no = _a[4],\n off = _a[5],\n b = slzh(data, off);\n o = no;\n var cbl = function cbl(e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n } else {\n if (d) files[fn] = d;\n if (! --lft) cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1) cbl(null, slc(data, b, b + sc));else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, {\n out: new u8(su)\n }));\n } catch (e) {\n cbl(e, null);\n }\n } else term.push(inflate(infl, {\n size: su\n }, cbl));\n } else cbl(_err(14, 'unknown compression type ' + c_1, 1), null);\n } else cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n } else cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nfunction unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) _err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c) return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z),\n c_2 = _a[0],\n sc = _a[1],\n su = _a[2],\n fn = _a[3],\n no = _a[4],\n off = _a[5],\n b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2) files[fn] = slc(data, b, b + sc);else if (c_2 == 8) files[fn] = inflateSync(data.subarray(b, b + sc), {\n out: new u8(su)\n });else _err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/eslint-loader??ref--13-0!./packages/utils/StreamLoaderParser.worker.js\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\nself.__streamLoaderStates = self.__streamLoaderStates || new Map();\nvar utf8Decoder = new TextDecoder('utf-8');\nself.onmessage = function (e) {\n var _e$data = e.data,\n id = _e$data.id,\n type = _e$data.type,\n data = _e$data.data;\n if (type === 'parseBufferData') {\n try {\n var buffer = data.buffer,\n prefixIdKey = data.prefixIdKey;\n var result = parseBufferData(buffer, prefixIdKey);\n // Transfer the buffer back if possible, but we constructed new arrays.\n // We rely on structured cloning.\n self.postMessage({\n id: id,\n type: 'success',\n result: result\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamInit') {\n try {\n var _ref = data || {},\n streamId = _ref.streamId,\n _prefixIdKey = _ref.prefixIdKey;\n if (!streamId) throw new Error('Missing streamId');\n var state = createStreamState(_prefixIdKey);\n self.__streamLoaderStates.set(streamId, state);\n self.postMessage({\n id: id,\n type: 'success',\n result: true\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamPush') {\n try {\n var _ref2 = data || {},\n _streamId = _ref2.streamId,\n chunk = _ref2.chunk,\n _ref2$byteOffset = _ref2.byteOffset,\n byteOffset = _ref2$byteOffset === void 0 ? 0 : _ref2$byteOffset,\n byteLength = _ref2.byteLength,\n _prefixIdKey2 = _ref2.prefixIdKey;\n if (!_streamId) throw new Error('Missing streamId');\n var _state = self.__streamLoaderStates.get(_streamId);\n if (!_state) {\n _state = createStreamState(_prefixIdKey2);\n self.__streamLoaderStates.set(_streamId, _state);\n }\n var view = new Uint8Array(chunk, byteOffset, byteLength !== null && byteLength !== void 0 ? byteLength : chunk.byteLength - byteOffset);\n var _result = parseStreamChunk(_state, view);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamFlush') {\n try {\n var _ref3 = data || {},\n _streamId2 = _ref3.streamId;\n if (!_streamId2) throw new Error('Missing streamId');\n var _state2 = self.__streamLoaderStates.get(_streamId2);\n if (!_state2) {\n self.postMessage({\n id: id,\n type: 'success',\n result: {\n meshes: [],\n primitives: []\n }\n });\n return;\n }\n var _result2 = parseStreamChunk(_state2, null, true);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result2\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamDispose') {\n try {\n var _ref4 = data || {},\n _streamId3 = _ref4.streamId;\n if (_streamId3) self.__streamLoaderStates.delete(_streamId3);\n self.postMessage({\n id: id,\n type: 'success',\n result: true\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'buildInstancedMapping') {\n try {\n var _ref5 = data || {},\n instances = _ref5.instances,\n drawObjs = _ref5.drawObjs;\n var _result3 = buildInstancedMapping(instances || [], drawObjs || []);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result3\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'occlusionScan') {\n var transfer = data && data.buffer ? [data.buffer] : [];\n try {\n var _ref6 = data || {},\n _buffer = _ref6.buffer,\n sw = _ref6.sw,\n sh = _ref6.sh,\n stride = _ref6.stride,\n maxIdx = _ref6.maxIdx,\n minSampleCount = _ref6.minSampleCount;\n var _result4 = scanOcclusionBuffer(_buffer, sw, sh, stride, maxIdx, minSampleCount);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result4,\n buffer: _buffer\n }, transfer);\n } catch (error) {\n var _buffer2 = data && data.buffer ? data.buffer : null;\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message,\n buffer: _buffer2\n }, transfer);\n }\n }\n};\nfunction createStreamState(prefixIdKey) {\n return {\n prefixIdKey: prefixIdKey || '',\n buffer: new Uint8Array(),\n pendingMesh: null,\n pendingPrimitiveIds: new Set(),\n pendingPrimitiveGroups: [],\n pendingMatchedPrimitiveIds: new Set(),\n expectingMesh: true,\n isFullProps: true\n };\n}\nfunction parseStreamChunk(state, chunkView) {\n var flushing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (chunkView && chunkView.length > 0) {\n var merged = new Uint8Array(state.buffer.length + chunkView.length);\n merged.set(state.buffer);\n merged.set(chunkView, state.buffer.length);\n state.buffer = merged;\n }\n var meshes = [];\n var primitives = [];\n var commitPendingMesh = function commitPendingMesh() {\n if (!state.pendingMesh) return;\n var meshList = Array.isArray(state.pendingMesh) ? state.pendingMesh : [state.pendingMesh];\n meshList.forEach(function (mesh) {\n meshes.push(mesh);\n primitives.push(state.pendingPrimitiveGroups);\n });\n state.pendingMesh = null;\n state.pendingPrimitiveIds = new Set();\n state.pendingPrimitiveGroups = [];\n state.pendingMatchedPrimitiveIds = new Set();\n };\n while (state.buffer.length > 0) {\n if (state.expectingMesh) {\n var meshResult = tryParseMeshFromState(state);\n if (meshResult.status === 'incomplete') break;\n if (meshResult.status === 'invalid') {\n break;\n }\n commitPendingMesh();\n state.pendingMesh = meshResult.mesh;\n state.pendingPrimitiveIds = new Set(collectMeshPrimitiveIds(meshResult.mesh));\n state.pendingPrimitiveGroups = [];\n state.pendingMatchedPrimitiveIds = new Set();\n state.expectingMesh = false;\n state.buffer = state.buffer.slice(meshResult.totalLen);\n } else {\n var nextMeshResult = tryParseMeshFromState(state);\n if (nextMeshResult.status === 'success') {\n commitPendingMesh();\n state.pendingMesh = nextMeshResult.mesh;\n state.pendingPrimitiveIds = new Set(collectMeshPrimitiveIds(nextMeshResult.mesh));\n state.pendingPrimitiveGroups = [];\n state.pendingMatchedPrimitiveIds = new Set();\n state.expectingMesh = false;\n state.buffer = state.buffer.slice(nextMeshResult.totalLen);\n continue;\n }\n if (state.buffer.length < 12) break;\n var primitiveResult = null;\n try {\n primitiveResult = parsePrimitiveFromState(state);\n } catch (e) {\n break;\n }\n var primitiveData = primitiveResult.primitive;\n if (state.pendingPrimitiveIds.has(primitiveData.id)) {\n state.pendingPrimitiveGroups.push(primitiveData);\n state.pendingMatchedPrimitiveIds.add(primitiveData.id);\n }\n state.buffer = state.buffer.slice(primitiveResult.consumedBytes);\n if (state.pendingPrimitiveIds.size > 0 && state.pendingMatchedPrimitiveIds.size >= state.pendingPrimitiveIds.size) {\n commitPendingMesh();\n state.expectingMesh = true;\n }\n }\n }\n if (flushing) {\n commitPendingMesh();\n state.buffer = new Uint8Array();\n }\n return {\n meshes: meshes,\n primitives: primitives\n };\n}\nfunction normalizeStreamMesh(mesh, prefixIdKey) {\n _applyPrefixId(mesh, 'id', null, prefixIdKey);\n var meshList = Array.isArray(mesh) ? mesh : [mesh];\n meshList.forEach(function (item) {\n if (!item) return;\n if (!Array.isArray(item.primitives)) {\n item.primitives = [];\n }\n _applyPrefixId(item.primitives, 'prmid', item.documentId, prefixIdKey);\n });\n return mesh;\n}\nfunction collectMeshPrimitiveIds(mesh) {\n var ids = [];\n var meshList = Array.isArray(mesh) ? mesh : [mesh];\n meshList.forEach(function (item) {\n if (!item || !Array.isArray(item.primitives)) return;\n item.primitives.forEach(function (primitive) {\n if (primitive && primitive.prmid != null) {\n ids.push(primitive.prmid);\n }\n });\n });\n return ids;\n}\nfunction isValidStreamMesh(mesh) {\n var meshList = Array.isArray(mesh) ? mesh : [mesh];\n if (meshList.length === 0) return false;\n return meshList.every(function (item) {\n return item && _typeof(item) === 'object' && Array.isArray(item.primitives);\n });\n}\nfunction tryParseMeshFromState(state) {\n if (state.buffer.length < 4) {\n return {\n status: 'incomplete'\n };\n }\n var length = new DataView(state.buffer.buffer, state.buffer.byteOffset).getUint32(0, false);\n if (length <= 0 || length > 10 * 1024 * 1024) {\n return {\n status: 'invalid'\n };\n }\n var totalLen = 4 + length;\n if (state.buffer.length < totalLen) {\n return {\n status: 'incomplete'\n };\n }\n try {\n var data = state.buffer.slice(4, totalLen);\n var parsedMesh = JSON.parse(utf8Decoder.decode(data));\n if (!isValidStreamMesh(parsedMesh)) {\n return {\n status: 'invalid'\n };\n }\n var mesh = normalizeStreamMesh(parsedMesh, state.prefixIdKey);\n return {\n status: 'success',\n mesh: mesh,\n totalLen: totalLen\n };\n } catch (e) {\n return {\n status: 'invalid'\n };\n }\n}\nfunction parsePrimitiveFromState(state) {\n var dataView = new DataView(state.buffer.buffer, state.buffer.byteOffset, state.buffer.byteLength);\n var primitiveResult = parsePrimitive(dataView, state.buffer, 0, state.isFullProps);\n var primitiveData = primitiveResult.primitive;\n _applyPrefixId(primitiveData, 'id', null, state.prefixIdKey);\n _applyPrefixId(primitiveData, 'material', null, state.prefixIdKey);\n if (state.isFullProps) {\n var _parsePrimitiveData = parsePrimitiveData(primitiveData),\n position = _parsePrimitiveData.position,\n normal = _parsePrimitiveData.normal,\n posindex = _parsePrimitiveData.posindex,\n nolindex = _parsePrimitiveData.nolindex,\n indices = _parsePrimitiveData.indices;\n var formatted = formatPrimitiveData({\n position: position,\n normal: normal,\n posindex: posindex,\n nolindex: nolindex\n });\n delete primitiveData.nolindex;\n delete primitiveData.posindex;\n primitiveData.position = formatted.position;\n primitiveData.normal = formatted.normal;\n primitiveData.indices = indices;\n }\n return {\n primitive: primitiveData,\n consumedBytes: primitiveResult.offset\n };\n}\nfunction parseBufferData(buffer, prefixIdKey) {\n var uint8Array = null;\n var dataView = null;\n var meshJsonBytes = null;\n var primitives = [];\n var mesh = null;\n try {\n uint8Array = new Uint8Array(buffer);\n dataView = new DataView(buffer);\n var offset = 0;\n var meshJsonLength = dataView.getInt32(offset, false);\n offset += 4;\n meshJsonBytes = new Uint8Array(uint8Array.buffer.slice(offset, offset + meshJsonLength));\n offset += meshJsonLength;\n var meshJsonStr = utf8Decoder.decode(meshJsonBytes);\n meshJsonBytes = null;\n try {\n mesh = JSON.parse(meshJsonStr);\n _applyPrefixId(mesh, 'id', null, prefixIdKey);\n if (Array.isArray(mesh)) {\n mesh.forEach(function (item) {\n _applyPrefixId(item.primitives, 'prmid', item.documentId, prefixIdKey);\n });\n } else {\n _applyPrefixId(mesh.primitives, 'prmid', mesh.documentId, prefixIdKey);\n }\n } catch (e) {\n console.error('JSON 解析失败:', e, meshJsonStr);\n throw new Error('JSON解析失败');\n }\n while (offset < uint8Array.length) {\n try {\n var result = parsePrimitive(dataView, uint8Array, offset);\n if (!result) break;\n primitives.push(result.primitive);\n offset = result.offset;\n } catch (e) {\n console.error('解析失败,偏移:', offset, e);\n break;\n }\n }\n for (var i = 0; i < primitives.length; i++) {\n var primitive = primitives[i];\n _applyPrefixId(primitive, 'id', null, prefixIdKey);\n _applyPrefixId(primitive, 'material', null, prefixIdKey);\n var _parsePrimitiveData2 = parsePrimitiveData(primitive),\n position = _parsePrimitiveData2.position,\n normal = _parsePrimitiveData2.normal,\n posindex = _parsePrimitiveData2.posindex,\n nolindex = _parsePrimitiveData2.nolindex,\n indices = _parsePrimitiveData2.indices;\n var formatted = formatPrimitiveData({\n position: position,\n normal: normal,\n posindex: posindex,\n nolindex: nolindex\n });\n delete primitive.nolindex;\n delete primitive.posindex;\n primitive.position = formatted.position;\n primitive.normal = formatted.normal;\n primitive.indices = indices;\n }\n return {\n mesh: mesh,\n primitives: primitives\n };\n } catch (error) {\n throw error;\n }\n}\nfunction _applyPrefixId(target, propKey, customPrefixId, prefixIdKey) {\n if (!prefixIdKey || !target) return;\n if (Array.isArray(target)) {\n target.forEach(function (item) {\n var prefixId = customPrefixId || item[prefixIdKey];\n if (item && prefixId && item[propKey] != null) {\n item[propKey] = \"\".concat(item[propKey], \":\").concat(prefixId);\n }\n });\n } else if ((customPrefixId || target[prefixIdKey]) && target[propKey] != null) {\n var prefixId = customPrefixId || target[prefixIdKey];\n target[propKey] = \"\".concat(target[propKey], \":\").concat(prefixId);\n }\n}\nfunction parsePrimitive(dataView, uint8Array, offset) {\n var isFullProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var primitive = {};\n if (dataView.byteLength < offset + 12) {\n throw new Error('Insufficient data for primitive header');\n }\n var primitiveIdTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (primitiveIdTextLen === 0xffffffff) {\n primitive.id = null;\n } else if (primitiveIdTextLen > 0) {\n if (dataView.byteLength < offset + primitiveIdTextLen) {\n throw new Error('Insufficient data for primitive id content');\n }\n var textBytes = uint8Array.subarray(offset, offset + primitiveIdTextLen);\n primitive.id = utf8Decoder.decode(textBytes);\n offset += primitiveIdTextLen;\n } else {\n primitive.id = '';\n }\n if (dataView.byteLength < offset + 4) {\n throw new Error('Insufficient data for GeomText length');\n }\n var documentTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (documentTextLen === 0xffffffff) {\n primitive.documentId = null;\n } else if (documentTextLen > 0) {\n if (dataView.byteLength < offset + documentTextLen) {\n throw new Error('Insufficient data for GeomText content');\n }\n var _textBytes = uint8Array.subarray(offset, offset + documentTextLen);\n primitive.documentId = utf8Decoder.decode(_textBytes);\n offset += documentTextLen;\n } else {\n primitive.documentId = '';\n }\n if (dataView.byteLength < offset + 4) {\n throw new Error('Insufficient data for Material length');\n }\n var materialTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (materialTextLen === 0xffffffff) {\n primitive.material = null;\n } else if (materialTextLen > 0) {\n if (dataView.byteLength < offset + materialTextLen) {\n throw new Error('Insufficient data for Material content');\n }\n var _textBytes2 = uint8Array.subarray(offset, offset + materialTextLen);\n primitive.material = utf8Decoder.decode(_textBytes2);\n offset += materialTextLen;\n } else {\n primitive.material = '';\n }\n if (dataView.byteLength < offset + 4) {\n throw new Error('Insufficient data for GeomText length');\n }\n var geomTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (geomTextLen === 0xffffffff) {\n primitive.geomText = null;\n } else if (geomTextLen > 0) {\n if (dataView.byteLength < offset + geomTextLen) {\n throw new Error('Insufficient data for GeomText content');\n }\n var _textBytes3 = uint8Array.subarray(offset, offset + geomTextLen);\n primitive.geomText = utf8Decoder.decode(_textBytes3);\n offset += geomTextLen;\n } else {\n primitive.geomText = '';\n }\n primitive.isCompressed = dataView.getInt32(offset, false);\n offset += 4;\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Position length');\n var positionLen = dataView.getUint32(offset, false);\n offset += 4;\n if (positionLen === 0xffffffff) {\n primitive.position = null;\n } else {\n if (dataView.byteLength < offset + positionLen) throw new Error('Insufficient data for Position content');\n primitive.position = uint8Array.subarray(offset, offset + positionLen);\n offset += positionLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Normal length');\n var normalLen = dataView.getUint32(offset, false);\n offset += 4;\n if (normalLen === 0xffffffff) {\n primitive.normal = null;\n } else {\n if (dataView.byteLength < offset + normalLen) throw new Error('Insufficient data for Normal content');\n primitive.normal = uint8Array.subarray(offset, offset + normalLen);\n offset += normalLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Indices length');\n var indicesLen = dataView.getUint32(offset, false);\n offset += 4;\n if (indicesLen === 0xffffffff) {\n primitive.indices = null;\n } else {\n if (dataView.byteLength < offset + indicesLen) throw new Error('Insufficient data for Indices content');\n primitive.indices = uint8Array.subarray(offset, offset + indicesLen);\n offset += indicesLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Posindex length');\n var posindexLen = dataView.getUint32(offset, false);\n offset += 4;\n if (posindexLen === 0xffffffff) {\n primitive.posindex = null;\n } else {\n if (dataView.byteLength < offset + posindexLen) throw new Error('Insufficient data for Posindex content');\n primitive.posindex = uint8Array.subarray(offset, offset + posindexLen);\n offset += posindexLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Nolindex length');\n var nolindexLen = dataView.getUint32(offset, false);\n offset += 4;\n if (nolindexLen === 0xffffffff) {\n primitive.nolindex = null;\n } else {\n if (dataView.byteLength < offset + nolindexLen) throw new Error('Insufficient data for Nolindex content');\n primitive.nolindex = uint8Array.subarray(offset, offset + nolindexLen);\n offset += nolindexLen;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for DataType length');\n var dataTypeLen = dataView.getUint32(offset, false);\n offset += 4;\n if (dataTypeLen === 0xffffffff) {\n primitive.dataType = null;\n } else if (dataTypeLen > 0) {\n if (dataView.byteLength < offset + dataTypeLen) throw new Error('Insufficient data for DataType content');\n var _textBytes4 = uint8Array.subarray(offset, offset + dataTypeLen);\n primitive.dataType = utf8Decoder.decode(_textBytes4);\n offset += dataTypeLen;\n } else {\n primitive.dataType = '';\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Min count');\n var minCount = dataView.getUint32(offset, false);\n offset += 4;\n if (minCount === 0xffffffff) {\n primitive.min = null;\n } else {\n if (dataView.byteLength < offset + minCount * 8) throw new Error('Insufficient data for Min values');\n primitive.min = [];\n for (var i = 0; i < minCount; i++) {\n primitive.min.push(dataView.getFloat64(offset, false));\n offset += 8;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Max count');\n var maxCount = dataView.getUint32(offset, false);\n offset += 4;\n if (maxCount === 0xffffffff) {\n primitive.max = null;\n } else {\n if (dataView.byteLength < offset + maxCount * 8) throw new Error('Insufficient data for Max values');\n primitive.max = [];\n for (var _i = 0; _i < maxCount; _i++) {\n primitive.max.push(dataView.getFloat64(offset, false));\n offset += 8;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for GeomType');\n primitive.geomType = dataView.getInt32(offset, false);\n offset += 4;\n return {\n primitive: primitive,\n offset: offset\n };\n}\nfunction parsePrimitiveData(primitive) {\n var keyOrder = ['position', 'normal', 'indices', 'posindex', 'nolindex'];\n var typeMap = {\n 0: {\n bytes: 4,\n getter: 'getFloat32'\n },\n 1: {\n bytes: 4,\n getter: 'getInt32'\n },\n 2: {\n bytes: 2,\n getter: 'getInt16'\n }\n };\n var parsedResult = {};\n var dataTypeString = primitive.dataType;\n for (var i = 0; i < keyOrder.length; i++) {\n var key = keyOrder[i];\n var typeCode = dataTypeString[i];\n var typeInfo = typeMap[typeCode];\n var uint8Array = primitive.isCompressed === 1 || primitive.isCompressed === undefined ? gunzipSync(primitive[key]) : primitive[key];\n if (!typeInfo || !uint8Array) {\n // console.warn(`无法找到键 \"${key}\" 或其类型定义,已跳过。`);\n parsedResult[key] = [];\n continue;\n }\n var result_array = [];\n var dataView = new DataView(uint8Array.buffer, uint8Array.byteOffset, uint8Array.byteLength);\n var littleEndian = true;\n for (var byteOffset = 0; byteOffset < dataView.byteLength; byteOffset += typeInfo.bytes) {\n if (byteOffset + typeInfo.bytes > dataView.byteLength) {\n console.warn(\"\\u952E \\\"\".concat(key, \"\\\" \\u7684\\u6570\\u636E\\u957F\\u5EA6 (\").concat(dataView.byteLength, \") \\u4E0D\\u662F\\u5176\\u7C7B\\u578B (\").concat(typeInfo.bytes, \"\\u5B57\\u8282) \\u7684\\u6574\\u6570\\u500D\\uFF0C\\u672B\\u5C3E\\u6570\\u636E\\u53EF\\u80FD\\u4E0D\\u5B8C\\u6574\\u3002\"));\n break;\n }\n var value = dataView[typeInfo.getter](byteOffset, littleEndian);\n result_array.push(value);\n }\n parsedResult[key] = result_array;\n }\n return parsedResult;\n}\nfunction formatPrimitiveData(primitive) {\n var position = primitive.position,\n normal = primitive.normal,\n posindex = primitive.posindex,\n nolindex = primitive.nolindex;\n var restoredPosition = new Array(posindex.length);\n var restoredNormal = new Array(nolindex.length);\n for (var i = 0; i < posindex.length; i++) {\n var posIndex = posindex[i];\n restoredPosition[i] = position[posIndex];\n }\n for (var _i2 = 0; _i2 < nolindex.length; _i2++) {\n var normalIndex = nolindex[_i2];\n restoredNormal[_i2] = normal[normalIndex];\n }\n primitive.position = null;\n primitive.normal = null;\n primitive.posindex = null;\n primitive.nolindex = null;\n return {\n position: restoredPosition,\n normal: restoredNormal\n };\n}\nfunction buildInstancedMapping(instances, drawObjs) {\n var drawObjMapInstance = {};\n var instanceToDrawObject = [];\n var meshByPrimId = new Map();\n for (var i = 0; i < drawObjs.length; i++) {\n var item = drawObjs[i];\n if (!item || !Array.isArray(item.geoms)) continue;\n var geoms = item.geoms;\n for (var j = 0; j < geoms.length; j++) {\n var geom = geoms[j];\n if (geom && geom.prmid !== undefined && geom.prmid !== null) {\n meshByPrimId.set(geom.prmid, geoms);\n }\n }\n }\n var seenByDrawObject = new Map();\n for (var _i3 = 0; _i3 < instances.length; _i3++) {\n var instance = instances[_i3];\n if (!instance) continue;\n var drawObject = instance.drawObject;\n if (!drawObject) continue;\n instanceToDrawObject.push({\n instanceId: instance.instanceId,\n drawObjectId: drawObject\n });\n var record = drawObjMapInstance[drawObject];\n if (!record) {\n record = {\n MapInstance: [],\n MapMesh: meshByPrimId.get(drawObject)\n };\n drawObjMapInstance[drawObject] = record;\n seenByDrawObject.set(drawObject, new Set());\n }\n var seen = seenByDrawObject.get(drawObject);\n if (!seen.has(instance.instanceId)) {\n record.MapInstance.push(instance);\n seen.add(instance.instanceId);\n }\n }\n return {\n drawObjMapInstance: drawObjMapInstance,\n instanceToDrawObject: instanceToDrawObject\n };\n}\nfunction scanOcclusionBuffer(buffer, sw, sh, stride, maxIdx, minSampleCount) {\n var indices = [];\n if (!buffer || !sw || !sh || !maxIdx) return {\n indices: indices\n };\n var view = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);\n var step = Math.max(1, stride || 1);\n var minCount = Math.max(1, minSampleCount || 1);\n var counts = new Uint32Array(maxIdx + 1);\n for (var y = 0; y < sh; y += step) {\n var row = y * sw * 4;\n for (var x = 0; x < sw; x += step) {\n var p = row + x * 4;\n var idxColor = view[p] + (view[p + 1] << 8) + (view[p + 2] << 16);\n if (idxColor > 0 && idxColor <= maxIdx) {\n var next = counts[idxColor] + 1;\n counts[idxColor] = next;\n if (next === minCount) {\n indices.push(idxColor);\n }\n }\n }\n }\n return {\n indices: indices\n };\n}\n\n/***/ })\n\n/******/ });\n", "Worker", undefined, undefined);
111431
+ return inline_default()("/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"f538\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"f538\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./node_modules/fflate/esm/browser.js\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = function wk(c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'], {\n type: 'text/javascript'\n }))));\n w.onmessage = function (e) {\n var d = e.data,\n ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n } else cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array,\n u16 = Uint16Array,\n i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */0, 0, /* impossible */0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function freb(eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = j - b[i] << 5 | i;\n }\n }\n return {\n b: b,\n r: r\n };\n};\nvar _a = freb(fleb, 2),\n fl = _a.b,\n revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0),\n fd = _b.b,\n revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var browser_i = 0; browser_i < 32768; ++browser_i) {\n // reverse table algorithm from SO\n var x = (browser_i & 0xAAAA) >> 1 | (browser_i & 0x5555) << 1;\n x = (x & 0xCCCC) >> 2 | (x & 0x3333) << 2;\n x = (x & 0xF0F0) >> 4 | (x & 0x0F0F) << 4;\n rev[browser_i] = ((x & 0xFF00) >> 8 | (x & 0x00FF) << 8) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = function hMap(cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i]) ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = le[i - 1] + l[i - 1] << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = i << 4 | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | (1 << r_1) - 1; v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n } else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> 15 - cd[i];\n }\n }\n }\n return co;\n};\n// fixed length tree\nvar flt = new u8(288);\nfor (var browser_i = 0; browser_i < 144; ++browser_i) flt[browser_i] = 8;\nfor (var browser_i = 144; browser_i < 256; ++browser_i) flt[browser_i] = 9;\nfor (var browser_i = 256; browser_i < 280; ++browser_i) flt[browser_i] = 7;\nfor (var browser_i = 280; browser_i < 288; ++browser_i) flt[browser_i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var browser_i = 0; browser_i < 32; ++browser_i) fdt[browser_i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/hMap(flt, 9, 0),\n flrm = /*#__PURE__*/hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/hMap(fdt, 5, 0),\n fdrm = /*#__PURE__*/hMap(fdt, 5, 1);\n// find max of array\nvar max = function max(a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m) m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function bits(d, p, m) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8) >> (p & 7) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function bits16(d, p) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);\n};\n// get end of byte\nvar shft = function shft(p) {\n return (p + 7) / 8 | 0;\n};\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function slc(v, s, e) {\n if (s == null || s < 0) s = 0;\n if (e == null || e > v.length) e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nvar FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = ['unexpected EOF', 'invalid block type', 'invalid length/literal', 'invalid distance', 'stream finished', 'no stream handler',, 'no callback', 'invalid UTF-8 data', 'extra field too long', 'date not in range 1980-2099', 'filename too long', 'stream finishing', 'invalid zip data'\n// determined by unknown compression method\n];\n;\nvar _err = function err(ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace) Error.captureStackTrace(e, _err);\n if (!nt) throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function inflt(dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length,\n dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l) return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf) buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function cbuf(l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0,\n pos = st.p || 0,\n bt = st.b || 0,\n lm = st.l,\n dm = st.d,\n lbt = st.m,\n dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4,\n l = dat[s - 4] | dat[s - 3] << 8,\n t = s + l;\n if (t > sl) {\n if (noSt) _err(0);\n break;\n }\n // ensure size\n if (resize) cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n } else if (type == 1) lm = flrm, dm = fdrm, lbt = 9, dbt = 5;else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257,\n hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt),\n clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n } else {\n // copy count\n var c = 0,\n n = 0;\n if (s == 16) n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];else if (s == 17) n = 3 + bits(dat, pos, 7), pos += 3;else if (s == 18) n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--) ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit),\n dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n } else _err(1);\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize) cbuf(bt + 131072);\n var lms = (1 << lbt) - 1,\n dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms],\n sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n if (!c) _err(2);\n if (sym < 256) buf[bt++] = sym;else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n } else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257,\n b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms],\n dsym = d >> 4;\n if (!d) _err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt) _err(0);\n break;\n }\n if (resize) cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt,\n dend = Math.min(dt, end);\n if (shift + bt < 0) _err(3);\n for (; bt < dend; ++bt) buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt) buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm) final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function wbits(d, p, v) {\n v <<= p & 7;\n var o = p / 8 | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function wbits16(d, p, v) {\n v <<= p & 7;\n var o = p / 8 | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function hTree(d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i]) t.push({\n s: i,\n f: d[i]\n });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s) return {\n t: et,\n l: 0\n };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return {\n t: v,\n l: 1\n };\n }\n t.sort(function (a, b) {\n return a.f - b.f;\n });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({\n s: -1,\n f: 25001\n });\n var l = t[0],\n r = t[1],\n i0 = 0,\n i1 = 1,\n i2 = 2;\n t[0] = {\n s: -1,\n f: l.f + r.f,\n l: l,\n r: r\n };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = {\n s: -1,\n f: l.f + r.f,\n l: l,\n r: r\n };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym) maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = _ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0,\n dt = 0;\n // left cost\n var lft = mbt - mb,\n cst = 1 << lft;\n t2.sort(function (a, b) {\n return tr[b.s] - tr[a.s] || a.f - b.f;\n });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << mbt - tr[i2_1]);\n tr[i2_1] = mb;\n } else break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb) dt -= 1 << mb - tr[i2_2]++ - 1;else ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return {\n t: new u8(tr),\n l: mbt\n };\n};\n// get the max length and assign length codes\nvar _ln = function ln(n, l, d) {\n return n.s == -1 ? Math.max(_ln(n.l, l, d + 1), _ln(n.r, l, d + 1)) : l[n.s] = d;\n};\n// length codes generation\nvar lc = function lc(c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s]);\n var cl = new u16(++s);\n // ind num streak\n var cli = 0,\n cln = c[0],\n cls = 1;\n var w = function w(v) {\n cl[cli++] = v;\n };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s) ++cls;else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138) w(32754);\n if (cls > 2) {\n w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);\n cls = 0;\n }\n } else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6) w(8304);\n if (cls > 2) w(cls - 3 << 5 | 8208), cls = 0;\n }\n while (cls--) w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return {\n c: cl.subarray(0, cli),\n n: s\n };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function clen(cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i) l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function wfblk(out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i) out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function wblk(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15),\n dlt = _a.t,\n mlb = _a.l;\n var _b = hTree(df, 15),\n ddt = _b.t,\n mdb = _b.l;\n var _c = lc(dlt),\n lclt = _c.c,\n nlc = _c.n;\n var _d = lc(ddt),\n lcdt = _d.c,\n ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i) ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i) ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7),\n lct = _e.t,\n mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc);\n var flen = bl + 5 << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen) return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i) wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15) wbits(out, p, clct[i] >> 5 & 127), p += clct[i] >> 12;\n }\n }\n } else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = sym >> 18 & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7) wbits(out, p, sym >> 23 & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3) wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];\n } else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function dflt(dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos) w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13,\n c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768),\n head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3),\n bs2_1 = 2 * bs1_1;\n var hsh = function hsh(i) {\n return (dat[i] ^ dat[i + 1] << bs1_1 ^ dat[i + 2] << bs2_1) & msk_1;\n };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288),\n df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0,\n eb = 0,\n i = st.i || 0,\n li = 0,\n wi = st.w || 0,\n bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767,\n pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j) lf[j] = 0;\n for (var j = 0; j < 30; ++j) df[j] = 0;\n }\n // len dist chain\n var l = 2,\n d = 0,\n ch_1 = c,\n dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl);\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn) break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md) md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];\n var lin = revfl[l] & 31,\n din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n } else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = pos & 7 | w[pos / 8 | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n } else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos / 8 | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i,\n k = 9;\n while (--k) c = (c & 1 && -306674912) ^ c >>> 1;\n t[i] = c;\n }\n return t;\n}();\n// CRC32\nvar crc = function crc() {\n var c = -1;\n return {\n p: function p(d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i) cr = crct[cr & 255 ^ d[i]] ^ cr >>> 8;\n c = cr;\n },\n d: function d() {\n return ~c;\n }\n };\n};\n// Adler32\nvar adler = function adler() {\n var a = 1,\n b = 0;\n return {\n p: function p(d) {\n // closures have awful performance\n var n = a,\n m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i) m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function d() {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | b >> 8;\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function dopt(dat, opt, pre, post, st) {\n if (!st) {\n st = {\n l: 1\n };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);\n};\n// Walmart object spread\nvar mrg = function mrg(a, b) {\n var o = {};\n for (var k in a) o[k] = a[k];\n for (var k in b) o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function wcln(fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i],\n k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n } else {\n fnStr += st_1;\n for (var t in v.prototype) fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n } else fnStr += st_1;\n } else td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function cbfs(v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function wrkr(fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '',\n td_1 = {},\n m = fns.length - 1;\n for (var i = 0; i < m; ++i) fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = {\n c: wcln(fns[m], fnStr, td_1),\n e: td_1\n };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function bInflt() {\n return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, _err, inflt, inflateSync, pbf, gopt];\n};\nvar bDflt = function bDflt() {\n return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, _ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf];\n};\n// gzip extra\nvar gze = function gze() {\n return [gzh, gzhl, wbytes, crc, crct];\n};\n// gunzip extra\nvar guze = function guze() {\n return [gzs, gzl];\n};\n// zlib extra\nvar zle = function zle() {\n return [zlh, wbytes, adler];\n};\n// unzlib extra\nvar zule = function zule() {\n return [zls];\n};\n// post buf\nvar pbf = function pbf(msg) {\n return postMessage(msg, [msg.buffer]);\n};\n// get opts\nvar gopt = function gopt(o) {\n return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n };\n};\n// async helper\nvar cbify = function cbify(dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () {\n w.terminate();\n };\n};\n// auto stream\nvar astrm = function astrm(strm) {\n strm.ondata = function (dat, final) {\n return postMessage([dat, final], [dat.buffer]);\n };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n } else strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function astrmify(fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err) w.terminate(), strm.ondata.call(strm, err);else if (!Array.isArray(dat)) ext(dat);else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain) strm.ondrain(dat[0]);\n } else {\n if (dat[1]) w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata) _err(5);\n if (t) strm.ondata(_err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () {\n w.terminate();\n };\n if (flush) {\n strm.flush = function () {\n w.postMessage([]);\n };\n }\n};\n// read 2 bytes\nvar b2 = function b2(d, b) {\n return d[b] | d[b + 1] << 8;\n};\n// read 4 bytes\nvar b4 = function b4(d, b) {\n return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;\n};\nvar b8 = function b8(d, b) {\n return b4(d, b) + b4(d, b + 4) * 4294967296;\n};\n// write bytes\nvar wbytes = function wbytes(d, b, v) {\n for (; v; ++b) d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function gzh(c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0) wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i) c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function gzs(d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8) _err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4) st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]);\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function gzl(d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function gzhl(o) {\n return 10 + (o.filename ? o.filename.length + 1 : 0);\n};\n// zlib header\nvar zlh = function zlh(c, o) {\n var lv = o.level,\n fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = fl << 6 | (o.dictionary && 32);\n c[1] |= 31 - (c[0] << 8 | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function zls(d, dict) {\n if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31) _err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict) _err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = {\n l: 0,\n i: 32768,\n w: 32768,\n z: 32768\n };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (this.s.l) _err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n } else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata) _err(5);\n if (this.s.l) _err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/function () {\n function AsyncDeflate(opts, cb) {\n astrmify([bDflt, function () {\n return [astrm, Deflate];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}();\n\nfunction deflate(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt], function (ev) {\n return pbf(deflateSync(ev.data[0], ev.data[1]));\n }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nfunction deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function') cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = {\n i: 0,\n b: dict ? dict.length : 0\n };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict) this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata) _err(5);\n if (this.d) _err(4);\n if (!this.p.length) this.p = c;else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/function () {\n function AsyncInflate(opts, cb) {\n astrmify([bInflt, function () {\n return [astrm, Inflate];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}();\n\nfunction inflate(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt], function (ev) {\n return pbf(inflateSync(ev.data[0], gopt(ev.data[1])));\n }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction inflateSync(data, opts) {\n return inflt(data, {\n i: 2\n }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v) gzh(raw, this.o), this.v = 0;\n if (f) wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}();\n\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/function () {\n function AsyncGzip(opts, cb) {\n astrmify([bDflt, gze, function () {\n return [astrm, Deflate, Gzip];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}();\n\nfunction gzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt, gze, function () {\n return [gzipSync];\n }], function (ev) {\n return pbf(gzipSync(ev.data[0], ev.data[1]));\n }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nfunction gzipSync(data, opts) {\n if (!opts) opts = {};\n var c = crc(),\n l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8),\n s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final) return;\n } else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = {\n i: 0\n };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}();\n\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([bInflt, guze, function () {\n return [astrm, Inflate, Gunzip];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) {\n return postMessage(offset);\n };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) {\n return _this.onmember && _this.onmember(offset);\n });\n }\n return AsyncGunzip;\n}();\n\nfunction gunzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt, guze, function () {\n return [gunzipSync];\n }], function (ev) {\n return pbf(gunzipSync(ev.data[0], ev.data[1]));\n }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length) _err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), {\n i: 2\n }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v) zlh(raw, this.o), this.v = 0;\n if (f) wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}();\n\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/function () {\n function AsyncZlib(opts, cb) {\n astrmify([bDflt, zle, function () {\n return [astrm, Deflate, Zlib];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}();\n\nfunction zlib(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bDflt, zle, function () {\n return [zlibSync];\n }], function (ev) {\n return pbf(zlibSync(ev.data[0], ev.data[1]));\n }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nfunction zlibSync(data, opts) {\n if (!opts) opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final) return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4) _err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}();\n\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([bInflt, zule, function () {\n return [astrm, Inflate, Unzlib];\n }], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}();\n\nfunction unzlib(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return cbify(data, opts, [bInflt, zule, function () {\n return [unzlibSync];\n }], function (ev) {\n return pbf(unzlibSync(ev.data[0], gopt(ev.data[1])));\n }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), {\n i: 2\n }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\n\n\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n } else this.p = chunk;\n if (this.p.length > 2) {\n this.s = this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8 ? new this.G(this.o) : (this.p[0] & 15) != 8 || this.p[0] >> 4 > 7 || (this.p[0] << 8 | this.p[1]) % 31 ? new this.I(this.o) : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n } else this.s.push(chunk, final);\n };\n return Decompress;\n}();\n\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain) _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}();\n\nfunction decompress(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nfunction decompressSync(data, opts) {\n return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar _fltn = function fltn(d, p, t, o) {\n for (var k in d) {\n var val = d[k],\n n = p + k,\n op = o;\n if (Array.isArray(val)) op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8) t[n] = [val, op];else {\n t[n += '/'] = [new u8(0), op];\n _fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, {\n stream: true\n });\n tds = 1;\n} catch (e) {}\n// decode UTF8\nvar dutf8 = function dutf8(d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length) return {\n s: r,\n r: slc(d, i - 1)\n };\n if (!eb) r += String.fromCharCode(c);else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | d[i++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);\n } else if (eb & 1) r += String.fromCharCode((c & 31) << 6 | d[i++] & 63);else r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | d[i++] & 63);\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds) this.t = new TextDecoder();else this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, {\n stream: true\n }), final);\n if (final) {\n if (this.t.decode().length) _err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p) _err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat),\n s = _a.s,\n r = _a.r;\n if (final) {\n if (r.length) _err(8);\n this.p = null;\n } else this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}();\n\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n if (this.d) _err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}();\n\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nfunction strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i) ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te) return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function w(v) {\n ar[ai++] = v;\n };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + (l - i << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1) w(c);else if (c < 2048) w(192 | c >> 6), w(128 | c & 63);else if (c > 55295 && c < 57344) c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);else w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nfunction strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384) r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n } else if (td) {\n return td.decode(dat);\n } else {\n var _a = dutf8(dat),\n s = _a.s,\n r = _a.r;\n if (r.length) _err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function dbf(l) {\n return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0;\n};\n// skip local zip header\nvar slzh = function slzh(d, b) {\n return b + 30 + b2(d, b + 26) + b2(d, b + 28);\n};\n// read zip header\nvar zh = function zh(d, b, z) {\n var fnl = b2(d, b + 28),\n fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)),\n es = b + 46 + fnl,\n bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)],\n sc = _a[0],\n su = _a[1],\n off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function z64e(d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2));\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function exfl(ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535) _err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function wzh(d, b, f, fn, u, c, ce, co) {\n var fl = fn.length,\n ex = f.extra,\n col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null) d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime),\n y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119) _err(10);\n wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k],\n l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col) d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function wzf(o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata) _err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final) this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}();\n\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts) opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n } catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts) opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}();\n\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata) _err(5);\n // finishing or finished\n if (this.d & 2) this.ondata(_err(4 + (this.d & 1) * 8, 0, 1), null, false);else {\n var f = strToU8(file.filename),\n fl_1 = f.length;\n var com = file.comment,\n o = com && strToU8(com);\n var u = fl_1 != file.filename.length || o && com.length != o.length;\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535) this.ondata(_err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function pAll_1() {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function t() {\n if (file.terminate) file.terminate();\n },\n r: function r() {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt) nxt.r();else _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n } else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1) uf_1.r();\n tr_1 = 1;\n } else if (tr_1) pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(_err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d) this.e();else this.u.push({\n r: function r() {\n if (!(_this.d & 1)) return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function t() {}\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0,\n l = 0,\n tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}();\n\nfunction zip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n var r = {};\n _fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length,\n o = 0,\n tot = 0;\n var slft = lft,\n files = new Array(lft);\n var term = [];\n var tAll = function tAll() {\n for (var i = 0; i < term.length; ++i) term[i]();\n };\n var cbd = function cbd(a, b) {\n mt(function () {\n cb(a, b);\n });\n };\n mt(function () {\n cbd = cb;\n });\n var cbf = function cbf() {\n var out = new u8(tot + 22),\n oe = o,\n cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n } catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft) cbf();\n var _loop_1 = function _loop_1(i) {\n var fn = k[i];\n var _a = r[fn],\n file = _a[0],\n p = _a[1];\n var c = crc(),\n size = file.length;\n c.p(file);\n var f = strToU8(fn),\n s = f.length;\n var com = p.comment,\n m = com && strToU8(com),\n ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function cbl(e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n } else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || m && com.length != ms,\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (! --lft) cbf();\n }\n };\n if (s > 65535) cbl(_err(11, 0, 1), null);\n if (!compression) cbl(null, file);else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n } catch (e) {\n cbl(e, null);\n }\n } else term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nfunction zipSync(data, opts) {\n if (!opts) opts = {};\n var r = {};\n var files = [];\n _fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn],\n file = _a[0],\n p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn),\n s = f.length;\n var com = p.comment,\n m = com && strToU8(com),\n ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535) _err(11);\n var d = compression ? deflateSync(file, p) : file,\n l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || m && com.length != ms,\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22),\n oe = o,\n cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/function () {\n function UnzipPassThrough() {}\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}();\n\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n } catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}();\n\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n } else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate) data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}();\n\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile) _err(5);\n if (!this.p) _err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d) this.d.push(toAdd, !this.c);else this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length) return this.push(chunk, final);\n } else {\n var f = 0,\n i = 0,\n is = void 0,\n buf = void 0;\n if (!this.p.length) buf = chunk;else if (!chunk.length) buf = this.p;else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length,\n oc = this.c,\n add = oc && this.d;\n var _loop_2 = function _loop_2() {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6),\n cmp_1 = b2(buf, i + 8),\n u = bf & 2048,\n dd = bf & 8,\n fnl = b2(buf, i + 26),\n es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18),\n su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n } else if (dd) sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function start() {\n if (!file_1.ondata) _err(5);\n if (!sc_1) file_1.ondata(null, et, true);else {\n var ctr = _this.o[cmp_1];\n if (!ctr) file_1.ondata(_err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) {\n file_1.ondata(err, dat, final);\n };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c) _this.d = d_1;else d_1.push(et, true);\n }\n },\n terminate: function terminate() {\n if (d_1 && d_1.terminate) d_1.terminate();\n }\n };\n if (sc_1 >= 0) file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n } else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n } else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\") break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add) add.push(dat, !!f);else this.k[+(f == 2)].push(dat);\n }\n if (f & 2) return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c) _err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}();\n\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) {\n fn();\n};\nfunction unzip(data, opts, cb) {\n if (!cb) cb = opts, opts = {};\n if (typeof cb != 'function') _err(7);\n var term = [];\n var tAll = function tAll() {\n for (var i = 0; i < term.length; ++i) term[i]();\n };\n var files = {};\n var cbd = function cbd(a, b) {\n mt(function () {\n cb(a, b);\n });\n };\n mt(function () {\n cbd = cb;\n });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(_err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function _loop_3(i) {\n var _a = zh(data, o, z),\n c_1 = _a[0],\n sc = _a[1],\n su = _a[2],\n fn = _a[3],\n no = _a[4],\n off = _a[5],\n b = slzh(data, off);\n o = no;\n var cbl = function cbl(e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n } else {\n if (d) files[fn] = d;\n if (! --lft) cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1) cbl(null, slc(data, b, b + sc));else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, {\n out: new u8(su)\n }));\n } catch (e) {\n cbl(e, null);\n }\n } else term.push(inflate(infl, {\n size: su\n }, cbl));\n } else cbl(_err(14, 'unknown compression type ' + c_1, 1), null);\n } else cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n } else cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nfunction unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) _err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c) return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z),\n c_2 = _a[0],\n sc = _a[1],\n su = _a[2],\n fn = _a[3],\n no = _a[4],\n off = _a[5],\n b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2) files[fn] = slc(data, b, b + sc);else if (c_2 == 8) files[fn] = inflateSync(data.subarray(b, b + sc), {\n out: new u8(su)\n });else _err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/eslint-loader??ref--13-0!./packages/utils/StreamLoaderParser.worker.js\n\nself.__streamLoaderStates = self.__streamLoaderStates || new Map();\nvar utf8Decoder = new TextDecoder('utf-8');\nself.onmessage = function (e) {\n var _e$data = e.data,\n id = _e$data.id,\n type = _e$data.type,\n data = _e$data.data;\n if (type === 'parseBufferData') {\n try {\n var buffer = data.buffer,\n prefixIdKey = data.prefixIdKey;\n var result = parseBufferData(buffer, prefixIdKey);\n // Transfer the buffer back if possible, but we constructed new arrays.\n // We rely on structured cloning.\n self.postMessage({\n id: id,\n type: 'success',\n result: result\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamInit') {\n try {\n var _ref = data || {},\n streamId = _ref.streamId,\n _prefixIdKey = _ref.prefixIdKey;\n if (!streamId) throw new Error('Missing streamId');\n var state = createStreamState(_prefixIdKey);\n self.__streamLoaderStates.set(streamId, state);\n self.postMessage({\n id: id,\n type: 'success',\n result: true\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamPush') {\n try {\n var _ref2 = data || {},\n _streamId = _ref2.streamId,\n chunk = _ref2.chunk,\n _ref2$byteOffset = _ref2.byteOffset,\n byteOffset = _ref2$byteOffset === void 0 ? 0 : _ref2$byteOffset,\n byteLength = _ref2.byteLength,\n _prefixIdKey2 = _ref2.prefixIdKey;\n if (!_streamId) throw new Error('Missing streamId');\n var _state = self.__streamLoaderStates.get(_streamId);\n if (!_state) {\n _state = createStreamState(_prefixIdKey2);\n self.__streamLoaderStates.set(_streamId, _state);\n }\n var view = new Uint8Array(chunk, byteOffset, byteLength !== null && byteLength !== void 0 ? byteLength : chunk.byteLength - byteOffset);\n var _result = parseStreamChunk(_state, view);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamFlush') {\n try {\n var _ref3 = data || {},\n _streamId2 = _ref3.streamId;\n if (!_streamId2) throw new Error('Missing streamId');\n var _state2 = self.__streamLoaderStates.get(_streamId2);\n if (!_state2) {\n self.postMessage({\n id: id,\n type: 'success',\n result: {\n meshes: [],\n primitives: []\n }\n });\n return;\n }\n var _result2 = parseStreamChunk(_state2, null, true);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result2\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'streamDispose') {\n try {\n var _ref4 = data || {},\n _streamId3 = _ref4.streamId;\n if (_streamId3) self.__streamLoaderStates.delete(_streamId3);\n self.postMessage({\n id: id,\n type: 'success',\n result: true\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'buildInstancedMapping') {\n try {\n var _ref5 = data || {},\n instances = _ref5.instances,\n drawObjs = _ref5.drawObjs;\n var _result3 = buildInstancedMapping(instances || [], drawObjs || []);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result3\n });\n } catch (error) {\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message\n });\n }\n } else if (type === 'occlusionScan') {\n var transfer = data && data.buffer ? [data.buffer] : [];\n try {\n var _ref6 = data || {},\n _buffer = _ref6.buffer,\n sw = _ref6.sw,\n sh = _ref6.sh,\n stride = _ref6.stride,\n maxIdx = _ref6.maxIdx,\n minSampleCount = _ref6.minSampleCount;\n var _result4 = scanOcclusionBuffer(_buffer, sw, sh, stride, maxIdx, minSampleCount);\n self.postMessage({\n id: id,\n type: 'success',\n result: _result4,\n buffer: _buffer\n }, transfer);\n } catch (error) {\n var _buffer2 = data && data.buffer ? data.buffer : null;\n self.postMessage({\n id: id,\n type: 'error',\n error: error.message,\n buffer: _buffer2\n }, transfer);\n }\n }\n};\nfunction createStreamState(prefixIdKey) {\n return {\n prefixIdKey: prefixIdKey || '',\n buffer: new Uint8Array(),\n pendingPrimitives: new Map(),\n expectingPrimitive: true,\n isFullProps: true\n };\n}\nfunction parseStreamChunk(state, chunkView) {\n var flushing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (chunkView && chunkView.length > 0) {\n var merged = new Uint8Array(state.buffer.length + chunkView.length);\n merged.set(state.buffer);\n merged.set(chunkView, state.buffer.length);\n state.buffer = merged;\n }\n var meshes = [];\n var primitives = [];\n while (state.buffer.length > 0) {\n if (state.expectingPrimitive) {\n if (state.buffer.length < 12) break;\n try {\n var dataView = new DataView(state.buffer.buffer, state.buffer.byteOffset, state.buffer.byteLength);\n var primitiveResult = parsePrimitive(dataView, state.buffer, 0, state.isFullProps);\n var primitiveData = primitiveResult.primitive;\n _applyPrefixId(primitiveData, 'id', null, state.prefixIdKey);\n _applyPrefixId(primitiveData, 'material', null, state.prefixIdKey);\n if (state.isFullProps) {\n var _parsePrimitiveData = parsePrimitiveData(primitiveData),\n position = _parsePrimitiveData.position,\n normal = _parsePrimitiveData.normal,\n posindex = _parsePrimitiveData.posindex,\n nolindex = _parsePrimitiveData.nolindex,\n indices = _parsePrimitiveData.indices;\n var formatted = formatPrimitiveData({\n position: position,\n normal: normal,\n posindex: posindex,\n nolindex: nolindex\n });\n delete primitiveData.nolindex;\n delete primitiveData.posindex;\n primitiveData.position = formatted.position;\n primitiveData.normal = formatted.normal;\n primitiveData.indices = indices;\n }\n state.pendingPrimitives.set(primitiveData.id, primitiveData);\n state.expectingPrimitive = false;\n state.buffer = state.buffer.slice(primitiveResult.offset);\n } catch (e) {\n break;\n }\n } else {\n if (state.buffer.length < 4) break;\n var length = new DataView(state.buffer.buffer, state.buffer.byteOffset).getUint32(0, false);\n if (length > 10 * 1024 * 1024) {\n state.expectingPrimitive = true;\n continue;\n }\n var totalLen = 4 + length;\n if (state.buffer.length < totalLen) break;\n var data = state.buffer.slice(4, totalLen);\n var mesh = null;\n try {\n var jsonStr = utf8Decoder.decode(data);\n mesh = JSON.parse(jsonStr);\n } catch (e) {\n state.expectingPrimitive = true;\n continue;\n }\n if (mesh) {\n state.isFullProps = true;\n _applyPrefixId(mesh, 'id', null, state.prefixIdKey);\n if (Array.isArray(mesh)) {\n mesh.forEach(function (item) {\n _applyPrefixId(item.primitives, 'prmid', item.documentId, state.prefixIdKey);\n });\n } else {\n _applyPrefixId(mesh.primitives, 'prmid', mesh.documentId, state.prefixIdKey);\n }\n var docId = mesh.id;\n var meshToPrimId = mesh.primitives.map(function (item) {\n return item.prmid;\n });\n var hasPendingPrimitive = meshToPrimId.some(function (item) {\n return state.pendingPrimitives.has(item);\n });\n var hasPendingMesh = state.pendingPrimitives.has(docId);\n if (hasPendingMesh || hasPendingPrimitive) {\n var _primitiveData = state.pendingPrimitives.get(docId);\n if (!hasPendingMesh && hasPendingPrimitive) {\n _primitiveData = state.pendingPrimitives.get(meshToPrimId[0]);\n }\n meshes.push(mesh);\n primitives.push(_primitiveData);\n }\n state.expectingPrimitive = false;\n state.buffer = state.buffer.slice(totalLen);\n }\n }\n }\n if (flushing) {\n state.buffer = new Uint8Array();\n }\n return {\n meshes: meshes,\n primitives: primitives\n };\n}\nfunction parseBufferData(buffer, prefixIdKey) {\n var uint8Array = null;\n var dataView = null;\n var meshJsonBytes = null;\n var primitives = [];\n var mesh = null;\n try {\n uint8Array = new Uint8Array(buffer);\n dataView = new DataView(buffer);\n var offset = 0;\n var meshJsonLength = dataView.getInt32(offset, false);\n offset += 4;\n meshJsonBytes = new Uint8Array(uint8Array.buffer.slice(offset, offset + meshJsonLength));\n offset += meshJsonLength;\n var meshJsonStr = utf8Decoder.decode(meshJsonBytes);\n meshJsonBytes = null;\n try {\n mesh = JSON.parse(meshJsonStr);\n _applyPrefixId(mesh, 'id', null, prefixIdKey);\n if (Array.isArray(mesh)) {\n mesh.forEach(function (item) {\n _applyPrefixId(item.primitives, 'prmid', item.documentId, prefixIdKey);\n });\n } else {\n _applyPrefixId(mesh.primitives, 'prmid', mesh.documentId, prefixIdKey);\n }\n } catch (e) {\n console.error('JSON 解析失败:', e, meshJsonStr);\n throw new Error('JSON解析失败');\n }\n while (offset < uint8Array.length) {\n try {\n var result = parsePrimitive(dataView, uint8Array, offset);\n if (!result) break;\n primitives.push(result.primitive);\n offset = result.offset;\n } catch (e) {\n console.error('解析失败,偏移:', offset, e);\n break;\n }\n }\n for (var i = 0; i < primitives.length; i++) {\n var primitive = primitives[i];\n _applyPrefixId(primitive, 'id', null, prefixIdKey);\n _applyPrefixId(primitive, 'material', null, prefixIdKey);\n var _parsePrimitiveData2 = parsePrimitiveData(primitive),\n position = _parsePrimitiveData2.position,\n normal = _parsePrimitiveData2.normal,\n posindex = _parsePrimitiveData2.posindex,\n nolindex = _parsePrimitiveData2.nolindex,\n indices = _parsePrimitiveData2.indices;\n var formatted = formatPrimitiveData({\n position: position,\n normal: normal,\n posindex: posindex,\n nolindex: nolindex\n });\n delete primitive.nolindex;\n delete primitive.posindex;\n primitive.position = formatted.position;\n primitive.normal = formatted.normal;\n primitive.indices = indices;\n }\n return {\n mesh: mesh,\n primitives: primitives\n };\n } catch (error) {\n throw error;\n }\n}\nfunction _applyPrefixId(target, propKey, customPrefixId, prefixIdKey) {\n if (!prefixIdKey || !target) return;\n if (Array.isArray(target)) {\n target.forEach(function (item) {\n var prefixId = customPrefixId || item[prefixIdKey];\n if (item && prefixId && item[propKey] != null) {\n item[propKey] = \"\".concat(item[propKey], \":\").concat(prefixId);\n }\n });\n } else if ((customPrefixId || target[prefixIdKey]) && target[propKey] != null) {\n var prefixId = customPrefixId || target[prefixIdKey];\n target[propKey] = \"\".concat(target[propKey], \":\").concat(prefixId);\n }\n}\nfunction parsePrimitive(dataView, uint8Array, offset) {\n var isFullProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var primitive = {};\n if (dataView.byteLength < offset + 12) {\n throw new Error('Insufficient data for primitive header');\n }\n primitive.id = dataView.getInt32(offset, false);\n offset += 4;\n if (dataView.byteLength < offset + 4) {\n throw new Error('Insufficient data for GeomText length');\n }\n var documentTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (documentTextLen === 0xffffffff) {\n primitive.documentId = null;\n } else if (documentTextLen > 0) {\n if (dataView.byteLength < offset + documentTextLen) {\n throw new Error('Insufficient data for GeomText content');\n }\n var textBytes = uint8Array.subarray(offset, offset + documentTextLen);\n primitive.documentId = utf8Decoder.decode(textBytes);\n offset += documentTextLen;\n } else {\n primitive.documentId = '';\n }\n primitive.material = dataView.getInt32(offset, false);\n offset += 4;\n if (dataView.byteLength < offset + 4) {\n throw new Error('Insufficient data for GeomText length');\n }\n var geomTextLen = dataView.getUint32(offset, false);\n offset += 4;\n if (geomTextLen === 0xffffffff) {\n primitive.geomText = null;\n } else if (geomTextLen > 0) {\n if (dataView.byteLength < offset + geomTextLen) {\n throw new Error('Insufficient data for GeomText content');\n }\n var _textBytes = uint8Array.subarray(offset, offset + geomTextLen);\n primitive.geomText = utf8Decoder.decode(_textBytes);\n offset += geomTextLen;\n } else {\n primitive.geomText = '';\n }\n primitive.isCompressed = dataView.getInt32(offset, false);\n offset += 4;\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Position length');\n var positionLen = dataView.getUint32(offset, false);\n offset += 4;\n if (positionLen === 0xffffffff) {\n primitive.position = null;\n } else {\n if (dataView.byteLength < offset + positionLen) throw new Error('Insufficient data for Position content');\n primitive.position = uint8Array.subarray(offset, offset + positionLen);\n offset += positionLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Normal length');\n var normalLen = dataView.getUint32(offset, false);\n offset += 4;\n if (normalLen === 0xffffffff) {\n primitive.normal = null;\n } else {\n if (dataView.byteLength < offset + normalLen) throw new Error('Insufficient data for Normal content');\n primitive.normal = uint8Array.subarray(offset, offset + normalLen);\n offset += normalLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Indices length');\n var indicesLen = dataView.getUint32(offset, false);\n offset += 4;\n if (indicesLen === 0xffffffff) {\n primitive.indices = null;\n } else {\n if (dataView.byteLength < offset + indicesLen) throw new Error('Insufficient data for Indices content');\n primitive.indices = uint8Array.subarray(offset, offset + indicesLen);\n offset += indicesLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Posindex length');\n var posindexLen = dataView.getUint32(offset, false);\n offset += 4;\n if (posindexLen === 0xffffffff) {\n primitive.posindex = null;\n } else {\n if (dataView.byteLength < offset + posindexLen) throw new Error('Insufficient data for Posindex content');\n primitive.posindex = uint8Array.subarray(offset, offset + posindexLen);\n offset += posindexLen;\n }\n }\n if (isFullProps) {\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Nolindex length');\n var nolindexLen = dataView.getUint32(offset, false);\n offset += 4;\n if (nolindexLen === 0xffffffff) {\n primitive.nolindex = null;\n } else {\n if (dataView.byteLength < offset + nolindexLen) throw new Error('Insufficient data for Nolindex content');\n primitive.nolindex = uint8Array.subarray(offset, offset + nolindexLen);\n offset += nolindexLen;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for DataType length');\n var dataTypeLen = dataView.getUint32(offset, false);\n offset += 4;\n if (dataTypeLen === 0xffffffff) {\n primitive.dataType = null;\n } else if (dataTypeLen > 0) {\n if (dataView.byteLength < offset + dataTypeLen) throw new Error('Insufficient data for DataType content');\n var _textBytes2 = uint8Array.subarray(offset, offset + dataTypeLen);\n primitive.dataType = utf8Decoder.decode(_textBytes2);\n offset += dataTypeLen;\n } else {\n primitive.dataType = '';\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Min count');\n var minCount = dataView.getUint32(offset, false);\n offset += 4;\n if (minCount === 0xffffffff) {\n primitive.min = null;\n } else {\n if (dataView.byteLength < offset + minCount * 8) throw new Error('Insufficient data for Min values');\n primitive.min = [];\n for (var i = 0; i < minCount; i++) {\n primitive.min.push(dataView.getFloat64(offset, false));\n offset += 8;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for Max count');\n var maxCount = dataView.getUint32(offset, false);\n offset += 4;\n if (maxCount === 0xffffffff) {\n primitive.max = null;\n } else {\n if (dataView.byteLength < offset + maxCount * 8) throw new Error('Insufficient data for Max values');\n primitive.max = [];\n for (var _i = 0; _i < maxCount; _i++) {\n primitive.max.push(dataView.getFloat64(offset, false));\n offset += 8;\n }\n }\n if (dataView.byteLength < offset + 4) throw new Error('Insufficient data for GeomType');\n primitive.geomType = dataView.getInt32(offset, false);\n offset += 4;\n return {\n primitive: primitive,\n offset: offset\n };\n}\nfunction parsePrimitiveData(primitive) {\n var keyOrder = ['position', 'normal', 'indices', 'posindex', 'nolindex'];\n var typeMap = {\n 0: {\n bytes: 4,\n getter: 'getFloat32'\n },\n 1: {\n bytes: 4,\n getter: 'getInt32'\n },\n 2: {\n bytes: 2,\n getter: 'getInt16'\n }\n };\n var parsedResult = {};\n var dataTypeString = primitive.dataType;\n for (var i = 0; i < keyOrder.length; i++) {\n var key = keyOrder[i];\n var typeCode = dataTypeString[i];\n var typeInfo = typeMap[typeCode];\n var uint8Array = primitive.isCompressed === 1 || primitive.isCompressed === undefined ? gunzipSync(primitive[key]) : primitive[key];\n if (!typeInfo || !uint8Array) {\n // console.warn(`无法找到键 \"${key}\" 或其类型定义,已跳过。`);\n parsedResult[key] = [];\n continue;\n }\n var result_array = [];\n var dataView = new DataView(uint8Array.buffer, uint8Array.byteOffset, uint8Array.byteLength);\n var littleEndian = true;\n for (var byteOffset = 0; byteOffset < dataView.byteLength; byteOffset += typeInfo.bytes) {\n if (byteOffset + typeInfo.bytes > dataView.byteLength) {\n console.warn(\"\\u952E \\\"\".concat(key, \"\\\" \\u7684\\u6570\\u636E\\u957F\\u5EA6 (\").concat(dataView.byteLength, \") \\u4E0D\\u662F\\u5176\\u7C7B\\u578B (\").concat(typeInfo.bytes, \"\\u5B57\\u8282) \\u7684\\u6574\\u6570\\u500D\\uFF0C\\u672B\\u5C3E\\u6570\\u636E\\u53EF\\u80FD\\u4E0D\\u5B8C\\u6574\\u3002\"));\n break;\n }\n var value = dataView[typeInfo.getter](byteOffset, littleEndian);\n result_array.push(value);\n }\n parsedResult[key] = result_array;\n }\n return parsedResult;\n}\nfunction formatPrimitiveData(primitive) {\n var position = primitive.position,\n normal = primitive.normal,\n posindex = primitive.posindex,\n nolindex = primitive.nolindex;\n var restoredPosition = new Array(posindex.length);\n var restoredNormal = new Array(nolindex.length);\n for (var i = 0; i < posindex.length; i++) {\n var posIndex = posindex[i];\n restoredPosition[i] = position[posIndex];\n }\n for (var _i2 = 0; _i2 < nolindex.length; _i2++) {\n var normalIndex = nolindex[_i2];\n restoredNormal[_i2] = normal[normalIndex];\n }\n primitive.position = null;\n primitive.normal = null;\n primitive.posindex = null;\n primitive.nolindex = null;\n return {\n position: restoredPosition,\n normal: restoredNormal\n };\n}\nfunction buildInstancedMapping(instances, drawObjs) {\n var drawObjMapInstance = {};\n var instanceToDrawObject = [];\n var meshByPrimId = new Map();\n for (var i = 0; i < drawObjs.length; i++) {\n var item = drawObjs[i];\n if (!item || !Array.isArray(item.geoms)) continue;\n var geoms = item.geoms;\n for (var j = 0; j < geoms.length; j++) {\n var geom = geoms[j];\n if (geom && geom.prmid !== undefined && geom.prmid !== null) {\n meshByPrimId.set(geom.prmid, geoms);\n }\n }\n }\n var seenByDrawObject = new Map();\n for (var _i3 = 0; _i3 < instances.length; _i3++) {\n var instance = instances[_i3];\n if (!instance) continue;\n var drawObject = instance.drawObject;\n if (!drawObject) continue;\n instanceToDrawObject.push({\n instanceId: instance.instanceId,\n drawObjectId: drawObject\n });\n var record = drawObjMapInstance[drawObject];\n if (!record) {\n record = {\n MapInstance: [],\n MapMesh: meshByPrimId.get(drawObject)\n };\n drawObjMapInstance[drawObject] = record;\n seenByDrawObject.set(drawObject, new Set());\n }\n var seen = seenByDrawObject.get(drawObject);\n if (!seen.has(instance.instanceId)) {\n record.MapInstance.push(instance);\n seen.add(instance.instanceId);\n }\n }\n return {\n drawObjMapInstance: drawObjMapInstance,\n instanceToDrawObject: instanceToDrawObject\n };\n}\nfunction scanOcclusionBuffer(buffer, sw, sh, stride, maxIdx, minSampleCount) {\n var indices = [];\n if (!buffer || !sw || !sh || !maxIdx) return {\n indices: indices\n };\n var view = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);\n var step = Math.max(1, stride || 1);\n var minCount = Math.max(1, minSampleCount || 1);\n var counts = new Uint32Array(maxIdx + 1);\n for (var y = 0; y < sh; y += step) {\n var row = y * sw * 4;\n for (var x = 0; x < sw; x += step) {\n var p = row + x * 4;\n var idxColor = view[p] + (view[p + 1] << 8) + (view[p + 2] << 16);\n if (idxColor > 0 && idxColor <= maxIdx) {\n var next = counts[idxColor] + 1;\n counts[idxColor] = next;\n if (next === minCount) {\n indices.push(idxColor);\n }\n }\n }\n }\n return {\n indices: indices\n };\n}\n\n/***/ })\n\n/******/ });\n", "Worker", undefined, undefined);
111435
111432
  }
111436
111433
 
111437
111434
  // CONCATENATED MODULE: ./src/utils/instance-parser.js
@@ -111552,37 +111549,9 @@ function getInstanceNormalSign(matrix) {
111552
111549
  if (!matrix || typeof matrix.determinant !== 'function') return 1;
111553
111550
  return matrix.determinant() < 0 ? -1 : 1;
111554
111551
  }
111555
- function getMatrixVal(matrix) {
111556
- var val = matrix && matrix.val ? matrix.val : matrix;
111557
- return val && val.length >= 16 ? val : null;
111558
- }
111559
- function composeInstanceMatrix(instance, mesh, geometry) {
111560
- var resultMatrix = new Matrix4();
111561
- var meshMatrix = new Matrix4();
111562
- var primitiveMatrix = new Matrix4();
111563
- var meshMatrixVal = getMatrixVal(instance && instance.matrix);
111564
- var primitiveMatrixVal = getMatrixVal(mesh && mesh.matrix);
111565
- if (meshMatrixVal) {
111566
- meshMatrix.fromArray(meshMatrixVal);
111567
- }
111568
- if (primitiveMatrixVal) {
111569
- primitiveMatrix.fromArray(primitiveMatrixVal);
111570
- }
111571
- var _ref = mesh || {},
111572
- points = _ref.points,
111573
- alignType = _ref.alignType;
111574
- if (mesh && isTextType(mesh.type) && points && points.length >= 3) {
111575
- var positionMatrix = new Matrix4();
111576
- var alignMatrix = createAlignedText(alignType, geometry);
111577
- positionMatrix.identity().makeTranslation(points[0], points[1], points[2]);
111578
- primitiveMatrix.multiply(alignMatrix).multiply(positionMatrix);
111579
- }
111580
- resultMatrix.multiplyMatrices(meshMatrix, primitiveMatrix);
111581
- return resultMatrix;
111582
- }
111583
111552
 
111584
- /**
111585
- * 重置处理状态,用于新的批量加载会话
111553
+ /**
111554
+ * 重置处理状态,用于新的批量加载会话
111586
111555
  */
111587
111556
  function resetProcessingState() {
111588
111557
  drawObjMapInstance = {};
@@ -111892,6 +111861,7 @@ function setInstanceMatricesAndColors(model, drawObj, mesh, meshName, customColo
111892
111861
 
111893
111862
  // 批量处理实例
111894
111863
  instances.forEach(function (item, index) {
111864
+ var _item$matrix;
111895
111865
  // 设置用户数据
111896
111866
  model.userData.instanceIndex = index;
111897
111867
  model.userData.instanceId = item.instanceId;
@@ -111920,19 +111890,38 @@ function setInstanceMatricesAndColors(model, drawObj, mesh, meshName, customColo
111920
111890
 
111921
111891
  // const instancedMesh = instanceToInstancedMeshMap.get(item.instanceId);
111922
111892
 
111923
- var m4 = composeInstanceMatrix(item, mesh, model.geometry);
111924
- model.setMatrixAt(index, m4);
111925
- var normalSignAttr = model.geometry && model.geometry.getAttribute('instanceNormalSign');
111926
- if (normalSignAttr && normalSignAttr.array && index < normalSignAttr.array.length) {
111927
- normalSignAttr.array[index] = getInstanceNormalSign(m4);
111928
- }
111929
- var copyMatrix = new Matrix4().copy(m4);
111930
- model.userData.copyMatrix = copyMatrix;
111931
- var temp = model.userData.instancesMap.get(item.instanceId);
111932
- temp.copyMatrix = copyMatrix;
111933
- if (sourceVisible === false) {
111934
- var offsetMatrix = new Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
111935
- model.setMatrixAt(index, offsetMatrix);
111893
+ // 处理矩阵变换
111894
+ var matrixVal = (_item$matrix = item.matrix) === null || _item$matrix === void 0 ? void 0 : _item$matrix.val;
111895
+ if (matrixVal) {
111896
+ var m4 = new Matrix4();
111897
+ var meshMatrix = new Matrix4();
111898
+ var geomMatrix = new Matrix4();
111899
+ meshMatrix.fromArray(matrixVal);
111900
+ geomMatrix.fromArray(new Matrix4().identity().elements);
111901
+
111902
+ // 处理文本居中对齐
111903
+ var points = mesh.points,
111904
+ alignType = mesh.alignType;
111905
+ if (isTextType(mesh.type)) {
111906
+ var positionMatrix = new Matrix4();
111907
+ var alignMatrix = createAlignedText(alignType, model.geometry);
111908
+ positionMatrix.identity().makeTranslation(points[0], points[1], points[2]);
111909
+ geomMatrix.multiply(alignMatrix).multiply(positionMatrix);
111910
+ }
111911
+ m4.multiplyMatrices(meshMatrix, geomMatrix);
111912
+ model.setMatrixAt(index, m4);
111913
+ var _normalSignAttr = model.geometry && model.geometry.getAttribute('instanceNormalSign');
111914
+ if (_normalSignAttr && _normalSignAttr.array && index < _normalSignAttr.array.length) {
111915
+ _normalSignAttr.array[index] = getInstanceNormalSign(m4);
111916
+ }
111917
+ var copyMatrix = new Matrix4().copy(m4);
111918
+ model.userData.copyMatrix = copyMatrix;
111919
+ var temp = model.userData.instancesMap.get(item.instanceId);
111920
+ temp.copyMatrix = copyMatrix;
111921
+ if (sourceVisible === false) {
111922
+ var offsetMatrix = new Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
111923
+ model.setMatrixAt(index, offsetMatrix);
111924
+ }
111936
111925
  }
111937
111926
 
111938
111927
  // 设置颜色
@@ -111978,6 +111967,7 @@ function appendInstanceToInstancedGroup(group, drawObj, instance, customColor) {
111978
111967
  }
111979
111968
  }
111980
111969
  function appendInstanceToInstancedMesh(model, drawObj, mesh, instance, customColor) {
111970
+ var _instance$matrix;
111981
111971
  if (!model || !model.isInstancedMesh) return;
111982
111972
  if (!instance || !instance.instanceId) return;
111983
111973
  var capacity = model.instanceMatrix && typeof model.instanceMatrix.count === 'number' ? model.instanceMatrix.count : model.count;
@@ -111990,8 +111980,22 @@ function appendInstanceToInstancedMesh(model, drawObj, mesh, instance, customCol
111990
111980
  var sourceVisible = mesh && mesh.prop && mesh.prop.sourceVisible === false ? false : true;
111991
111981
  var colorArr = Array.isArray(rawColor) ? rawColor : typeof rawColor === 'string' ? rawColor.split(',') : [255, 255, 255];
111992
111982
  var meshColor = customColor ? new Color(customColor) : new Color("rgb(".concat(colorArr[0], ", ").concat(colorArr[1], ", ").concat(colorArr[2], ")"));
111993
- if (!mesh) return;
111994
- var m4 = composeInstanceMatrix(instance, mesh, model.geometry);
111983
+ var matrixVal = (_instance$matrix = instance.matrix) === null || _instance$matrix === void 0 ? void 0 : _instance$matrix.val;
111984
+ if (!matrixVal || !mesh || !mesh.matrix || !mesh.matrix.val) return;
111985
+ var m4 = new Matrix4();
111986
+ var meshMatrix = new Matrix4();
111987
+ var geomMatrix = new Matrix4();
111988
+ meshMatrix.fromArray(instance.matrix.val);
111989
+ geomMatrix.fromArray(new Matrix4().identity().elements);
111990
+ var points = mesh.points,
111991
+ alignType = mesh.alignType;
111992
+ if (isTextType(mesh.type)) {
111993
+ var positionMatrix = new Matrix4();
111994
+ var alignMatrix = createAlignedText(alignType, model.geometry);
111995
+ positionMatrix.identity().makeTranslation(points[0], points[1], points[2]);
111996
+ geomMatrix.multiply(alignMatrix).multiply(positionMatrix);
111997
+ }
111998
+ m4.multiplyMatrices(meshMatrix, geomMatrix);
111995
111999
  var renderMatrix = sourceVisible === false ? new Matrix4().copy(m4).makeTranslation(9999999, 9999999, 9999999) : m4;
111996
112000
  model.setMatrixAt(currentCount, renderMatrix);
111997
112001
  if (model.instanceMatrix) model.instanceMatrix.needsUpdate = true;
@@ -112095,13 +112099,13 @@ function drawModel(geom, instanceName, instanceCount, nColor, nOpacity) {
112095
112099
  var model;
112096
112100
  // 处理二维几何体(普通2D图形和特殊2D图形)
112097
112101
  if (geom.type == GEOM_TYPES.geom_2d || geom.type == GEOM_TYPES.geom_2d_others) {
112098
- model = draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity, options); // TODO 该类型调试中
112102
+ model = draw2Dmodel(geom, instanceName, instanceCount, options); // TODO 该类型调试中
112099
112103
  // 处理二维文本类型
112100
112104
  } else if (isTextType(geom.type)) {
112101
112105
  model = drawText(geom, instanceName, instanceCount, options);
112102
112106
  // 处理各种曲线类型(圆形、圆弧、椭圆、椭圆弧)
112103
112107
  } else if (geom.type == GEOM_TYPES.geom_2d_circle || geom.type == GEOM_TYPES.geom_2d_arc || geom.type == GEOM_TYPES.geom_2d_ellipse || geom.type == GEOM_TYPES.geom_2d_ellipseArc) {
112104
- model = drawCurves(geom, instanceName, instanceCount, nColor, nOpacity, options); // TODO 该类型调试中
112108
+ model = drawCurves(geom, instanceName, instanceCount, options); // TODO 该类型调试中
112105
112109
  // 处理三维几何体(普通3D模型和OBJ模型)
112106
112110
  } else if (geom.type == GEOM_TYPES.geom_3d || geom.type == GEOM_TYPES.geom_3d_obj) {
112107
112111
  model = draw3Dmodel(geom, instanceName, instanceCount, nColor, nOpacity, options);
@@ -112125,8 +112129,8 @@ function isTextType(type) {
112125
112129
  * @param {String} instanceName- 曲线实例的名称
112126
112130
  * @return {Object}- 包含曲线模型和曲线信息的对象
112127
112131
  */
112128
- function drawCurves(geom, instanceName, instanceCount, nColor, nOpacity) {
112129
- var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
112132
+ function drawCurves(geom, instanceName, instanceCount) {
112133
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
112130
112134
  var points = geom.points,
112131
112135
  normals = geom.normals;
112132
112136
  var aX = points[0];
@@ -112156,7 +112160,7 @@ function drawCurves(geom, instanceName, instanceCount, nColor, nOpacity) {
112156
112160
  var model = draw2Dmodel(instance_parser_objectSpread(instance_parser_objectSpread({}, geom), {}, {
112157
112161
  points: list,
112158
112162
  normals: normals
112159
- }), instanceName, instanceCount, nColor, nOpacity, options);
112163
+ }), instanceName, instanceCount, options);
112160
112164
  // model.rotation.x = -Math.PI / 2;
112161
112165
  // model.position.set(aX, aY, aZ);
112162
112166
  var matrix = new Matrix4();
@@ -112329,7 +112333,7 @@ function draw3Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112329
112333
 
112330
112334
  // 处理transparent透明度
112331
112335
  opacity = 1 - transparent;
112332
- var finalOpacity = nOpacity !== undefined && nOpacity !== null && nOpacity !== '' ? nOpacity : opacity;
112336
+ var finalOpacity = nOpacity !== '' ? nOpacity : opacity;
112333
112337
 
112334
112338
  // 判断是否全透明
112335
112339
  var isTransparent = finalOpacity < 1.0;
@@ -112406,8 +112410,8 @@ function draw3Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112406
112410
  * @param {String} instanceName - 模型实例的名称
112407
112411
  * @returns {Object} - 包含所有 2D 模型的组对象
112408
112412
  */
112409
- function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112410
- var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
112413
+ function draw2Dmodel(geom, instanceName, instanceCount) {
112414
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
112411
112415
  var points = geom.points;
112412
112416
  var normals = geom.normals;
112413
112417
  var geometry = new BufferGeometry();
@@ -112433,7 +112437,7 @@ function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112433
112437
  prop: geom.prop,
112434
112438
  geometry: lineGeometry,
112435
112439
  material: material
112436
- }, instanceName, instanceCount, nColor, nOpacity, options);
112440
+ }, instanceName, instanceCount, options);
112437
112441
  // mesh.raycast = raycast;
112438
112442
 
112439
112443
  model.userData.instanceName = instanceName;
@@ -114524,14 +114528,17 @@ _Stats.Panel = function (name, fg, bg) {
114524
114528
  };
114525
114529
  };
114526
114530
  /* harmony default export */ var stats_module = (_Stats);
114531
+ // EXTERNAL MODULE: ./packages/components/com-graphics/box.json
114532
+ var com_graphics_box = __webpack_require__("cbf5");
114533
+
114527
114534
  // EXTERNAL MODULE: ./node_modules/fflate/esm/browser.js
114528
114535
  var browser = __webpack_require__("72ba");
114529
114536
 
114530
114537
  // CONCATENATED MODULE: ./packages/utils/StreamLoader.js
114538
+ function StreamLoader_typeof(o) { "@babel/helpers - typeof"; return StreamLoader_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, StreamLoader_typeof(o); }
114531
114539
  function StreamLoader_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
114532
114540
  function StreamLoader_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? StreamLoader_ownKeys(Object(t), !0).forEach(function (r) { StreamLoader_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : StreamLoader_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
114533
114541
  function StreamLoader_defineProperty(e, r, t) { return (r = StreamLoader_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
114534
- function StreamLoader_typeof(o) { "@babel/helpers - typeof"; return StreamLoader_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, StreamLoader_typeof(o); }
114535
114542
  function StreamLoader_toConsumableArray(r) { return StreamLoader_arrayWithoutHoles(r) || StreamLoader_iterableToArray(r) || StreamLoader_unsupportedIterableToArray(r) || StreamLoader_nonIterableSpread(); }
114536
114543
  function StreamLoader_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
114537
114544
  function StreamLoader_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return StreamLoader_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? StreamLoader_arrayLikeToArray(r, a) : void 0; } }
@@ -114722,16 +114729,15 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114722
114729
  }, {
114723
114730
  key: "parseStreamImmediate",
114724
114731
  value: function () {
114725
- var _parseStreamImmediate = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee4(reader, list, range) {
114732
+ var _parseStreamImmediate = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee3(reader, list, range) {
114726
114733
  var _this4 = this;
114727
114734
  var abortSignal,
114728
114735
  streamId,
114729
114736
  batchMeshes,
114730
- batchPrimitiveGroups,
114737
+ batchPrimitives,
114731
114738
  batchSize,
114732
114739
  batchStart,
114733
114740
  streamStats,
114734
- flattenPrimitiveGroups,
114735
114741
  processStreamBatch,
114736
114742
  ensureNotAborted,
114737
114743
  localStreamId,
@@ -114749,52 +114755,63 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114749
114755
  abortPromiseInBatch,
114750
114756
  interactionPromiseInBatch,
114751
114757
  meshesToProcess,
114752
- primitiveGroupsToProcess,
114758
+ primitivesToProcess,
114753
114759
  _abortPromiseInBatch,
114754
114760
  _interactionPromiseInBatch,
114755
114761
  _meshesToProcess,
114756
- _primitiveGroupsToProcess,
114762
+ _primitivesToProcess,
114757
114763
  transferable,
114758
114764
  parsed,
114759
114765
  _abortPromiseInBatch2,
114760
114766
  _interactionPromiseInBatch2,
114761
114767
  _meshesToProcess2,
114762
- _primitiveGroupsToProcess2,
114768
+ _primitivesToProcess2,
114763
114769
  decoder,
114764
114770
  buffer,
114765
- expectingMesh,
114766
- pendingMesh,
114767
- pendingPrimitiveIds,
114768
- pendingPrimitiveGroups,
114769
- pendingMatchedPrimitiveIds,
114771
+ pendingPrimitives,
114772
+ expectingPrimitive,
114770
114773
  isFullProps,
114771
- normalizeMesh,
114772
- collectMeshPrimitiveIds,
114773
- isValidStreamMesh,
114774
- tryParseMeshFromBuffer,
114775
- parsePrimitiveFromBuffer,
114776
- commitPendingMesh,
114777
114774
  _content2,
114778
114775
  _content3,
114779
114776
  _done,
114780
114777
  _value,
114781
114778
  newBuf,
114782
- meshResult,
114783
- nextMeshResult,
114779
+ dataView,
114784
114780
  primitiveResult,
114785
114781
  primitiveData,
114786
- _args4 = arguments,
114782
+ consumedBytes,
114783
+ _this$parsePrimitiveD,
114784
+ position,
114785
+ normal,
114786
+ posindex,
114787
+ nolindex,
114788
+ indices,
114789
+ formatted,
114790
+ docId,
114791
+ length,
114792
+ totalLen,
114793
+ data,
114794
+ mesh,
114795
+ jsonStr,
114796
+ _docId,
114797
+ meshToPrimId,
114798
+ hasPendingPrimitive,
114799
+ hasPendingMesh,
114800
+ _primitiveData,
114801
+ primId,
114802
+ _args3 = arguments,
114787
114803
  _t,
114788
114804
  _t2,
114789
114805
  _t3,
114790
- _t4;
114791
- return StreamLoader_regenerator().w(function (_context4) {
114792
- while (1) switch (_context4.p = _context4.n) {
114806
+ _t4,
114807
+ _t5;
114808
+ return StreamLoader_regenerator().w(function (_context3) {
114809
+ while (1) switch (_context3.p = _context3.n) {
114793
114810
  case 0:
114794
- abortSignal = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : null;
114795
- streamId = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : null;
114811
+ abortSignal = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : null;
114812
+ streamId = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : null;
114796
114813
  batchMeshes = [];
114797
- batchPrimitiveGroups = [];
114814
+ batchPrimitives = [];
114798
114815
  batchSize = this.batchSize;
114799
114816
  batchStart = 0;
114800
114817
  streamStats = {
@@ -114802,28 +114819,8 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114802
114819
  totalMeshes: 0,
114803
114820
  totalPrimitives: 0
114804
114821
  };
114805
- flattenPrimitiveGroups = function flattenPrimitiveGroups(primitiveGroups) {
114806
- if (!primitiveGroups || primitiveGroups.length === 0) return [];
114807
- var primitivesToProcess = [];
114808
- var usedIds = new Set();
114809
- primitiveGroups.forEach(function (group) {
114810
- var primitives = Array.isArray(group) ? group : [group];
114811
- primitives.forEach(function (primitive) {
114812
- if (!primitive) return;
114813
- if (primitive.id == null) {
114814
- primitivesToProcess.push(primitive);
114815
- return;
114816
- }
114817
- if (usedIds.has(primitive.id)) return;
114818
- usedIds.add(primitive.id);
114819
- primitivesToProcess.push(primitive);
114820
- });
114821
- });
114822
- return primitivesToProcess;
114823
- };
114824
114822
  processStreamBatch = /*#__PURE__*/function () {
114825
- var _ref2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee2(meshesToProcess, primitiveGroupsToProcess) {
114826
- var primitivesToProcess;
114823
+ var _ref2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee2(meshesToProcess, primitivesToProcess) {
114827
114824
  return StreamLoader_regenerator().w(function (_context2) {
114828
114825
  while (1) switch (_context2.n) {
114829
114826
  case 0:
@@ -114833,7 +114830,6 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114833
114830
  }
114834
114831
  return _context2.a(2);
114835
114832
  case 1:
114836
- primitivesToProcess = flattenPrimitiveGroups(primitiveGroupsToProcess);
114837
114833
  _context2.n = 2;
114838
114834
  return _this4.processBatchData(meshesToProcess, primitivesToProcess, list, range, abortSignal);
114839
114835
  case 2:
@@ -114857,7 +114853,7 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114857
114853
  return null;
114858
114854
  };
114859
114855
  if (!this.worker) {
114860
- _context4.n = 33;
114856
+ _context3.n = 33;
114861
114857
  break;
114862
114858
  }
114863
114859
  localStreamId = streamId || this.createStreamRequestId();
@@ -114865,45 +114861,45 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114865
114861
  if (!_this4.externalEnsureNotInteracting && !_this4.isUserInteracting) return null;
114866
114862
  return _this4.ensureNotInteracting(abortSignal);
114867
114863
  };
114868
- _context4.n = 1;
114864
+ _context3.n = 1;
114869
114865
  return this.workerRequest('streamInit', {
114870
114866
  streamId: localStreamId,
114871
114867
  prefixIdKey: this.prefixIdKey
114872
114868
  });
114873
114869
  case 1:
114874
- _context4.p = 1;
114870
+ _context3.p = 1;
114875
114871
  if (this.debug) performance.mark('while-start');
114876
114872
  case 2:
114877
114873
  if (false) {}
114878
114874
  abortPromise = ensureNotAborted();
114879
114875
  if (!abortPromise) {
114880
- _context4.n = 3;
114876
+ _context3.n = 3;
114881
114877
  break;
114882
114878
  }
114883
- _context4.n = 3;
114879
+ _context3.n = 3;
114884
114880
  return abortPromise;
114885
114881
  case 3:
114886
114882
  interactionPromise = ensureNotInteracting();
114887
114883
  if (!interactionPromise) {
114888
- _context4.n = 4;
114884
+ _context3.n = 4;
114889
114885
  break;
114890
114886
  }
114891
- _context4.n = 4;
114887
+ _context3.n = 4;
114892
114888
  return interactionPromise;
114893
114889
  case 4:
114894
114890
  content = void 0;
114895
- _context4.p = 5;
114896
- _context4.n = 6;
114891
+ _context3.p = 5;
114892
+ _context3.n = 6;
114897
114893
  return reader.read();
114898
114894
  case 6:
114899
- content = _context4.v;
114900
- _context4.n = 9;
114895
+ content = _context3.v;
114896
+ _context3.n = 9;
114901
114897
  break;
114902
114898
  case 7:
114903
- _context4.p = 7;
114904
- _t = _context4.v;
114899
+ _context3.p = 7;
114900
+ _t = _context3.v;
114905
114901
  if (!(_t && _t.name === 'AbortError')) {
114906
- _context4.n = 8;
114902
+ _context3.n = 8;
114907
114903
  break;
114908
114904
  }
114909
114905
  throw _t;
@@ -114912,91 +114908,91 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
114912
114908
  case 9:
114913
114909
  _content = content, done = _content.done, value = _content.value;
114914
114910
  if (!done) {
114915
- _context4.n = 20;
114911
+ _context3.n = 20;
114916
114912
  break;
114917
114913
  }
114918
114914
  abortPromiseOnDone = ensureNotAborted();
114919
114915
  if (!abortPromiseOnDone) {
114920
- _context4.n = 10;
114916
+ _context3.n = 10;
114921
114917
  break;
114922
114918
  }
114923
- _context4.n = 10;
114919
+ _context3.n = 10;
114924
114920
  return abortPromiseOnDone;
114925
114921
  case 10:
114926
114922
  if (this.debug) {
114927
114923
  performance.mark('while-end');
114928
114924
  performance.measure('while', 'while-start', 'while-end');
114929
114925
  }
114930
- _context4.n = 11;
114926
+ _context3.n = 11;
114931
114927
  return this.workerRequest('streamFlush', {
114932
114928
  streamId: localStreamId
114933
114929
  });
114934
114930
  case 11:
114935
- flushed = _context4.v;
114931
+ flushed = _context3.v;
114936
114932
  if (flushed !== null && flushed !== void 0 && (_flushed$meshes = flushed.meshes) !== null && _flushed$meshes !== void 0 && _flushed$meshes.length) {
114937
114933
  batchMeshes.push.apply(batchMeshes, StreamLoader_toConsumableArray(flushed.meshes));
114938
- batchPrimitiveGroups.push.apply(batchPrimitiveGroups, StreamLoader_toConsumableArray(flushed.primitives));
114934
+ batchPrimitives.push.apply(batchPrimitives, StreamLoader_toConsumableArray(flushed.primitives));
114939
114935
  }
114940
114936
  case 12:
114941
114937
  if (!(batchMeshes.length - batchStart >= batchSize)) {
114942
- _context4.n = 16;
114938
+ _context3.n = 16;
114943
114939
  break;
114944
114940
  }
114945
114941
  abortPromiseInBatch = ensureNotAborted();
114946
114942
  if (!abortPromiseInBatch) {
114947
- _context4.n = 13;
114943
+ _context3.n = 13;
114948
114944
  break;
114949
114945
  }
114950
- _context4.n = 13;
114946
+ _context3.n = 13;
114951
114947
  return abortPromiseInBatch;
114952
114948
  case 13:
114953
114949
  interactionPromiseInBatch = ensureNotInteracting();
114954
114950
  if (!interactionPromiseInBatch) {
114955
- _context4.n = 14;
114951
+ _context3.n = 14;
114956
114952
  break;
114957
114953
  }
114958
- _context4.n = 14;
114954
+ _context3.n = 14;
114959
114955
  return interactionPromiseInBatch;
114960
114956
  case 14:
114961
114957
  meshesToProcess = batchMeshes.slice(batchStart, batchStart + batchSize);
114962
- primitiveGroupsToProcess = batchPrimitiveGroups.slice(batchStart, batchStart + batchSize);
114958
+ primitivesToProcess = batchPrimitives.slice(batchStart, batchStart + batchSize);
114963
114959
  batchStart += batchSize;
114964
- _context4.n = 15;
114965
- return processStreamBatch(meshesToProcess, primitiveGroupsToProcess);
114960
+ _context3.n = 15;
114961
+ return processStreamBatch(meshesToProcess, primitivesToProcess);
114966
114962
  case 15:
114967
- _context4.n = 12;
114963
+ _context3.n = 12;
114968
114964
  break;
114969
114965
  case 16:
114970
114966
  if (!(batchMeshes.length - batchStart > 0)) {
114971
- _context4.n = 19;
114967
+ _context3.n = 19;
114972
114968
  break;
114973
114969
  }
114974
114970
  _abortPromiseInBatch = ensureNotAborted();
114975
114971
  if (!_abortPromiseInBatch) {
114976
- _context4.n = 17;
114972
+ _context3.n = 17;
114977
114973
  break;
114978
114974
  }
114979
- _context4.n = 17;
114975
+ _context3.n = 17;
114980
114976
  return _abortPromiseInBatch;
114981
114977
  case 17:
114982
114978
  _interactionPromiseInBatch = ensureNotInteracting();
114983
114979
  if (!_interactionPromiseInBatch) {
114984
- _context4.n = 18;
114980
+ _context3.n = 18;
114985
114981
  break;
114986
114982
  }
114987
- _context4.n = 18;
114983
+ _context3.n = 18;
114988
114984
  return _interactionPromiseInBatch;
114989
114985
  case 18:
114990
114986
  _meshesToProcess = batchMeshes.slice(batchStart);
114991
- _primitiveGroupsToProcess = batchPrimitiveGroups.slice(batchStart);
114987
+ _primitivesToProcess = batchPrimitives.slice(batchStart);
114992
114988
  batchStart = batchMeshes.length;
114993
- _context4.n = 19;
114994
- return processStreamBatch(_meshesToProcess, _primitiveGroupsToProcess);
114989
+ _context3.n = 19;
114990
+ return processStreamBatch(_meshesToProcess, _primitivesToProcess);
114995
114991
  case 19:
114996
- return _context4.a(3, 27);
114992
+ return _context3.a(3, 27);
114997
114993
  case 20:
114998
114994
  transferable = (value === null || value === void 0 ? void 0 : value.buffer) instanceof ArrayBuffer ? [value.buffer] : [];
114999
- _context4.n = 21;
114995
+ _context3.n = 21;
115000
114996
  return this.workerRequest('streamPush', {
115001
114997
  streamId: localStreamId,
115002
114998
  chunk: value.buffer,
@@ -115004,240 +115000,92 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115004
115000
  byteLength: value.byteLength
115005
115001
  }, transferable);
115006
115002
  case 21:
115007
- parsed = _context4.v;
115003
+ parsed = _context3.v;
115008
115004
  if (parsed !== null && parsed !== void 0 && (_parsed$meshes = parsed.meshes) !== null && _parsed$meshes !== void 0 && _parsed$meshes.length) {
115009
115005
  batchMeshes.push.apply(batchMeshes, StreamLoader_toConsumableArray(parsed.meshes));
115010
- batchPrimitiveGroups.push.apply(batchPrimitiveGroups, StreamLoader_toConsumableArray(parsed.primitives));
115006
+ batchPrimitives.push.apply(batchPrimitives, StreamLoader_toConsumableArray(parsed.primitives));
115011
115007
  }
115012
115008
  case 22:
115013
115009
  if (!(batchMeshes.length - batchStart >= batchSize)) {
115014
- _context4.n = 26;
115010
+ _context3.n = 26;
115015
115011
  break;
115016
115012
  }
115017
115013
  _abortPromiseInBatch2 = ensureNotAborted();
115018
115014
  if (!_abortPromiseInBatch2) {
115019
- _context4.n = 23;
115015
+ _context3.n = 23;
115020
115016
  break;
115021
115017
  }
115022
- _context4.n = 23;
115018
+ _context3.n = 23;
115023
115019
  return _abortPromiseInBatch2;
115024
115020
  case 23:
115025
115021
  _interactionPromiseInBatch2 = ensureNotInteracting();
115026
115022
  if (!_interactionPromiseInBatch2) {
115027
- _context4.n = 24;
115023
+ _context3.n = 24;
115028
115024
  break;
115029
115025
  }
115030
- _context4.n = 24;
115026
+ _context3.n = 24;
115031
115027
  return _interactionPromiseInBatch2;
115032
115028
  case 24:
115033
115029
  _meshesToProcess2 = batchMeshes.slice(batchStart, batchStart + batchSize);
115034
- _primitiveGroupsToProcess2 = batchPrimitiveGroups.slice(batchStart, batchStart + batchSize);
115030
+ _primitivesToProcess2 = batchPrimitives.slice(batchStart, batchStart + batchSize);
115035
115031
  batchStart += batchSize;
115036
- _context4.n = 25;
115037
- return processStreamBatch(_meshesToProcess2, _primitiveGroupsToProcess2);
115032
+ _context3.n = 25;
115033
+ return processStreamBatch(_meshesToProcess2, _primitivesToProcess2);
115038
115034
  case 25:
115039
- _context4.n = 22;
115035
+ _context3.n = 22;
115040
115036
  break;
115041
115037
  case 26:
115042
115038
  if (batchStart >= batchSize * 4) {
115043
115039
  batchMeshes.splice(0, batchStart);
115044
- batchPrimitiveGroups.splice(0, batchStart);
115040
+ batchPrimitives.splice(0, batchStart);
115045
115041
  batchStart = 0;
115046
115042
  }
115047
- _context4.n = 2;
115043
+ _context3.n = 2;
115048
115044
  break;
115049
115045
  case 27:
115050
- _context4.p = 27;
115051
- _context4.p = 28;
115052
- _context4.n = 29;
115046
+ _context3.p = 27;
115047
+ _context3.p = 28;
115048
+ _context3.n = 29;
115053
115049
  return this.workerRequest('streamDispose', {
115054
115050
  streamId: localStreamId
115055
115051
  });
115056
115052
  case 29:
115057
- _context4.n = 31;
115053
+ _context3.n = 31;
115058
115054
  break;
115059
115055
  case 30:
115060
- _context4.p = 30;
115061
- _t2 = _context4.v;
115056
+ _context3.p = 30;
115057
+ _t2 = _context3.v;
115062
115058
  case 31:
115063
- return _context4.f(27);
115059
+ return _context3.f(27);
115064
115060
  case 32:
115065
- return _context4.a(2, streamStats);
115061
+ return _context3.a(2, streamStats);
115066
115062
  case 33:
115067
115063
  decoder = new TextDecoder('utf-8');
115068
115064
  buffer = new Uint8Array();
115069
- expectingMesh = true;
115070
- pendingMesh = null;
115071
- pendingPrimitiveIds = new Set();
115072
- pendingPrimitiveGroups = [];
115073
- pendingMatchedPrimitiveIds = new Set();
115065
+ pendingPrimitives = new Map();
115066
+ expectingPrimitive = true;
115074
115067
  isFullProps = true;
115075
- normalizeMesh = function normalizeMesh(mesh) {
115076
- _this4._applyPrefixId(mesh, 'id');
115077
- var meshList = Array.isArray(mesh) ? mesh : [mesh];
115078
- meshList.forEach(function (item) {
115079
- if (!item) return;
115080
- if (!Array.isArray(item.primitives)) {
115081
- item.primitives = [];
115082
- }
115083
- _this4._applyPrefixId(item.primitives, 'prmid', item.documentId);
115084
- });
115085
- return mesh;
115086
- };
115087
- collectMeshPrimitiveIds = function collectMeshPrimitiveIds(mesh) {
115088
- var ids = [];
115089
- var meshList = Array.isArray(mesh) ? mesh : [mesh];
115090
- meshList.forEach(function (item) {
115091
- if (!item || !Array.isArray(item.primitives)) return;
115092
- item.primitives.forEach(function (primitive) {
115093
- if (primitive && primitive.prmid != null) {
115094
- ids.push(primitive.prmid);
115095
- }
115096
- });
115097
- });
115098
- return ids;
115099
- };
115100
- isValidStreamMesh = function isValidStreamMesh(mesh) {
115101
- var meshList = Array.isArray(mesh) ? mesh : [mesh];
115102
- if (meshList.length === 0) return false;
115103
- return meshList.every(function (item) {
115104
- return item && StreamLoader_typeof(item) === 'object' && Array.isArray(item.primitives);
115105
- });
115106
- };
115107
- tryParseMeshFromBuffer = function tryParseMeshFromBuffer() {
115108
- if (buffer.length < 4) {
115109
- return {
115110
- status: 'incomplete'
115111
- };
115112
- }
115113
- var length = new DataView(buffer.buffer, buffer.byteOffset).getUint32(0, false);
115114
- if (length <= 0 || length > 10 * 1024 * 1024) {
115115
- return {
115116
- status: 'invalid'
115117
- };
115118
- }
115119
- var totalLen = 4 + length;
115120
- if (buffer.length < totalLen) {
115121
- return {
115122
- status: 'incomplete'
115123
- };
115124
- }
115125
- try {
115126
- var data = buffer.slice(4, totalLen);
115127
- var parsedMesh = JSON.parse(decoder.decode(data));
115128
- if (!isValidStreamMesh(parsedMesh)) {
115129
- return {
115130
- status: 'invalid'
115131
- };
115132
- }
115133
- var mesh = normalizeMesh(parsedMesh);
115134
- return {
115135
- status: 'success',
115136
- mesh: mesh,
115137
- totalLen: totalLen
115138
- };
115139
- } catch (e) {
115140
- return {
115141
- status: 'invalid'
115142
- };
115143
- }
115144
- };
115145
- parsePrimitiveFromBuffer = function parsePrimitiveFromBuffer() {
115146
- var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
115147
- var primitiveResult = _this4.parsePrimitive(dataView, buffer, 0, isFullProps);
115148
- var primitiveData = primitiveResult.primitive;
115149
- _this4._applyPrefixId(primitiveData, 'id');
115150
- _this4._applyPrefixId(primitiveData, 'material');
115151
- if (isFullProps) {
115152
- var _this4$parsePrimitive = _this4.parsePrimitiveData(primitiveData),
115153
- position = _this4$parsePrimitive.position,
115154
- normal = _this4$parsePrimitive.normal,
115155
- posindex = _this4$parsePrimitive.posindex,
115156
- nolindex = _this4$parsePrimitive.nolindex,
115157
- indices = _this4$parsePrimitive.indices;
115158
- var formatted = _this4.formatPrimitiveData({
115159
- position: position,
115160
- normal: normal,
115161
- posindex: posindex,
115162
- nolindex: nolindex
115163
- });
115164
- delete primitiveData.nolindex;
115165
- delete primitiveData.posindex;
115166
- primitiveData.position = formatted.position;
115167
- primitiveData.normal = formatted.normal;
115168
- primitiveData.indices = indices;
115169
- }
115170
- return {
115171
- primitive: primitiveData,
115172
- consumedBytes: primitiveResult.offset
115173
- };
115174
- };
115175
- commitPendingMesh = /*#__PURE__*/function () {
115176
- var _ref3 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee3() {
115177
- var meshList;
115178
- return StreamLoader_regenerator().w(function (_context3) {
115179
- while (1) switch (_context3.n) {
115180
- case 0:
115181
- if (pendingMesh) {
115182
- _context3.n = 1;
115183
- break;
115184
- }
115185
- return _context3.a(2);
115186
- case 1:
115187
- meshList = Array.isArray(pendingMesh) ? pendingMesh : [pendingMesh];
115188
- meshList.forEach(function (mesh) {
115189
- batchMeshes.push(mesh);
115190
- batchPrimitiveGroups.push(pendingPrimitiveGroups);
115191
- });
115192
- pendingMesh = null;
115193
- pendingPrimitiveIds = new Set();
115194
- pendingPrimitiveGroups = [];
115195
- pendingMatchedPrimitiveIds = new Set();
115196
- if (!(batchMeshes.length >= _this4.batchSize)) {
115197
- _context3.n = 5;
115198
- break;
115199
- }
115200
- _context3.n = 2;
115201
- return ensureNotAborted();
115202
- case 2:
115203
- _context3.n = 3;
115204
- return _this4.ensureNotInteracting(abortSignal);
115205
- case 3:
115206
- _context3.n = 4;
115207
- return processStreamBatch(batchMeshes, batchPrimitiveGroups);
115208
- case 4:
115209
- batchMeshes.length = 0;
115210
- batchPrimitiveGroups.length = 0;
115211
- case 5:
115212
- return _context3.a(2);
115213
- }
115214
- }, _callee3);
115215
- }));
115216
- return function commitPendingMesh() {
115217
- return _ref3.apply(this, arguments);
115218
- };
115219
- }();
115220
115068
  case 34:
115221
115069
  if (false) {}
115222
- _context4.n = 35;
115070
+ _context3.n = 35;
115223
115071
  return ensureNotAborted();
115224
115072
  case 35:
115225
- _context4.n = 36;
115073
+ _context3.n = 36;
115226
115074
  return this.ensureNotInteracting(abortSignal);
115227
115075
  case 36:
115228
115076
  _content2 = void 0;
115229
- _context4.p = 37;
115230
- _context4.n = 38;
115077
+ _context3.p = 37;
115078
+ _context3.n = 38;
115231
115079
  return reader.read();
115232
115080
  case 38:
115233
- _content2 = _context4.v;
115234
- _context4.n = 41;
115081
+ _content2 = _context3.v;
115082
+ _context3.n = 41;
115235
115083
  break;
115236
115084
  case 39:
115237
- _context4.p = 39;
115238
- _t3 = _context4.v;
115085
+ _context3.p = 39;
115086
+ _t3 = _context3.v;
115239
115087
  if (!(_t3 && _t3.name === 'AbortError')) {
115240
- _context4.n = 40;
115088
+ _context3.n = 40;
115241
115089
  break;
115242
115090
  }
115243
115091
  throw _t3;
@@ -115246,125 +115094,178 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115246
115094
  case 41:
115247
115095
  _content3 = _content2, _done = _content3.done, _value = _content3.value;
115248
115096
  if (!_done) {
115249
- _context4.n = 47;
115097
+ _context3.n = 46;
115250
115098
  break;
115251
115099
  }
115252
- _context4.n = 42;
115100
+ _context3.n = 42;
115253
115101
  return ensureNotAborted();
115254
115102
  case 42:
115255
- _context4.n = 43;
115256
- return commitPendingMesh();
115257
- case 43:
115258
115103
  if (!(batchMeshes.length > 0)) {
115259
- _context4.n = 46;
115104
+ _context3.n = 45;
115260
115105
  break;
115261
115106
  }
115262
- _context4.n = 44;
115107
+ _context3.n = 43;
115263
115108
  return ensureNotAborted();
115264
- case 44:
115265
- _context4.n = 45;
115109
+ case 43:
115110
+ _context3.n = 44;
115266
115111
  return this.ensureNotInteracting(abortSignal);
115112
+ case 44:
115113
+ _context3.n = 45;
115114
+ return processStreamBatch(batchMeshes, batchPrimitives);
115267
115115
  case 45:
115268
- _context4.n = 46;
115269
- return processStreamBatch(batchMeshes, batchPrimitiveGroups);
115116
+ return _context3.a(3, 65);
115270
115117
  case 46:
115271
- return _context4.a(3, 63);
115272
- case 47:
115273
115118
  newBuf = new Uint8Array(buffer.length + _value.length);
115274
115119
  newBuf.set(buffer);
115275
115120
  newBuf.set(_value, buffer.length);
115276
115121
  buffer = newBuf;
115277
- case 48:
115122
+ case 47:
115278
115123
  if (!(buffer.length > 0)) {
115279
- _context4.n = 62;
115124
+ _context3.n = 64;
115280
115125
  break;
115281
115126
  }
115282
- _context4.n = 49;
115127
+ _context3.n = 48;
115283
115128
  return ensureNotAborted();
115284
- case 49:
115285
- if (!expectingMesh) {
115286
- _context4.n = 53;
115129
+ case 48:
115130
+ if (!expectingPrimitive) {
115131
+ _context3.n = 52;
115287
115132
  break;
115288
115133
  }
115289
- meshResult = tryParseMeshFromBuffer();
115290
- if (!(meshResult.status === 'incomplete')) {
115291
- _context4.n = 50;
115134
+ if (!(buffer.length < 12)) {
115135
+ _context3.n = 49;
115292
115136
  break;
115293
115137
  }
115294
- return _context4.a(3, 62);
115295
- case 50:
115296
- if (!(meshResult.status === 'invalid')) {
115297
- _context4.n = 51;
115298
- break;
115138
+ return _context3.a(3, 64);
115139
+ case 49:
115140
+ _context3.p = 49;
115141
+ dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
115142
+ primitiveResult = this.parsePrimitive(dataView, buffer, 0, isFullProps);
115143
+ primitiveData = primitiveResult.primitive;
115144
+ this._applyPrefixId(primitiveData, 'id');
115145
+ this._applyPrefixId(primitiveData, 'material');
115146
+ consumedBytes = primitiveResult.offset;
115147
+ if (isFullProps) {
115148
+ _this$parsePrimitiveD = this.parsePrimitiveData(primitiveData), position = _this$parsePrimitiveD.position, normal = _this$parsePrimitiveD.normal, posindex = _this$parsePrimitiveD.posindex, nolindex = _this$parsePrimitiveD.nolindex, indices = _this$parsePrimitiveD.indices;
115149
+ formatted = this.formatPrimitiveData({
115150
+ position: position,
115151
+ normal: normal,
115152
+ posindex: posindex,
115153
+ nolindex: nolindex
115154
+ });
115155
+ delete primitiveData.nolindex;
115156
+ delete primitiveData.posindex;
115157
+ primitiveData.position = formatted.position;
115158
+ primitiveData.normal = formatted.normal;
115159
+ primitiveData.indices = indices;
115299
115160
  }
115300
- return _context4.a(3, 62);
115161
+ docId = primitiveData.id;
115162
+ pendingPrimitives.set(docId, primitiveData);
115163
+ expectingPrimitive = false;
115164
+ buffer = buffer.slice(consumedBytes);
115165
+ _context3.n = 51;
115166
+ break;
115167
+ case 50:
115168
+ _context3.p = 50;
115169
+ _t4 = _context3.v;
115170
+ return _context3.a(3, 64);
115301
115171
  case 51:
115302
- _context4.n = 52;
115303
- return commitPendingMesh();
115304
- case 52:
115305
- pendingMesh = meshResult.mesh;
115306
- pendingPrimitiveIds = new Set(collectMeshPrimitiveIds(pendingMesh));
115307
- pendingPrimitiveGroups = [];
115308
- pendingMatchedPrimitiveIds = new Set();
115309
- expectingMesh = false;
115310
- buffer = buffer.slice(meshResult.totalLen);
115311
- _context4.n = 61;
115172
+ _context3.n = 63;
115312
115173
  break;
115174
+ case 52:
115175
+ if (!(buffer.length < 4)) {
115176
+ _context3.n = 53;
115177
+ break;
115178
+ }
115179
+ return _context3.a(3, 64);
115313
115180
  case 53:
115314
- nextMeshResult = tryParseMeshFromBuffer();
115315
- if (!(nextMeshResult.status === 'success')) {
115316
- _context4.n = 55;
115181
+ length = new DataView(buffer.buffer, buffer.byteOffset).getUint32(0, false);
115182
+ if (!(length > 10 * 1024 * 1024)) {
115183
+ _context3.n = 54;
115317
115184
  break;
115318
115185
  }
115319
- _context4.n = 54;
115320
- return commitPendingMesh();
115186
+ expectingPrimitive = true;
115187
+ return _context3.a(3, 47);
115321
115188
  case 54:
115322
- pendingMesh = nextMeshResult.mesh;
115323
- pendingPrimitiveIds = new Set(collectMeshPrimitiveIds(pendingMesh));
115324
- expectingMesh = false;
115325
- buffer = buffer.slice(nextMeshResult.totalLen);
115326
- return _context4.a(3, 48);
115327
- case 55:
115328
- if (!(buffer.length < 12)) {
115329
- _context4.n = 56;
115189
+ totalLen = 4 + length;
115190
+ if (!(buffer.length < totalLen)) {
115191
+ _context3.n = 55;
115330
115192
  break;
115331
115193
  }
115332
- return _context4.a(3, 62);
115333
- case 56:
115334
- primitiveResult = null;
115335
- _context4.p = 57;
115336
- primitiveResult = parsePrimitiveFromBuffer();
115337
- _context4.n = 59;
115194
+ return _context3.a(3, 64);
115195
+ case 55:
115196
+ data = buffer.slice(4, totalLen);
115197
+ mesh = null;
115198
+ _context3.p = 56;
115199
+ jsonStr = decoder.decode(data);
115200
+ mesh = JSON.parse(jsonStr);
115201
+ _context3.n = 58;
115338
115202
  break;
115203
+ case 57:
115204
+ _context3.p = 57;
115205
+ _t5 = _context3.v;
115206
+ expectingPrimitive = true;
115207
+ return _context3.a(3, 47);
115339
115208
  case 58:
115340
- _context4.p = 58;
115341
- _t4 = _context4.v;
115342
- return _context4.a(3, 62);
115343
- case 59:
115344
- primitiveData = primitiveResult.primitive;
115345
- if (pendingPrimitiveIds.has(primitiveData.id)) {
115346
- pendingPrimitiveGroups.push(primitiveData);
115347
- pendingMatchedPrimitiveIds.add(primitiveData.id);
115209
+ if (!mesh) {
115210
+ _context3.n = 63;
115211
+ break;
115348
115212
  }
115349
- buffer = buffer.slice(primitiveResult.consumedBytes);
115350
- if (!(pendingPrimitiveIds.size > 0 && pendingMatchedPrimitiveIds.size >= pendingPrimitiveIds.size)) {
115351
- _context4.n = 61;
115213
+ isFullProps = true;
115214
+ this._applyPrefixId(mesh, 'id');
115215
+ if (Array.isArray(mesh)) {
115216
+ mesh.forEach(function (item) {
115217
+ _this4._applyPrefixId(item.primitives, 'prmid', item.documentId);
115218
+ });
115219
+ } else {
115220
+ this._applyPrefixId(mesh.primitives, 'prmid', mesh.documentId);
115221
+ }
115222
+ _docId = mesh.id;
115223
+ meshToPrimId = mesh.primitives.map(function (item) {
115224
+ return item.prmid;
115225
+ });
115226
+ hasPendingPrimitive = meshToPrimId.some(function (item) {
115227
+ return pendingPrimitives.has(item);
115228
+ });
115229
+ hasPendingMesh = pendingPrimitives.has(_docId);
115230
+ if (!(hasPendingMesh || hasPendingPrimitive)) {
115231
+ _context3.n = 62;
115232
+ break;
115233
+ }
115234
+ _primitiveData = pendingPrimitives.get(_docId);
115235
+ if (!hasPendingMesh && hasPendingPrimitive) {
115236
+ primId = meshToPrimId[0];
115237
+ _primitiveData = pendingPrimitives.get(primId);
115238
+ }
115239
+ batchMeshes.push(mesh);
115240
+ batchPrimitives.push(_primitiveData);
115241
+ if (!(batchMeshes.length >= this.batchSize)) {
115242
+ _context3.n = 62;
115352
115243
  break;
115353
115244
  }
115354
- _context4.n = 60;
115355
- return commitPendingMesh();
115245
+ _context3.n = 59;
115246
+ return ensureNotAborted();
115247
+ case 59:
115248
+ _context3.n = 60;
115249
+ return this.ensureNotInteracting(abortSignal);
115356
115250
  case 60:
115357
- expectingMesh = true;
115251
+ _context3.n = 61;
115252
+ return processStreamBatch(batchMeshes, batchPrimitives);
115358
115253
  case 61:
115359
- _context4.n = 48;
115360
- break;
115254
+ batchMeshes.length = 0;
115255
+ batchPrimitives.length = 0;
115361
115256
  case 62:
115362
- _context4.n = 34;
115363
- break;
115257
+ expectingPrimitive = false;
115258
+ buffer = buffer.slice(totalLen);
115364
115259
  case 63:
115365
- return _context4.a(2, streamStats);
115260
+ _context3.n = 47;
115261
+ break;
115262
+ case 64:
115263
+ _context3.n = 34;
115264
+ break;
115265
+ case 65:
115266
+ return _context3.a(2, streamStats);
115366
115267
  }
115367
- }, _callee4, this, [[57, 58], [37, 39], [28, 30], [5, 7], [1,, 27, 32]]);
115268
+ }, _callee3, this, [[56, 57], [49, 50], [37, 39], [28, 30], [5, 7], [1,, 27, 32]]);
115368
115269
  }));
115369
115270
  function parseStreamImmediate(_x, _x2, _x3) {
115370
115271
  return _parseStreamImmediate.apply(this, arguments);
@@ -115376,57 +115277,57 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115376
115277
  }, {
115377
115278
  key: "processBatchData",
115378
115279
  value: function () {
115379
- var _processBatchData = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee5(meshes, primitives, list, range) {
115280
+ var _processBatchData = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee4(meshes, primitives, list, range) {
115380
115281
  var abortSignal,
115381
115282
  renderResult,
115382
- _args5 = arguments,
115383
- _t5;
115384
- return StreamLoader_regenerator().w(function (_context5) {
115385
- while (1) switch (_context5.p = _context5.n) {
115283
+ _args4 = arguments,
115284
+ _t6;
115285
+ return StreamLoader_regenerator().w(function (_context4) {
115286
+ while (1) switch (_context4.p = _context4.n) {
115386
115287
  case 0:
115387
- abortSignal = _args5.length > 4 && _args5[4] !== undefined ? _args5[4] : null;
115388
- _context5.p = 1;
115288
+ abortSignal = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : null;
115289
+ _context4.p = 1;
115389
115290
  if (!(abortSignal && abortSignal.aborted)) {
115390
- _context5.n = 2;
115291
+ _context4.n = 2;
115391
115292
  break;
115392
115293
  }
115393
115294
  throw new DOMException('Request was aborted', 'AbortError');
115394
115295
  case 2:
115395
- _context5.n = 3;
115296
+ _context4.n = 3;
115396
115297
  return this.renderModelData(meshes, primitives, list, range, null, undefined, {
115397
115298
  suppressLoadComplete: true,
115398
115299
  source: 'inRangeDis2'
115399
115300
  });
115400
115301
  case 3:
115401
- renderResult = _context5.v;
115302
+ renderResult = _context4.v;
115402
115303
  if (!(renderResult && renderResult.canceled)) {
115403
- _context5.n = 4;
115304
+ _context4.n = 4;
115404
115305
  break;
115405
115306
  }
115406
115307
  throw new DOMException('Batch loading was canceled', 'AbortError');
115407
115308
  case 4:
115408
115309
  if (!(abortSignal && abortSignal.aborted)) {
115409
- _context5.n = 5;
115310
+ _context4.n = 5;
115410
115311
  break;
115411
115312
  }
115412
115313
  throw new DOMException('Request was aborted', 'AbortError');
115413
115314
  case 5:
115414
- return _context5.a(2, renderResult);
115315
+ return _context4.a(2, renderResult);
115415
115316
  case 6:
115416
- _context5.p = 6;
115417
- _t5 = _context5.v;
115418
- if (!(_t5 && _t5.name === 'AbortError')) {
115419
- _context5.n = 7;
115317
+ _context4.p = 6;
115318
+ _t6 = _context4.v;
115319
+ if (!(_t6 && _t6.name === 'AbortError')) {
115320
+ _context4.n = 7;
115420
115321
  break;
115421
115322
  }
115422
- throw _t5;
115323
+ throw _t6;
115423
115324
  case 7:
115424
- console.error('Failed to render batch data:', _t5);
115425
- throw _t5;
115325
+ console.error('Failed to render batch data:', _t6);
115326
+ throw _t6;
115426
115327
  case 8:
115427
- return _context5.a(2);
115328
+ return _context4.a(2);
115428
115329
  }
115429
- }, _callee5, this, [[1, 6]]);
115330
+ }, _callee4, this, [[1, 6]]);
115430
115331
  }));
115431
115332
  function processBatchData(_x6, _x7, _x8, _x9) {
115432
115333
  return _processBatchData.apply(this, arguments);
@@ -115438,26 +115339,26 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115438
115339
  }, {
115439
115340
  key: "getPrimitivesByRangeStream",
115440
115341
  value: function () {
115441
- var _getPrimitivesByRangeStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee6(params, list, range) {
115342
+ var _getPrimitivesByRangeStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee5(params, list, range) {
115442
115343
  var abortSignal,
115443
115344
  requestId,
115444
115345
  internalController,
115445
115346
  reader,
115446
115347
  res,
115447
115348
  streamStats,
115448
- _args6 = arguments,
115449
- _t6;
115450
- return StreamLoader_regenerator().w(function (_context6) {
115451
- while (1) switch (_context6.p = _context6.n) {
115349
+ _args5 = arguments,
115350
+ _t7;
115351
+ return StreamLoader_regenerator().w(function (_context5) {
115352
+ while (1) switch (_context5.p = _context5.n) {
115452
115353
  case 0:
115453
- abortSignal = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : null;
115454
- _context6.n = 1;
115354
+ abortSignal = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : null;
115355
+ _context5.n = 1;
115455
115356
  return this.abortAllStreamRequests();
115456
115357
  case 1:
115457
115358
  requestId = this.createStreamRequestId();
115458
115359
  internalController = null;
115459
115360
  reader = null;
115460
- _context6.p = 2;
115361
+ _context5.p = 2;
115461
115362
  internalController = new AbortController();
115462
115363
  this.currentAbortController = internalController;
115463
115364
  this.activeStreamControllers.add(internalController);
@@ -115474,7 +115375,7 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115474
115375
  }
115475
115376
  }
115476
115377
  if (!internalController.signal.aborted) {
115477
- _context6.n = 3;
115378
+ _context5.n = 3;
115478
115379
  break;
115479
115380
  }
115480
115381
  throw new DOMException('Request was aborted', 'AbortError');
@@ -115482,14 +115383,14 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115482
115383
  params.requestId = requestId;
115483
115384
  params.projectId = this.projectId;
115484
115385
  if (!(this.modelApi && typeof this.modelApi.getPrimitivesByRangeStream === 'function')) {
115485
- _context6.n = 5;
115386
+ _context5.n = 5;
115486
115387
  break;
115487
115388
  }
115488
- _context6.n = 4;
115389
+ _context5.n = 4;
115489
115390
  return this.modelApi.getPrimitivesByRangeStream(params, internalController.signal);
115490
115391
  case 4:
115491
- res = _context6.v;
115492
- _context6.n = 6;
115392
+ res = _context5.v;
115393
+ _context5.n = 6;
115493
115394
  break;
115494
115395
  case 5:
115495
115396
  throw new Error('modelApi.getPrimitivesByRangeStream is not available');
@@ -115497,49 +115398,49 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115497
115398
  reader = res.getReader();
115498
115399
  this.currentStreamReader = reader;
115499
115400
  this.activeStreamReaders.add(reader);
115500
- _context6.n = 7;
115401
+ _context5.n = 7;
115501
115402
  return this.parseStreamImmediate(reader, list, range, internalController.signal, requestId);
115502
115403
  case 7:
115503
- streamStats = _context6.v;
115404
+ streamStats = _context5.v;
115504
115405
  if (!internalController.signal.aborted) {
115505
- _context6.n = 8;
115406
+ _context5.n = 8;
115506
115407
  break;
115507
115408
  }
115508
115409
  throw new DOMException('Request was aborted', 'AbortError');
115509
115410
  case 8:
115510
115411
  if (!res) {
115511
- _context6.n = 9;
115412
+ _context5.n = 9;
115512
115413
  break;
115513
115414
  }
115514
- return _context6.a(2, StreamLoader_objectSpread({
115415
+ return _context5.a(2, StreamLoader_objectSpread({
115515
115416
  stream: res,
115516
115417
  requestId: requestId
115517
115418
  }, streamStats || {}));
115518
115419
  case 9:
115519
- return _context6.a(2, null);
115420
+ return _context5.a(2, null);
115520
115421
  case 10:
115521
- _context6.p = 10;
115522
- _t6 = _context6.v;
115523
- if (!(_t6.name === 'AbortError')) {
115524
- _context6.n = 11;
115422
+ _context5.p = 10;
115423
+ _t7 = _context5.v;
115424
+ if (!(_t7.name === 'AbortError')) {
115425
+ _context5.n = 11;
115525
115426
  break;
115526
115427
  }
115527
- throw _t6;
115428
+ throw _t7;
115528
115429
  case 11:
115529
- console.error(_t6);
115530
- throw _t6;
115430
+ console.error(_t7);
115431
+ throw _t7;
115531
115432
  case 12:
115532
- _context6.p = 12;
115433
+ _context5.p = 12;
115533
115434
  if (reader) this.activeStreamReaders.delete(reader);
115534
115435
  if (internalController) this.activeStreamControllers.delete(internalController);
115535
115436
  if (requestId) this.activeRequestIds.delete(requestId);
115536
115437
  this.currentStreamReader = null;
115537
115438
  this.currentAbortController = null;
115538
- return _context6.f(12);
115439
+ return _context5.f(12);
115539
115440
  case 13:
115540
- return _context6.a(2);
115441
+ return _context5.a(2);
115541
115442
  }
115542
- }, _callee6, this, [[2, 10, 12, 13]]);
115443
+ }, _callee5, this, [[2, 10, 12, 13]]);
115543
115444
  }));
115544
115445
  function getPrimitivesByRangeStream(_x0, _x1, _x10) {
115545
115446
  return _getPrimitivesByRangeStream.apply(this, arguments);
@@ -115549,56 +115450,56 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115549
115450
  }, {
115550
115451
  key: "getPrimitivesByRange",
115551
115452
  value: function () {
115552
- var _getPrimitivesByRange = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee7(params) {
115453
+ var _getPrimitivesByRange = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee6(params) {
115553
115454
  var abortSignal,
115554
115455
  res,
115555
- _args7 = arguments,
115556
- _t7;
115557
- return StreamLoader_regenerator().w(function (_context7) {
115558
- while (1) switch (_context7.p = _context7.n) {
115456
+ _args6 = arguments,
115457
+ _t8;
115458
+ return StreamLoader_regenerator().w(function (_context6) {
115459
+ while (1) switch (_context6.p = _context6.n) {
115559
115460
  case 0:
115560
- abortSignal = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : null;
115561
- _context7.p = 1;
115461
+ abortSignal = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;
115462
+ _context6.p = 1;
115562
115463
  if (!(abortSignal && abortSignal.aborted)) {
115563
- _context7.n = 2;
115464
+ _context6.n = 2;
115564
115465
  break;
115565
115466
  }
115566
115467
  throw new DOMException('Request was aborted', 'AbortError');
115567
115468
  case 2:
115568
- _context7.n = 3;
115469
+ _context6.n = 3;
115569
115470
  return this.modelApi.getPrimitivesByRange(params, abortSignal);
115570
115471
  case 3:
115571
- res = _context7.v;
115472
+ res = _context6.v;
115572
115473
  if (!(abortSignal && abortSignal.aborted)) {
115573
- _context7.n = 4;
115474
+ _context6.n = 4;
115574
115475
  break;
115575
115476
  }
115576
115477
  throw new DOMException('Request was aborted', 'AbortError');
115577
115478
  case 4:
115578
115479
  if (!res) {
115579
- _context7.n = 5;
115480
+ _context6.n = 5;
115580
115481
  break;
115581
115482
  }
115582
- return _context7.a(2, res);
115483
+ return _context6.a(2, res);
115583
115484
  case 5:
115584
115485
  throw new Error('Failed to get primitives');
115585
115486
  case 6:
115586
- _context7.n = 9;
115487
+ _context6.n = 9;
115587
115488
  break;
115588
115489
  case 7:
115589
- _context7.p = 7;
115590
- _t7 = _context7.v;
115591
- if (!(_t7.name === 'AbortError')) {
115592
- _context7.n = 8;
115490
+ _context6.p = 7;
115491
+ _t8 = _context6.v;
115492
+ if (!(_t8.name === 'AbortError')) {
115493
+ _context6.n = 8;
115593
115494
  break;
115594
115495
  }
115595
- throw _t7;
115496
+ throw _t8;
115596
115497
  case 8:
115597
- throw _t7;
115498
+ throw _t8;
115598
115499
  case 9:
115599
- return _context7.a(2);
115500
+ return _context6.a(2);
115600
115501
  }
115601
- }, _callee7, this, [[1, 7]]);
115502
+ }, _callee6, this, [[1, 7]]);
115602
115503
  }));
115603
115504
  function getPrimitivesByRange(_x11) {
115604
115505
  return _getPrimitivesByRange.apply(this, arguments);
@@ -115608,31 +115509,31 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115608
115509
  }, {
115609
115510
  key: "getPrimitivesByMaterial",
115610
115511
  value: function () {
115611
- var _getPrimitivesByMaterial = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee8(params) {
115612
- var res, _t8;
115613
- return StreamLoader_regenerator().w(function (_context8) {
115614
- while (1) switch (_context8.p = _context8.n) {
115512
+ var _getPrimitivesByMaterial = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee7(params) {
115513
+ var res, _t9;
115514
+ return StreamLoader_regenerator().w(function (_context7) {
115515
+ while (1) switch (_context7.p = _context7.n) {
115615
115516
  case 0:
115616
- _context8.p = 0;
115617
- _context8.n = 1;
115517
+ _context7.p = 0;
115518
+ _context7.n = 1;
115618
115519
  return this.modelApi.getPrimitivesByMaterial(params);
115619
115520
  case 1:
115620
- res = _context8.v;
115521
+ res = _context7.v;
115621
115522
  if (!res) {
115622
- _context8.n = 2;
115523
+ _context7.n = 2;
115623
115524
  break;
115624
115525
  }
115625
- return _context8.a(2, res);
115526
+ return _context7.a(2, res);
115626
115527
  case 2:
115627
115528
  throw new Error('Failed to get Material');
115628
115529
  case 3:
115629
- _context8.p = 3;
115630
- _t8 = _context8.v;
115631
- throw _t8;
115530
+ _context7.p = 3;
115531
+ _t9 = _context7.v;
115532
+ throw _t9;
115632
115533
  case 4:
115633
- return _context8.a(2);
115534
+ return _context7.a(2);
115634
115535
  }
115635
- }, _callee8, this, [[0, 3]]);
115536
+ }, _callee7, this, [[0, 3]]);
115636
115537
  }));
115637
115538
  function getPrimitivesByMaterial(_x12) {
115638
115539
  return _getPrimitivesByMaterial.apply(this, arguments);
@@ -115642,29 +115543,29 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115642
115543
  }, {
115643
115544
  key: "getPrimitivesByMergeMaterial",
115644
115545
  value: function () {
115645
- var _getPrimitivesByMergeMaterial = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee9(params) {
115646
- var res, _t9;
115647
- return StreamLoader_regenerator().w(function (_context9) {
115648
- while (1) switch (_context9.p = _context9.n) {
115546
+ var _getPrimitivesByMergeMaterial = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee8(params) {
115547
+ var res, _t0;
115548
+ return StreamLoader_regenerator().w(function (_context8) {
115549
+ while (1) switch (_context8.p = _context8.n) {
115649
115550
  case 0:
115650
- _context9.p = 0;
115551
+ _context8.p = 0;
115651
115552
  if (!(!this.modelApi || typeof this.modelApi.getPrimitivesByMergeMaterial !== 'function')) {
115652
- _context9.n = 1;
115553
+ _context8.n = 1;
115653
115554
  break;
115654
115555
  }
115655
- return _context9.a(2, null);
115556
+ return _context8.a(2, null);
115656
115557
  case 1:
115657
- _context9.n = 2;
115558
+ _context8.n = 2;
115658
115559
  return this.modelApi.getPrimitivesByMergeMaterial(params);
115659
115560
  case 2:
115660
- res = _context9.v;
115661
- return _context9.a(2, res || null);
115561
+ res = _context8.v;
115562
+ return _context8.a(2, res || null);
115662
115563
  case 3:
115663
- _context9.p = 3;
115664
- _t9 = _context9.v;
115665
- return _context9.a(2, null);
115564
+ _context8.p = 3;
115565
+ _t0 = _context8.v;
115566
+ return _context8.a(2, null);
115666
115567
  }
115667
- }, _callee9, this, [[0, 3]]);
115568
+ }, _callee8, this, [[0, 3]]);
115668
115569
  }));
115669
115570
  function getPrimitivesByMergeMaterial(_x13) {
115670
115571
  return _getPrimitivesByMergeMaterial.apply(this, arguments);
@@ -115702,36 +115603,36 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115702
115603
  }, {
115703
115604
  key: "abortAllStreamRequests",
115704
115605
  value: function () {
115705
- var _abortAllStreamRequests = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee0() {
115706
- var requestIds, _i2, _requestIds, requestId, readers, _i3, _readers, reader, _t0, _t1, _t10;
115707
- return StreamLoader_regenerator().w(function (_context0) {
115708
- while (1) switch (_context0.p = _context0.n) {
115606
+ var _abortAllStreamRequests = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee9() {
115607
+ var requestIds, _i2, _requestIds, requestId, readers, _i3, _readers, reader, _t1, _t10, _t11;
115608
+ return StreamLoader_regenerator().w(function (_context9) {
115609
+ while (1) switch (_context9.p = _context9.n) {
115709
115610
  case 0:
115710
- _context0.p = 0;
115611
+ _context9.p = 0;
115711
115612
  requestIds = Array.from(this.activeRequestIds);
115712
115613
  _i2 = 0, _requestIds = requestIds;
115713
115614
  case 1:
115714
115615
  if (!(_i2 < _requestIds.length)) {
115715
- _context0.n = 6;
115616
+ _context9.n = 6;
115716
115617
  break;
115717
115618
  }
115718
115619
  requestId = _requestIds[_i2];
115719
115620
  if (!(typeof this.onCancelRequestId === 'function')) {
115720
- _context0.n = 5;
115621
+ _context9.n = 5;
115721
115622
  break;
115722
115623
  }
115723
- _context0.p = 2;
115724
- _context0.n = 3;
115624
+ _context9.p = 2;
115625
+ _context9.n = 3;
115725
115626
  return this.onCancelRequestId(requestId);
115726
115627
  case 3:
115727
- _context0.n = 5;
115628
+ _context9.n = 5;
115728
115629
  break;
115729
115630
  case 4:
115730
- _context0.p = 4;
115731
- _t0 = _context0.v;
115631
+ _context9.p = 4;
115632
+ _t1 = _context9.v;
115732
115633
  case 5:
115733
115634
  _i2++;
115734
- _context0.n = 1;
115635
+ _context9.n = 1;
115735
115636
  break;
115736
115637
  case 6:
115737
115638
  this.activeRequestIds.clear();
@@ -115746,25 +115647,25 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115746
115647
  _i3 = 0, _readers = readers;
115747
115648
  case 7:
115748
115649
  if (!(_i3 < _readers.length)) {
115749
- _context0.n = 12;
115650
+ _context9.n = 12;
115750
115651
  break;
115751
115652
  }
115752
115653
  reader = _readers[_i3];
115753
- _context0.p = 8;
115754
- _context0.n = 9;
115654
+ _context9.p = 8;
115655
+ _context9.n = 9;
115755
115656
  return reader.cancel();
115756
115657
  case 9:
115757
- _context0.n = 11;
115658
+ _context9.n = 11;
115758
115659
  break;
115759
115660
  case 10:
115760
- _context0.p = 10;
115761
- _t1 = _context0.v;
115661
+ _context9.p = 10;
115662
+ _t10 = _context9.v;
115762
115663
  case 11:
115763
115664
  _i3++;
115764
- _context0.n = 7;
115665
+ _context9.n = 7;
115765
115666
  break;
115766
115667
  case 12:
115767
- _context0.p = 12;
115668
+ _context9.p = 12;
115768
115669
  if (this.currentAbortController) {
115769
115670
  try {
115770
115671
  this.currentAbortController.abort();
@@ -115772,26 +115673,26 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115772
115673
  this.currentAbortController = null;
115773
115674
  }
115774
115675
  if (!this.currentStreamReader) {
115775
- _context0.n = 17;
115676
+ _context9.n = 17;
115776
115677
  break;
115777
115678
  }
115778
- _context0.p = 13;
115779
- _context0.n = 14;
115679
+ _context9.p = 13;
115680
+ _context9.n = 14;
115780
115681
  return this.currentStreamReader.cancel();
115781
115682
  case 14:
115782
- _context0.n = 16;
115683
+ _context9.n = 16;
115783
115684
  break;
115784
115685
  case 15:
115785
- _context0.p = 15;
115786
- _t10 = _context0.v;
115686
+ _context9.p = 15;
115687
+ _t11 = _context9.v;
115787
115688
  case 16:
115788
115689
  this.currentStreamReader = null;
115789
115690
  case 17:
115790
- return _context0.f(12);
115691
+ return _context9.f(12);
115791
115692
  case 18:
115792
- return _context0.a(2);
115693
+ return _context9.a(2);
115793
115694
  }
115794
- }, _callee0, this, [[13, 15], [8, 10], [2, 4], [0,, 12, 18]]);
115695
+ }, _callee9, this, [[13, 15], [8, 10], [2, 4], [0,, 12, 18]]);
115795
115696
  }));
115796
115697
  function abortAllStreamRequests() {
115797
115698
  return _abortAllStreamRequests.apply(this, arguments);
@@ -115803,52 +115704,52 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115803
115704
  }, {
115804
115705
  key: "fetchPrimitiveBufferByStream",
115805
115706
  value: function () {
115806
- var _fetchPrimitiveBufferByStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee1(range, list) {
115707
+ var _fetchPrimitiveBufferByStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee0(range, list) {
115807
115708
  var abortSignal,
115808
115709
  requestId,
115809
115710
  request,
115810
115711
  streamResult,
115811
- _args1 = arguments,
115812
- _t11;
115813
- return StreamLoader_regenerator().w(function (_context1) {
115814
- while (1) switch (_context1.p = _context1.n) {
115712
+ _args0 = arguments,
115713
+ _t12;
115714
+ return StreamLoader_regenerator().w(function (_context0) {
115715
+ while (1) switch (_context0.p = _context0.n) {
115815
115716
  case 0:
115816
- abortSignal = _args1.length > 2 && _args1[2] !== undefined ? _args1[2] : null;
115817
- requestId = _args1.length > 3 && _args1[3] !== undefined ? _args1[3] : null;
115818
- _context1.p = 1;
115819
- _context1.n = 2;
115717
+ abortSignal = _args0.length > 2 && _args0[2] !== undefined ? _args0[2] : null;
115718
+ requestId = _args0.length > 3 && _args0[3] !== undefined ? _args0[3] : null;
115719
+ _context0.p = 1;
115720
+ _context0.n = 2;
115820
115721
  return this.abortAllStreamRequests();
115821
115722
  case 2:
115822
115723
  request = this.createAbortableRequest(requestId); // Use requestId if provided as key? Logic slightly different in utils
115823
115724
  // Adaptation: utils used getPrimitivesByRangeStreamWithAutoAbort which calls getPrimitivesByRangeStream
115824
115725
  // Here I simplify by calling getPrimitivesByRangeStream directly but managing request key
115825
- _context1.n = 3;
115726
+ _context0.n = 3;
115826
115727
  return this.getPrimitivesByRangeStream(range, list, range, abortSignal || request.signal);
115827
115728
  case 3:
115828
- streamResult = _context1.v;
115729
+ streamResult = _context0.v;
115829
115730
  this.cleanupRequest(request.requestId);
115830
115731
  if (streamResult) {
115831
- _context1.n = 4;
115732
+ _context0.n = 4;
115832
115733
  break;
115833
115734
  }
115834
- return _context1.a(2, null);
115735
+ return _context0.a(2, null);
115835
115736
  case 4:
115836
- return _context1.a(2, streamResult);
115737
+ return _context0.a(2, streamResult);
115837
115738
  case 5:
115838
- _context1.p = 5;
115839
- _t11 = _context1.v;
115840
- if (_t11.name === 'AbortError') {
115739
+ _context0.p = 5;
115740
+ _t12 = _context0.v;
115741
+ if (_t12.name === 'AbortError') {
115841
115742
  // throw error;
115842
115743
  }
115843
115744
  if (!(requestId && this.currentRequestId !== requestId)) {
115844
- _context1.n = 6;
115745
+ _context0.n = 6;
115845
115746
  break;
115846
115747
  }
115847
- return _context1.a(2, null);
115748
+ return _context0.a(2, null);
115848
115749
  case 6:
115849
- return _context1.a(2);
115750
+ return _context0.a(2);
115850
115751
  }
115851
- }, _callee1, this, [[1, 5]]);
115752
+ }, _callee0, this, [[1, 5]]);
115852
115753
  }));
115853
115754
  function fetchPrimitiveBufferByStream(_x14, _x15) {
115854
115755
  return _fetchPrimitiveBufferByStream.apply(this, arguments);
@@ -115858,58 +115759,58 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115858
115759
  }, {
115859
115760
  key: "fetchPrimitiveBuffer",
115860
115761
  value: function () {
115861
- var _fetchPrimitiveBuffer = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee10(range) {
115762
+ var _fetchPrimitiveBuffer = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee1(range) {
115862
115763
  var abortSignal,
115863
115764
  requestId,
115864
115765
  request,
115865
- _buffer,
115866
- _args10 = arguments,
115867
- _t12;
115868
- return StreamLoader_regenerator().w(function (_context10) {
115869
- while (1) switch (_context10.p = _context10.n) {
115766
+ buffer,
115767
+ _args1 = arguments,
115768
+ _t13;
115769
+ return StreamLoader_regenerator().w(function (_context1) {
115770
+ while (1) switch (_context1.p = _context1.n) {
115870
115771
  case 0:
115871
- abortSignal = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : null;
115872
- requestId = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : null;
115873
- _context10.p = 1;
115772
+ abortSignal = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : null;
115773
+ requestId = _args1.length > 2 && _args1[2] !== undefined ? _args1[2] : null;
115774
+ _context1.p = 1;
115874
115775
  request = this.createAbortableRequest(requestId || 'default');
115875
- _context10.n = 2;
115776
+ _context1.n = 2;
115876
115777
  return this.getPrimitivesByRange(range, abortSignal || request.signal);
115877
115778
  case 2:
115878
- _buffer = _context10.v;
115779
+ buffer = _context1.v;
115879
115780
  this.cleanupRequest(request.requestId);
115880
- if (!(!_buffer || _buffer.byteLength === 0)) {
115881
- _context10.n = 3;
115781
+ if (!(!buffer || buffer.byteLength === 0)) {
115782
+ _context1.n = 3;
115882
115783
  break;
115883
115784
  }
115884
- return _context10.a(2, null);
115785
+ return _context1.a(2, null);
115885
115786
  case 3:
115886
- if (!(_buffer.byteLength < 4)) {
115887
- _context10.n = 4;
115787
+ if (!(buffer.byteLength < 4)) {
115788
+ _context1.n = 4;
115888
115789
  break;
115889
115790
  }
115890
- return _context10.a(2, null);
115791
+ return _context1.a(2, null);
115891
115792
  case 4:
115892
- return _context10.a(2, _buffer);
115793
+ return _context1.a(2, buffer);
115893
115794
  case 5:
115894
- _context10.p = 5;
115895
- _t12 = _context10.v;
115896
- if (!(_t12.name === 'AbortError')) {
115897
- _context10.n = 6;
115795
+ _context1.p = 5;
115796
+ _t13 = _context1.v;
115797
+ if (!(_t13.name === 'AbortError')) {
115798
+ _context1.n = 6;
115898
115799
  break;
115899
115800
  }
115900
- throw _t12;
115801
+ throw _t13;
115901
115802
  case 6:
115902
115803
  if (!(requestId && this.currentRequestId !== requestId)) {
115903
- _context10.n = 7;
115804
+ _context1.n = 7;
115904
115805
  break;
115905
115806
  }
115906
- return _context10.a(2, null);
115807
+ return _context1.a(2, null);
115907
115808
  case 7:
115908
- throw _t12;
115809
+ throw _t13;
115909
115810
  case 8:
115910
- return _context10.a(2);
115811
+ return _context1.a(2);
115911
115812
  }
115912
- }, _callee10, this, [[1, 5]]);
115813
+ }, _callee1, this, [[1, 5]]);
115913
115814
  }));
115914
115815
  function fetchPrimitiveBuffer(_x16) {
115915
115816
  return _fetchPrimitiveBuffer.apply(this, arguments);
@@ -115919,13 +115820,13 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115919
115820
  }, {
115920
115821
  key: "parseBufferData",
115921
115822
  value: function () {
115922
- var _parseBufferData = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee11(buffer) {
115823
+ var _parseBufferData = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee10(buffer) {
115923
115824
  var transferable;
115924
- return StreamLoader_regenerator().w(function (_context11) {
115925
- while (1) switch (_context11.n) {
115825
+ return StreamLoader_regenerator().w(function (_context10) {
115826
+ while (1) switch (_context10.n) {
115926
115827
  case 0:
115927
115828
  if (!this.worker) {
115928
- _context11.n = 1;
115829
+ _context10.n = 1;
115929
115830
  break;
115930
115831
  }
115931
115832
  transferable = [];
@@ -115934,16 +115835,16 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115934
115835
  } else if (buffer.buffer instanceof ArrayBuffer) {
115935
115836
  transferable.push(buffer.buffer);
115936
115837
  }
115937
- return _context11.a(2, this.workerRequest('parseBufferData', {
115838
+ return _context10.a(2, this.workerRequest('parseBufferData', {
115938
115839
  buffer: buffer,
115939
115840
  prefixIdKey: this.prefixIdKey
115940
115841
  }, transferable));
115941
115842
  case 1:
115942
- return _context11.a(2, this._parseBufferDataSync(buffer));
115843
+ return _context10.a(2, this._parseBufferDataSync(buffer));
115943
115844
  case 2:
115944
- return _context11.a(2);
115845
+ return _context10.a(2);
115945
115846
  }
115946
- }, _callee11, this);
115847
+ }, _callee10, this);
115947
115848
  }));
115948
115849
  function parseBufferData(_x17) {
115949
115850
  return _parseBufferData.apply(this, arguments);
@@ -115953,17 +115854,17 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115953
115854
  }, {
115954
115855
  key: "_parseBufferDataSync",
115955
115856
  value: function () {
115956
- var _parseBufferDataSync2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee12(buffer) {
115857
+ var _parseBufferDataSync2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee11(buffer) {
115957
115858
  var _this6 = this;
115958
- var uint8Array, dataView, meshJsonBytes, primitives, offset, meshJsonLength, _decoder, meshJsonStr, mesh, result, i, primitive, _this$parsePrimitiveD, position, normal, posindex, nolindex, indices, formatted, _t13, _t14, _t15;
115959
- return StreamLoader_regenerator().w(function (_context12) {
115960
- while (1) switch (_context12.p = _context12.n) {
115859
+ var uint8Array, dataView, meshJsonBytes, primitives, offset, meshJsonLength, decoder, meshJsonStr, mesh, result, i, primitive, _this$parsePrimitiveD2, position, normal, posindex, nolindex, indices, formatted, _t14, _t15, _t16;
115860
+ return StreamLoader_regenerator().w(function (_context11) {
115861
+ while (1) switch (_context11.p = _context11.n) {
115961
115862
  case 0:
115962
115863
  uint8Array = null;
115963
115864
  dataView = null;
115964
115865
  meshJsonBytes = null;
115965
115866
  primitives = [];
115966
- _context12.p = 1;
115867
+ _context11.p = 1;
115967
115868
  uint8Array = new Uint8Array(buffer);
115968
115869
  dataView = new DataView(buffer);
115969
115870
  offset = 0;
@@ -115971,10 +115872,10 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115971
115872
  offset += 4;
115972
115873
  meshJsonBytes = new Uint8Array(uint8Array.buffer.slice(offset, offset + meshJsonLength));
115973
115874
  offset += meshJsonLength;
115974
- _decoder = new TextDecoder('utf-8');
115975
- meshJsonStr = _decoder.decode(meshJsonBytes);
115875
+ decoder = new TextDecoder('utf-8');
115876
+ meshJsonStr = decoder.decode(meshJsonBytes);
115976
115877
  meshJsonBytes = null;
115977
- _context12.p = 2;
115878
+ _context11.p = 2;
115978
115879
  mesh = JSON.parse(meshJsonStr);
115979
115880
  this._applyPrefixId(mesh, 'id');
115980
115881
  if (Array.isArray(mesh)) {
@@ -115984,45 +115885,45 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
115984
115885
  } else {
115985
115886
  this._applyPrefixId(mesh.primitives, 'prmid', mesh.documentId);
115986
115887
  }
115987
- _context12.n = 4;
115888
+ _context11.n = 4;
115988
115889
  break;
115989
115890
  case 3:
115990
- _context12.p = 3;
115991
- _t13 = _context12.v;
115992
- console.error('JSON 解析失败:', _t13, meshJsonStr);
115891
+ _context11.p = 3;
115892
+ _t14 = _context11.v;
115893
+ console.error('JSON 解析失败:', _t14, meshJsonStr);
115993
115894
  throw new Error('JSON解析失败');
115994
115895
  case 4:
115995
115896
  if (!(offset < uint8Array.length)) {
115996
- _context12.n = 9;
115897
+ _context11.n = 9;
115997
115898
  break;
115998
115899
  }
115999
- _context12.p = 5;
115900
+ _context11.p = 5;
116000
115901
  result = this.parsePrimitive(dataView, uint8Array, offset);
116001
115902
  console.log('result', result);
116002
115903
  if (result) {
116003
- _context12.n = 6;
115904
+ _context11.n = 6;
116004
115905
  break;
116005
115906
  }
116006
- return _context12.a(3, 9);
115907
+ return _context11.a(3, 9);
116007
115908
  case 6:
116008
115909
  primitives.push(result.primitive);
116009
115910
  offset = result.offset;
116010
- _context12.n = 8;
115911
+ _context11.n = 8;
116011
115912
  break;
116012
115913
  case 7:
116013
- _context12.p = 7;
116014
- _t14 = _context12.v;
116015
- console.error('解析失败,偏移:', offset, _t14);
116016
- return _context12.a(3, 9);
115914
+ _context11.p = 7;
115915
+ _t15 = _context11.v;
115916
+ console.error('解析失败,偏移:', offset, _t15);
115917
+ return _context11.a(3, 9);
116017
115918
  case 8:
116018
- _context12.n = 4;
115919
+ _context11.n = 4;
116019
115920
  break;
116020
115921
  case 9:
116021
115922
  for (i = 0; i < primitives.length; i++) {
116022
115923
  primitive = primitives[i];
116023
115924
  this._applyPrefixId(primitive, 'id');
116024
115925
  this._applyPrefixId(primitive, 'material');
116025
- _this$parsePrimitiveD = this.parsePrimitiveData(primitive), position = _this$parsePrimitiveD.position, normal = _this$parsePrimitiveD.normal, posindex = _this$parsePrimitiveD.posindex, nolindex = _this$parsePrimitiveD.nolindex, indices = _this$parsePrimitiveD.indices;
115926
+ _this$parsePrimitiveD2 = this.parsePrimitiveData(primitive), position = _this$parsePrimitiveD2.position, normal = _this$parsePrimitiveD2.normal, posindex = _this$parsePrimitiveD2.posindex, nolindex = _this$parsePrimitiveD2.nolindex, indices = _this$parsePrimitiveD2.indices;
116026
115927
  formatted = this.formatPrimitiveData({
116027
115928
  position: position,
116028
115929
  normal: normal,
@@ -116035,24 +115936,24 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116035
115936
  primitive.normal = formatted.normal;
116036
115937
  primitive.indices = indices;
116037
115938
  }
116038
- return _context12.a(2, {
115939
+ return _context11.a(2, {
116039
115940
  mesh: mesh,
116040
115941
  primitives: primitives
116041
115942
  });
116042
115943
  case 10:
116043
- _context12.p = 10;
116044
- _t15 = _context12.v;
116045
- throw _t15;
115944
+ _context11.p = 10;
115945
+ _t16 = _context11.v;
115946
+ throw _t16;
116046
115947
  case 11:
116047
- _context12.p = 11;
115948
+ _context11.p = 11;
116048
115949
  uint8Array = null;
116049
115950
  dataView = null;
116050
115951
  meshJsonBytes = null;
116051
- return _context12.f(11);
115952
+ return _context11.f(11);
116052
115953
  case 12:
116053
- return _context12.a(2);
115954
+ return _context11.a(2);
116054
115955
  }
116055
- }, _callee12, this, [[5, 7], [2, 3], [1, 10, 11, 12]]);
115956
+ }, _callee11, this, [[5, 7], [2, 3], [1, 10, 11, 12]]);
116056
115957
  }));
116057
115958
  function _parseBufferDataSync(_x18) {
116058
115959
  return _parseBufferDataSync2.apply(this, arguments);
@@ -116062,7 +115963,7 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116062
115963
  }, {
116063
115964
  key: "fetchJsonSync",
116064
115965
  value: function () {
116065
- var _fetchJsonSync = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee13(list, range) {
115966
+ var _fetchJsonSync = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee12(list, range) {
116066
115967
  var abortSignal,
116067
115968
  requestId,
116068
115969
  buffer,
@@ -116071,65 +115972,65 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116071
115972
  _yield$this$parseBuff,
116072
115973
  mesh,
116073
115974
  parsed,
116074
- _args13 = arguments,
116075
- _t16;
116076
- return StreamLoader_regenerator().w(function (_context13) {
116077
- while (1) switch (_context13.p = _context13.n) {
115975
+ _args12 = arguments,
115976
+ _t17;
115977
+ return StreamLoader_regenerator().w(function (_context12) {
115978
+ while (1) switch (_context12.p = _context12.n) {
116078
115979
  case 0:
116079
- abortSignal = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : null;
116080
- requestId = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : null;
115980
+ abortSignal = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : null;
115981
+ requestId = _args12.length > 3 && _args12[3] !== undefined ? _args12[3] : null;
116081
115982
  buffer = null;
116082
115983
  primitives = [];
116083
- _context13.p = 1;
115984
+ _context12.p = 1;
116084
115985
  loadStartTime = Date.now();
116085
- _context13.n = 2;
115986
+ _context12.n = 2;
116086
115987
  return this.fetchPrimitiveBuffer(range, abortSignal, requestId);
116087
115988
  case 2:
116088
- buffer = _context13.v;
115989
+ buffer = _context12.v;
116089
115990
  if (buffer) {
116090
- _context13.n = 3;
115991
+ _context12.n = 3;
116091
115992
  break;
116092
115993
  }
116093
- return _context13.a(2, {
115994
+ return _context12.a(2, {
116094
115995
  primitives: []
116095
115996
  });
116096
115997
  case 3:
116097
- _context13.n = 4;
115998
+ _context12.n = 4;
116098
115999
  return this.parseBufferData(buffer);
116099
116000
  case 4:
116100
- _yield$this$parseBuff = _context13.v;
116001
+ _yield$this$parseBuff = _context12.v;
116101
116002
  mesh = _yield$this$parseBuff.mesh;
116102
116003
  parsed = _yield$this$parseBuff.primitives;
116103
116004
  primitives = parsed;
116104
116005
  if (!(typeof this.renderModelData === 'function')) {
116105
- _context13.n = 5;
116006
+ _context12.n = 5;
116106
116007
  break;
116107
116008
  }
116108
- _context13.n = 5;
116009
+ _context12.n = 5;
116109
116010
  return this.renderModelData(mesh, primitives, list, range);
116110
116011
  case 5:
116111
- return _context13.a(2, {
116012
+ return _context12.a(2, {
116112
116013
  primitives: primitives,
116113
116014
  mesh: mesh
116114
116015
  });
116115
116016
  case 6:
116116
- _context13.p = 6;
116117
- _t16 = _context13.v;
116118
- if (!(_t16.name === 'AbortError')) {
116119
- _context13.n = 7;
116017
+ _context12.p = 6;
116018
+ _t17 = _context12.v;
116019
+ if (!(_t17.name === 'AbortError')) {
116020
+ _context12.n = 7;
116120
116021
  break;
116121
116022
  }
116122
- throw _t16;
116023
+ throw _t17;
116123
116024
  case 7:
116124
116025
  if (!(requestId && this.currentRequestId !== requestId)) {
116125
- _context13.n = 8;
116026
+ _context12.n = 8;
116126
116027
  break;
116127
116028
  }
116128
- return _context13.a(2);
116029
+ return _context12.a(2);
116129
116030
  case 8:
116130
- throw _t16;
116031
+ throw _t17;
116131
116032
  case 9:
116132
- _context13.p = 9;
116033
+ _context12.p = 9;
116133
116034
  try {
116134
116035
  buffer = null;
116135
116036
  primitives = null;
@@ -116139,11 +116040,11 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116139
116040
  } catch (cleanupErr) {
116140
116041
  console.warn('内存清理时发生错误:', cleanupErr);
116141
116042
  }
116142
- return _context13.f(9);
116043
+ return _context12.f(9);
116143
116044
  case 10:
116144
- return _context13.a(2);
116045
+ return _context12.a(2);
116145
116046
  }
116146
- }, _callee13, this, [[1, 6, 9, 10]]);
116047
+ }, _callee12, this, [[1, 6, 9, 10]]);
116147
116048
  }));
116148
116049
  function fetchJsonSync(_x19, _x20) {
116149
116050
  return _fetchJsonSync.apply(this, arguments);
@@ -116153,47 +116054,47 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116153
116054
  }, {
116154
116055
  key: "fetchJsonStream",
116155
116056
  value: function () {
116156
- var _fetchJsonStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee14(list, range) {
116057
+ var _fetchJsonStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee13(list, range) {
116157
116058
  var abortSignal,
116158
116059
  requestId,
116159
116060
  loadStartTime,
116160
116061
  streamResult,
116161
- _args14 = arguments,
116162
- _t17;
116163
- return StreamLoader_regenerator().w(function (_context14) {
116164
- while (1) switch (_context14.p = _context14.n) {
116062
+ _args13 = arguments,
116063
+ _t18;
116064
+ return StreamLoader_regenerator().w(function (_context13) {
116065
+ while (1) switch (_context13.p = _context13.n) {
116165
116066
  case 0:
116166
- abortSignal = _args14.length > 2 && _args14[2] !== undefined ? _args14[2] : null;
116167
- requestId = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : null;
116168
- _context14.p = 1;
116067
+ abortSignal = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : null;
116068
+ requestId = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : null;
116069
+ _context13.p = 1;
116169
116070
  loadStartTime = Date.now();
116170
- _context14.n = 2;
116071
+ _context13.n = 2;
116171
116072
  return this.fetchPrimitiveBufferByStream(range, list, abortSignal, requestId);
116172
116073
  case 2:
116173
- streamResult = _context14.v;
116174
- return _context14.a(2, StreamLoader_objectSpread(StreamLoader_objectSpread({}, streamResult || {}), {}, {
116074
+ streamResult = _context13.v;
116075
+ return _context13.a(2, StreamLoader_objectSpread(StreamLoader_objectSpread({}, streamResult || {}), {}, {
116175
116076
  duration: Date.now() - loadStartTime
116176
116077
  }));
116177
116078
  case 3:
116178
- _context14.p = 3;
116179
- _t17 = _context14.v;
116180
- if (!(_t17.name === 'AbortError')) {
116181
- _context14.n = 4;
116079
+ _context13.p = 3;
116080
+ _t18 = _context13.v;
116081
+ if (!(_t18.name === 'AbortError')) {
116082
+ _context13.n = 4;
116182
116083
  break;
116183
116084
  }
116184
- throw _t17;
116085
+ throw _t18;
116185
116086
  case 4:
116186
116087
  if (!(requestId && this.currentRequestId !== requestId)) {
116187
- _context14.n = 5;
116088
+ _context13.n = 5;
116188
116089
  break;
116189
116090
  }
116190
- return _context14.a(2);
116091
+ return _context13.a(2);
116191
116092
  case 5:
116192
- throw _t17;
116093
+ throw _t18;
116193
116094
  case 6:
116194
- return _context14.a(2);
116095
+ return _context13.a(2);
116195
116096
  }
116196
- }, _callee14, this, [[1, 3]]);
116097
+ }, _callee13, this, [[1, 3]]);
116197
116098
  }));
116198
116099
  function fetchJsonStream(_x21, _x22) {
116199
116100
  return _fetchJsonStream.apply(this, arguments);
@@ -116281,20 +116182,8 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116281
116182
  if (dataView.byteLength < offset + 12) {
116282
116183
  throw new Error('Insufficient data for primitive header');
116283
116184
  }
116284
- var primitiveIdTextLen = dataView.getUint32(offset, false);
116185
+ primitive.id = dataView.getInt32(offset, false);
116285
116186
  offset += 4;
116286
- if (primitiveIdTextLen === 0xffffffff) {
116287
- primitive.id = null;
116288
- } else if (primitiveIdTextLen > 0) {
116289
- if (dataView.byteLength < offset + primitiveIdTextLen) {
116290
- throw new Error('Insufficient data for primitive id content');
116291
- }
116292
- var textBytes = uint8Array.subarray(offset, offset + primitiveIdTextLen);
116293
- primitive.id = new TextDecoder('utf-8').decode(textBytes);
116294
- offset += primitiveIdTextLen;
116295
- } else {
116296
- primitive.id = '';
116297
- }
116298
116187
  if (dataView.byteLength < offset + 4) {
116299
116188
  throw new Error('Insufficient data for GeomText length');
116300
116189
  }
@@ -116306,29 +116195,14 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116306
116195
  if (dataView.byteLength < offset + documentTextLen) {
116307
116196
  throw new Error('Insufficient data for GeomText content');
116308
116197
  }
116309
- var _textBytes = uint8Array.subarray(offset, offset + documentTextLen);
116310
- primitive.documentId = new TextDecoder('utf-8').decode(_textBytes);
116198
+ var textBytes = uint8Array.subarray(offset, offset + documentTextLen);
116199
+ primitive.documentId = new TextDecoder('utf-8').decode(textBytes);
116311
116200
  offset += documentTextLen;
116312
116201
  } else {
116313
116202
  primitive.documentId = '';
116314
116203
  }
116315
- if (dataView.byteLength < offset + 4) {
116316
- throw new Error('Insufficient data for Material length');
116317
- }
116318
- var materialTextLen = dataView.getUint32(offset, false);
116204
+ primitive.material = dataView.getInt32(offset, false);
116319
116205
  offset += 4;
116320
- if (materialTextLen === 0xffffffff) {
116321
- primitive.material = null;
116322
- } else if (materialTextLen > 0) {
116323
- if (dataView.byteLength < offset + materialTextLen) {
116324
- throw new Error('Insufficient data for Material content');
116325
- }
116326
- var _textBytes2 = uint8Array.subarray(offset, offset + materialTextLen);
116327
- primitive.material = new TextDecoder('utf-8').decode(_textBytes2);
116328
- offset += materialTextLen;
116329
- } else {
116330
- primitive.material = '';
116331
- }
116332
116206
  if (dataView.byteLength < offset + 4) {
116333
116207
  throw new Error('Insufficient data for GeomText length');
116334
116208
  }
@@ -116340,8 +116214,8 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116340
116214
  if (dataView.byteLength < offset + geomTextLen) {
116341
116215
  throw new Error('Insufficient data for GeomText content');
116342
116216
  }
116343
- var _textBytes3 = uint8Array.subarray(offset, offset + geomTextLen);
116344
- primitive.geomText = new TextDecoder('utf-8').decode(_textBytes3);
116217
+ var _textBytes = uint8Array.subarray(offset, offset + geomTextLen);
116218
+ primitive.geomText = new TextDecoder('utf-8').decode(_textBytes);
116345
116219
  offset += geomTextLen;
116346
116220
  } else {
116347
116221
  primitive.geomText = '';
@@ -116421,8 +116295,8 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116421
116295
  primitive.dataType = null;
116422
116296
  } else if (dataTypeLen > 0) {
116423
116297
  if (dataView.byteLength < offset + dataTypeLen) throw new Error('Insufficient data for DataType content');
116424
- var _textBytes4 = uint8Array.subarray(offset, offset + dataTypeLen);
116425
- primitive.dataType = new TextDecoder('utf-8').decode(_textBytes4);
116298
+ var _textBytes2 = uint8Array.subarray(offset, offset + dataTypeLen);
116299
+ primitive.dataType = new TextDecoder('utf-8').decode(_textBytes2);
116426
116300
  offset += dataTypeLen;
116427
116301
  } else {
116428
116302
  primitive.dataType = '';
@@ -116473,43 +116347,43 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116473
116347
  }, {
116474
116348
  key: "ensureNotInteracting",
116475
116349
  value: function () {
116476
- var _ensureNotInteracting = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee15(abortSignal) {
116350
+ var _ensureNotInteracting = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee14(abortSignal) {
116477
116351
  var _this7 = this;
116478
- return StreamLoader_regenerator().w(function (_context15) {
116479
- while (1) switch (_context15.n) {
116352
+ return StreamLoader_regenerator().w(function (_context14) {
116353
+ while (1) switch (_context14.n) {
116480
116354
  case 0:
116481
116355
  if (!(abortSignal && abortSignal.aborted)) {
116482
- _context15.n = 1;
116356
+ _context14.n = 1;
116483
116357
  break;
116484
116358
  }
116485
- return _context15.a(2);
116359
+ return _context14.a(2);
116486
116360
  case 1:
116487
116361
  if (!this.externalEnsureNotInteracting) {
116488
- _context15.n = 3;
116362
+ _context14.n = 3;
116489
116363
  break;
116490
116364
  }
116491
- _context15.n = 2;
116365
+ _context14.n = 2;
116492
116366
  return this.externalEnsureNotInteracting(abortSignal);
116493
116367
  case 2:
116494
- return _context15.a(2);
116368
+ return _context14.a(2);
116495
116369
  case 3:
116496
116370
  if (this.isUserInteracting) {
116497
- _context15.n = 4;
116371
+ _context14.n = 4;
116498
116372
  break;
116499
116373
  }
116500
- return _context15.a(2);
116374
+ return _context14.a(2);
116501
116375
  case 4:
116502
116376
  if (!this.parsePausePromise) {
116503
116377
  this.parsePausePromise = new Promise(function (resolve) {
116504
116378
  _this7.parsePauseResolver = resolve;
116505
116379
  });
116506
116380
  }
116507
- _context15.n = 5;
116381
+ _context14.n = 5;
116508
116382
  return this.parsePausePromise;
116509
116383
  case 5:
116510
- return _context15.a(2);
116384
+ return _context14.a(2);
116511
116385
  }
116512
- }, _callee15, this);
116386
+ }, _callee14, this);
116513
116387
  }));
116514
116388
  function ensureNotInteracting(_x23) {
116515
116389
  return _ensureNotInteracting.apply(this, arguments);
@@ -116534,10 +116408,10 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116534
116408
  }, {
116535
116409
  key: "handleControlEnd",
116536
116410
  value: function () {
116537
- var _handleControlEnd = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee16() {
116411
+ var _handleControlEnd = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee15() {
116538
116412
  var pressDuration;
116539
- return StreamLoader_regenerator().w(function (_context16) {
116540
- while (1) switch (_context16.n) {
116413
+ return StreamLoader_regenerator().w(function (_context15) {
116414
+ while (1) switch (_context15.n) {
116541
116415
  case 0:
116542
116416
  pressDuration = Date.now() - (this.controlPressStartAt || 0);
116543
116417
  if (pressDuration >= this.longPressAbortThresholdMs) {
@@ -116549,9 +116423,9 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116549
116423
  this.isUserInteracting = false;
116550
116424
  this.resumeParsing();
116551
116425
  case 1:
116552
- return _context16.a(2);
116426
+ return _context15.a(2);
116553
116427
  }
116554
- }, _callee16, this);
116428
+ }, _callee15, this);
116555
116429
  }));
116556
116430
  function handleControlEnd() {
116557
116431
  return _handleControlEnd.apply(this, arguments);
@@ -116561,18 +116435,18 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116561
116435
  }, {
116562
116436
  key: "handleWheelStart",
116563
116437
  value: function () {
116564
- var _handleWheelStart = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee17() {
116565
- return StreamLoader_regenerator().w(function (_context17) {
116566
- while (1) switch (_context17.n) {
116438
+ var _handleWheelStart = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee16() {
116439
+ return StreamLoader_regenerator().w(function (_context16) {
116440
+ while (1) switch (_context16.n) {
116567
116441
  case 0:
116568
116442
  try {
116569
116443
  // await this.abortAllStreamRequests();
116570
116444
  } catch (_) {}
116571
116445
  this.isUserInteracting = true;
116572
116446
  case 1:
116573
- return _context17.a(2);
116447
+ return _context16.a(2);
116574
116448
  }
116575
- }, _callee17, this);
116449
+ }, _callee16, this);
116576
116450
  }));
116577
116451
  function handleWheelStart() {
116578
116452
  return _handleWheelStart.apply(this, arguments);
@@ -116592,18 +116466,18 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116592
116466
  }, {
116593
116467
  key: "batchLoadRegions",
116594
116468
  value: function () {
116595
- var _batchLoadRegions = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee18(item, divideData) {
116596
- var priorityRegions, level0Regions, level1Regions, level2Regions, level3Regions, level4Regions, i, regionData, range, _t18, _t19;
116597
- return StreamLoader_regenerator().w(function (_context18) {
116598
- while (1) switch (_context18.p = _context18.n) {
116469
+ var _batchLoadRegions = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee17(item, divideData) {
116470
+ var priorityRegions, level0Regions, level1Regions, level2Regions, level3Regions, level4Regions, i, regionData, range, _t19, _t20;
116471
+ return StreamLoader_regenerator().w(function (_context17) {
116472
+ while (1) switch (_context17.p = _context17.n) {
116599
116473
  case 0:
116600
116474
  if (!(!divideData || divideData.length === 0)) {
116601
- _context18.n = 1;
116475
+ _context17.n = 1;
116602
116476
  break;
116603
116477
  }
116604
- return _context18.a(2);
116478
+ return _context17.a(2);
116605
116479
  case 1:
116606
- _context18.p = 1;
116480
+ _context17.p = 1;
116607
116481
  priorityRegions = [];
116608
116482
  level0Regions = divideData.filter(function (region) {
116609
116483
  return region.lodLevel && region.lodLevel.includes(0);
@@ -116622,15 +116496,15 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116622
116496
  });
116623
116497
  priorityRegions.push.apply(priorityRegions, StreamLoader_toConsumableArray(level0Regions).concat(StreamLoader_toConsumableArray(level1Regions), StreamLoader_toConsumableArray(level2Regions), StreamLoader_toConsumableArray(level3Regions), StreamLoader_toConsumableArray(level4Regions)));
116624
116498
  if (!(priorityRegions.length === 0)) {
116625
- _context18.n = 2;
116499
+ _context17.n = 2;
116626
116500
  break;
116627
116501
  }
116628
- return _context18.a(2);
116502
+ return _context17.a(2);
116629
116503
  case 2:
116630
116504
  i = 0;
116631
116505
  case 3:
116632
116506
  if (!(i < priorityRegions.length && i < 1)) {
116633
- _context18.n = 8;
116507
+ _context17.n = 8;
116634
116508
  break;
116635
116509
  }
116636
116510
  regionData = priorityRegions[i];
@@ -116638,30 +116512,30 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116638
116512
  regionIndex: regionData.index,
116639
116513
  documentId: item.id
116640
116514
  };
116641
- _context18.p = 4;
116642
- _context18.n = 5;
116515
+ _context17.p = 4;
116516
+ _context17.n = 5;
116643
116517
  return this.fetchJsonSync(item, range);
116644
116518
  case 5:
116645
- _context18.n = 7;
116519
+ _context17.n = 7;
116646
116520
  break;
116647
116521
  case 6:
116648
- _context18.p = 6;
116649
- _t18 = _context18.v;
116522
+ _context17.p = 6;
116523
+ _t19 = _context17.v;
116650
116524
  case 7:
116651
116525
  i++;
116652
- _context18.n = 3;
116526
+ _context17.n = 3;
116653
116527
  break;
116654
116528
  case 8:
116655
- _context18.n = 10;
116529
+ _context17.n = 10;
116656
116530
  break;
116657
116531
  case 9:
116658
- _context18.p = 9;
116659
- _t19 = _context18.v;
116660
- throw _t19;
116532
+ _context17.p = 9;
116533
+ _t20 = _context17.v;
116534
+ throw _t20;
116661
116535
  case 10:
116662
- return _context18.a(2);
116536
+ return _context17.a(2);
116663
116537
  }
116664
- }, _callee18, this, [[4, 6], [1, 9]]);
116538
+ }, _callee17, this, [[4, 6], [1, 9]]);
116665
116539
  }));
116666
116540
  function batchLoadRegions(_x24, _x25) {
116667
116541
  return _batchLoadRegions.apply(this, arguments);
@@ -116671,59 +116545,59 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116671
116545
  }, {
116672
116546
  key: "loadModelByIds",
116673
116547
  value: function () {
116674
- var _loadModelByIds = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee19(options) {
116675
- var params, onComplete, buffer, primitives, _params$immediateUpda, loadStartTime, _ref4, ids, documentIdToIds, _yield$this$parseBuff2, mesh, parsed, _t20;
116676
- return StreamLoader_regenerator().w(function (_context19) {
116677
- while (1) switch (_context19.p = _context19.n) {
116548
+ var _loadModelByIds = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee18(options) {
116549
+ var params, onComplete, buffer, primitives, _params$immediateUpda, loadStartTime, _ref3, ids, documentIdToIds, _yield$this$parseBuff2, mesh, parsed, _t21;
116550
+ return StreamLoader_regenerator().w(function (_context18) {
116551
+ while (1) switch (_context18.p = _context18.n) {
116678
116552
  case 0:
116679
116553
  params = options.params, onComplete = options.onComplete;
116680
116554
  buffer = null;
116681
116555
  primitives = [];
116682
- _context19.p = 1;
116556
+ _context18.p = 1;
116683
116557
  loadStartTime = Date.now(); // 构建 documentIdToIds 映射 多个documentid->modelid
116684
- _ref4 = options.params || {}, ids = _ref4.ids;
116558
+ _ref3 = options.params || {}, ids = _ref3.ids;
116685
116559
  documentIdToIds = this.parseModelDocumentMappings(ids);
116686
116560
  delete params.ids;
116687
116561
  params.documentIdToIds = documentIdToIds;
116688
116562
  params.projectId = this.projectId;
116689
- _context19.n = 2;
116563
+ _context18.n = 2;
116690
116564
  return this.getPrimitivesByRangeDetail(params);
116691
116565
  case 2:
116692
- buffer = _context19.v;
116566
+ buffer = _context18.v;
116693
116567
  if (buffer) {
116694
- _context19.n = 3;
116568
+ _context18.n = 3;
116695
116569
  break;
116696
116570
  }
116697
- return _context19.a(2, {
116571
+ return _context18.a(2, {
116698
116572
  primitives: []
116699
116573
  });
116700
116574
  case 3:
116701
- _context19.n = 4;
116575
+ _context18.n = 4;
116702
116576
  return this.parseBufferData(buffer);
116703
116577
  case 4:
116704
- _yield$this$parseBuff2 = _context19.v;
116578
+ _yield$this$parseBuff2 = _context18.v;
116705
116579
  mesh = _yield$this$parseBuff2.mesh;
116706
116580
  parsed = _yield$this$parseBuff2.primitives;
116707
116581
  primitives = parsed;
116708
- _context19.n = 5;
116582
+ _context18.n = 5;
116709
116583
  return this.renderModelData(mesh, primitives, params.folderInfo, null, onComplete, (_params$immediateUpda = params.immediateUpdate) !== null && _params$immediateUpda !== void 0 ? _params$immediateUpda : true);
116710
116584
  case 5:
116711
- return _context19.a(2, {
116585
+ return _context18.a(2, {
116712
116586
  primitives: primitives,
116713
116587
  mesh: mesh
116714
116588
  });
116715
116589
  case 6:
116716
- _context19.p = 6;
116717
- _t20 = _context19.v;
116718
- if (!(_t20.name === 'AbortError')) {
116719
- _context19.n = 7;
116590
+ _context18.p = 6;
116591
+ _t21 = _context18.v;
116592
+ if (!(_t21.name === 'AbortError')) {
116593
+ _context18.n = 7;
116720
116594
  break;
116721
116595
  }
116722
- throw _t20;
116596
+ throw _t21;
116723
116597
  case 7:
116724
- throw _t20;
116598
+ throw _t21;
116725
116599
  case 8:
116726
- _context19.p = 8;
116600
+ _context18.p = 8;
116727
116601
  try {
116728
116602
  buffer = null;
116729
116603
  if (primitives && primitives.length > 0) {
@@ -116742,11 +116616,11 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116742
116616
  window.gc();
116743
116617
  }
116744
116618
  } catch (cleanupErr) {}
116745
- return _context19.f(8);
116619
+ return _context18.f(8);
116746
116620
  case 9:
116747
- return _context19.a(2);
116621
+ return _context18.a(2);
116748
116622
  }
116749
- }, _callee19, this, [[1, 6, 8, 9]]);
116623
+ }, _callee18, this, [[1, 6, 8, 9]]);
116750
116624
  }));
116751
116625
  function loadModelByIds(_x26) {
116752
116626
  return _loadModelByIds.apply(this, arguments);
@@ -116758,26 +116632,26 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116758
116632
  }, {
116759
116633
  key: "getPrimitivesByDivide",
116760
116634
  value: function () {
116761
- var _getPrimitivesByDivide = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee20(params) {
116635
+ var _getPrimitivesByDivide = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee19(params) {
116762
116636
  var res;
116763
- return StreamLoader_regenerator().w(function (_context20) {
116764
- while (1) switch (_context20.n) {
116637
+ return StreamLoader_regenerator().w(function (_context19) {
116638
+ while (1) switch (_context19.n) {
116765
116639
  case 0:
116766
- _context20.n = 1;
116640
+ _context19.n = 1;
116767
116641
  return this.modelApi.getPrimitivesByDivide(params);
116768
116642
  case 1:
116769
- res = _context20.v;
116643
+ res = _context19.v;
116770
116644
  if (!res) {
116771
- _context20.n = 2;
116645
+ _context19.n = 2;
116772
116646
  break;
116773
116647
  }
116774
- return _context20.a(2, res);
116648
+ return _context19.a(2, res);
116775
116649
  case 2:
116776
116650
  throw new Error('Failed to get primitives');
116777
116651
  case 3:
116778
- return _context20.a(2);
116652
+ return _context19.a(2);
116779
116653
  }
116780
- }, _callee20, this);
116654
+ }, _callee19, this);
116781
116655
  }));
116782
116656
  function getPrimitivesByDivide(_x27) {
116783
116657
  return _getPrimitivesByDivide.apply(this, arguments);
@@ -116787,26 +116661,26 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116787
116661
  }, {
116788
116662
  key: "getPrimitivesByRangeDetail",
116789
116663
  value: function () {
116790
- var _getPrimitivesByRangeDetail = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee21(params) {
116664
+ var _getPrimitivesByRangeDetail = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee20(params) {
116791
116665
  var res;
116792
- return StreamLoader_regenerator().w(function (_context21) {
116793
- while (1) switch (_context21.n) {
116666
+ return StreamLoader_regenerator().w(function (_context20) {
116667
+ while (1) switch (_context20.n) {
116794
116668
  case 0:
116795
- _context21.n = 1;
116669
+ _context20.n = 1;
116796
116670
  return this.modelApi.getPrimitivesByRangeDetail(params);
116797
116671
  case 1:
116798
- res = _context21.v;
116672
+ res = _context20.v;
116799
116673
  if (!res) {
116800
- _context21.n = 2;
116674
+ _context20.n = 2;
116801
116675
  break;
116802
116676
  }
116803
- return _context21.a(2, res);
116677
+ return _context20.a(2, res);
116804
116678
  case 2:
116805
116679
  throw new Error('Failed to get batch model');
116806
116680
  case 3:
116807
- return _context21.a(2);
116681
+ return _context20.a(2);
116808
116682
  }
116809
- }, _callee21, this);
116683
+ }, _callee20, this);
116810
116684
  }));
116811
116685
  function getPrimitivesByRangeDetail(_x28) {
116812
116686
  return _getPrimitivesByRangeDetail.apply(this, arguments);
@@ -116818,31 +116692,31 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116818
116692
  }, {
116819
116693
  key: "getSceneBox",
116820
116694
  value: function () {
116821
- var _getSceneBox = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee22(_ref5) {
116822
- var id, _ref5$projectId, projectId, res;
116823
- return StreamLoader_regenerator().w(function (_context22) {
116824
- while (1) switch (_context22.n) {
116695
+ var _getSceneBox = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee21(_ref4) {
116696
+ var id, _ref4$projectId, projectId, res;
116697
+ return StreamLoader_regenerator().w(function (_context21) {
116698
+ while (1) switch (_context21.n) {
116825
116699
  case 0:
116826
- id = _ref5.id, _ref5$projectId = _ref5.projectId, projectId = _ref5$projectId === void 0 ? this.projectId : _ref5$projectId;
116827
- _context22.n = 1;
116700
+ id = _ref4.id, _ref4$projectId = _ref4.projectId, projectId = _ref4$projectId === void 0 ? this.projectId : _ref4$projectId;
116701
+ _context21.n = 1;
116828
116702
  return this.modelApi.getSceneBox({
116829
116703
  id: id,
116830
116704
  projectId: projectId
116831
116705
  });
116832
116706
  case 1:
116833
- res = _context22.v;
116707
+ res = _context21.v;
116834
116708
  if (!(res && res[0])) {
116835
- _context22.n = 2;
116709
+ _context21.n = 2;
116836
116710
  break;
116837
116711
  }
116838
116712
  this.sceneBox = res[0];
116839
- return _context22.a(2, res[0]);
116713
+ return _context21.a(2, res[0]);
116840
116714
  case 2:
116841
- return _context22.a(2, null);
116715
+ return _context21.a(2, null);
116842
116716
  case 3:
116843
- return _context22.a(2);
116717
+ return _context21.a(2);
116844
116718
  }
116845
- }, _callee22, this);
116719
+ }, _callee21, this);
116846
116720
  }));
116847
116721
  function getSceneBox(_x29) {
116848
116722
  return _getSceneBox.apply(this, arguments);
@@ -116852,43 +116726,43 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116852
116726
  }, {
116853
116727
  key: "getBox",
116854
116728
  value: function () {
116855
- var _getBox = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee23(_ref6) {
116856
- var id, _ref6$projectId, projectId, isDebug, cached, res;
116857
- return StreamLoader_regenerator().w(function (_context23) {
116858
- while (1) switch (_context23.n) {
116729
+ var _getBox = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee22(_ref5) {
116730
+ var id, _ref5$projectId, projectId, cached, res;
116731
+ return StreamLoader_regenerator().w(function (_context22) {
116732
+ while (1) switch (_context22.n) {
116859
116733
  case 0:
116860
- id = _ref6.id, _ref6$projectId = _ref6.projectId, projectId = _ref6$projectId === void 0 ? this.projectId || 0 : _ref6$projectId, isDebug = _ref6.isDebug;
116861
- _context23.n = 1;
116734
+ id = _ref5.id, _ref5$projectId = _ref5.projectId, projectId = _ref5$projectId === void 0 ? this.projectId || 0 : _ref5$projectId;
116735
+ _context22.n = 1;
116862
116736
  return this._getFromDB(id, projectId);
116863
116737
  case 1:
116864
- cached = _context23.v;
116865
- if (!(cached && !isDebug)) {
116866
- _context23.n = 2;
116738
+ cached = _context22.v;
116739
+ if (!cached) {
116740
+ _context22.n = 2;
116867
116741
  break;
116868
116742
  }
116869
- return _context23.a(2, cached);
116743
+ return _context22.a(2, cached);
116870
116744
  case 2:
116871
- _context23.n = 3;
116745
+ _context22.n = 3;
116872
116746
  return this.modelApi.getBox({
116873
116747
  id: id,
116874
116748
  projectId: projectId
116875
116749
  });
116876
116750
  case 3:
116877
- res = _context23.v;
116751
+ res = _context22.v;
116878
116752
  if (!res) {
116879
- _context23.n = 4;
116753
+ _context22.n = 4;
116880
116754
  break;
116881
116755
  }
116882
116756
  // 3. 存入 IndexedDB (存储原始数据)
116883
116757
  this._applyPrefixId(res, 'id', id);
116884
116758
  this._saveToDB(id, res, projectId);
116885
- return _context23.a(2, res);
116759
+ return _context22.a(2, res);
116886
116760
  case 4:
116887
- return _context23.a(2, null);
116761
+ return _context22.a(2, null);
116888
116762
  case 5:
116889
- return _context23.a(2);
116763
+ return _context22.a(2);
116890
116764
  }
116891
- }, _callee23, this);
116765
+ }, _callee22, this);
116892
116766
  }));
116893
116767
  function getBox(_x30) {
116894
116768
  return _getBox.apply(this, arguments);
@@ -116898,11 +116772,11 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116898
116772
  }, {
116899
116773
  key: "handleCameraControlForStream",
116900
116774
  value: function () {
116901
- var _handleCameraControlForStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee24(args) {
116775
+ var _handleCameraControlForStream = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee23(args) {
116902
116776
  var _this8 = this;
116903
- var chainRequest, loadedModels, documentIdToIds, activeItems, primaryItem, requestId, range, streamResult, _t21;
116904
- return StreamLoader_regenerator().w(function (_context24) {
116905
- while (1) switch (_context24.p = _context24.n) {
116777
+ var chainRequest, loadedModels, documentIdToIds, activeItems, primaryItem, requestId, range, streamResult, _t22;
116778
+ return StreamLoader_regenerator().w(function (_context23) {
116779
+ while (1) switch (_context23.p = _context23.n) {
116906
116780
  case 0:
116907
116781
  // 性能优化注释:禁用 range 被注释字段的解构声明与初始化
116908
116782
  chainRequest = args.chainRequest, loadedModels = args.loadedModels; // 构建 documentIdToIds 映射 多个documentid->modelid
@@ -116926,10 +116800,10 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116926
116800
  }
116927
116801
  });
116928
116802
  if (!(activeItems.length === 0)) {
116929
- _context24.n = 1;
116803
+ _context23.n = 1;
116930
116804
  break;
116931
116805
  }
116932
- return _context24.a(2);
116806
+ return _context23.a(2);
116933
116807
  case 1:
116934
116808
  primaryItem = activeItems[0]; // 使用第一个item作为主上下文
116935
116809
  requestId = Date.now() + '_' + Math.random().toString(36).substr(2, 9);
@@ -116978,20 +116852,20 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
116978
116852
  // range.minZ = Math.max(range.minZ, boxToUse.min_z);
116979
116853
  // range.maxZ = Math.min(range.maxZ, boxToUse.max_z);
116980
116854
  // }
116981
- _context24.p = 2;
116982
- _context24.n = 3;
116855
+ _context23.p = 2;
116856
+ _context23.n = 3;
116983
116857
  return this.fetchJsonStream(primaryItem, range, this.currentAbortController.signal, requestId);
116984
116858
  case 3:
116985
- streamResult = _context24.v;
116859
+ streamResult = _context23.v;
116986
116860
  if (!(this.currentRequestId === requestId)) {
116987
- _context24.n = 5;
116861
+ _context23.n = 5;
116988
116862
  break;
116989
116863
  }
116990
116864
  if (!(typeof this.onRangeStreamComplete === 'function')) {
116991
- _context24.n = 4;
116865
+ _context23.n = 4;
116992
116866
  break;
116993
116867
  }
116994
- _context24.n = 4;
116868
+ _context23.n = 4;
116995
116869
  return this.onRangeStreamComplete(StreamLoader_objectSpread({
116996
116870
  source: 'inRangeDis2',
116997
116871
  requestId: requestId,
@@ -117001,28 +116875,28 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117001
116875
  case 4:
117002
116876
  this.currentAbortController = null;
117003
116877
  this.currentRequestId = null;
117004
- _context24.n = 5;
116878
+ _context23.n = 5;
117005
116879
  break;
117006
116880
  case 5:
117007
- _context24.n = 8;
116881
+ _context23.n = 8;
117008
116882
  break;
117009
116883
  case 6:
117010
- _context24.p = 6;
117011
- _t21 = _context24.v;
117012
- if (!(_t21.name === 'AbortError')) {
117013
- _context24.n = 7;
116884
+ _context23.p = 6;
116885
+ _t22 = _context23.v;
116886
+ if (!(_t22.name === 'AbortError')) {
116887
+ _context23.n = 7;
117014
116888
  break;
117015
116889
  }
117016
- return _context24.a(2);
116890
+ return _context23.a(2);
117017
116891
  case 7:
117018
116892
  if (this.currentRequestId === requestId) {
117019
116893
  this.currentAbortController = null;
117020
116894
  this.currentRequestId = null;
117021
116895
  }
117022
116896
  case 8:
117023
- return _context24.a(2);
116897
+ return _context23.a(2);
117024
116898
  }
117025
- }, _callee24, this, [[2, 6]]);
116899
+ }, _callee23, this, [[2, 6]]);
117026
116900
  }));
117027
116901
  function handleCameraControlForStream(_x31) {
117028
116902
  return _handleCameraControlForStream.apply(this, arguments);
@@ -117081,61 +116955,60 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117081
116955
  }, {
117082
116956
  key: "processModelItem",
117083
116957
  value: function () {
117084
- var _processModelItem = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee25(item) {
116958
+ var _processModelItem = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee24(item) {
117085
116959
  var options,
117086
116960
  materialData,
117087
116961
  mergeMaterialData,
117088
116962
  sceneBox,
117089
116963
  boxIndex,
117090
116964
  modelResourceMapObj,
117091
- _args25 = arguments,
117092
- _t22;
117093
- return StreamLoader_regenerator().w(function (_context25) {
117094
- while (1) switch (_context25.p = _context25.n) {
116965
+ _args24 = arguments,
116966
+ _t23;
116967
+ return StreamLoader_regenerator().w(function (_context24) {
116968
+ while (1) switch (_context24.p = _context24.n) {
117095
116969
  case 0:
117096
- options = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
117097
- _context25.p = 1;
116970
+ options = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {};
116971
+ _context24.p = 1;
117098
116972
  if (typeof item.id !== 'string') {
117099
116973
  item.id = '' + item.id;
117100
116974
  }
117101
116975
 
117102
116976
  // 获取材质数据
117103
- _context25.n = 2;
116977
+ _context24.n = 2;
117104
116978
  return this.getPrimitivesByMaterial({
117105
116979
  id: item.id,
117106
116980
  projectId: this.projectId
117107
116981
  });
117108
116982
  case 2:
117109
- materialData = _context25.v;
117110
- _context25.n = 3;
116983
+ materialData = _context24.v;
116984
+ _context24.n = 3;
117111
116985
  return this.getPrimitivesByMergeMaterial({
117112
116986
  id: item.id,
117113
116987
  projectId: this.projectId
117114
116988
  });
117115
116989
  case 3:
117116
- mergeMaterialData = _context25.v;
116990
+ mergeMaterialData = _context24.v;
117117
116991
  this._applyPrefixId(mergeMaterialData, 'id');
117118
116992
  this._applyPrefixId(materialData, 'id');
117119
116993
 
117120
116994
  // 获取场景包围盒
117121
- _context25.n = 4;
116995
+ _context24.n = 4;
117122
116996
  return this.getSceneBox({
117123
116997
  id: item.id,
117124
116998
  projectId: this.projectId
117125
116999
  });
117126
117000
  case 4:
117127
- sceneBox = _context25.v;
117001
+ sceneBox = _context24.v;
117128
117002
  this.sceneBox = sceneBox;
117129
117003
 
117130
117004
  // 获取BoxIndex
117131
- _context25.n = 5;
117005
+ _context24.n = 5;
117132
117006
  return this.getBox({
117133
117007
  id: item.id,
117134
- projectId: this.projectId,
117135
- isDebug: this.debug
117008
+ projectId: this.projectId
117136
117009
  });
117137
117010
  case 5:
117138
- boxIndex = _context25.v;
117011
+ boxIndex = _context24.v;
117139
117012
  this.boxIndex = boxIndex;
117140
117013
 
117141
117014
  // 将 mergeMaterialData 覆盖到 materialData(按 id 覆盖 color/transp)
@@ -117147,18 +117020,18 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117147
117020
  }; // 设置当前模型到注册表
117148
117021
  this.updateModelRegistry(item, materialData, mergeMaterialData, sceneBox, boxIndex);
117149
117022
  console.log('modelRegistry', this.modelRegistry);
117150
- return _context25.a(2, {
117023
+ return _context24.a(2, {
117151
117024
  modelResourceMap: modelResourceMapObj,
117152
117025
  sceneBox: sceneBox,
117153
117026
  boxIndex: boxIndex,
117154
117027
  item: item
117155
117028
  });
117156
117029
  case 6:
117157
- _context25.p = 6;
117158
- _t22 = _context25.v;
117159
- return _context25.a(2, null);
117030
+ _context24.p = 6;
117031
+ _t23 = _context24.v;
117032
+ return _context24.a(2, null);
117160
117033
  }
117161
- }, _callee25, this, [[1, 6]]);
117034
+ }, _callee24, this, [[1, 6]]);
117162
117035
  }));
117163
117036
  function processModelItem(_x32) {
117164
117037
  return _processModelItem.apply(this, arguments);
@@ -117197,27 +117070,27 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117197
117070
  }, {
117198
117071
  key: "_getFromDB",
117199
117072
  value: function () {
117200
- var _getFromDB2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee26(id) {
117073
+ var _getFromDB2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee25(id) {
117201
117074
  var projectId,
117202
117075
  db,
117203
- _args26 = arguments,
117204
- _t23;
117205
- return StreamLoader_regenerator().w(function (_context26) {
117206
- while (1) switch (_context26.p = _context26.n) {
117076
+ _args25 = arguments,
117077
+ _t24;
117078
+ return StreamLoader_regenerator().w(function (_context25) {
117079
+ while (1) switch (_context25.p = _context25.n) {
117207
117080
  case 0:
117208
- projectId = _args26.length > 1 && _args26[1] !== undefined ? _args26[1] : this.projectId || 0;
117209
- _context26.p = 1;
117210
- _context26.n = 2;
117081
+ projectId = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : this.projectId || 0;
117082
+ _context25.p = 1;
117083
+ _context25.n = 2;
117211
117084
  return this._initDB();
117212
117085
  case 2:
117213
- db = _context26.v;
117086
+ db = _context25.v;
117214
117087
  if (db) {
117215
- _context26.n = 3;
117088
+ _context25.n = 3;
117216
117089
  break;
117217
117090
  }
117218
- return _context26.a(2, null);
117091
+ return _context25.a(2, null);
117219
117092
  case 3:
117220
- return _context26.a(2, new Promise(function (resolve) {
117093
+ return _context25.a(2, new Promise(function (resolve) {
117221
117094
  var transaction = db.transaction(['boxCache'], 'readonly');
117222
117095
  var store = transaction.objectStore('boxCache');
117223
117096
  var request = store.get("".concat(projectId, ":").concat(id));
@@ -117229,12 +117102,12 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117229
117102
  };
117230
117103
  }));
117231
117104
  case 4:
117232
- _context26.p = 4;
117233
- _t23 = _context26.v;
117234
- console.warn('Error reading from IndexedDB:', _t23);
117235
- return _context26.a(2, null);
117105
+ _context25.p = 4;
117106
+ _t24 = _context25.v;
117107
+ console.warn('Error reading from IndexedDB:', _t24);
117108
+ return _context25.a(2, null);
117236
117109
  }
117237
- }, _callee26, this, [[1, 4]]);
117110
+ }, _callee25, this, [[1, 4]]);
117238
117111
  }));
117239
117112
  function _getFromDB(_x33) {
117240
117113
  return _getFromDB2.apply(this, arguments);
@@ -117244,41 +117117,41 @@ var StreamLoader_StreamLoader = /*#__PURE__*/function () {
117244
117117
  }, {
117245
117118
  key: "_saveToDB",
117246
117119
  value: function () {
117247
- var _saveToDB2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee27(id, data) {
117120
+ var _saveToDB2 = StreamLoader_asyncToGenerator(/*#__PURE__*/StreamLoader_regenerator().m(function _callee26(id, data) {
117248
117121
  var projectId,
117249
117122
  db,
117250
117123
  transaction,
117251
117124
  store,
117252
- _args27 = arguments,
117253
- _t24;
117254
- return StreamLoader_regenerator().w(function (_context27) {
117255
- while (1) switch (_context27.p = _context27.n) {
117125
+ _args26 = arguments,
117126
+ _t25;
117127
+ return StreamLoader_regenerator().w(function (_context26) {
117128
+ while (1) switch (_context26.p = _context26.n) {
117256
117129
  case 0:
117257
- projectId = _args27.length > 2 && _args27[2] !== undefined ? _args27[2] : this.projectId || 0;
117258
- _context27.p = 1;
117259
- _context27.n = 2;
117130
+ projectId = _args26.length > 2 && _args26[2] !== undefined ? _args26[2] : this.projectId || 0;
117131
+ _context26.p = 1;
117132
+ _context26.n = 2;
117260
117133
  return this._initDB();
117261
117134
  case 2:
117262
- db = _context27.v;
117135
+ db = _context26.v;
117263
117136
  if (db) {
117264
- _context27.n = 3;
117137
+ _context26.n = 3;
117265
117138
  break;
117266
117139
  }
117267
- return _context27.a(2);
117140
+ return _context26.a(2);
117268
117141
  case 3:
117269
117142
  transaction = db.transaction(['boxCache'], 'readwrite');
117270
117143
  store = transaction.objectStore('boxCache');
117271
117144
  store.put(data, "".concat(projectId, ":").concat(id));
117272
- _context27.n = 5;
117145
+ _context26.n = 5;
117273
117146
  break;
117274
117147
  case 4:
117275
- _context27.p = 4;
117276
- _t24 = _context27.v;
117277
- console.warn('Error saving to IndexedDB:', _t24);
117148
+ _context26.p = 4;
117149
+ _t25 = _context26.v;
117150
+ console.warn('Error saving to IndexedDB:', _t25);
117278
117151
  case 5:
117279
- return _context27.a(2);
117152
+ return _context26.a(2);
117280
117153
  }
117281
- }, _callee27, this, [[1, 4]]);
117154
+ }, _callee26, this, [[1, 4]]);
117282
117155
  }));
117283
117156
  function _saveToDB(_x34, _x35) {
117284
117157
  return _saveToDB2.apply(this, arguments);
@@ -120921,7 +120794,7 @@ var LOG_INTERVAL = 30;
120921
120794
 
120922
120795
 
120923
120796
 
120924
- // import boxJson from './box.json';
120797
+
120925
120798
 
120926
120799
 
120927
120800
 
@@ -122252,12 +122125,8 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122252
122125
  if (isAdd && boxJson) {
122253
122126
  var arr = boxJson ? boxJson : [];
122254
122127
  var modelIds = new Set();
122255
- var validGeomTypes = new Set(Object.values(GEOM_TYPES));
122256
122128
  for (var i = 0; i < arr.length; i++) {
122257
122129
  var it = arr[i];
122258
- if (!validGeomTypes.has(it.geomType)) {
122259
- continue;
122260
- }
122261
122130
  if (it.obb.length == 0) {
122262
122131
  continue;
122263
122132
  }
@@ -122268,21 +122137,10 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122268
122137
 
122269
122138
  // 构造 AABB
122270
122139
  var boxThree = new this.THREE.Box3(min, max);
122271
- var hasMatrix = Array.isArray(it.matrix) && it.matrix.length >= 16;
122272
- var hasMeshMatrix = Array.isArray(it.meshMatrix) && it.meshMatrix.length >= 16;
122273
- var localMatrix = null;
122274
- if (hasMatrix || hasMeshMatrix) {
122275
- localMatrix = new this.THREE.Matrix4();
122276
- if (hasMeshMatrix) {
122277
- localMatrix.fromArray(it.meshMatrix);
122278
- } else {
122279
- localMatrix.identity();
122280
- }
122281
- if (hasMatrix) {
122282
- var matrix = new this.THREE.Matrix4().fromArray(it.matrix);
122283
- localMatrix.multiply(matrix);
122284
- }
122285
- var worldMatrix = localMatrix.clone();
122140
+ var hasMatrix = Array.isArray(it.matrix);
122141
+ if (hasMatrix && it.matrix.length >= 16) {
122142
+ var matrix = new this.THREE.Matrix4().fromArray(it.matrix);
122143
+ var worldMatrix = matrix.clone();
122286
122144
  if (this.bizToThreeMatrix) {
122287
122145
  worldMatrix.premultiply(this.bizToThreeMatrix);
122288
122146
  }
@@ -122294,19 +122152,15 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122294
122152
  var userData = {
122295
122153
  flag: it.flag || 1,
122296
122154
  // 默认为 1
122297
- geomType: it.geomType,
122298
122155
  obbData: it.obb,
122299
122156
  // 存储原始 OBB 数据
122300
122157
  transparent: it.transp > 0,
122301
122158
  sourceVisible: it.visible === false ? false : true,
122302
- visible: it.visible === false ? false : true,
122303
- // 默认显示
122304
- occlusionEnabled: it.geomType === GEOM_TYPES.geom_3d || it.geomType === GEOM_TYPES.geom_3d_obj
122159
+ visible: it.visible === false ? false : true // 默认显示
122305
122160
  };
122306
122161
  if (it.flag === 1) {
122307
122162
  userData.indices = it.indices;
122308
- userData.matrix = localMatrix ? localMatrix.toArray() : it.matrix;
122309
- userData.meshMatrix = it.meshMatrix;
122163
+ userData.matrix = it.matrix;
122310
122164
  // userData.matrix = new this.THREE.Matrix4().identity();
122311
122165
  }
122312
122166
  // 如果是 flag=3,解析并存储中心点、半轴长、旋转矩阵
@@ -122320,9 +122174,6 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122320
122174
  var rotationMatrix4 = new this.THREE.Matrix4().setFromMatrix3(rotation);
122321
122175
  var obbMatrix = new this.THREE.Matrix4().makeTranslation(center.x, center.y, center.z);
122322
122176
  obbMatrix.multiply(rotationMatrix4);
122323
- if (localMatrix) {
122324
- obbMatrix.premultiply(localMatrix);
122325
- }
122326
122177
  userData.obb = {
122327
122178
  matrix: obbMatrix,
122328
122179
  center: center,
@@ -122367,9 +122218,6 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122367
122218
  this.buildOctreeFromBoxIndex();
122368
122219
  console.log('time end', Date.now());
122369
122220
  },
122370
- shouldApplyOcclusionByBox: function shouldApplyOcclusionByBox(box) {
122371
- return !!(box && box.userData && box.userData.occlusionEnabled);
122372
- },
122373
122221
  tryInitialCenterAfterBoundsReady: function tryInitialCenterAfterBoundsReady() {
122374
122222
  if (this.hasExecutedCentering || this.userInteracting) return;
122375
122223
  if (!this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) return;
@@ -122999,7 +122847,7 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
122999
122847
  }
123000
122848
  visibleIdSet = new Set(visibleIds);
123001
122849
  if (!_this12._octree) {
123002
- _context3.n = 8;
122850
+ _context3.n = 7;
123003
122851
  break;
123004
122852
  }
123005
122853
  frustum = _this12._getCurrentFrustum();
@@ -123008,40 +122856,29 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123008
122856
  i = 0;
123009
122857
  case 3:
123010
122858
  if (!(i < hits.length)) {
123011
- _context3.n = 7;
122859
+ _context3.n = 6;
123012
122860
  break;
123013
122861
  }
123014
122862
  if (!(hits[i].box && hits[i].box.userData && hits[i].box.userData.visible === false)) {
123015
122863
  _context3.n = 4;
123016
122864
  break;
123017
122865
  }
123018
- return _context3.a(3, 6);
122866
+ return _context3.a(3, 5);
123019
122867
  case 4:
123020
- if (_this12.shouldApplyOcclusionByBox(hits[i].box)) {
123021
- _context3.n = 5;
123022
- break;
123023
- }
123024
- visibleIdSet.add(_this12.formatModelId(hits[i].modelId));
123025
- return _context3.a(3, 6);
123026
- case 5:
123027
122868
  candidates.push(hits[i]);
123028
- case 6:
122869
+ case 5:
123029
122870
  i++;
123030
122871
  _context3.n = 3;
123031
122872
  break;
123032
- case 7:
123033
- _context3.n = 9;
122873
+ case 6:
122874
+ _context3.n = 8;
123034
122875
  break;
123035
- case 8:
122876
+ case 7:
123036
122877
  if (_this12._boxIndex && _this12._boxIndex.size > 0) {
123037
122878
  _this12._boxIndex.forEach(function (box, modelId) {
123038
122879
  if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
123039
122880
  if (box.userData && box.userData.visible === false) return;
123040
122881
  if (_this12.isBoxInFrustum(box)) {
123041
- if (!_this12.shouldApplyOcclusionByBox(box)) {
123042
- visibleIdSet.add(_this12.formatModelId(modelId));
123043
- return;
123044
- }
123045
122882
  candidates.push({
123046
122883
  modelId: modelId,
123047
122884
  box: box
@@ -123049,11 +122886,11 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123049
122886
  }
123050
122887
  });
123051
122888
  }
123052
- case 9:
122889
+ case 8:
123053
122890
  occlusionState = _this12.noObserver ? _this12.noObserver.occlusionState : _this12.occlusionState; // 从响应式对象获取开关状态
123054
122891
  occlusionEnabled = _this12.occlusionState && _this12.occlusionState.enabled;
123055
122892
  if (!occlusionEnabled) {
123056
- _context3.n = 16;
122893
+ _context3.n = 15;
123057
122894
  break;
123058
122895
  }
123059
122896
  state = occlusionState;
@@ -123067,7 +122904,7 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123067
122904
  sh = Math.max(1, sh);
123068
122905
  rt = state._colorRT;
123069
122906
  t0 = performance.now();
123070
- _context3.p = 10;
122907
+ _context3.p = 9;
123071
122908
  if (!rt || state._rtW !== sw || state._rtH !== sh) {
123072
122909
  if (rt && typeof rt.dispose === 'function') rt.dispose();
123073
122910
  rt = new _this12.THREE.WebGLRenderTarget(sw, sh, {
@@ -123564,9 +123401,9 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123564
123401
  extraStride = _this12.occlusionState && _this12.occlusionState.sampleStride ? _this12.occlusionState.sampleStride : 1;
123565
123402
  stride = Math.max(1, baseStride * Math.max(1, extraStride));
123566
123403
  minSampleCount = _this12.occlusionState && _this12.occlusionState.minSampleCount ? _this12.occlusionState.minSampleCount : 1;
123567
- _context3.n = 11;
123404
+ _context3.n = 10;
123568
123405
  return _this12.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, maxIdx, minSampleCount);
123569
- case 11:
123406
+ case 10:
123570
123407
  scanResult = _context3.v;
123571
123408
  if (scanResult && scanResult.buffer) {
123572
123409
  state._colorBuffer = new Uint8Array(scanResult.buffer);
@@ -123580,7 +123417,7 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123580
123417
  }
123581
123418
  transparentMaxIdx = typeof state._occTransparentMaxIdx === 'number' ? state._occTransparentMaxIdx : 0;
123582
123419
  if (!(transparentMaxIdx > 0 && transparentMesh && transparentMesh.visible)) {
123583
- _context3.n = 13;
123420
+ _context3.n = 12;
123584
123421
  break;
123585
123422
  }
123586
123423
  _this12.renderer.setClearColor(new _this12.THREE.Color(0, 0, 0), 0);
@@ -123588,9 +123425,9 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123588
123425
  _this12.renderer.render(state._occTransparentScene, _this12.camera);
123589
123426
  _this12.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
123590
123427
  tIdIndexArr = transparentIdIndexArr;
123591
- _context3.n = 12;
123428
+ _context3.n = 11;
123592
123429
  return _this12.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, transparentMaxIdx, minSampleCount);
123593
- case 12:
123430
+ case 11:
123594
123431
  tScanResult = _context3.v;
123595
123432
  if (tScanResult && tScanResult.buffer) {
123596
123433
  state._colorBuffer = new Uint8Array(tScanResult.buffer);
@@ -123602,26 +123439,26 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123602
123439
  visibleIdSet.add(_id);
123603
123440
  }
123604
123441
  }
123605
- case 13:
123442
+ case 12:
123606
123443
  _this12.renderer.setRenderTarget(prevTarget);
123607
123444
  _this12.renderer.setClearColor(prevClearColorHex, prevClearAlpha);
123608
123445
  _this12.renderer.toneMapping = prevToneMapping;
123609
- _context3.n = 15;
123446
+ _context3.n = 14;
123610
123447
  break;
123611
- case 14:
123612
- _context3.p = 14;
123448
+ case 13:
123449
+ _context3.p = 13;
123613
123450
  _t2 = _context3.v;
123614
123451
  for (_i10 = 0; _i10 < candidates.length; _i10++) {
123615
123452
  visibleIdSet.add(candidates[_i10].modelId);
123616
123453
  }
123617
- case 15:
123618
- _context3.n = 17;
123454
+ case 14:
123455
+ _context3.n = 16;
123619
123456
  break;
123620
- case 16:
123457
+ case 15:
123621
123458
  for (_i11 = 0; _i11 < candidates.length; _i11++) {
123622
123459
  visibleIdSet.add(candidates[_i11].modelId);
123623
123460
  }
123624
- case 17:
123461
+ case 16:
123625
123462
  visibleIds.length = 0;
123626
123463
  visibleIdSet.forEach(function (id) {
123627
123464
  return visibleIds.push(id);
@@ -123652,11 +123489,6 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123652
123489
  if (bypassList && bypassList.size > 0 && bypassList.has(_modelId)) return;
123653
123490
  var instanceInfo = instancesMap.get(_modelId);
123654
123491
  var instanceIndex = instanceInfo && typeof instanceInfo.instanceIndex === 'number' ? instanceInfo.instanceIndex : null;
123655
- var _box = _this12._boxIndex && _this12._boxIndex.has(String(_modelId)) ? _this12._boxIndex.get(String(_modelId)) : _this12._boxIndex && _this12._boxIndex.has(_modelId) ? _this12._boxIndex.get(_modelId) : null;
123656
- if (!_this12.shouldApplyOcclusionByBox(_box)) {
123657
- allInactive = false;
123658
- continue;
123659
- }
123660
123492
  var _inFrustum = _this12.isModelInFrustum(child, instanceIndex, globalFrustum);
123661
123493
  var _modelInVisible = toLoadSet.has(_modelId);
123662
123494
  // console.log('modelId', modelId, 'inFrustum', inFrustum, 'modelInVisible', modelInVisible)
@@ -123670,13 +123502,6 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123670
123502
  // 第二遍遍历:同步状态并决定是否卸载
123671
123503
  for (var _i13 = 0, _modelIds3 = modelIds; _i13 < _modelIds3.length; _i13++) {
123672
123504
  var _modelId2 = _modelIds3[_i13];
123673
- var _box2 = _this12._boxIndex && _this12._boxIndex.has(String(_modelId2)) ? _this12._boxIndex.get(String(_modelId2)) : _this12._boxIndex && _this12._boxIndex.has(_modelId2) ? _this12._boxIndex.get(_modelId2) : null;
123674
- if (!_this12.shouldApplyOcclusionByBox(_box2)) {
123675
- if (toLoadSet.has(_modelId2)) {
123676
- toLoadSet.delete(_modelId2);
123677
- }
123678
- continue;
123679
- }
123680
123505
  // 无论是否卸载,只要模型已在场景中,就从待加载集合中移除
123681
123506
  if (toLoadSet.has(_modelId2)) {
123682
123507
  toLoadSet.delete(_modelId2);
@@ -123698,13 +123523,6 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123698
123523
  }
123699
123524
  var modelId = child.parent && child.parent.userData && child.parent.userData.instanceId ? child.parent.userData.instanceId : child.uuid;
123700
123525
  if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
123701
- var box = _this12._boxIndex && _this12._boxIndex.has(String(modelId)) ? _this12._boxIndex.get(String(modelId)) : _this12._boxIndex && _this12._boxIndex.has(modelId) ? _this12._boxIndex.get(modelId) : null;
123702
- if (!_this12.shouldApplyOcclusionByBox(box)) {
123703
- if (toLoadSet.has(modelId)) {
123704
- toLoadSet.delete(modelId);
123705
- }
123706
- return;
123707
- }
123708
123526
  var inFrustum = _this12.isModelInFrustum(child, null, globalFrustum);
123709
123527
  var modelInVisible = toLoadSet.has(modelId);
123710
123528
  if (modelInVisible) {
@@ -123730,10 +123548,10 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
123730
123548
  });
123731
123549
  }
123732
123550
  _this12.modelStateManager.isloadedModelsIds = Object.freeze(Array.from(toLoadSet));
123733
- case 18:
123551
+ case 17:
123734
123552
  return _context3.a(2);
123735
123553
  }
123736
- }, _callee3, null, [[10, 14]]);
123554
+ }, _callee3, null, [[9, 13]]);
123737
123555
  }))();
123738
123556
  },
123739
123557
  isBoxInFrustum: function isBoxInFrustum(box) {
@@ -127558,11 +127376,11 @@ var COLLISION_PENETRATION_EPSILON = 0.1;
127558
127376
  });
127559
127377
  // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=script&lang=js
127560
127378
  /* harmony default export */ var components_com_graphicsvue_type_script_lang_js = (com_graphicsvue_type_script_lang_js);
127561
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=46d6866f&prod&lang=scss&scoped=true
127562
- var com_graphicsvue_type_style_index_0_id_46d6866f_prod_lang_scss_scoped_true = __webpack_require__("cbdd");
127379
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=607a330c&prod&lang=scss&scoped=true
127380
+ var com_graphicsvue_type_style_index_0_id_607a330c_prod_lang_scss_scoped_true = __webpack_require__("d181");
127563
127381
 
127564
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=46d6866f&prod&lang=css
127565
- var com_graphicsvue_type_style_index_1_id_46d6866f_prod_lang_css = __webpack_require__("12fb");
127382
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=607a330c&prod&lang=css
127383
+ var com_graphicsvue_type_style_index_1_id_607a330c_prod_lang_css = __webpack_require__("0c36");
127566
127384
 
127567
127385
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
127568
127386
  /* globals __VUE_SSR_CONTEXT__ */
@@ -127674,17 +127492,17 @@ function normalizeComponent(
127674
127492
 
127675
127493
  var component = normalizeComponent(
127676
127494
  components_com_graphicsvue_type_script_lang_js,
127677
- com_graphicsvue_type_template_id_46d6866f_scoped_true_render,
127495
+ com_graphicsvue_type_template_id_607a330c_scoped_true_render,
127678
127496
  staticRenderFns,
127679
127497
  false,
127680
127498
  null,
127681
- "46d6866f",
127499
+ "607a330c",
127682
127500
  null
127683
127501
 
127684
127502
  )
127685
127503
 
127686
127504
  /* harmony default export */ var com_graphics = (component.exports);
127687
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44f05828-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=b313ab6c&scoped=true
127505
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"13819966-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=b313ab6c&scoped=true
127688
127506
  var com_flcanvasvue_type_template_id_b313ab6c_scoped_true_render = function render() {
127689
127507
  var _vm = this,
127690
127508
  _c = _vm._self._c;
@@ -131737,7 +131555,7 @@ var com_flcanvas_component = normalizeComponent(
131737
131555
  )
131738
131556
 
131739
131557
  /* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
131740
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44f05828-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
131558
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"13819966-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
131741
131559
  var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
131742
131560
  var _vm = this,
131743
131561
  _c = _vm._self._c;
@@ -131845,7 +131663,7 @@ var per_control_component = normalizeComponent(
131845
131663
  )
131846
131664
 
131847
131665
  /* harmony default export */ var per_control = (per_control_component.exports);
131848
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44f05828-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
131666
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"13819966-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
131849
131667
  var pidvue_type_template_id_2572c0e2_scoped_true_render = function render() {
131850
131668
  var _vm = this,
131851
131669
  _c = _vm._self._c;
@@ -131892,7 +131710,7 @@ var browserify_default = /*#__PURE__*/__webpack_require__.n(browserify);
131892
131710
  var html2canvas = __webpack_require__("c0e9");
131893
131711
  var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
131894
131712
 
131895
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44f05828-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
131713
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"13819966-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
131896
131714
  var ann_toolvue_type_template_id_4b17bce0_scoped_true_render = function render() {
131897
131715
  var _vm = this,
131898
131716
  _c = _vm._self._c;