@realsee/dnalogel 2.0.0-alpha.18 → 2.0.0-alpha.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.
Files changed (175) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  10. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  11. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  13. package/dist/ModelTVVideoPlugin/index.js +3 -28
  14. package/dist/PanoCompassPlugin/index.js +53 -86
  15. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  16. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  17. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  19. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  21. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  22. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  23. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  25. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  27. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  28. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  33. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  34. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  36. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  37. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  39. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  40. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  42. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  43. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  44. package/dist/PanoRulerPlugin/index.js +3 -28
  45. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  46. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  47. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  48. package/dist/floorplan/ModelFloorplanPlugin/index.js +1253 -1284
  49. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +61 -183
  50. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  51. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  52. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1243 -1235
  53. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  54. package/dist/index.es.js +1429 -1435
  55. package/dist/index.js +1428 -1434
  56. package/dist/index.umd.js +1428 -1434
  57. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  58. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  59. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  60. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  61. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  62. package/docs/assets/search.js +1 -1
  63. package/docs/classes/ModelRoomLabelController.html +6 -6
  64. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  65. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  66. package/docs/interfaces/LineJson.html +1 -1
  67. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  68. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  69. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  70. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  71. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  72. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  73. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  74. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  75. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  76. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  77. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  78. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  79. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  80. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  81. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  82. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  83. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  84. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  85. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  86. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  90. package/docs/interfaces/PointJson.html +1 -1
  91. package/docs/interfaces/RoomLabel.html +7 -7
  92. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  93. package/docs/modules.html +12 -12
  94. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  95. package/libs/CameraMovementPlugin/index.js +15 -24
  96. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  97. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  98. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  99. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  100. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  101. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  102. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  103. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  104. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  105. package/libs/ModelTVVideoPlugin/index.js +3 -12
  106. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  107. package/libs/PanoCompassPlugin/index.js +49 -64
  108. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  109. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  110. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  111. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  112. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  114. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  115. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  116. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  117. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  118. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  121. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  122. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  123. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  124. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  125. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  128. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  130. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  131. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  133. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  134. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  136. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  138. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  139. package/libs/PanoRulerPlugin/index.js +3 -12
  140. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  141. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  142. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  143. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  144. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  145. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  146. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  147. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  148. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  151. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  152. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  153. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  154. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  155. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  156. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  157. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  158. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  159. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  160. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  161. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  162. package/libs/floorplan/utils/formatData.js +28 -43
  163. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  164. package/libs/floorplan/utils/formatPosition.js +2 -2
  165. package/libs/shared-utils/five/changeMode.js +12 -23
  166. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  167. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  168. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  169. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  170. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  171. package/libs/shared-utils/three/loadTexture.js +6 -17
  172. package/libs/shared-utils/to.js +10 -21
  173. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  174. package/package.json +1 -1
  175. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
package/dist/index.js CHANGED
@@ -489,7 +489,7 @@ const ROOM_LABEL_BG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAY
489
489
 
490
490
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
491
491
 
492
- function add_css$l(target) {
492
+ function add_css$m(target) {
493
493
  internal.append_styles(target, "svelte-1ak9fbs", ".room-label-item.svelte-1ak9fbs{position:absolute;font-size:0.41667rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.room-label-item__text.svelte-1ak9fbs{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1ak9fbs{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1ak9fbs{font-size:0.52083rem}");
494
494
  }
495
495
 
@@ -583,24 +583,24 @@ function instance$q($$self, $$props, $$invalidate) {
583
583
  class RoomLabelItem extends internal.SvelteComponent {
584
584
  constructor(options) {
585
585
  super();
586
- internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$l);
586
+ internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$m);
587
587
  }
588
588
  }
589
589
 
590
590
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
591
591
 
592
- function add_css$k(target) {
592
+ function add_css$l(target) {
593
593
  internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
594
594
  }
595
595
 
596
- function get_each_context$8(ctx, list, i) {
596
+ function get_each_context$9(ctx, list, i) {
597
597
  const child_ctx = ctx.slice();
598
598
  child_ctx[9] = list[i];
599
599
  return child_ctx;
600
600
  }
601
601
 
602
602
  // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
603
- function create_each_block$8(key_1, ctx) {
603
+ function create_each_block$9(key_1, ctx) {
604
604
  let first;
605
605
  let roomlabelitem;
606
606
  let current;
@@ -658,9 +658,9 @@ function create_fragment$p(ctx) {
658
658
  const get_key = ctx => /*roomLableItem*/ ctx[9].id;
659
659
 
660
660
  for (let i = 0; i < each_value.length; i += 1) {
661
- let child_ctx = get_each_context$8(ctx, each_value, i);
661
+ let child_ctx = get_each_context$9(ctx, each_value, i);
662
662
  let key = get_key(child_ctx);
663
- each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
663
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx));
664
664
  }
665
665
 
666
666
  return {
@@ -688,7 +688,7 @@ function create_fragment$p(ctx) {
688
688
  if (dirty & /*roomLabels, five*/ 3) {
689
689
  each_value = /*roomLabels*/ ctx[0];
690
690
  internal.group_outros();
691
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
691
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$9, null, get_each_context$9);
692
692
  internal.check_outros();
693
693
  }
694
694
  },
@@ -811,7 +811,7 @@ function instance$p($$self, $$props, $$invalidate) {
811
811
  class RoomLabelItems extends internal.SvelteComponent {
812
812
  constructor(options) {
813
813
  super();
814
- internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$k);
814
+ internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$l);
815
815
  }
816
816
  }
817
817
 
@@ -982,37 +982,11 @@ exports.FLOOR_PLAN_ATTACHED_TO = void 0;
982
982
  FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
983
983
  })(exports.FLOOR_PLAN_ATTACHED_TO || (exports.FLOOR_PLAN_ATTACHED_TO = {}));
984
984
 
985
- /*! *****************************************************************************
986
- Copyright (c) Microsoft Corporation.
987
-
988
- Permission to use, copy, modify, and/or distribute this software for any
989
- purpose with or without fee is hereby granted.
990
-
991
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
992
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
993
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
994
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
995
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
996
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
997
- PERFORMANCE OF THIS SOFTWARE.
998
- ***************************************************************************** */
999
-
1000
- function __awaiter(thisArg, _arguments, P, generator) {
1001
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1002
- return new (P || (P = Promise))(function (resolve, reject) {
1003
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1004
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1005
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1006
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1007
- });
1008
- }
1009
-
1010
985
  const pluginStyle$1 = {
1011
986
  position: 'absolute',
1012
987
  left: '50%',
1013
988
  top: '50%',
1014
989
  transform: 'translate(-50%, -50%)',
1015
- pointerEvents: 'none',
1016
990
  zIndex: '10',
1017
991
  };
1018
992
 
@@ -1039,9 +1013,9 @@ function pathD(points, options = {}) {
1039
1013
  return d + (needZ ? 'Z' : '');
1040
1014
  }
1041
1015
  /** 把户型图上点点位转换到 SVG 上的点位 */
1042
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1016
+ function formatFloorplanPoint({ x, y }, bounding) {
1043
1017
  const { max, min } = bounding;
1044
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1018
+ return { x: x - min.x, y: max.y - y };
1045
1019
  }
1046
1020
  /** 模型坐标转户型图坐标 */
1047
1021
  function modelPosition2FloorplanPosition(position, floorplanData) {
@@ -1069,26 +1043,22 @@ function getFloorIndexFromModelPosition(position, five) {
1069
1043
  return floorIndex;
1070
1044
  }
1071
1045
 
1072
- function formatOutlines(outlines) {
1073
- return __awaiter(this, void 0, void 0, function* () {
1074
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1075
- const getOutlineItem = function (item) {
1076
- return __awaiter(this, void 0, void 0, function* () {
1077
- const outlineItem = {
1078
- index: item.index,
1079
- url: item.url,
1080
- svgUrl: item.svg_url,
1081
- };
1082
- if (item.svg_url) {
1083
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1084
- outlineItem.svgContent = svgContent;
1085
- }
1086
- return outlineItem;
1087
- });
1046
+ async function formatOutlines(outlines) {
1047
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1048
+ const getOutlineItem = async function (item) {
1049
+ const outlineItem = {
1050
+ index: item.index,
1051
+ url: item.url,
1052
+ svgUrl: item.svg_url,
1088
1053
  };
1089
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1090
- return svgOutlineItems;
1091
- });
1054
+ if (item.svg_url) {
1055
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1056
+ outlineItem.svgContent = svgContent;
1057
+ }
1058
+ return outlineItem;
1059
+ };
1060
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1061
+ return svgOutlineItems;
1092
1062
  }
1093
1063
  function formatRoom(data) {
1094
1064
  const floorplanRoomItem = {
@@ -1134,21 +1104,19 @@ function formatFloorplanEntrance(data) {
1134
1104
  };
1135
1105
  return floorplanEntrance;
1136
1106
  }
1137
- function formatData(data) {
1138
- return __awaiter(this, void 0, void 0, function* () {
1139
- const outlines = yield formatOutlines(data.outlines);
1140
- const bounding = data.computed_data.bounding;
1141
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1142
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1143
- const floorplanData = {
1144
- outlines,
1145
- entrance,
1146
- bounding,
1147
- floorDatas,
1148
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1149
- };
1150
- return floorplanData;
1151
- });
1107
+ async function formatData(data) {
1108
+ const outlines = await formatOutlines(data.outlines);
1109
+ const bounding = data.computed_data.bounding;
1110
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1111
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1112
+ const floorplanData = {
1113
+ outlines,
1114
+ entrance,
1115
+ bounding,
1116
+ floorDatas,
1117
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1118
+ };
1119
+ return floorplanData;
1152
1120
  }
1153
1121
  function formatExtraObjects(data, five, floorplanData) {
1154
1122
  const extraObjects = data.map((object) => {
@@ -1168,35 +1136,6 @@ function formatExtraObjects(data, five, floorplanData) {
1168
1136
  return extraObjects;
1169
1137
  }
1170
1138
 
1171
- /**
1172
- * 把第一个参数传入第二个参数(函数)中并执行
1173
- * 一般用于执行函数后返回变量。
1174
- * @param {any} something
1175
- * @param {function} callback
1176
- * @return {any}
1177
- */
1178
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1179
- function tap(something, callback) {
1180
- callback(something);
1181
- return something;
1182
- }
1183
-
1184
- /**
1185
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1186
- * @param object
1187
- * @param props 排除的属性
1188
- * @return
1189
- */
1190
- function omit(object, props) {
1191
- return tap({}, (result) => {
1192
- for (const name in object) {
1193
- if (props.indexOf(name) !== -1)
1194
- continue;
1195
- result[name] = object[name];
1196
- }
1197
- });
1198
- }
1199
-
1200
1139
  /**
1201
1140
  * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
1202
1141
  * @param five five
@@ -1230,15 +1169,44 @@ function getPxmm(five, container, floorIndex, options) {
1230
1169
  return pxmm;
1231
1170
  }
1232
1171
 
1172
+ /**
1173
+ * 把第一个参数传入第二个参数(函数)中并执行
1174
+ * 一般用于执行函数后返回变量。
1175
+ * @param {any} something
1176
+ * @param {function} callback
1177
+ * @return {any}
1178
+ */
1179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1180
+ function tap(something, callback) {
1181
+ callback(something);
1182
+ return something;
1183
+ }
1184
+
1185
+ /**
1186
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1187
+ * @param object
1188
+ * @param props 排除的属性
1189
+ * @return
1190
+ */
1191
+ function omit(object, props) {
1192
+ return tap({}, (result) => {
1193
+ for (const name in object) {
1194
+ if (props.indexOf(name) !== -1)
1195
+ continue;
1196
+ result[name] = object[name];
1197
+ }
1198
+ });
1199
+ }
1200
+
1233
1201
  const CAMERA_IMAGE = 'data:image/png;base64,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';
1234
1202
 
1235
1203
  function rad2Deg$1(rad) {
1236
1204
  return (rad * 180) / Math.PI;
1237
1205
  }
1238
1206
 
1239
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
1207
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
1240
1208
 
1241
- function add_css$j(target) {
1209
+ function add_css$k(target) {
1242
1210
  internal.append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
1243
1211
  }
1244
1212
 
@@ -1334,16 +1302,16 @@ class Camera$1 extends internal.SvelteComponent {
1334
1302
  lastPanoramaLongitude: 7,
1335
1303
  cameraImageUrl: 0
1336
1304
  },
1337
- add_css$j
1305
+ add_css$k
1338
1306
  );
1339
1307
  }
1340
1308
  }
1341
1309
 
1342
1310
  const COMPASS_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3v+3x/+0xv+etf+Vrv9pjf/B0P9ukf+ht/+Vr/94mP/G0/+8zP+2x//+/v/09v/W4f9ojv/c5P+xxP/d5v+xw/+vwv+Jo//g6P+nvP+SrP/R3P/1+f/W3//U3//C0P+Jp/9nh/+Kpv+Fov/Y4f/J1/+Pqf+rv/+Oqv+Oqv+muv+twP/f5//t8P97mf/h5/+twP+kuf/L2P+juP+Ipf+huP+Pqf/d5v+zxf+cs/+Zsf+wwv/V3v+8zP+Go/+zxP+GpP/T3f/r8P/u8v/o7f/d5P/m7P/H1P/w9P/D0f+uwf/Z4v/F0v/09//D0v/v8//s8v/d5P/Y4f/s8P+etv/X4f+gt/+ovf+bsv+xw/+Vr//j6v+1x//J1v+4yf/r8P+yxf/T3f/B0f+Fo//09//W4P/h6P/L1v/i6f/x9f/t8v/G0/+uwf/z9f/7/P/n7f/z9v/T3f+4yf/J1v/z9f/w8//q7v/O2v/8/f/5+v/y9f/w8//g6P/z9v+/zv+5yf+9zf/5+v/Q3P/B0P/u8f/R2//////LSJnaAAAA/HRSTlMAAwGMx2jAn2u7ebn0q8zX7J3TiHz45bRS35SFYZmPSembkYNwVMXh2cmodWVjXN43DHZu6gfyrJZGOvrzLAbVvbBB91raz7aypqH+4s6Bfj9/Vk9EMint3C8gt+fc1q+XGAml/O/SxBz7s66kSz3wI/bjc+fQvpOObV8VoyZyXjSpmgv97sMPyorNiYZN0XpYuvHCv6JNEhEWw61YgCUdGBIP5CIgHypaUEU6NS9JQy8lGlY6NCuMfVtPSzspJoRxcExBNTMUyn9zaWRfVkk9Oad9emtkY0RBMLGsnJaQj4ZmXVHhsaKbeW9owb466dnVy7mYj45wyaGV3bdGzuNnAAASkklEQVR42uyaS0iUURiGTUQZ1MaMURSEbOFt4ybGQClFHO9rBS8F3nAURHG0hZvyQrgQRsfNuKmRCTcGGaEzThNqMyouwswKNTVMLe/a/bLo+845/5z/dzIiumj971I3gz6+Puc9x0POT6bRaXfYrJa18YHFhYXXKzMz6+/fb2+/ePFia8uvWlXelFkcr6pO2NqCr2xv77xfn5lZWXm9sDgwvmZZGnHYzaZjHnLk/PaYzL0jS9Pji6+XN3Z3gvJPnTkTEJCT01xSUtWuVick+PlVJ6tUqvj44uLipkxIU3F5fLxKlZxc7efnl6BWt1eVlDTn5AQEnDl16lR+be2n3fWZlYWBNcugze485yFHzq/Kub7eEcv44tzyekpsbEhIZGRWVk1NUFBtPqU2gFGbANRWVycnI7XlCO0XQm25mFp1VRWjFrDNz68NCqqpyYqMDAmJjc3NzQ3cmJwfmLba7CZPDzlyfg5Wh3V6YG559HyhUhkVlZJSUJDLqK3pDkJqoS8ZtVWEWiCTUltejl37BaCVdG2Cul1MLUIb1M2pLShIiYpSKpWF58+37U3Oj1ue2E0ecuT8EK1mm3VoYG4vW6MrLQ0MDDwvUIvQ8q6tBWqZIeRQQ+DU8q51NwQxtbVAbRajNrZARG1gaWBpm0anyY6enB+bGOyV6ZVzIK6bPUPzs17Rx48fb80GaHVtpQRaF7XYtZFIbTcRBAFb7rWc2uJM1rVoCCqgFquWdy0TBDCEbqSWlm2KQC38rZSW6nS67OxW+CxXr0Z7ec/J8MqRxtQ7ONQ/2xIREeHlFR191UVtqRu1wBep2hpqCNxrpYYg6dp4Ude2Y9cG8K5FQ8hyNwSglnZtNoE22svLKyKirKxFsTo28cQsH9v+81Bevb29O1qMZQAtUhs9SqnVsK5199osRi3fENwNgXitcBqrrmZly7r2DKUWq7Zb8FrBEAoptW1tGg3rWk5tC3xSQ53ig8zuf5pzd4df9c8qFIrEOgOhtgyphdCubaVdC9iyrkVo+Wnsm12bID6NZYqWLxX32qpm0fKVD9ii10bSrkVDiJJ2bWuriFqjsaUDPmpdXWIifG7f1bGezT55bfhfYrrfM7Wamufrq9cjtIkGA+1aZgiArdRrlUBtirRr2YbAvBZGBLV71/INAcuWbwjcEERey7tWKe7abGnXdiC1DFq9r29eampF/3O5dv/1ODd7pj5og4ODU13UQtdyQ+Beq9FovnMaE20IAdwQJHut2BCE05jaffkSDAGwxbJl1CK27DQ2iqcxCFKLXWsgXatX+BJqg4O1aWlJz14N35XR/RfTeP/2VOeFpKS0tDQCLVDrq9AjtXVIrdFYVsaoHWWGQKgN3EdtCNVa91sGtdQQmvhpjFUtX74QWjoioNdm0a5lGwL3Wp1GI/HaCCP1WkMddi1Cm5cH1BJsky5UxGHrysLw7wQd9pl/XFfFBaRWq9UCtalIrZ56rcG7A7u2jHktMQQN91qllFq2fImoba468G5M6rVq4rV8Q0CvZdTGgtcitrxrNUgtli1QCyFe6+0yBL3eF6Cl1CYBtYBtnL9/0b2ezWseco56QGLvpV++7O8fF1dRAdhC16Ih0K4lhpBoQBaMLS6vZacxTdu+DSFXsiHkU689YENgd2MSQ0iQ7rXiG90Qvnxh2eJhTOfqWihb7rXUEIBalyFotaRru+IQ28uXY9LBF27JD3OObPqePn9TlJ4eExNDqO0CapOQWsCWdq2CUmtgGwKnli9f6LWFrg0hhFEr7doS1rXSu7HM8nK3DaHd7W6shnutyxACqdficYxSyzYEgVqEVsENQYtdi9j6U2rTi4oqfaZu32n0kHO04nlr+N3HjIaGoqIipNafUNsF1KIicK9VUK8FQ8Cu5YbAqQVslfv2Wuq1+TU7uxszK/DycG1t2mJZWrKOjIzYHA673Wx2Ok3nPImbNJqcfWa7vdfhsMG3rUtLFss0PG3Eh43ruzvC8sW7lhkCgxYMQXzLYCReyzYESGoePY0JXesPiYlBbCsbOjMyMu713L/uIedo5NiNm+8++vhkALSVlaRrqSEAtNKu1VNqWddKN4Rs3f6uLdxYnsTXsdNLg7Ze8y95WOhp6rM7RqyW6fGB+bnJ5Q0lNQRyo+u+fOGGIMFWOI2Rqq2ghgDUYtcSbH18fE4AuXLnHvr0PX30JvzEiRM+gG0nYFsE2IIgQARD0LINIY9vCNLla1R8ozu6PLc4brE6zH/iEcAxp90GD83mJ/dAqjU64TTGvNYodC0uX2SvJV1LNwSkFg3B1bWEWvhBhIdfeSjbwiHO9QeP34aFXQkPp9AitWgIgtfGYdcecBrrMJYJy1c0gLIHb62GrE96+/7aCmoyOwYnhvrnJo3otXz5Yl6roNCmptLTGHYtei1imy50rQ+lFrANC7v48ra86B6+HLs1/PDs2YsA7RWAlmLb0MkNgXStdENwv2WIUKzi2yrnoZo98ekkPpYQ7saQWtq1dPlCr+WGIO1axJZSe/Hs2bePHsiae4jSeOfxpdBQhJZULe/aSmIISG0cNwTetQoIMQTDbP9Qj818mP+Pejp7ByfGVmeF5WufIVw4wGuxahm1oaGh9S9vyqPYYYgnnL1O19cDtEAt7VrqtXCIdnWtsCEkYdfyWwaF4jMp174j9JtsvGvrGer/oMcNQXzL0CVZvhoaMii1iG2YQG19/enTp08+li33K/tm7JNGGIbxqiEht5m7iasMcBuwwOJk0tEFcn9BG7s1bizQGBycCCbXpUkTo9VFJVpRSeNkuBqnq6BRoiwOMtldm3Tr+37fJ9+dtFEUbNX3+RPIj+d+93zf/ctgyZb1YDAUAmx510J410JY1wqvbTeEma3vJ9uP9571yObu8rfTd6xrhSEIahFb2bXCayW1wWAwM2CvLf5XFvSMMr9fzw9kMhnEFqmVXSsMYQI3hFFJLUD7GixwZuvHU/kuoG+zsXx0CtS+Yl4runZ0fHzcvSEAtUPcEEKCWshhdYlezx44I0vV80J+AILQQgIuagdby9e1vXbm9Ogp3kmd2j45q7z1Ll/tXRuAoCEAtQzbQkE93qdLCw+Wsa9NXVXVfB6xdXftsOxauSHwszHgtfG0L6IufNkBdhm0vGul10Kk14quzQO1qqqDK7yg9Dwj682wrk+raqEgoGXUtrp2yGUI3Gt/we3T5/L+0Q+6W/mIXTvR7rWArTSEfJ5Rq+the40at5dBMTDDCC2jVhoCYjscAGo5tBC+fA0elXefhsF2dqTdOKtMyLlWvo2F3NQCtNPTiG04aZcI3B6lb6mqJZPhK2rVFrVBFATRtXKvrZw1Fh/RotXdoOzu/LwYhLj3Wo8hCGrDQG1y1jTIcbufvo2ilTJnZxFbnRsC81qxIYQ8XntRpy9SWOZ3y+dv2pevjPRaQa1pplIph87OuoxsXEulTJND6zWEjPRagDZwXqbredd94bgiqfUYgsq6Ngldi9hqmna8Qj9etw6/bMvSNIYt/MAtQ8i7DQG79rLeoPH8b75QPg8wbINyQ+CGILtW0yxLUZoE7v2RrRmKolgaUouGwL1W93gtdu1lnY57bj5IPBRei+GGAHF3rYKJ7608l82lF5lacSLxOFLLutaUXeuhNlOnOyEdkMu9VnYtJGnysrUshDYej6SLG9QBd5TZdASgjSsQhNZFrS69FoilF6+OsgDkIrauDWEWu1ZjhoDYRiKRdNohU+g4CyUnl2tRa1nSEKTXFmwi9s7kNg89G4IwBNG1SG0uZ9BVhQ4PEwzDyKWBWoEtUis2BNG19toSydc9bx81D91dC9hKaiNIrWE4dPxwy8yXnEQCoL3WtSnetQhtsklXRLv1YajNli8BraYgtozaXBqgTSQS2cl1+q1vytj6pD+bBWpF10qvFV2btIukBV2WhVRrQxDQCkNAbLNZv1N7zoeMt/jr13x+P1LLyhawlYLAX8fobl33g0ZWtE2+11oearFr/RDf3gEV7p/z6WDS5/MJaF1eqwhslSo9q3qW/vn9Y63Na7Fqs0gtpDZHhXs9/Z9r0ShC6+5aQS1C65ToEKHXmVqvRtoNwQ9BbKPR96vUGt5H1IcYg9YjCDkxIcSrNB32ONLRSg7H1msIEMA2GqNJoZWp1ckYQCuoRWwZtUYaFSFdpNHwYbOwsodde7UhtLAFaGOxl7U5eub9Ztfscd0Eoihsu8oSKJBoQpUYyYULmhSIBVjACuip0tFQpEaaagTSyLiI9GSMZArEKp4it95N7oXBk6dUr7Ln59sB4uNw7p0BTlfb3s7Wcm0fvfbbV7MveAYo7k9eEB5h+x0Aa22b9OlKb9bHP7kNgLZC2slawKTs80Bx/2sIW8DO7dy7VSt9SfuoyHMurei1k7bnt/3K8ExQXLT2Y0MA8qLwro2mRaG6hV5RTNpuuba81345v+n+E3oR6su7aAjc2hyt9cL4qN+fcNNcw9DzPJG1i7VG2dfidHlHaYW1qK0H2oauZvvz/ZEyhtLyrBUN4WzuxLweIO6HrOXWhiQa6pUupHeLkRCYrbWB2dqzZh+vPGxOl1xoW3iztYyxqNWj4KadG0URm7z9tyHoPZi+PnBJRExjk7WEEHiTrtMof9T7q7NctJYwcBaYGgJwVf/R5Sft3bkh8KydrXVV93aHzs7WklBMY2b+kob65uE0NhcEQhhaa1mWo+7VmqqzgElaRlDbKWtD0wykAg6GikJkretO2saKelt1cRyjtQAD5qw1zUBCdr2L1jIWAdzaWEVvq44+pI0AErLQs/rdyiAjm9ONiF5rATGlpaPWwUM1ZHSxFokIY9FNn12fivw4toQwkbWobemPynhbD1lW0hKtfYTtVa3PUk+q3pp7LYDW0jLL2lGJ+yP14DhZltFFW5DW6swApgbrpn1kbVmCtJnj+KP0GyFwFsCspZRLq1j70Z2qsxC0loK0qK0vd95Wne/7IC1Q8qgd9DgB1Il0dKx4CVsH8P1E3n3C7t76AM/aErKW3s1FAxVZNweUllvrIwc5V5r7MUiSWVoMW5C2NdVAXao7DmNL1vpJkgy1dH/V9W9wNmmTxdqy7OR7CMMnV2EiaxMgkGzoXjdDEKC2S0HwR3OeoD6beuBZ26K0QXC4y/Pa/7Jrx7gJw1AYx2su0iuYgYFI7sAJstiS2ZKpk8UeWfKWKyQLLJ5Qxyp34TZ9D15YOkBpm9ji/U/A8CP+HFj0styMapHtZ54bh/t5y2E9LoQNVppMXoN1uixLQns8rl9PeZ0T3O96O5T4rL2wBQkuZnCbWQ7OXdUe1zwNni8YCsh2VOuK1I/a2jtHapHtZp/J+cD9bf0HoiW1rpAp38TfYlEUgJaetWUOZwP3P3UnetYCW1ChU52JogoS1UKIlq9gT95yILSugKRKciq2VhLaEpIVm3366j2pxaSMyf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=';
1343
1311
 
1344
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
1312
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
1345
1313
 
1346
- function add_css$i(target) {
1314
+ function add_css$j(target) {
1347
1315
  internal.append_styles(target, "svelte-1q44ru9", ".floorplan-plugin__compass.svelte-1q44ru9{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-1q44ru9{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-1q44ru9{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
1348
1316
  }
1349
1317
 
@@ -1436,345 +1404,271 @@ function instance$n($$self, $$props, $$invalidate) {
1436
1404
  class Compass extends internal.SvelteComponent {
1437
1405
  constructor(options) {
1438
1406
  super();
1439
- internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$i);
1407
+ internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$j);
1440
1408
  }
1441
1409
  }
1442
1410
 
1443
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1411
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1444
1412
 
1445
- function add_css$h(target) {
1446
- internal.append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
1413
+ function add_css$i(target) {
1414
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1447
1415
  }
1448
1416
 
1449
- // (22:30)
1450
- function create_if_block_1$4(ctx) {
1451
- let html_tag;
1452
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1453
- let html_anchor;
1417
+ function create_fragment$m(ctx) {
1418
+ let img;
1419
+ let img_src_value;
1454
1420
 
1455
1421
  return {
1456
1422
  c() {
1457
- html_tag = new internal.HtmlTag();
1458
- html_anchor = internal.empty();
1459
- html_tag.a = html_anchor;
1423
+ img = internal.element("img");
1424
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1425
+ internal.attr(img, "alt", "floorplan iamge");
1426
+ internal.attr(img, "class", "svelte-1gfoniz");
1460
1427
  },
1461
1428
  m(target, anchor) {
1462
- html_tag.m(raw_value, target, anchor);
1463
- internal.insert(target, html_anchor, anchor);
1429
+ internal.insert(target, img, anchor);
1464
1430
  },
1465
- p(ctx, dirty) {
1466
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1431
+ p(ctx, [dirty]) {
1432
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1433
+ internal.attr(img, "src", img_src_value);
1434
+ }
1467
1435
  },
1436
+ i: internal.noop,
1437
+ o: internal.noop,
1468
1438
  d(detaching) {
1469
- if (detaching) internal.detach(html_anchor);
1470
- if (detaching) html_tag.d();
1439
+ if (detaching) internal.detach(img);
1471
1440
  }
1472
1441
  };
1473
1442
  }
1474
1443
 
1475
- // (16:2) {#if getLabelElement === undefined}
1476
- function create_if_block$7(ctx) {
1477
- let span0;
1478
- let t0_value = /*room*/ ctx[0].name + "";
1479
- let t0;
1480
- let t1;
1481
- let span1;
1444
+ function instance$m($$self, $$props, $$invalidate) {
1445
+ let { url } = $$props;
1482
1446
 
1483
- return {
1484
- c() {
1485
- span0 = internal.element("span");
1486
- t0 = internal.text(t0_value);
1487
- t1 = internal.space();
1488
- span1 = internal.element("span");
1489
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1490
- internal.attr(span0, "class", "floorplan-plugin__room-name");
1491
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1492
- },
1493
- m(target, anchor) {
1494
- internal.insert(target, span0, anchor);
1495
- internal.append(span0, t0);
1496
- internal.insert(target, t1, anchor);
1497
- internal.insert(target, span1, anchor);
1498
- },
1499
- p(ctx, dirty) {
1500
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1501
- },
1502
- d(detaching) {
1503
- if (detaching) internal.detach(span0);
1504
- if (detaching) internal.detach(t1);
1505
- if (detaching) internal.detach(span1);
1506
- }
1447
+ $$self.$$set = $$props => {
1448
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1507
1449
  };
1508
- }
1509
1450
 
1510
- function create_fragment$m(ctx) {
1511
- let div;
1451
+ return [url];
1452
+ }
1512
1453
 
1513
- function select_block_type(ctx, dirty) {
1514
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$7;
1515
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
1454
+ class Normalmage extends internal.SvelteComponent {
1455
+ constructor(options) {
1456
+ super();
1457
+ internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { url: 0 }, add_css$i);
1516
1458
  }
1459
+ }
1517
1460
 
1518
- let current_block_type = select_block_type(ctx);
1519
- let if_block = current_block_type && current_block_type(ctx);
1461
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1462
+
1463
+ function add_css$h(target) {
1464
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1465
+ }
1466
+
1467
+ function create_fragment$l(ctx) {
1468
+ let div;
1469
+ let html_tag;
1470
+ let t;
1471
+ let html_tag_1;
1520
1472
 
1521
1473
  return {
1522
1474
  c() {
1523
1475
  div = internal.element("div");
1524
- if (if_block) if_block.c();
1525
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1526
- internal.set_style(div, "left", /*left*/ ctx[4], false);
1527
- internal.set_style(div, "top", /*top*/ ctx[5], false);
1528
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1476
+ html_tag = new internal.HtmlTag();
1477
+ t = internal.space();
1478
+ html_tag_1 = new internal.HtmlTag();
1479
+ html_tag.a = t;
1480
+ html_tag_1.a = null;
1481
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1529
1482
  },
1530
1483
  m(target, anchor) {
1531
1484
  internal.insert(target, div, anchor);
1532
- if (if_block) if_block.m(div, null);
1485
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1486
+ internal.append(div, t);
1487
+ html_tag_1.m(/*content*/ ctx[0], div);
1533
1488
  },
1534
1489
  p(ctx, [dirty]) {
1535
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1536
- if_block.p(ctx, dirty);
1537
- } else {
1538
- if (if_block) if_block.d(1);
1539
- if_block = current_block_type && current_block_type(ctx);
1540
-
1541
- if (if_block) {
1542
- if_block.c();
1543
- if_block.m(div, null);
1544
- }
1545
- }
1490
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1546
1491
  },
1547
1492
  i: internal.noop,
1548
1493
  o: internal.noop,
1549
1494
  d(detaching) {
1550
1495
  if (detaching) internal.detach(div);
1551
-
1552
- if (if_block) {
1553
- if_block.d();
1554
- }
1555
1496
  }
1556
1497
  };
1557
1498
  }
1558
1499
 
1559
- function instance$m($$self, $$props, $$invalidate) {
1560
- let userConfigElement;
1561
- let { room } = $$props;
1562
- let { getLabelElement } = $$props;
1563
-
1564
- // TODO: 统一这里的判断条件,目前写了多处
1565
- const bodyWidth = document.body.clientWidth;
1500
+ function instance$l($$self, $$props, $$invalidate) {
1501
+ let { content } = $$props;
1566
1502
 
1567
- const bodyHeight = document.body.clientHeight;
1568
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1569
- const roomLabel = room.roomLabel;
1570
- const left = roomLabel.positionInImage.x * 100 + '%';
1571
- const top = roomLabel.positionInImage.y * 100 + '%';
1572
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1503
+ const svgStyle = `
1504
+ <style>
1505
+ svg [type='lineGroup'] path {
1506
+ fill: #ffffff;
1507
+ stroke: #ffffff;
1508
+ }
1509
+ svg [type='lineItemGroup'] g g g g {
1510
+ stroke: #ffffff;
1511
+ }</style>
1512
+ `;
1573
1513
 
1574
1514
  $$self.$$set = $$props => {
1575
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
1576
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1577
- };
1578
-
1579
- $$self.$$.update = () => {
1580
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1581
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1582
- ? void 0
1583
- : getLabelElement(room));
1584
- }
1515
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1585
1516
  };
1586
1517
 
1587
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1518
+ return [content, svgStyle];
1588
1519
  }
1589
1520
 
1590
- class RoomLabel extends internal.SvelteComponent {
1521
+ class SvgImage extends internal.SvelteComponent {
1591
1522
  constructor(options) {
1592
1523
  super();
1593
- internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$h);
1524
+ internal.init(this, options, instance$l, create_fragment$l, internal.safe_not_equal, { content: 0 }, add_css$h);
1594
1525
  }
1595
1526
  }
1596
1527
 
1597
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1528
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1598
1529
 
1599
1530
  function add_css$g(target) {
1600
- internal.append_styles(target, "svelte-vkeyjz", ".floorplan-plugin__room-labels.svelte-vkeyjz{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
1601
- }
1602
-
1603
- function get_each_context$7(ctx, list, i) {
1604
- const child_ctx = ctx.slice();
1605
- child_ctx[4] = list[i];
1606
- return child_ctx;
1531
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1607
1532
  }
1608
1533
 
1609
- // (8:0) {#if rooms}
1610
- function create_if_block$6(ctx) {
1611
- let div;
1612
- let each_blocks = [];
1613
- let each_1_lookup = new Map();
1534
+ // (13:22)
1535
+ function create_if_block_1$4(ctx) {
1536
+ let normalimage;
1614
1537
  let current;
1615
- let each_value = /*rooms*/ ctx[1];
1616
- const get_key = ctx => /*room*/ ctx[4].id;
1617
-
1618
- for (let i = 0; i < each_value.length; i += 1) {
1619
- let child_ctx = get_each_context$7(ctx, each_value, i);
1620
- let key = get_key(child_ctx);
1621
- each_1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
1622
- }
1538
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1623
1539
 
1624
1540
  return {
1625
1541
  c() {
1626
- div = internal.element("div");
1627
-
1628
- for (let i = 0; i < each_blocks.length; i += 1) {
1629
- each_blocks[i].c();
1630
- }
1631
-
1632
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-vkeyjz");
1542
+ internal.create_component(normalimage.$$.fragment);
1633
1543
  },
1634
1544
  m(target, anchor) {
1635
- internal.insert(target, div, anchor);
1636
-
1637
- for (let i = 0; i < each_blocks.length; i += 1) {
1638
- each_blocks[i].m(div, null);
1639
- }
1640
-
1545
+ internal.mount_component(normalimage, target, anchor);
1641
1546
  current = true;
1642
1547
  },
1643
1548
  p(ctx, dirty) {
1644
- if (dirty & /*rooms, getLabelElement*/ 3) {
1645
- each_value = /*rooms*/ ctx[1];
1646
- internal.group_outros();
1647
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$7, null, get_each_context$7);
1648
- internal.check_outros();
1649
- }
1549
+ const normalimage_changes = {};
1550
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1551
+ normalimage.$set(normalimage_changes);
1650
1552
  },
1651
1553
  i(local) {
1652
1554
  if (current) return;
1653
-
1654
- for (let i = 0; i < each_value.length; i += 1) {
1655
- internal.transition_in(each_blocks[i]);
1656
- }
1657
-
1555
+ internal.transition_in(normalimage.$$.fragment, local);
1658
1556
  current = true;
1659
1557
  },
1660
1558
  o(local) {
1661
- for (let i = 0; i < each_blocks.length; i += 1) {
1662
- internal.transition_out(each_blocks[i]);
1663
- }
1664
-
1559
+ internal.transition_out(normalimage.$$.fragment, local);
1665
1560
  current = false;
1666
1561
  },
1667
1562
  d(detaching) {
1668
- if (detaching) internal.detach(div);
1669
-
1670
- for (let i = 0; i < each_blocks.length; i += 1) {
1671
- each_blocks[i].d();
1672
- }
1563
+ internal.destroy_component(normalimage, detaching);
1673
1564
  }
1674
1565
  };
1675
1566
  }
1676
1567
 
1677
- // (10:4) {#each rooms as room (room.id)}
1678
- function create_each_block$7(key_1, ctx) {
1679
- let first;
1680
- let roomlabel;
1568
+ // (11:2) {#if svgContent}
1569
+ function create_if_block$7(ctx) {
1570
+ let svgimage;
1681
1571
  let current;
1682
1572
 
1683
- const roomlabel_spread_levels = [
1684
- {
1685
- room: /*room*/ ctx[4],
1686
- getLabelElement: /*getLabelElement*/ ctx[0]
1687
- }
1688
- ];
1689
-
1690
- let roomlabel_props = {};
1691
-
1692
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1693
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1694
- }
1695
-
1696
- roomlabel = new RoomLabel({ props: roomlabel_props });
1573
+ svgimage = new SvgImage({
1574
+ props: { content: /*svgContent*/ ctx[0] }
1575
+ });
1697
1576
 
1698
1577
  return {
1699
- key: key_1,
1700
- first: null,
1701
1578
  c() {
1702
- first = internal.empty();
1703
- internal.create_component(roomlabel.$$.fragment);
1704
- this.first = first;
1579
+ internal.create_component(svgimage.$$.fragment);
1705
1580
  },
1706
1581
  m(target, anchor) {
1707
- internal.insert(target, first, anchor);
1708
- internal.mount_component(roomlabel, target, anchor);
1582
+ internal.mount_component(svgimage, target, anchor);
1709
1583
  current = true;
1710
1584
  },
1711
- p(new_ctx, dirty) {
1712
- ctx = new_ctx;
1713
-
1714
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1715
- ? internal.get_spread_update(roomlabel_spread_levels, [
1716
- {
1717
- room: /*room*/ ctx[4],
1718
- getLabelElement: /*getLabelElement*/ ctx[0]
1719
- }
1720
- ])
1721
- : {};
1722
-
1723
- roomlabel.$set(roomlabel_changes);
1585
+ p(ctx, dirty) {
1586
+ const svgimage_changes = {};
1587
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1588
+ svgimage.$set(svgimage_changes);
1724
1589
  },
1725
1590
  i(local) {
1726
1591
  if (current) return;
1727
- internal.transition_in(roomlabel.$$.fragment, local);
1592
+ internal.transition_in(svgimage.$$.fragment, local);
1728
1593
  current = true;
1729
1594
  },
1730
1595
  o(local) {
1731
- internal.transition_out(roomlabel.$$.fragment, local);
1596
+ internal.transition_out(svgimage.$$.fragment, local);
1732
1597
  current = false;
1733
1598
  },
1734
1599
  d(detaching) {
1735
- if (detaching) internal.detach(first);
1736
- internal.destroy_component(roomlabel, detaching);
1600
+ internal.destroy_component(svgimage, detaching);
1737
1601
  }
1738
1602
  };
1739
1603
  }
1740
1604
 
1741
- function create_fragment$l(ctx) {
1742
- let if_block_anchor;
1605
+ function create_fragment$k(ctx) {
1606
+ let div;
1607
+ let current_block_type_index;
1608
+ let if_block;
1743
1609
  let current;
1744
- let if_block = /*rooms*/ ctx[1] && create_if_block$6(ctx);
1610
+ const if_block_creators = [create_if_block$7, create_if_block_1$4];
1611
+ const if_blocks = [];
1612
+
1613
+ function select_block_type(ctx, dirty) {
1614
+ if (/*svgContent*/ ctx[0]) return 0;
1615
+ if (/*imageData*/ ctx[1]) return 1;
1616
+ return -1;
1617
+ }
1618
+
1619
+ if (~(current_block_type_index = select_block_type(ctx))) {
1620
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1621
+ }
1745
1622
 
1746
1623
  return {
1747
1624
  c() {
1625
+ div = internal.element("div");
1748
1626
  if (if_block) if_block.c();
1749
- if_block_anchor = internal.empty();
1627
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1750
1628
  },
1751
1629
  m(target, anchor) {
1752
- if (if_block) if_block.m(target, anchor);
1753
- internal.insert(target, if_block_anchor, anchor);
1630
+ internal.insert(target, div, anchor);
1631
+
1632
+ if (~current_block_type_index) {
1633
+ if_blocks[current_block_type_index].m(div, null);
1634
+ }
1635
+
1754
1636
  current = true;
1755
1637
  },
1756
1638
  p(ctx, [dirty]) {
1757
- if (/*rooms*/ ctx[1]) {
1639
+ let previous_block_index = current_block_type_index;
1640
+ current_block_type_index = select_block_type(ctx);
1641
+
1642
+ if (current_block_type_index === previous_block_index) {
1643
+ if (~current_block_type_index) {
1644
+ if_blocks[current_block_type_index].p(ctx, dirty);
1645
+ }
1646
+ } else {
1758
1647
  if (if_block) {
1759
- if_block.p(ctx, dirty);
1648
+ internal.group_outros();
1760
1649
 
1761
- if (dirty & /*rooms*/ 2) {
1762
- internal.transition_in(if_block, 1);
1763
- }
1764
- } else {
1765
- if_block = create_if_block$6(ctx);
1766
- if_block.c();
1767
- internal.transition_in(if_block, 1);
1768
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
1650
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1651
+ if_blocks[previous_block_index] = null;
1652
+ });
1653
+
1654
+ internal.check_outros();
1769
1655
  }
1770
- } else if (if_block) {
1771
- internal.group_outros();
1772
1656
 
1773
- internal.transition_out(if_block, 1, 1, () => {
1774
- if_block = null;
1775
- });
1657
+ if (~current_block_type_index) {
1658
+ if_block = if_blocks[current_block_type_index];
1776
1659
 
1777
- internal.check_outros();
1660
+ if (!if_block) {
1661
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1662
+ if_block.c();
1663
+ } else {
1664
+ if_block.p(ctx, dirty);
1665
+ }
1666
+
1667
+ internal.transition_in(if_block, 1);
1668
+ if_block.m(div, null);
1669
+ } else {
1670
+ if_block = null;
1671
+ }
1778
1672
  }
1779
1673
  },
1780
1674
  i(local) {
@@ -1787,434 +1681,230 @@ function create_fragment$l(ctx) {
1787
1681
  current = false;
1788
1682
  },
1789
1683
  d(detaching) {
1790
- if (if_block) if_block.d(detaching);
1791
- if (detaching) internal.detach(if_block_anchor);
1684
+ if (detaching) internal.detach(div);
1685
+
1686
+ if (~current_block_type_index) {
1687
+ if_blocks[current_block_type_index].d();
1688
+ }
1792
1689
  }
1793
1690
  };
1794
1691
  }
1795
1692
 
1796
- function instance$l($$self, $$props, $$invalidate) {
1797
- let rooms;
1693
+ function instance$k($$self, $$props, $$invalidate) {
1694
+ let imageData;
1695
+ let svgContent;
1696
+ var _a, _b;
1798
1697
  let { floorIndex } = $$props;
1799
1698
  let { floorplanData } = $$props;
1800
- let { getLabelElement } = $$props;
1801
1699
 
1802
1700
  $$self.$$set = $$props => {
1803
1701
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1804
1702
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1805
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1806
1703
  };
1807
1704
 
1808
1705
  $$self.$$.update = () => {
1809
1706
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1810
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1707
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1708
+ }
1709
+
1710
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1711
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1712
+ ? void 0
1713
+ : _a[floorIndex]) === null || _b === void 0
1714
+ ? void 0
1715
+ : _b.svgContent);
1811
1716
  }
1812
1717
  };
1813
1718
 
1814
- return [getLabelElement, rooms, floorIndex, floorplanData];
1719
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1815
1720
  }
1816
1721
 
1817
- class RoomLabels extends internal.SvelteComponent {
1722
+ class BaseImage extends internal.SvelteComponent {
1818
1723
  constructor(options) {
1819
1724
  super();
1820
-
1821
- internal.init(
1822
- this,
1823
- options,
1824
- instance$l,
1825
- create_fragment$l,
1826
- internal.safe_not_equal,
1827
- {
1828
- floorIndex: 2,
1829
- floorplanData: 3,
1830
- getLabelElement: 0
1831
- },
1832
- add_css$g
1833
- );
1725
+ internal.init(this, options, instance$k, create_fragment$k, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$g);
1834
1726
  }
1835
1727
  }
1836
1728
 
1837
- /**
1838
- * 判断对象是否为`null`或`undefined`。
1839
- * @param
1840
- * @return
1841
- */
1842
- /**
1843
- * 判断对象不为`null`或`undefined`。
1844
- */
1845
- function notNil(value) {
1846
- return value !== null && value !== undefined;
1847
- }
1848
-
1849
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1729
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1850
1730
 
1851
1731
  function add_css$f(target) {
1852
- internal.append_styles(target, "svelte-1d5a0k4", ".floorplan-plugin__rule-labels.svelte-1d5a0k4{position:absolute;height:0.26042rem;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1d5a0k4{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1d5a0k4{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1d5a0k4{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1d5a0k4{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1d5a0k4{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1d5a0k4{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:0.26042rem}.floorplan-plugin__text-wrapper.svelte-1d5a0k4{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1d5a0k4{top:0.52083rem}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1d5a0k4{bottom:0.52083rem}.floorplan-plugin__rule-text.svelte-1d5a0k4{position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:0.52083rem;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1d5a0k4{transform:translate(-50%, -50%)}");
1853
- }
1854
-
1855
- function get_each_context$6(ctx, list, i) {
1856
- const child_ctx = ctx.slice();
1857
- child_ctx[24] = list[i];
1858
- child_ctx[26] = i;
1859
- return child_ctx;
1860
- }
1861
-
1862
- function get_each_context_1(ctx, list, i) {
1863
- const child_ctx = ctx.slice();
1864
- child_ctx[27] = list[i];
1865
- child_ctx[29] = i;
1866
- return child_ctx;
1732
+ internal.append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
1867
1733
  }
1868
1734
 
1869
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
1870
- function create_each_block_1(key_1, ctx) {
1871
- let div;
1872
- let style_left = `${/*position*/ ctx[27]}px`;
1735
+ // (22:30)
1736
+ function create_if_block_1$3(ctx) {
1737
+ let html_tag;
1738
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1739
+ let html_anchor;
1873
1740
 
1874
1741
  return {
1875
- key: key_1,
1876
- first: null,
1877
1742
  c() {
1878
- div = internal.element("div");
1879
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1d5a0k4");
1880
- internal.set_style(div, "left", style_left, false);
1881
- this.first = div;
1743
+ html_tag = new internal.HtmlTag();
1744
+ html_anchor = internal.empty();
1745
+ html_tag.a = html_anchor;
1882
1746
  },
1883
1747
  m(target, anchor) {
1884
- internal.insert(target, div, anchor);
1885
- },
1886
- p(new_ctx, dirty) {
1887
- ctx = new_ctx;
1748
+ html_tag.m(raw_value, target, anchor);
1749
+ internal.insert(target, html_anchor, anchor);
1750
+ },
1751
+ p(ctx, dirty) {
1752
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1888
1753
  },
1889
1754
  d(detaching) {
1890
- if (detaching) internal.detach(div);
1755
+ if (detaching) internal.detach(html_anchor);
1756
+ if (detaching) html_tag.d();
1891
1757
  }
1892
1758
  };
1893
1759
  }
1894
1760
 
1895
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
1896
- function create_each_block$6(key_1, ctx) {
1897
- let div;
1898
- let span;
1899
- let t0_value = /*textItem*/ ctx[24].distance + "";
1761
+ // (16:2) {#if getLabelElement === undefined}
1762
+ function create_if_block$6(ctx) {
1763
+ let span0;
1764
+ let t0_value = /*room*/ ctx[0].name + "";
1900
1765
  let t0;
1901
1766
  let t1;
1902
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
1767
+ let span1;
1903
1768
 
1904
1769
  return {
1905
- key: key_1,
1906
- first: null,
1907
1770
  c() {
1908
- div = internal.element("div");
1909
- span = internal.element("span");
1771
+ span0 = internal.element("span");
1910
1772
  t0 = internal.text(t0_value);
1911
1773
  t1 = internal.space();
1912
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1d5a0k4");
1913
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
1914
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1d5a0k4");
1915
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
1916
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
1917
- internal.set_style(div, "left", style_left, false);
1918
- this.first = div;
1774
+ span1 = internal.element("span");
1775
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1776
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
1777
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1919
1778
  },
1920
1779
  m(target, anchor) {
1921
- internal.insert(target, div, anchor);
1922
- internal.append(div, span);
1923
- internal.append(span, t0);
1924
- internal.append(div, t1);
1780
+ internal.insert(target, span0, anchor);
1781
+ internal.append(span0, t0);
1782
+ internal.insert(target, t1, anchor);
1783
+ internal.insert(target, span1, anchor);
1925
1784
  },
1926
- p(new_ctx, dirty) {
1927
- ctx = new_ctx;
1785
+ p(ctx, dirty) {
1786
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1928
1787
  },
1929
1788
  d(detaching) {
1930
- if (detaching) internal.detach(div);
1789
+ if (detaching) internal.detach(span0);
1790
+ if (detaching) internal.detach(t1);
1791
+ if (detaching) internal.detach(span1);
1931
1792
  }
1932
1793
  };
1933
1794
  }
1934
1795
 
1935
- function create_fragment$k(ctx) {
1936
- let div1;
1937
- let div0;
1938
- let t0;
1939
- let each_blocks_1 = [];
1940
- let each0_lookup = new Map();
1941
- let t1;
1942
- let each_blocks = [];
1943
- let each1_lookup = new Map();
1944
- let div1_class_value;
1945
- let each_value_1 = /*positionPxArray*/ ctx[6];
1946
- const get_key = ctx => /*positionIndex*/ ctx[29];
1796
+ function create_fragment$j(ctx) {
1797
+ let div;
1947
1798
 
1948
- for (let i = 0; i < each_value_1.length; i += 1) {
1949
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
1950
- let key = get_key(child_ctx);
1951
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
1799
+ function select_block_type(ctx, dirty) {
1800
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$6;
1801
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
1952
1802
  }
1953
1803
 
1954
- let each_value = /*textArray*/ ctx[10];
1955
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
1956
-
1957
- for (let i = 0; i < each_value.length; i += 1) {
1958
- let child_ctx = get_each_context$6(ctx, each_value, i);
1959
- let key = get_key_1(child_ctx);
1960
- each1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
1961
- }
1804
+ let current_block_type = select_block_type(ctx);
1805
+ let if_block = current_block_type && current_block_type(ctx);
1962
1806
 
1963
1807
  return {
1964
1808
  c() {
1965
- div1 = internal.element("div");
1966
- div0 = internal.element("div");
1967
- t0 = internal.space();
1968
-
1969
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1970
- each_blocks_1[i].c();
1971
- }
1972
-
1973
- t1 = internal.space();
1974
-
1975
- for (let i = 0; i < each_blocks.length; i += 1) {
1976
- each_blocks[i].c();
1977
- }
1978
-
1979
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1d5a0k4");
1980
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4");
1981
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
1982
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
1983
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
1809
+ div = internal.element("div");
1810
+ if (if_block) if_block.c();
1811
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1812
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
1813
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
1814
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1984
1815
  },
1985
1816
  m(target, anchor) {
1986
- internal.insert(target, div1, anchor);
1987
- internal.append(div1, div0);
1988
- internal.append(div1, t0);
1989
-
1990
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1991
- each_blocks_1[i].m(div1, null);
1992
- }
1993
-
1994
- internal.append(div1, t1);
1995
-
1996
- for (let i = 0; i < each_blocks.length; i += 1) {
1997
- each_blocks[i].m(div1, null);
1998
- }
1817
+ internal.insert(target, div, anchor);
1818
+ if (if_block) if_block.m(div, null);
1999
1819
  },
2000
1820
  p(ctx, [dirty]) {
2001
- if (dirty & /*positionPxArray*/ 64) {
2002
- each_value_1 = /*positionPxArray*/ ctx[6];
2003
- each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
2004
- }
2005
-
2006
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
2007
- each_value = /*textArray*/ ctx[10];
2008
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$6, null, get_each_context$6);
2009
- }
1821
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1822
+ if_block.p(ctx, dirty);
1823
+ } else {
1824
+ if (if_block) if_block.d(1);
1825
+ if_block = current_block_type && current_block_type(ctx);
2010
1826
 
2011
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4")) {
2012
- internal.attr(div1, "class", div1_class_value);
1827
+ if (if_block) {
1828
+ if_block.c();
1829
+ if_block.m(div, null);
1830
+ }
2013
1831
  }
2014
1832
  },
2015
1833
  i: internal.noop,
2016
1834
  o: internal.noop,
2017
1835
  d(detaching) {
2018
- if (detaching) internal.detach(div1);
2019
-
2020
- for (let i = 0; i < each_blocks_1.length; i += 1) {
2021
- each_blocks_1[i].d();
2022
- }
1836
+ if (detaching) internal.detach(div);
2023
1837
 
2024
- for (let i = 0; i < each_blocks.length; i += 1) {
2025
- each_blocks[i].d();
1838
+ if (if_block) {
1839
+ if_block.d();
2026
1840
  }
2027
1841
  }
2028
1842
  };
2029
1843
  }
2030
1844
 
2031
- const padding = 1000;
2032
-
2033
- function instance$k($$self, $$props, $$invalidate) {
2034
- let { pxmm } = $$props;
2035
- let { type } = $$props;
2036
- let { data } = $$props;
2037
- let { bounding } = $$props;
2038
- const isTop = type === 'top';
2039
- const isBottom = type === 'bottom';
2040
- const isLeft = type === 'left';
2041
- const isRight = type === 'right';
2042
- const isRow = isTop || isBottom;
1845
+ function instance$j($$self, $$props, $$invalidate) {
1846
+ let userConfigElement;
1847
+ let { room } = $$props;
1848
+ let { getLabelElement } = $$props;
2043
1849
 
2044
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2045
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2046
- if (index === 0) return true;
2047
- return x !== arr[index - 1];
2048
- });
1850
+ // TODO: 统一这里的判断条件,目前写了多处
1851
+ const bodyWidth = document.body.clientWidth;
2049
1852
 
2050
- const minPosition = positionArray[0];
2051
- const maxPosition = positionArray.slice(-1)[0];
2052
- const length = maxPosition - minPosition;
2053
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
2054
- const lengthPx = length * pxmm;
2055
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
2056
-
2057
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
2058
- const translateMain = (minPosition - minBounding) * pxmm;
2059
-
2060
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
2061
- const translateSecond = 27 - padding * pxmm;
2062
-
2063
- const translate = (() => {
2064
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
2065
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
2066
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
2067
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
2068
- })();
2069
-
2070
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
2071
- const transform = `${translate} ${rotate}`;
2072
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
2073
- const width = lengthPx + 'px';
2074
-
2075
- // 把点位的户型图坐标转成距离起始位置的像素值
2076
- const textArray = positionArray.map((position, index, array) => {
2077
- if (index === 0) return null;
2078
- const distance = position - array[index - 1];
2079
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
2080
- return { distance, positionPx };
2081
- }).filter(notNil).filter(item => item.distance / length > 0.12);
1853
+ const bodyHeight = document.body.clientHeight;
1854
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1855
+ const roomLabel = room.roomLabel;
1856
+ const left = roomLabel.positionInImage.x * 100 + '%';
1857
+ const top = roomLabel.positionInImage.y * 100 + '%';
1858
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
2082
1859
 
2083
1860
  $$self.$$set = $$props => {
2084
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
2085
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
2086
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
2087
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1861
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
1862
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
2088
1863
  };
2089
1864
 
2090
- return [
2091
- type,
2092
- isTop,
2093
- isBottom,
2094
- isLeft,
2095
- isRight,
2096
- isRow,
2097
- positionPxArray,
2098
- transform,
2099
- transformOrigin,
2100
- width,
2101
- textArray,
2102
- pxmm,
2103
- data,
2104
- bounding
2105
- ];
1865
+ $$self.$$.update = () => {
1866
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1867
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1868
+ ? void 0
1869
+ : getLabelElement(room));
1870
+ }
1871
+ };
1872
+
1873
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
2106
1874
  }
2107
1875
 
2108
- class RuleItem extends internal.SvelteComponent {
1876
+ class RoomLabel extends internal.SvelteComponent {
2109
1877
  constructor(options) {
2110
1878
  super();
2111
-
2112
- internal.init(
2113
- this,
2114
- options,
2115
- instance$k,
2116
- create_fragment$k,
2117
- internal.safe_not_equal,
2118
- {
2119
- pxmm: 11,
2120
- type: 0,
2121
- data: 12,
2122
- bounding: 13
2123
- },
2124
- add_css$f
2125
- );
1879
+ internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$f);
2126
1880
  }
2127
1881
  }
2128
1882
 
2129
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1883
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
2130
1884
 
2131
- function get_each_context$5(ctx, list, i) {
2132
- const child_ctx = ctx.slice();
2133
- child_ctx[7] = list[i][0];
2134
- child_ctx[8] = list[i][1];
2135
- return child_ctx;
1885
+ function add_css$e(target) {
1886
+ internal.append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
2136
1887
  }
2137
1888
 
2138
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
2139
- function create_each_block$5(key_1, ctx) {
2140
- let first;
2141
- let ruleitem;
2142
- let current;
2143
-
2144
- const ruleitem_spread_levels = [
2145
- {
2146
- type: /*type*/ ctx[7],
2147
- data: /*data*/ ctx[8],
2148
- pxmm: /*pxmm*/ ctx[0],
2149
- bounding: /*bounding*/ ctx[2]
2150
- }
2151
- ];
2152
-
2153
- let ruleitem_props = {};
2154
-
2155
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2156
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2157
- }
2158
-
2159
- ruleitem = new RuleItem({ props: ruleitem_props });
2160
-
2161
- return {
2162
- key: key_1,
2163
- first: null,
2164
- c() {
2165
- first = internal.empty();
2166
- internal.create_component(ruleitem.$$.fragment);
2167
- this.first = first;
2168
- },
2169
- m(target, anchor) {
2170
- internal.insert(target, first, anchor);
2171
- internal.mount_component(ruleitem, target, anchor);
2172
- current = true;
2173
- },
2174
- p(new_ctx, dirty) {
2175
- ctx = new_ctx;
2176
-
2177
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
2178
- ? internal.get_spread_update(ruleitem_spread_levels, [
2179
- {
2180
- type: /*type*/ ctx[7],
2181
- data: /*data*/ ctx[8],
2182
- pxmm: /*pxmm*/ ctx[0],
2183
- bounding: /*bounding*/ ctx[2]
2184
- }
2185
- ])
2186
- : {};
2187
-
2188
- ruleitem.$set(ruleitem_changes);
2189
- },
2190
- i(local) {
2191
- if (current) return;
2192
- internal.transition_in(ruleitem.$$.fragment, local);
2193
- current = true;
2194
- },
2195
- o(local) {
2196
- internal.transition_out(ruleitem.$$.fragment, local);
2197
- current = false;
2198
- },
2199
- d(detaching) {
2200
- if (detaching) internal.detach(first);
2201
- internal.destroy_component(ruleitem, detaching);
2202
- }
2203
- };
1889
+ function get_each_context$8(ctx, list, i) {
1890
+ const child_ctx = ctx.slice();
1891
+ child_ctx[4] = list[i];
1892
+ return child_ctx;
2204
1893
  }
2205
1894
 
2206
- function create_fragment$j(ctx) {
1895
+ // (8:0) {#if rooms}
1896
+ function create_if_block$5(ctx) {
2207
1897
  let div;
2208
1898
  let each_blocks = [];
2209
1899
  let each_1_lookup = new Map();
2210
1900
  let current;
2211
- let each_value = /*ruleLabelArray*/ ctx[1];
2212
- const get_key = ctx => /*type*/ ctx[7];
1901
+ let each_value = /*rooms*/ ctx[1];
1902
+ const get_key = ctx => /*room*/ ctx[4].id;
2213
1903
 
2214
1904
  for (let i = 0; i < each_value.length; i += 1) {
2215
- let child_ctx = get_each_context$5(ctx, each_value, i);
1905
+ let child_ctx = get_each_context$8(ctx, each_value, i);
2216
1906
  let key = get_key(child_ctx);
2217
- each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1907
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
2218
1908
  }
2219
1909
 
2220
1910
  return {
@@ -2225,7 +1915,7 @@ function create_fragment$j(ctx) {
2225
1915
  each_blocks[i].c();
2226
1916
  }
2227
1917
 
2228
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
1918
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
2229
1919
  },
2230
1920
  m(target, anchor) {
2231
1921
  internal.insert(target, div, anchor);
@@ -2236,11 +1926,11 @@ function create_fragment$j(ctx) {
2236
1926
 
2237
1927
  current = true;
2238
1928
  },
2239
- p(ctx, [dirty]) {
2240
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
2241
- each_value = /*ruleLabelArray*/ ctx[1];
1929
+ p(ctx, dirty) {
1930
+ if (dirty & /*rooms, getLabelElement*/ 3) {
1931
+ each_value = /*rooms*/ ctx[1];
2242
1932
  internal.group_outros();
2243
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1933
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
2244
1934
  internal.check_outros();
2245
1935
  }
2246
1936
  },
@@ -2270,372 +1960,670 @@ function create_fragment$j(ctx) {
2270
1960
  };
2271
1961
  }
2272
1962
 
2273
- function instance$j($$self, $$props, $$invalidate) {
2274
- let bounding;
2275
- let ruleLabelData;
2276
- let ruleLabelDataKeys;
2277
- let ruleLabelArray;
2278
- let { pxmm } = $$props;
2279
- let { floorIndex } = $$props;
2280
- let { floorplanData } = $$props;
2281
-
2282
- $$self.$$set = $$props => {
2283
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2284
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2285
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2286
- };
1963
+ // (10:4) {#each rooms as room (room.id)}
1964
+ function create_each_block$8(key_1, ctx) {
1965
+ let first;
1966
+ let roomlabel;
1967
+ let current;
2287
1968
 
2288
- $$self.$$.update = () => {
2289
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
2290
- $$invalidate(2, bounding = floorplanData.bounding);
2291
- }
2292
-
2293
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2294
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1969
+ const roomlabel_spread_levels = [
1970
+ {
1971
+ room: /*room*/ ctx[4],
1972
+ getLabelElement: /*getLabelElement*/ ctx[0]
2295
1973
  }
1974
+ ];
2296
1975
 
2297
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
2298
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
2299
- }
1976
+ let roomlabel_props = {};
2300
1977
 
2301
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
2302
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2303
- }
2304
- };
1978
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1979
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1980
+ }
2305
1981
 
2306
- return [
2307
- pxmm,
2308
- ruleLabelArray,
2309
- bounding,
2310
- floorIndex,
2311
- floorplanData,
2312
- ruleLabelData,
2313
- ruleLabelDataKeys
2314
- ];
2315
- }
1982
+ roomlabel = new RoomLabel({ props: roomlabel_props });
2316
1983
 
2317
- class RuleLabels extends internal.SvelteComponent {
2318
- constructor(options) {
2319
- super();
2320
- internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
2321
- }
2322
- }
1984
+ return {
1985
+ key: key_1,
1986
+ first: null,
1987
+ c() {
1988
+ first = internal.empty();
1989
+ internal.create_component(roomlabel.$$.fragment);
1990
+ this.first = first;
1991
+ },
1992
+ m(target, anchor) {
1993
+ internal.insert(target, first, anchor);
1994
+ internal.mount_component(roomlabel, target, anchor);
1995
+ current = true;
1996
+ },
1997
+ p(new_ctx, dirty) {
1998
+ ctx = new_ctx;
2323
1999
 
2324
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
2000
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
2001
+ ? internal.get_spread_update(roomlabel_spread_levels, [
2002
+ {
2003
+ room: /*room*/ ctx[4],
2004
+ getLabelElement: /*getLabelElement*/ ctx[0]
2005
+ }
2006
+ ])
2007
+ : {};
2325
2008
 
2326
- function add_css$e(target) {
2327
- internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
2009
+ roomlabel.$set(roomlabel_changes);
2010
+ },
2011
+ i(local) {
2012
+ if (current) return;
2013
+ internal.transition_in(roomlabel.$$.fragment, local);
2014
+ current = true;
2015
+ },
2016
+ o(local) {
2017
+ internal.transition_out(roomlabel.$$.fragment, local);
2018
+ current = false;
2019
+ },
2020
+ d(detaching) {
2021
+ if (detaching) internal.detach(first);
2022
+ internal.destroy_component(roomlabel, detaching);
2023
+ }
2024
+ };
2328
2025
  }
2329
2026
 
2330
2027
  function create_fragment$i(ctx) {
2331
- let img;
2332
- let img_src_value;
2028
+ let if_block_anchor;
2029
+ let current;
2030
+ let if_block = /*rooms*/ ctx[1] && create_if_block$5(ctx);
2333
2031
 
2334
2032
  return {
2335
2033
  c() {
2336
- img = internal.element("img");
2337
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
2338
- internal.attr(img, "alt", "floorplan iamge");
2339
- internal.attr(img, "class", "svelte-1gfoniz");
2034
+ if (if_block) if_block.c();
2035
+ if_block_anchor = internal.empty();
2340
2036
  },
2341
2037
  m(target, anchor) {
2342
- internal.insert(target, img, anchor);
2038
+ if (if_block) if_block.m(target, anchor);
2039
+ internal.insert(target, if_block_anchor, anchor);
2040
+ current = true;
2343
2041
  },
2344
2042
  p(ctx, [dirty]) {
2345
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
2346
- internal.attr(img, "src", img_src_value);
2043
+ if (/*rooms*/ ctx[1]) {
2044
+ if (if_block) {
2045
+ if_block.p(ctx, dirty);
2046
+
2047
+ if (dirty & /*rooms*/ 2) {
2048
+ internal.transition_in(if_block, 1);
2049
+ }
2050
+ } else {
2051
+ if_block = create_if_block$5(ctx);
2052
+ if_block.c();
2053
+ internal.transition_in(if_block, 1);
2054
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2055
+ }
2056
+ } else if (if_block) {
2057
+ internal.group_outros();
2058
+
2059
+ internal.transition_out(if_block, 1, 1, () => {
2060
+ if_block = null;
2061
+ });
2062
+
2063
+ internal.check_outros();
2347
2064
  }
2348
2065
  },
2349
- i: internal.noop,
2350
- o: internal.noop,
2066
+ i(local) {
2067
+ if (current) return;
2068
+ internal.transition_in(if_block);
2069
+ current = true;
2070
+ },
2071
+ o(local) {
2072
+ internal.transition_out(if_block);
2073
+ current = false;
2074
+ },
2351
2075
  d(detaching) {
2352
- if (detaching) internal.detach(img);
2076
+ if (if_block) if_block.d(detaching);
2077
+ if (detaching) internal.detach(if_block_anchor);
2353
2078
  }
2354
2079
  };
2355
2080
  }
2356
2081
 
2357
2082
  function instance$i($$self, $$props, $$invalidate) {
2358
- let { url } = $$props;
2083
+ let rooms;
2084
+ let { floorIndex } = $$props;
2085
+ let { floorplanData } = $$props;
2086
+ let { getLabelElement } = $$props;
2359
2087
 
2360
2088
  $$self.$$set = $$props => {
2361
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
2089
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2090
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2091
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
2362
2092
  };
2363
2093
 
2364
- return [url];
2094
+ $$self.$$.update = () => {
2095
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2096
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
2097
+ }
2098
+ };
2099
+
2100
+ return [getLabelElement, rooms, floorIndex, floorplanData];
2365
2101
  }
2366
2102
 
2367
- class Normalmage extends internal.SvelteComponent {
2103
+ class RoomLabels extends internal.SvelteComponent {
2368
2104
  constructor(options) {
2369
2105
  super();
2370
- internal.init(this, options, instance$i, create_fragment$i, internal.safe_not_equal, { url: 0 }, add_css$e);
2106
+
2107
+ internal.init(
2108
+ this,
2109
+ options,
2110
+ instance$i,
2111
+ create_fragment$i,
2112
+ internal.safe_not_equal,
2113
+ {
2114
+ floorIndex: 2,
2115
+ floorplanData: 3,
2116
+ getLabelElement: 0
2117
+ },
2118
+ add_css$e
2119
+ );
2371
2120
  }
2372
2121
  }
2373
2122
 
2374
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
2123
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
2375
2124
 
2376
2125
  function add_css$d(target) {
2377
- internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
2126
+ internal.append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
2378
2127
  }
2379
2128
 
2380
- function create_fragment$h(ctx) {
2129
+ function get_each_context$7(ctx, list, i) {
2130
+ const child_ctx = ctx.slice();
2131
+ child_ctx[10] = list[i];
2132
+ child_ctx[12] = i;
2133
+ return child_ctx;
2134
+ }
2135
+
2136
+ function get_each_context_1(ctx, list, i) {
2137
+ const child_ctx = ctx.slice();
2138
+ child_ctx[13] = list[i];
2139
+ return child_ctx;
2140
+ }
2141
+
2142
+ // (53:4) {#each rulerLabels as rulerLabel}
2143
+ function create_each_block_1(ctx) {
2381
2144
  let div;
2382
- let html_tag;
2383
- let t;
2384
- let html_tag_1;
2385
2145
 
2386
2146
  return {
2387
2147
  c() {
2388
2148
  div = internal.element("div");
2389
- html_tag = new internal.HtmlTag();
2390
- t = internal.space();
2391
- html_tag_1 = new internal.HtmlTag();
2392
- html_tag.a = t;
2393
- html_tag_1.a = null;
2394
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
2149
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
2150
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
2151
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
2395
2152
  },
2396
2153
  m(target, anchor) {
2397
2154
  internal.insert(target, div, anchor);
2398
- html_tag.m(/*svgStyle*/ ctx[1], div);
2399
- internal.append(div, t);
2400
- html_tag_1.m(/*content*/ ctx[0], div);
2155
+ },
2156
+ p: internal.noop,
2157
+ d(detaching) {
2158
+ if (detaching) internal.detach(div);
2159
+ }
2160
+ };
2161
+ }
2162
+
2163
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
2164
+ function create_each_block$7(key_1, ctx) {
2165
+ let div1;
2166
+ let div0;
2167
+ let t0_value = /*textItem*/ ctx[10].distance + "";
2168
+ let t0;
2169
+ let t1;
2170
+
2171
+ return {
2172
+ key: key_1,
2173
+ first: null,
2174
+ c() {
2175
+ div1 = internal.element("div");
2176
+ div0 = internal.element("div");
2177
+ t0 = internal.text(t0_value);
2178
+ t1 = internal.space();
2179
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
2180
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
2181
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
2182
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
2183
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
2184
+ this.first = div1;
2185
+ },
2186
+ m(target, anchor) {
2187
+ internal.insert(target, div1, anchor);
2188
+ internal.append(div1, div0);
2189
+ internal.append(div0, t0);
2190
+ internal.append(div1, t1);
2191
+ },
2192
+ p(new_ctx, dirty) {
2193
+ ctx = new_ctx;
2194
+ },
2195
+ d(detaching) {
2196
+ if (detaching) internal.detach(div1);
2197
+ }
2198
+ };
2199
+ }
2200
+
2201
+ function create_fragment$h(ctx) {
2202
+ let div3;
2203
+ let div0;
2204
+ let t0;
2205
+ let div1;
2206
+ let t1;
2207
+ let div2;
2208
+ let each_blocks = [];
2209
+ let each1_lookup = new Map();
2210
+ let div3_class_value;
2211
+ let each_value_1 = /*rulerLabels*/ ctx[2];
2212
+ let each_blocks_1 = [];
2213
+
2214
+ for (let i = 0; i < each_value_1.length; i += 1) {
2215
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
2216
+ }
2217
+
2218
+ let each_value = /*rulerTexts*/ ctx[3];
2219
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
2220
+
2221
+ for (let i = 0; i < each_value.length; i += 1) {
2222
+ let child_ctx = get_each_context$7(ctx, each_value, i);
2223
+ let key = get_key(child_ctx);
2224
+ each1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
2225
+ }
2226
+
2227
+ return {
2228
+ c() {
2229
+ div3 = internal.element("div");
2230
+ div0 = internal.element("div");
2231
+ t0 = internal.space();
2232
+ div1 = internal.element("div");
2233
+
2234
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2235
+ each_blocks_1[i].c();
2236
+ }
2237
+
2238
+ t1 = internal.space();
2239
+ div2 = internal.element("div");
2240
+
2241
+ for (let i = 0; i < each_blocks.length; i += 1) {
2242
+ each_blocks[i].c();
2243
+ }
2244
+
2245
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
2246
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
2247
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
2248
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
2249
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
2250
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2251
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2252
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2253
+ },
2254
+ m(target, anchor) {
2255
+ internal.insert(target, div3, anchor);
2256
+ internal.append(div3, div0);
2257
+ internal.append(div3, t0);
2258
+ internal.append(div3, div1);
2259
+
2260
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2261
+ each_blocks_1[i].m(div1, null);
2262
+ }
2263
+
2264
+ internal.append(div3, t1);
2265
+ internal.append(div3, div2);
2266
+
2267
+ for (let i = 0; i < each_blocks.length; i += 1) {
2268
+ each_blocks[i].m(div2, null);
2269
+ }
2401
2270
  },
2402
2271
  p(ctx, [dirty]) {
2403
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
2272
+ if (dirty & /*rulerLabels*/ 4) {
2273
+ each_value_1 = /*rulerLabels*/ ctx[2];
2274
+ let i;
2275
+
2276
+ for (i = 0; i < each_value_1.length; i += 1) {
2277
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
2278
+
2279
+ if (each_blocks_1[i]) {
2280
+ each_blocks_1[i].p(child_ctx, dirty);
2281
+ } else {
2282
+ each_blocks_1[i] = create_each_block_1(child_ctx);
2283
+ each_blocks_1[i].c();
2284
+ each_blocks_1[i].m(div1, null);
2285
+ }
2286
+ }
2287
+
2288
+ for (; i < each_blocks_1.length; i += 1) {
2289
+ each_blocks_1[i].d(1);
2290
+ }
2291
+
2292
+ each_blocks_1.length = each_value_1.length;
2293
+ }
2294
+
2295
+ if (dirty & /*rulerTexts, isRow*/ 10) {
2296
+ each_value = /*rulerTexts*/ ctx[3];
2297
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$7, null, get_each_context$7);
2298
+ }
2299
+
2300
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
2301
+ internal.attr(div3, "class", div3_class_value);
2302
+ }
2303
+
2304
+ if (dirty & /*type, isRow*/ 3) {
2305
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2306
+ }
2404
2307
  },
2405
2308
  i: internal.noop,
2406
2309
  o: internal.noop,
2407
2310
  d(detaching) {
2408
- if (detaching) internal.detach(div);
2311
+ if (detaching) internal.detach(div3);
2312
+ internal.destroy_each(each_blocks_1, detaching);
2313
+
2314
+ for (let i = 0; i < each_blocks.length; i += 1) {
2315
+ each_blocks[i].d();
2316
+ }
2409
2317
  }
2410
2318
  };
2411
2319
  }
2412
2320
 
2321
+ const padding$1 = 1000;
2322
+ const exteriorWallOffset$1 = 180;
2323
+
2413
2324
  function instance$h($$self, $$props, $$invalidate) {
2414
- let { content } = $$props;
2325
+ let { type } = $$props;
2326
+ let { data } = $$props;
2327
+ let { bounding } = $$props;
2328
+ const isRow = type === 'top' || type === 'bottom';
2329
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
2330
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
2415
2331
 
2416
- const svgStyle = `
2417
- <style>
2418
- svg [type='lineGroup'] path {
2419
- fill: #ffffff;
2420
- stroke: #ffffff;
2421
- }
2422
- svg [type='lineItemGroup'] g g g g {
2423
- stroke: #ffffff;
2424
- }</style>
2425
- `;
2332
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2333
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2334
+ // 筛除重复数据
2335
+ if (index === 0) return true;
2336
+
2337
+ return x !== arr[index - 1];
2338
+ });
2339
+
2340
+ const rulerLabels = rulerPoints.map(num => {
2341
+ const left = isRow
2342
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2343
+ : 0;
2344
+
2345
+ const bottom = !isRow
2346
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2347
+ : 0;
2348
+
2349
+ return { left, bottom };
2350
+ });
2351
+
2352
+ rulerLabels.unshift({ left: 0, bottom: 0 });
2353
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
2354
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
2355
+
2356
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
2357
+ const distance = index === 0 ? 0 : num - arr[index - 1];
2358
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
2359
+
2360
+ const left = isRow
2361
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2362
+ : 0;
2363
+
2364
+ const bottom = !isRow
2365
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2366
+ : 0;
2367
+
2368
+ return { left, bottom, distance };
2369
+ }).filter(({ distance }) => distance / length > 0.1);
2426
2370
 
2427
2371
  $$self.$$set = $$props => {
2428
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
2372
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
2373
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
2374
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
2429
2375
  };
2430
2376
 
2431
- return [content, svgStyle];
2377
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
2432
2378
  }
2433
2379
 
2434
- class SvgImage extends internal.SvelteComponent {
2380
+ class RuleItem extends internal.SvelteComponent {
2435
2381
  constructor(options) {
2436
2382
  super();
2437
- internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { content: 0 }, add_css$d);
2383
+ internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$d);
2438
2384
  }
2439
2385
  }
2440
2386
 
2441
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
2387
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
2442
2388
 
2443
2389
  function add_css$c(target) {
2444
- internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
2390
+ internal.append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
2445
2391
  }
2446
2392
 
2447
- // (13:22)
2448
- function create_if_block_1$3(ctx) {
2449
- let normalimage;
2393
+ function get_each_context$6(ctx, list, i) {
2394
+ const child_ctx = ctx.slice();
2395
+ child_ctx[12] = list[i][0];
2396
+ child_ctx[13] = list[i][1];
2397
+ return child_ctx;
2398
+ }
2399
+
2400
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
2401
+ function create_each_block$6(key_1, ctx) {
2402
+ let first;
2403
+ let ruleitem;
2450
2404
  let current;
2451
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
2452
2405
 
2453
- return {
2454
- c() {
2455
- internal.create_component(normalimage.$$.fragment);
2456
- },
2457
- m(target, anchor) {
2458
- internal.mount_component(normalimage, target, anchor);
2459
- current = true;
2460
- },
2461
- p(ctx, dirty) {
2462
- const normalimage_changes = {};
2463
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
2464
- normalimage.$set(normalimage_changes);
2465
- },
2466
- i(local) {
2467
- if (current) return;
2468
- internal.transition_in(normalimage.$$.fragment, local);
2469
- current = true;
2470
- },
2471
- o(local) {
2472
- internal.transition_out(normalimage.$$.fragment, local);
2473
- current = false;
2474
- },
2475
- d(detaching) {
2476
- internal.destroy_component(normalimage, detaching);
2406
+ const ruleitem_spread_levels = [
2407
+ {
2408
+ type: /*type*/ ctx[12],
2409
+ data: /*data*/ ctx[13],
2410
+ bounding: /*bounding*/ ctx[0]
2477
2411
  }
2478
- };
2479
- }
2412
+ ];
2480
2413
 
2481
- // (11:2) {#if svgContent}
2482
- function create_if_block$5(ctx) {
2483
- let svgimage;
2484
- let current;
2414
+ let ruleitem_props = {};
2485
2415
 
2486
- svgimage = new SvgImage({
2487
- props: { content: /*svgContent*/ ctx[0] }
2488
- });
2416
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2417
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2418
+ }
2419
+
2420
+ ruleitem = new RuleItem({ props: ruleitem_props });
2489
2421
 
2490
2422
  return {
2423
+ key: key_1,
2424
+ first: null,
2491
2425
  c() {
2492
- internal.create_component(svgimage.$$.fragment);
2426
+ first = internal.empty();
2427
+ internal.create_component(ruleitem.$$.fragment);
2428
+ this.first = first;
2493
2429
  },
2494
2430
  m(target, anchor) {
2495
- internal.mount_component(svgimage, target, anchor);
2431
+ internal.insert(target, first, anchor);
2432
+ internal.mount_component(ruleitem, target, anchor);
2496
2433
  current = true;
2497
2434
  },
2498
- p(ctx, dirty) {
2499
- const svgimage_changes = {};
2500
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
2501
- svgimage.$set(svgimage_changes);
2435
+ p(new_ctx, dirty) {
2436
+ ctx = new_ctx;
2437
+
2438
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
2439
+ ? internal.get_spread_update(ruleitem_spread_levels, [
2440
+ {
2441
+ type: /*type*/ ctx[12],
2442
+ data: /*data*/ ctx[13],
2443
+ bounding: /*bounding*/ ctx[0]
2444
+ }
2445
+ ])
2446
+ : {};
2447
+
2448
+ ruleitem.$set(ruleitem_changes);
2502
2449
  },
2503
2450
  i(local) {
2504
2451
  if (current) return;
2505
- internal.transition_in(svgimage.$$.fragment, local);
2452
+ internal.transition_in(ruleitem.$$.fragment, local);
2506
2453
  current = true;
2507
2454
  },
2508
2455
  o(local) {
2509
- internal.transition_out(svgimage.$$.fragment, local);
2456
+ internal.transition_out(ruleitem.$$.fragment, local);
2510
2457
  current = false;
2511
2458
  },
2512
2459
  d(detaching) {
2513
- internal.destroy_component(svgimage, detaching);
2460
+ if (detaching) internal.detach(first);
2461
+ internal.destroy_component(ruleitem, detaching);
2514
2462
  }
2515
2463
  };
2516
2464
  }
2517
2465
 
2518
2466
  function create_fragment$g(ctx) {
2519
2467
  let div;
2520
- let current_block_type_index;
2521
- let if_block;
2468
+ let each_blocks = [];
2469
+ let each_1_lookup = new Map();
2522
2470
  let current;
2523
- const if_block_creators = [create_if_block$5, create_if_block_1$3];
2524
- const if_blocks = [];
2525
-
2526
- function select_block_type(ctx, dirty) {
2527
- if (/*svgContent*/ ctx[0]) return 0;
2528
- if (/*imageData*/ ctx[1]) return 1;
2529
- return -1;
2530
- }
2471
+ let each_value = /*ruleLabelArray*/ ctx[3];
2472
+ const get_key = ctx => /*type*/ ctx[12];
2531
2473
 
2532
- if (~(current_block_type_index = select_block_type(ctx))) {
2533
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2474
+ for (let i = 0; i < each_value.length; i += 1) {
2475
+ let child_ctx = get_each_context$6(ctx, each_value, i);
2476
+ let key = get_key(child_ctx);
2477
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
2534
2478
  }
2535
2479
 
2536
2480
  return {
2537
2481
  c() {
2538
2482
  div = internal.element("div");
2539
- if (if_block) if_block.c();
2540
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
2483
+
2484
+ for (let i = 0; i < each_blocks.length; i += 1) {
2485
+ each_blocks[i].c();
2486
+ }
2487
+
2488
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
2489
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2490
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2541
2491
  },
2542
2492
  m(target, anchor) {
2543
2493
  internal.insert(target, div, anchor);
2544
2494
 
2545
- if (~current_block_type_index) {
2546
- if_blocks[current_block_type_index].m(div, null);
2495
+ for (let i = 0; i < each_blocks.length; i += 1) {
2496
+ each_blocks[i].m(div, null);
2547
2497
  }
2548
2498
 
2549
2499
  current = true;
2550
2500
  },
2551
2501
  p(ctx, [dirty]) {
2552
- let previous_block_index = current_block_type_index;
2553
- current_block_type_index = select_block_type(ctx);
2554
-
2555
- if (current_block_type_index === previous_block_index) {
2556
- if (~current_block_type_index) {
2557
- if_blocks[current_block_type_index].p(ctx, dirty);
2558
- }
2559
- } else {
2560
- if (if_block) {
2561
- internal.group_outros();
2562
-
2563
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2564
- if_blocks[previous_block_index] = null;
2565
- });
2566
-
2567
- internal.check_outros();
2568
- }
2569
-
2570
- if (~current_block_type_index) {
2571
- if_block = if_blocks[current_block_type_index];
2502
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
2503
+ each_value = /*ruleLabelArray*/ ctx[3];
2504
+ internal.group_outros();
2505
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$6, null, get_each_context$6);
2506
+ internal.check_outros();
2507
+ }
2572
2508
 
2573
- if (!if_block) {
2574
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2575
- if_block.c();
2576
- } else {
2577
- if_block.p(ctx, dirty);
2578
- }
2509
+ if (dirty & /*width*/ 4) {
2510
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2511
+ }
2579
2512
 
2580
- internal.transition_in(if_block, 1);
2581
- if_block.m(div, null);
2582
- } else {
2583
- if_block = null;
2584
- }
2513
+ if (dirty & /*height*/ 2) {
2514
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2585
2515
  }
2586
2516
  },
2587
2517
  i(local) {
2588
2518
  if (current) return;
2589
- internal.transition_in(if_block);
2519
+
2520
+ for (let i = 0; i < each_value.length; i += 1) {
2521
+ internal.transition_in(each_blocks[i]);
2522
+ }
2523
+
2590
2524
  current = true;
2591
2525
  },
2592
2526
  o(local) {
2593
- internal.transition_out(if_block);
2527
+ for (let i = 0; i < each_blocks.length; i += 1) {
2528
+ internal.transition_out(each_blocks[i]);
2529
+ }
2530
+
2594
2531
  current = false;
2595
2532
  },
2596
2533
  d(detaching) {
2597
2534
  if (detaching) internal.detach(div);
2598
2535
 
2599
- if (~current_block_type_index) {
2600
- if_blocks[current_block_type_index].d();
2536
+ for (let i = 0; i < each_blocks.length; i += 1) {
2537
+ each_blocks[i].d();
2601
2538
  }
2602
2539
  }
2603
2540
  };
2604
2541
  }
2605
2542
 
2543
+ const padding = 1000;
2544
+ const exteriorWallOffset = 180;
2545
+
2606
2546
  function instance$g($$self, $$props, $$invalidate) {
2607
- let imageData;
2608
- let svgContent;
2609
- var _a, _b;
2547
+ let bounding;
2548
+ let ruleLabelData;
2549
+ let ruleLabelDataKeys;
2550
+ let ruleLabelArray;
2551
+ let boundingWidth;
2552
+ let boundingHeight;
2553
+ let contentWidth;
2554
+ let contentHeight;
2555
+ let width;
2556
+ let height;
2610
2557
  let { floorIndex } = $$props;
2611
2558
  let { floorplanData } = $$props;
2612
2559
 
2613
2560
  $$self.$$set = $$props => {
2614
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2615
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2561
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
2562
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2616
2563
  };
2617
2564
 
2618
2565
  $$self.$$.update = () => {
2619
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2620
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
2566
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
2567
+ $$invalidate(0, bounding = floorplanData.bounding);
2621
2568
  }
2622
2569
 
2623
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
2624
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
2625
- ? void 0
2626
- : _a[floorIndex]) === null || _b === void 0
2627
- ? void 0
2628
- : _b.svgContent);
2570
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
2571
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
2572
+ }
2573
+
2574
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
2575
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
2576
+ }
2577
+
2578
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
2579
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2580
+ }
2581
+
2582
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2583
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
2584
+ }
2585
+
2586
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2587
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
2588
+ }
2589
+
2590
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2591
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
2592
+ }
2593
+
2594
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2595
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
2596
+ }
2597
+
2598
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
2599
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
2600
+ }
2601
+
2602
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
2603
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
2629
2604
  }
2630
2605
  };
2631
2606
 
2632
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
2607
+ return [
2608
+ bounding,
2609
+ height,
2610
+ width,
2611
+ ruleLabelArray,
2612
+ floorIndex,
2613
+ floorplanData,
2614
+ boundingHeight,
2615
+ contentHeight,
2616
+ boundingWidth,
2617
+ contentWidth,
2618
+ ruleLabelData,
2619
+ ruleLabelDataKeys
2620
+ ];
2633
2621
  }
2634
2622
 
2635
- class BaseImage extends internal.SvelteComponent {
2623
+ class RuleLabels extends internal.SvelteComponent {
2636
2624
  constructor(options) {
2637
2625
  super();
2638
- internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$c);
2626
+ internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$c);
2639
2627
  }
2640
2628
  }
2641
2629
 
@@ -2909,17 +2897,17 @@ function add_css$b(target) {
2909
2897
  internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
2910
2898
  }
2911
2899
 
2912
- function get_each_context$4(ctx, list, i) {
2900
+ function get_each_context$5(ctx, list, i) {
2913
2901
  const child_ctx = ctx.slice();
2914
- child_ctx[4] = list[i];
2902
+ child_ctx[5] = list[i];
2915
2903
  return child_ctx;
2916
2904
  }
2917
2905
 
2918
- // (18:6) {:else}
2906
+ // (19:6) {:else}
2919
2907
  function create_else_block(ctx) {
2920
2908
  let roommaterial_1;
2921
2909
  let current;
2922
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2910
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2923
2911
 
2924
2912
  return {
2925
2913
  c() {
@@ -2931,7 +2919,7 @@ function create_else_block(ctx) {
2931
2919
  },
2932
2920
  p(ctx, dirty) {
2933
2921
  const roommaterial_1_changes = {};
2934
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2922
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2935
2923
  roommaterial_1.$set(roommaterial_1_changes);
2936
2924
  },
2937
2925
  i(local) {
@@ -2949,11 +2937,11 @@ function create_else_block(ctx) {
2949
2937
  };
2950
2938
  }
2951
2939
 
2952
- // (16:37)
2940
+ // (17:37)
2953
2941
  function create_if_block_1$2(ctx) {
2954
2942
  let roommaterial_2;
2955
2943
  let current;
2956
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2944
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2957
2945
 
2958
2946
  return {
2959
2947
  c() {
@@ -2965,7 +2953,7 @@ function create_if_block_1$2(ctx) {
2965
2953
  },
2966
2954
  p(ctx, dirty) {
2967
2955
  const roommaterial_2_changes = {};
2968
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2956
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2969
2957
  roommaterial_2.$set(roommaterial_2_changes);
2970
2958
  },
2971
2959
  i(local) {
@@ -2983,11 +2971,11 @@ function create_if_block_1$2(ctx) {
2983
2971
  };
2984
2972
  }
2985
2973
 
2986
- // (14:6) {#if room.floorType === 1}
2974
+ // (15:6) {#if room.floorType === 1}
2987
2975
  function create_if_block$4(ctx) {
2988
2976
  let roommaterial_0;
2989
2977
  let current;
2990
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2978
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
2991
2979
 
2992
2980
  return {
2993
2981
  c() {
@@ -2999,7 +2987,7 @@ function create_if_block$4(ctx) {
2999
2987
  },
3000
2988
  p(ctx, dirty) {
3001
2989
  const roommaterial_0_changes = {};
3002
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2990
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
3003
2991
  roommaterial_0.$set(roommaterial_0_changes);
3004
2992
  },
3005
2993
  i(local) {
@@ -3017,18 +3005,19 @@ function create_if_block$4(ctx) {
3017
3005
  };
3018
3006
  }
3019
3007
 
3020
- // (12:2) {#each rooms as room}
3021
- function create_each_block$4(ctx) {
3008
+ // (13:2) {#each rooms as room}
3009
+ function create_each_block$5(ctx) {
3022
3010
  let svg;
3023
3011
  let current_block_type_index;
3024
3012
  let if_block;
3013
+ let svg_viewBox_value;
3025
3014
  let current;
3026
3015
  const if_block_creators = [create_if_block$4, create_if_block_1$2, create_else_block];
3027
3016
  const if_blocks = [];
3028
3017
 
3029
3018
  function select_block_type(ctx, dirty) {
3030
- if (/*room*/ ctx[4].floorType === 1) return 0;
3031
- if (/*room*/ ctx[4].floorType === 0) return 1;
3019
+ if (/*room*/ ctx[5].floorType === 1) return 0;
3020
+ if (/*room*/ ctx[5].floorType === 0) return 1;
3032
3021
  return 2;
3033
3022
  }
3034
3023
 
@@ -3039,6 +3028,9 @@ function create_each_block$4(ctx) {
3039
3028
  c() {
3040
3029
  svg = internal.svg_element("svg");
3041
3030
  if_block.c();
3031
+ internal.attr(svg, "width", "100%");
3032
+ internal.attr(svg, "height", "100%");
3033
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
3042
3034
  internal.attr(svg, "class", "svelte-1d4xj70");
3043
3035
  },
3044
3036
  m(target, anchor) {
@@ -3096,7 +3088,7 @@ function create_fragment$c(ctx) {
3096
3088
  let each_blocks = [];
3097
3089
 
3098
3090
  for (let i = 0; i < each_value.length; i += 1) {
3099
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3091
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3100
3092
  }
3101
3093
 
3102
3094
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -3123,18 +3115,18 @@ function create_fragment$c(ctx) {
3123
3115
  current = true;
3124
3116
  },
3125
3117
  p(ctx, [dirty]) {
3126
- if (dirty & /*rooms*/ 1) {
3118
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
3127
3119
  each_value = /*rooms*/ ctx[0];
3128
3120
  let i;
3129
3121
 
3130
3122
  for (i = 0; i < each_value.length; i += 1) {
3131
- const child_ctx = get_each_context$4(ctx, each_value, i);
3123
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3132
3124
 
3133
3125
  if (each_blocks[i]) {
3134
3126
  each_blocks[i].p(child_ctx, dirty);
3135
3127
  internal.transition_in(each_blocks[i], 1);
3136
3128
  } else {
3137
- each_blocks[i] = create_each_block$4(child_ctx);
3129
+ each_blocks[i] = create_each_block$5(child_ctx);
3138
3130
  each_blocks[i].c();
3139
3131
  internal.transition_in(each_blocks[i], 1);
3140
3132
  each_blocks[i].m(div, null);
@@ -3178,30 +3170,30 @@ function create_fragment$c(ctx) {
3178
3170
  function instance$c($$self, $$props, $$invalidate) {
3179
3171
  let rooms;
3180
3172
  let { floorIndex } = $$props;
3181
- let { pxmm } = $$props;
3182
3173
  let { floorplanData } = $$props;
3174
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3175
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3183
3176
 
3184
3177
  $$self.$$set = $$props => {
3185
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3186
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
3187
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3178
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
3179
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
3188
3180
  };
3189
3181
 
3190
3182
  $$self.$$.update = () => {
3191
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
3183
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
3192
3184
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
3193
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
3185
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
3194
3186
  })));
3195
3187
  }
3196
3188
  };
3197
3189
 
3198
- return [rooms, floorIndex, pxmm, floorplanData];
3190
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
3199
3191
  }
3200
3192
 
3201
3193
  class RoomMaterial extends internal.SvelteComponent {
3202
3194
  constructor(options) {
3203
3195
  super();
3204
- internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$b);
3196
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$b);
3205
3197
  }
3206
3198
  }
3207
3199
 
@@ -3234,55 +3226,52 @@ function create_fragment$b(ctx) {
3234
3226
  }
3235
3227
 
3236
3228
  function instance$b($$self, $$props, $$invalidate) {
3237
- let { pxmm } = $$props;
3238
3229
  let { room } = $$props;
3239
3230
  let { floorplanData } = $$props;
3240
3231
  const { bounding } = floorplanData;
3241
3232
 
3242
3233
  const _pathD = pathD(room.path, {
3243
3234
  needZ: true,
3244
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
3235
+ format: vector => formatFloorplanPoint(vector, bounding)
3245
3236
  });
3246
3237
 
3247
3238
  $$self.$$set = $$props => {
3248
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3249
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
3250
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3239
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
3240
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3251
3241
  };
3252
3242
 
3253
- return [_pathD, pxmm, room, floorplanData];
3243
+ return [_pathD, room, floorplanData];
3254
3244
  }
3255
3245
 
3256
3246
  class Room extends internal.SvelteComponent {
3257
3247
  constructor(options) {
3258
3248
  super();
3259
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$a);
3249
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$a);
3260
3250
  }
3261
3251
  }
3262
3252
 
3263
3253
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
3264
3254
 
3265
3255
  function add_css$9(target) {
3266
- internal.append_styles(target, "svelte-klfhwd", ".floorplan-plugin__room-highlight.svelte-klfhwd{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-klfhwd{width:100%;height:100%;overflow:visible}");
3256
+ internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
3267
3257
  }
3268
3258
 
3269
- function get_each_context$3(ctx, list, i) {
3259
+ function get_each_context$4(ctx, list, i) {
3270
3260
  const child_ctx = ctx.slice();
3271
- child_ctx[12] = list[i];
3261
+ child_ctx[4] = list[i];
3272
3262
  return child_ctx;
3273
3263
  }
3274
3264
 
3275
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3276
- function create_each_block$3(key_1, ctx) {
3265
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3266
+ function create_each_block$4(key_1, ctx) {
3277
3267
  let first;
3278
3268
  let room;
3279
3269
  let current;
3280
3270
 
3281
3271
  const room_spread_levels = [
3282
3272
  {
3283
- room: /*room*/ ctx[12],
3284
- floorplanData: /*floorplanData*/ ctx[2],
3285
- pxmm: /*pxmm*/ ctx[0]
3273
+ room: /*room*/ ctx[4],
3274
+ floorplanData: /*floorplanData*/ ctx[1]
3286
3275
  }
3287
3276
  ];
3288
3277
 
@@ -3310,12 +3299,11 @@ function create_each_block$3(key_1, ctx) {
3310
3299
  p(new_ctx, dirty) {
3311
3300
  ctx = new_ctx;
3312
3301
 
3313
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
3302
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
3314
3303
  ? internal.get_spread_update(room_spread_levels, [
3315
3304
  {
3316
- room: /*room*/ ctx[12],
3317
- floorplanData: /*floorplanData*/ ctx[2],
3318
- pxmm: /*pxmm*/ ctx[0]
3305
+ room: /*room*/ ctx[4],
3306
+ floorplanData: /*floorplanData*/ ctx[1]
3319
3307
  }
3320
3308
  ])
3321
3309
  : {};
@@ -3343,17 +3331,14 @@ function create_fragment$a(ctx) {
3343
3331
  let svg;
3344
3332
  let each_blocks = [];
3345
3333
  let each_1_lookup = new Map();
3346
- let div_resize_listener;
3347
3334
  let current;
3348
- let mounted;
3349
- let dispose;
3350
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3351
- const get_key = ctx => /*room*/ ctx[12].id;
3335
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3336
+ const get_key = ctx => /*room*/ ctx[4].id;
3352
3337
 
3353
3338
  for (let i = 0; i < each_value.length; i += 1) {
3354
- let child_ctx = get_each_context$3(ctx, each_value, i);
3339
+ let child_ctx = get_each_context$4(ctx, each_value, i);
3355
3340
  let key = get_key(child_ctx);
3356
- each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
3341
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3357
3342
  }
3358
3343
 
3359
3344
  return {
@@ -3365,9 +3350,11 @@ function create_fragment$a(ctx) {
3365
3350
  each_blocks[i].c();
3366
3351
  }
3367
3352
 
3368
- internal.attr(svg, "class", "svelte-klfhwd");
3369
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-klfhwd");
3370
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
3353
+ internal.attr(svg, "width", "100%");
3354
+ internal.attr(svg, "height", "100%");
3355
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
3356
+ internal.attr(svg, "class", "svelte-1kqo6e4");
3357
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
3371
3358
  },
3372
3359
  m(target, anchor) {
3373
3360
  internal.insert(target, div, anchor);
@@ -3377,20 +3364,13 @@ function create_fragment$a(ctx) {
3377
3364
  each_blocks[i].m(svg, null);
3378
3365
  }
3379
3366
 
3380
- /*div_binding*/ ctx[9](div);
3381
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
3382
3367
  current = true;
3383
-
3384
- if (!mounted) {
3385
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
3386
- mounted = true;
3387
- }
3388
3368
  },
3389
3369
  p(ctx, [dirty]) {
3390
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
3391
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3370
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
3371
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3392
3372
  internal.group_outros();
3393
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
3373
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
3394
3374
  internal.check_outros();
3395
3375
  }
3396
3376
  },
@@ -3416,127 +3396,46 @@ function create_fragment$a(ctx) {
3416
3396
  for (let i = 0; i < each_blocks.length; i += 1) {
3417
3397
  each_blocks[i].d();
3418
3398
  }
3419
-
3420
- /*div_binding*/ ctx[9](null);
3421
- div_resize_listener();
3422
- mounted = false;
3423
- dispose();
3424
3399
  }
3425
3400
  };
3426
3401
  }
3427
3402
 
3428
3403
  function instance$a($$self, $$props, $$invalidate) {
3429
- let { five } = $$props;
3430
- let { pxmm } = $$props;
3431
3404
  let { floorIndex } = $$props;
3432
3405
  let { floorplanData } = $$props;
3433
- let { onRoomHeightClick } = $$props;
3434
- let clientWidth;
3435
- let clientHeight;
3436
- let highlightContainerDom;
3437
- const { observers: floorplan_observers } = floorplanData;
3438
-
3439
- const handleClick = function (e) {
3440
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
3441
- ? void 0
3442
- : onRoomHeightClick(e)) === false) return;
3443
-
3444
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
3445
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
3446
-
3447
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
3448
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
3449
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
3450
-
3451
- // px 转换为 百分比
3452
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
3453
-
3454
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
3455
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
3456
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
3457
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
3458
- })[0];
3459
-
3460
- five.moveToPano(closestPoint.index);
3461
- };
3462
-
3463
- function div_binding($$value) {
3464
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3465
- highlightContainerDom = $$value;
3466
- $$invalidate(5, highlightContainerDom);
3467
- });
3468
- }
3469
-
3470
- function div_elementresize_handler() {
3471
- clientWidth = this.clientWidth;
3472
- clientHeight = this.clientHeight;
3473
- $$invalidate(3, clientWidth);
3474
- $$invalidate(4, clientHeight);
3475
- }
3406
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3407
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3476
3408
 
3477
3409
  $$self.$$set = $$props => {
3478
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
3479
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3480
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3481
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3482
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
3410
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
3411
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
3483
3412
  };
3484
3413
 
3485
- return [
3486
- pxmm,
3487
- floorIndex,
3488
- floorplanData,
3489
- clientWidth,
3490
- clientHeight,
3491
- highlightContainerDom,
3492
- handleClick,
3493
- five,
3494
- onRoomHeightClick,
3495
- div_binding,
3496
- div_elementresize_handler
3497
- ];
3414
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
3498
3415
  }
3499
3416
 
3500
3417
  class RoomHighlight extends internal.SvelteComponent {
3501
3418
  constructor(options) {
3502
3419
  super();
3503
-
3504
- internal.init(
3505
- this,
3506
- options,
3507
- instance$a,
3508
- create_fragment$a,
3509
- internal.safe_not_equal,
3510
- {
3511
- five: 7,
3512
- pxmm: 0,
3513
- floorIndex: 1,
3514
- floorplanData: 2,
3515
- onRoomHeightClick: 8
3516
- },
3517
- add_css$9
3518
- );
3420
+ internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$9);
3519
3421
  }
3520
3422
  }
3521
3423
 
3522
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
3424
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
3523
3425
 
3524
3426
  function add_css$8(target) {
3525
- internal.append_styles(target, "svelte-tlo7rk", ".floorplan-current-floor.svelte-tlo7rk{position:relative;width:100%;height:100%}");
3427
+ internal.append_styles(target, "svelte-bl8zrz", ".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}");
3526
3428
  }
3527
3429
 
3528
- // (19:2) {#if hoverEnable}
3430
+ // (17:2) {#if hoverEnable}
3529
3431
  function create_if_block_2(ctx) {
3530
3432
  let roomhighlight;
3531
3433
  let current;
3532
3434
 
3533
3435
  const roomhighlight_spread_levels = [
3534
3436
  {
3535
- five: /*five*/ ctx[1],
3536
- pxmm: /*pxmm*/ ctx[0],
3537
- floorIndex: /*floorIndex*/ ctx[2],
3538
- floorplanData: /*floorplanData*/ ctx[6],
3539
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3437
+ floorIndex: /*floorIndex*/ ctx[1],
3438
+ floorplanData: /*floorplanData*/ ctx[5]
3540
3439
  }
3541
3440
  ];
3542
3441
 
@@ -3557,14 +3456,11 @@ function create_if_block_2(ctx) {
3557
3456
  current = true;
3558
3457
  },
3559
3458
  p(ctx, dirty) {
3560
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
3459
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3561
3460
  ? internal.get_spread_update(roomhighlight_spread_levels, [
3562
3461
  {
3563
- five: /*five*/ ctx[1],
3564
- pxmm: /*pxmm*/ ctx[0],
3565
- floorIndex: /*floorIndex*/ ctx[2],
3566
- floorplanData: /*floorplanData*/ ctx[6],
3567
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3462
+ floorIndex: /*floorIndex*/ ctx[1],
3463
+ floorplanData: /*floorplanData*/ ctx[5]
3568
3464
  }
3569
3465
  ])
3570
3466
  : {};
@@ -3586,16 +3482,16 @@ function create_if_block_2(ctx) {
3586
3482
  };
3587
3483
  }
3588
3484
 
3589
- // (23:2) {#if roomLabelsEnable}
3485
+ // (21:2) {#if roomLabelsEnable}
3590
3486
  function create_if_block_1$1(ctx) {
3591
3487
  let roomlabels;
3592
3488
  let current;
3593
3489
 
3594
3490
  const roomlabels_spread_levels = [
3595
3491
  {
3596
- floorplanData: /*floorplanData*/ ctx[6],
3597
- floorIndex: /*floorIndex*/ ctx[2],
3598
- getLabelElement: /*getLabelElement*/ ctx[8]
3492
+ floorplanData: /*floorplanData*/ ctx[5],
3493
+ floorIndex: /*floorIndex*/ ctx[1],
3494
+ getLabelElement: /*getLabelElement*/ ctx[6]
3599
3495
  }
3600
3496
  ];
3601
3497
 
@@ -3616,12 +3512,12 @@ function create_if_block_1$1(ctx) {
3616
3512
  current = true;
3617
3513
  },
3618
3514
  p(ctx, dirty) {
3619
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
3515
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
3620
3516
  ? internal.get_spread_update(roomlabels_spread_levels, [
3621
3517
  {
3622
- floorplanData: /*floorplanData*/ ctx[6],
3623
- floorIndex: /*floorIndex*/ ctx[2],
3624
- getLabelElement: /*getLabelElement*/ ctx[8]
3518
+ floorplanData: /*floorplanData*/ ctx[5],
3519
+ floorIndex: /*floorIndex*/ ctx[1],
3520
+ getLabelElement: /*getLabelElement*/ ctx[6]
3625
3521
  }
3626
3522
  ])
3627
3523
  : {};
@@ -3643,16 +3539,15 @@ function create_if_block_1$1(ctx) {
3643
3539
  };
3644
3540
  }
3645
3541
 
3646
- // (26:2) {#if ruleLabelsEnable}
3542
+ // (24:2) {#if ruleLabelsEnable}
3647
3543
  function create_if_block$3(ctx) {
3648
3544
  let rulelabels;
3649
3545
  let current;
3650
3546
 
3651
3547
  const rulelabels_spread_levels = [
3652
3548
  {
3653
- floorplanData: /*floorplanData*/ ctx[6],
3654
- floorIndex: /*floorIndex*/ ctx[2],
3655
- pxmm: /*pxmm*/ ctx[0]
3549
+ floorplanData: /*floorplanData*/ ctx[5],
3550
+ floorIndex: /*floorIndex*/ ctx[1]
3656
3551
  }
3657
3552
  ];
3658
3553
 
@@ -3673,12 +3568,11 @@ function create_if_block$3(ctx) {
3673
3568
  current = true;
3674
3569
  },
3675
3570
  p(ctx, dirty) {
3676
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
3571
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3677
3572
  ? internal.get_spread_update(rulelabels_spread_levels, [
3678
3573
  {
3679
- floorplanData: /*floorplanData*/ ctx[6],
3680
- floorIndex: /*floorIndex*/ ctx[2],
3681
- pxmm: /*pxmm*/ ctx[0]
3574
+ floorplanData: /*floorplanData*/ ctx[5],
3575
+ floorIndex: /*floorIndex*/ ctx[1]
3682
3576
  }
3683
3577
  ])
3684
3578
  : {};
@@ -3708,13 +3602,13 @@ function create_fragment$9(ctx) {
3708
3602
  let baseimage;
3709
3603
  let t2;
3710
3604
  let t3;
3605
+ let div_class_value;
3711
3606
  let current;
3712
3607
 
3713
3608
  const roommaterial_spread_levels = [
3714
3609
  {
3715
- floorIndex: /*floorIndex*/ ctx[2],
3716
- floorplanData: /*floorplanData*/ ctx[6],
3717
- pxmm: /*pxmm*/ ctx[0]
3610
+ floorIndex: /*floorIndex*/ ctx[1],
3611
+ floorplanData: /*floorplanData*/ ctx[5]
3718
3612
  }
3719
3613
  ];
3720
3614
 
@@ -3725,12 +3619,12 @@ function create_fragment$9(ctx) {
3725
3619
  }
3726
3620
 
3727
3621
  roommaterial = new RoomMaterial({ props: roommaterial_props });
3728
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
3622
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
3729
3623
 
3730
3624
  const baseimage_spread_levels = [
3731
3625
  {
3732
- floorplanData: /*floorplanData*/ ctx[6],
3733
- floorIndex: /*floorIndex*/ ctx[2]
3626
+ floorplanData: /*floorplanData*/ ctx[5],
3627
+ floorIndex: /*floorIndex*/ ctx[1]
3734
3628
  }
3735
3629
  ];
3736
3630
 
@@ -3741,8 +3635,8 @@ function create_fragment$9(ctx) {
3741
3635
  }
3742
3636
 
3743
3637
  baseimage = new BaseImage({ props: baseimage_props });
3744
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
3745
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$3(ctx);
3638
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
3639
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$3(ctx);
3746
3640
 
3747
3641
  return {
3748
3642
  c() {
@@ -3756,7 +3650,10 @@ function create_fragment$9(ctx) {
3756
3650
  if (if_block1) if_block1.c();
3757
3651
  t3 = internal.space();
3758
3652
  if (if_block2) if_block2.c();
3759
- internal.attr(div, "class", "floorplan-current-floor svelte-tlo7rk");
3653
+
3654
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3655
+ ? ' floorplan-plugin__floor--is-current'
3656
+ : ''}`) + " svelte-bl8zrz"));
3760
3657
  },
3761
3658
  m(target, anchor) {
3762
3659
  internal.insert(target, div, anchor);
@@ -3772,23 +3669,22 @@ function create_fragment$9(ctx) {
3772
3669
  current = true;
3773
3670
  },
3774
3671
  p(ctx, [dirty]) {
3775
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
3672
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3776
3673
  ? internal.get_spread_update(roommaterial_spread_levels, [
3777
3674
  {
3778
- floorIndex: /*floorIndex*/ ctx[2],
3779
- floorplanData: /*floorplanData*/ ctx[6],
3780
- pxmm: /*pxmm*/ ctx[0]
3675
+ floorIndex: /*floorIndex*/ ctx[1],
3676
+ floorplanData: /*floorplanData*/ ctx[5]
3781
3677
  }
3782
3678
  ])
3783
3679
  : {};
3784
3680
 
3785
3681
  roommaterial.$set(roommaterial_changes);
3786
3682
 
3787
- if (/*hoverEnable*/ ctx[3]) {
3683
+ if (/*hoverEnable*/ ctx[2]) {
3788
3684
  if (if_block0) {
3789
3685
  if_block0.p(ctx, dirty);
3790
3686
 
3791
- if (dirty & /*hoverEnable*/ 8) {
3687
+ if (dirty & /*hoverEnable*/ 4) {
3792
3688
  internal.transition_in(if_block0, 1);
3793
3689
  }
3794
3690
  } else {
@@ -3807,22 +3703,22 @@ function create_fragment$9(ctx) {
3807
3703
  internal.check_outros();
3808
3704
  }
3809
3705
 
3810
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
3706
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3811
3707
  ? internal.get_spread_update(baseimage_spread_levels, [
3812
3708
  {
3813
- floorplanData: /*floorplanData*/ ctx[6],
3814
- floorIndex: /*floorIndex*/ ctx[2]
3709
+ floorplanData: /*floorplanData*/ ctx[5],
3710
+ floorIndex: /*floorIndex*/ ctx[1]
3815
3711
  }
3816
3712
  ])
3817
3713
  : {};
3818
3714
 
3819
3715
  baseimage.$set(baseimage_changes);
3820
3716
 
3821
- if (/*roomLabelsEnable*/ ctx[4]) {
3717
+ if (/*roomLabelsEnable*/ ctx[3]) {
3822
3718
  if (if_block1) {
3823
3719
  if_block1.p(ctx, dirty);
3824
3720
 
3825
- if (dirty & /*roomLabelsEnable*/ 16) {
3721
+ if (dirty & /*roomLabelsEnable*/ 8) {
3826
3722
  internal.transition_in(if_block1, 1);
3827
3723
  }
3828
3724
  } else {
@@ -3841,11 +3737,11 @@ function create_fragment$9(ctx) {
3841
3737
  internal.check_outros();
3842
3738
  }
3843
3739
 
3844
- if (/*ruleLabelsEnable*/ ctx[5]) {
3740
+ if (/*ruleLabelsEnable*/ ctx[4]) {
3845
3741
  if (if_block2) {
3846
3742
  if_block2.p(ctx, dirty);
3847
3743
 
3848
- if (dirty & /*ruleLabelsEnable*/ 32) {
3744
+ if (dirty & /*ruleLabelsEnable*/ 16) {
3849
3745
  internal.transition_in(if_block2, 1);
3850
3746
  }
3851
3747
  } else {
@@ -3863,6 +3759,12 @@ function create_fragment$9(ctx) {
3863
3759
 
3864
3760
  internal.check_outros();
3865
3761
  }
3762
+
3763
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3764
+ ? ' floorplan-plugin__floor--is-current'
3765
+ : ''}`) + " svelte-bl8zrz"))) {
3766
+ internal.attr(div, "class", div_class_value);
3767
+ }
3866
3768
  },
3867
3769
  i(local) {
3868
3770
  if (current) return;
@@ -3893,37 +3795,31 @@ function create_fragment$9(ctx) {
3893
3795
  }
3894
3796
 
3895
3797
  function instance$9($$self, $$props, $$invalidate) {
3896
- let { pxmm } = $$props;
3897
- let { five } = $$props;
3798
+ let { isCurrent } = $$props;
3898
3799
  let { floorIndex } = $$props;
3899
3800
  let { hoverEnable } = $$props;
3900
3801
  let { roomLabelsEnable } = $$props;
3901
3802
  let { ruleLabelsEnable } = $$props;
3902
3803
  let { floorplanData } = $$props;
3903
- let { onRoomHeightClick } = $$props;
3904
3804
  let { getLabelElement } = $$props;
3905
3805
 
3906
3806
  $$self.$$set = $$props => {
3907
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3908
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3909
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
3910
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
3911
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
3912
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
3913
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
3914
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
3915
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3807
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3808
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3809
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3810
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3811
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3812
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3813
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3916
3814
  };
3917
3815
 
3918
3816
  return [
3919
- pxmm,
3920
- five,
3817
+ isCurrent,
3921
3818
  floorIndex,
3922
3819
  hoverEnable,
3923
3820
  roomLabelsEnable,
3924
3821
  ruleLabelsEnable,
3925
3822
  floorplanData,
3926
- onRoomHeightClick,
3927
3823
  getLabelElement
3928
3824
  ];
3929
3825
  }
@@ -3939,65 +3835,56 @@ class CurrentFloor$1 extends internal.SvelteComponent {
3939
3835
  create_fragment$9,
3940
3836
  internal.safe_not_equal,
3941
3837
  {
3942
- pxmm: 0,
3943
- five: 1,
3944
- floorIndex: 2,
3945
- hoverEnable: 3,
3946
- roomLabelsEnable: 4,
3947
- ruleLabelsEnable: 5,
3948
- floorplanData: 6,
3949
- onRoomHeightClick: 7,
3950
- getLabelElement: 8
3838
+ isCurrent: 0,
3839
+ floorIndex: 1,
3840
+ hoverEnable: 2,
3841
+ roomLabelsEnable: 3,
3842
+ ruleLabelsEnable: 4,
3843
+ floorplanData: 5,
3844
+ getLabelElement: 6
3951
3845
  },
3952
3846
  add_css$8
3953
3847
  );
3954
3848
  }
3955
3849
  }
3956
3850
 
3957
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3851
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3958
3852
 
3959
3853
  function add_css$7(target) {
3960
3854
  internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
3961
3855
  }
3962
3856
 
3963
- // (24:0) {#if visible}
3857
+ function get_each_context$3(ctx, list, i) {
3858
+ const child_ctx = ctx.slice();
3859
+ child_ctx[13] = list[i];
3860
+ return child_ctx;
3861
+ }
3862
+
3863
+ // (21:0) {#if visible}
3964
3864
  function create_if_block$2(ctx) {
3965
3865
  let div;
3966
- let currentfloor;
3967
3866
  let t0;
3968
3867
  let camera;
3969
3868
  let t1;
3970
3869
  let div_intro;
3971
3870
  let current;
3972
-
3973
- const currentfloor_spread_levels = [
3974
- {
3975
- five: /*five*/ ctx[2],
3976
- pxmm: /*pxmm*/ ctx[1],
3977
- floorIndex: /*floorIndex*/ ctx[6],
3978
- hoverEnable: /*hoverEnable*/ ctx[7],
3979
- floorplanData: /*floorplanData*/ ctx[11],
3980
- getLabelElement: /*getLabelElement*/ ctx[15],
3981
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3982
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3983
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3984
- }
3985
- ];
3986
-
3987
- let currentfloor_props = {};
3988
-
3989
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3990
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3871
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3872
+ let each_blocks = [];
3873
+
3874
+ for (let i = 0; i < each_value.length; i += 1) {
3875
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
3991
3876
  }
3992
3877
 
3993
- currentfloor = new CurrentFloor$1({ props: currentfloor_props });
3878
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3879
+ each_blocks[i] = null;
3880
+ });
3994
3881
 
3995
3882
  const camera_spread_levels = [
3996
3883
  {
3997
- panoIndex: /*panoIndex*/ ctx[5],
3998
- floorplanData: /*floorplanData*/ ctx[11],
3999
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4000
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3884
+ panoIndex: /*panoIndex*/ ctx[3],
3885
+ floorplanData: /*floorplanData*/ ctx[9],
3886
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3887
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4001
3888
  }
4002
3889
  ];
4003
3890
 
@@ -4008,12 +3895,16 @@ function create_if_block$2(ctx) {
4008
3895
  }
4009
3896
 
4010
3897
  camera = new Camera$1({ props: camera_props });
4011
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
3898
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
4012
3899
 
4013
3900
  return {
4014
3901
  c() {
4015
3902
  div = internal.element("div");
4016
- internal.create_component(currentfloor.$$.fragment);
3903
+
3904
+ for (let i = 0; i < each_blocks.length; i += 1) {
3905
+ each_blocks[i].c();
3906
+ }
3907
+
4017
3908
  t0 = internal.space();
4018
3909
  internal.create_component(camera.$$.fragment);
4019
3910
  t1 = internal.space();
@@ -4022,7 +3913,11 @@ function create_if_block$2(ctx) {
4022
3913
  },
4023
3914
  m(target, anchor) {
4024
3915
  internal.insert(target, div, anchor);
4025
- internal.mount_component(currentfloor, div, null);
3916
+
3917
+ for (let i = 0; i < each_blocks.length; i += 1) {
3918
+ each_blocks[i].m(div, null);
3919
+ }
3920
+
4026
3921
  internal.append(div, t0);
4027
3922
  internal.mount_component(camera, div, null);
4028
3923
  internal.append(div, t1);
@@ -4032,42 +3927,51 @@ function create_if_block$2(ctx) {
4032
3927
  p(new_ctx, dirty) {
4033
3928
  ctx = new_ctx;
4034
3929
 
4035
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
4036
- ? internal.get_spread_update(currentfloor_spread_levels, [
4037
- {
4038
- five: /*five*/ ctx[2],
4039
- pxmm: /*pxmm*/ ctx[1],
4040
- floorIndex: /*floorIndex*/ ctx[6],
4041
- hoverEnable: /*hoverEnable*/ ctx[7],
4042
- floorplanData: /*floorplanData*/ ctx[11],
4043
- getLabelElement: /*getLabelElement*/ ctx[15],
4044
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
4045
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
4046
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3930
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
3931
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3932
+ let i;
3933
+
3934
+ for (i = 0; i < each_value.length; i += 1) {
3935
+ const child_ctx = get_each_context$3(ctx, each_value, i);
3936
+
3937
+ if (each_blocks[i]) {
3938
+ each_blocks[i].p(child_ctx, dirty);
3939
+ internal.transition_in(each_blocks[i], 1);
3940
+ } else {
3941
+ each_blocks[i] = create_each_block$3(child_ctx);
3942
+ each_blocks[i].c();
3943
+ internal.transition_in(each_blocks[i], 1);
3944
+ each_blocks[i].m(div, t0);
4047
3945
  }
4048
- ])
4049
- : {};
3946
+ }
4050
3947
 
4051
- currentfloor.$set(currentfloor_changes);
3948
+ internal.group_outros();
3949
+
3950
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3951
+ out(i);
3952
+ }
4052
3953
 
4053
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
3954
+ internal.check_outros();
3955
+ }
3956
+
3957
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
4054
3958
  ? internal.get_spread_update(camera_spread_levels, [
4055
3959
  {
4056
- panoIndex: /*panoIndex*/ ctx[5],
4057
- floorplanData: /*floorplanData*/ ctx[11],
4058
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4059
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3960
+ panoIndex: /*panoIndex*/ ctx[3],
3961
+ floorplanData: /*floorplanData*/ ctx[9],
3962
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3963
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4060
3964
  }
4061
3965
  ])
4062
3966
  : {};
4063
3967
 
4064
3968
  camera.$set(camera_changes);
4065
3969
 
4066
- if (/*compassEnable*/ ctx[8]) {
3970
+ if (/*compassEnable*/ ctx[6]) {
4067
3971
  if (if_block) {
4068
3972
  if_block.p(ctx, dirty);
4069
3973
 
4070
- if (dirty & /*compassEnable*/ 256) {
3974
+ if (dirty & /*compassEnable*/ 64) {
4071
3975
  internal.transition_in(if_block, 1);
4072
3976
  }
4073
3977
  } else {
@@ -4088,14 +3992,18 @@ function create_if_block$2(ctx) {
4088
3992
  },
4089
3993
  i(local) {
4090
3994
  if (current) return;
4091
- internal.transition_in(currentfloor.$$.fragment, local);
3995
+
3996
+ for (let i = 0; i < each_value.length; i += 1) {
3997
+ internal.transition_in(each_blocks[i]);
3998
+ }
3999
+
4092
4000
  internal.transition_in(camera.$$.fragment, local);
4093
4001
  internal.transition_in(if_block);
4094
4002
 
4095
4003
  if (!div_intro) {
4096
4004
  internal.add_render_callback(() => {
4097
4005
  div_intro = internal.create_in_transition(div, transition.fade, {
4098
- duration: /*duration*/ ctx[3],
4006
+ duration: /*duration*/ ctx[0],
4099
4007
  easing: easing.linear
4100
4008
  });
4101
4009
 
@@ -4106,29 +4014,107 @@ function create_if_block$2(ctx) {
4106
4014
  current = true;
4107
4015
  },
4108
4016
  o(local) {
4109
- internal.transition_out(currentfloor.$$.fragment, local);
4017
+ each_blocks = each_blocks.filter(Boolean);
4018
+
4019
+ for (let i = 0; i < each_blocks.length; i += 1) {
4020
+ internal.transition_out(each_blocks[i]);
4021
+ }
4022
+
4110
4023
  internal.transition_out(camera.$$.fragment, local);
4111
4024
  internal.transition_out(if_block);
4112
4025
  current = false;
4113
4026
  },
4114
4027
  d(detaching) {
4115
4028
  if (detaching) internal.detach(div);
4116
- internal.destroy_component(currentfloor);
4029
+ internal.destroy_each(each_blocks, detaching);
4117
4030
  internal.destroy_component(camera);
4118
4031
  if (if_block) if_block.d();
4119
4032
  }
4120
4033
  };
4121
4034
  }
4122
4035
 
4123
- // (40:4) {#if compassEnable}
4036
+ // (23:4) {#each floorplanData.floorDatas as floorData}
4037
+ function create_each_block$3(ctx) {
4038
+ let currentfloor;
4039
+ let current;
4040
+
4041
+ const currentfloor_spread_levels = [
4042
+ {
4043
+ hoverEnable: /*hoverEnable*/ ctx[5],
4044
+ floorplanData: /*floorplanData*/ ctx[9],
4045
+ getLabelElement: /*getLabelElement*/ ctx[12],
4046
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4047
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4048
+ },
4049
+ {
4050
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4051
+ },
4052
+ {
4053
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4054
+ }
4055
+ ];
4056
+
4057
+ let currentfloor_props = {};
4058
+
4059
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4060
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
4061
+ }
4062
+
4063
+ currentfloor = new CurrentFloor$1({ props: currentfloor_props });
4064
+
4065
+ return {
4066
+ c() {
4067
+ internal.create_component(currentfloor.$$.fragment);
4068
+ },
4069
+ m(target, anchor) {
4070
+ internal.mount_component(currentfloor, target, anchor);
4071
+ current = true;
4072
+ },
4073
+ p(ctx, dirty) {
4074
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
4075
+ ? internal.get_spread_update(currentfloor_spread_levels, [
4076
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
4077
+ hoverEnable: /*hoverEnable*/ ctx[5],
4078
+ floorplanData: /*floorplanData*/ ctx[9],
4079
+ getLabelElement: /*getLabelElement*/ ctx[12],
4080
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4081
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4082
+ },
4083
+ dirty & /*floorplanData*/ 512 && {
4084
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4085
+ },
4086
+ dirty & /*floorplanData, floorIndex*/ 528 && {
4087
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4088
+ }
4089
+ ])
4090
+ : {};
4091
+
4092
+ currentfloor.$set(currentfloor_changes);
4093
+ },
4094
+ i(local) {
4095
+ if (current) return;
4096
+ internal.transition_in(currentfloor.$$.fragment, local);
4097
+ current = true;
4098
+ },
4099
+ o(local) {
4100
+ internal.transition_out(currentfloor.$$.fragment, local);
4101
+ current = false;
4102
+ },
4103
+ d(detaching) {
4104
+ internal.destroy_component(currentfloor, detaching);
4105
+ }
4106
+ };
4107
+ }
4108
+
4109
+ // (37:4) {#if compassEnable}
4124
4110
  function create_if_block_1(ctx) {
4125
4111
  let compass;
4126
4112
  let current;
4127
4113
 
4128
4114
  compass = new Compass({
4129
4115
  props: {
4130
- floorplanData: /*floorplanData*/ ctx[11],
4131
- northDesc: /*northDesc*/ ctx[0]
4116
+ floorplanData: /*floorplanData*/ ctx[9],
4117
+ northDesc: /*northDesc*/ ctx[2]
4132
4118
  }
4133
4119
  });
4134
4120
 
@@ -4142,8 +4128,8 @@ function create_if_block_1(ctx) {
4142
4128
  },
4143
4129
  p(ctx, dirty) {
4144
4130
  const compass_changes = {};
4145
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
4146
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
4131
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
4132
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
4147
4133
  compass.$set(compass_changes);
4148
4134
  },
4149
4135
  i(local) {
@@ -4164,7 +4150,7 @@ function create_if_block_1(ctx) {
4164
4150
  function create_fragment$8(ctx) {
4165
4151
  let if_block_anchor;
4166
4152
  let current;
4167
- let if_block = /*visible*/ ctx[4] && create_if_block$2(ctx);
4153
+ let if_block = /*visible*/ ctx[1] && create_if_block$2(ctx);
4168
4154
 
4169
4155
  return {
4170
4156
  c() {
@@ -4177,11 +4163,11 @@ function create_fragment$8(ctx) {
4177
4163
  current = true;
4178
4164
  },
4179
4165
  p(ctx, [dirty]) {
4180
- if (/*visible*/ ctx[4]) {
4166
+ if (/*visible*/ ctx[1]) {
4181
4167
  if (if_block) {
4182
4168
  if_block.p(ctx, dirty);
4183
4169
 
4184
- if (dirty & /*visible*/ 16) {
4170
+ if (dirty & /*visible*/ 2) {
4185
4171
  internal.transition_in(if_block, 1);
4186
4172
  }
4187
4173
  } else {
@@ -4217,11 +4203,9 @@ function create_fragment$8(ctx) {
4217
4203
  }
4218
4204
 
4219
4205
  function instance$8($$self, $$props, $$invalidate) {
4220
- let { northDesc } = $$props;
4221
- let { pxmm } = $$props;
4222
- let { five } = $$props;
4223
4206
  let { duration = 0 } = $$props;
4224
4207
  let { visible } = $$props;
4208
+ let { northDesc } = $$props;
4225
4209
  let { panoIndex } = $$props;
4226
4210
  let { floorIndex } = $$props;
4227
4211
  let { hoverEnable } = $$props;
@@ -4231,34 +4215,28 @@ function instance$8($$self, $$props, $$invalidate) {
4231
4215
  let { floorplanData } = $$props;
4232
4216
  let { lastPanoramaLongitude } = $$props;
4233
4217
  let { cameraImageUrl } = $$props;
4234
- let { onRoomHeightClick } = $$props;
4235
4218
  let { getLabelElement } = $$props;
4236
4219
 
4237
4220
  $$self.$$set = $$props => {
4238
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
4239
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
4240
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
4241
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
4242
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
4243
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
4244
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
4245
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
4246
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
4247
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
4248
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
4249
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
4250
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4251
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
4252
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
4253
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
4221
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
4222
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
4223
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
4224
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
4225
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
4226
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
4227
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
4228
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
4229
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
4230
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
4231
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4232
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
4233
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
4254
4234
  };
4255
4235
 
4256
4236
  return [
4257
- northDesc,
4258
- pxmm,
4259
- five,
4260
4237
  duration,
4261
4238
  visible,
4239
+ northDesc,
4262
4240
  panoIndex,
4263
4241
  floorIndex,
4264
4242
  hoverEnable,
@@ -4268,7 +4246,6 @@ function instance$8($$self, $$props, $$invalidate) {
4268
4246
  floorplanData,
4269
4247
  lastPanoramaLongitude,
4270
4248
  cameraImageUrl,
4271
- onRoomHeightClick,
4272
4249
  getLabelElement
4273
4250
  ];
4274
4251
  }
@@ -4284,22 +4261,19 @@ class Main$1 extends internal.SvelteComponent {
4284
4261
  create_fragment$8,
4285
4262
  internal.safe_not_equal,
4286
4263
  {
4287
- northDesc: 0,
4288
- pxmm: 1,
4289
- five: 2,
4290
- duration: 3,
4291
- visible: 4,
4292
- panoIndex: 5,
4293
- floorIndex: 6,
4294
- hoverEnable: 7,
4295
- compassEnable: 8,
4296
- roomLabelsEnable: 9,
4297
- ruleLabelsEnable: 10,
4298
- floorplanData: 11,
4299
- lastPanoramaLongitude: 12,
4300
- cameraImageUrl: 13,
4301
- onRoomHeightClick: 14,
4302
- getLabelElement: 15
4264
+ duration: 0,
4265
+ visible: 1,
4266
+ northDesc: 2,
4267
+ panoIndex: 3,
4268
+ floorIndex: 4,
4269
+ hoverEnable: 5,
4270
+ compassEnable: 6,
4271
+ roomLabelsEnable: 7,
4272
+ ruleLabelsEnable: 8,
4273
+ floorplanData: 9,
4274
+ lastPanoramaLongitude: 10,
4275
+ cameraImageUrl: 11,
4276
+ getLabelElement: 12
4303
4277
  },
4304
4278
  add_css$7
4305
4279
  );
@@ -4409,32 +4383,58 @@ class TopviewFloorplanPluginController {
4409
4383
  value: () => {
4410
4384
  var _a, _b;
4411
4385
  this.hide();
4412
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
4413
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
4414
- this.five.off('modeChange', this.handleModeChange);
4415
- this.five.off('panoArrived', this.handlePanoArrived);
4416
- this.five.off('modelLoaded', this.handleModelLoaded);
4417
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
4418
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
4419
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
4386
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
4387
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
4388
+ this.five.off('modeChange', this.onFiveModeChange);
4389
+ this.five.off('panGesture', this.onFivePanGesture);
4390
+ this.five.off('panoArrived', this.onFivePanoArrived);
4391
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
4392
+ this.five.off('pinchGesture', this.onFivePinchGesture);
4393
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
4394
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4395
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4420
4396
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
4421
4397
  }
4422
4398
  });
4423
- /** 模型楼层高亮改变时,自动进行楼层切换 */
4399
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
4400
+ enumerable: true,
4401
+ configurable: true,
4402
+ writable: true,
4403
+ value: () => {
4404
+ if (this.visible && this.configs.preventRoomClick)
4405
+ return false;
4406
+ }
4407
+ });
4408
+ Object.defineProperty(this, "onFiveWantsGesture", {
4409
+ enumerable: true,
4410
+ configurable: true,
4411
+ writable: true,
4412
+ value: (type) => {
4413
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
4414
+ return;
4415
+ if (this.visible && !this.configs.gestureEnable)
4416
+ return false;
4417
+ }
4418
+ });
4424
4419
  Object.defineProperty(this, "onModelShownFloorChange", {
4425
4420
  enumerable: true,
4426
4421
  configurable: true,
4427
4422
  writable: true,
4428
4423
  value: (shownFloor) => {
4429
- if (shownFloor === null)
4424
+ if (this.floorIndex === shownFloor)
4425
+ return;
4426
+ if (shownFloor === null) {
4427
+ const panoIndex = this.five.getCurrentState().panoIndex;
4428
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4430
4429
  return;
4430
+ }
4431
+ // 模型楼层高亮改变时,自动进行楼层切换
4431
4432
  this.floorIndex = shownFloor;
4432
4433
  this.updateSize();
4433
4434
  this.render();
4434
4435
  }
4435
4436
  });
4436
- /** panoIndex 改变时,更新 floorIndex */
4437
- Object.defineProperty(this, "handlePanoArrived", {
4437
+ Object.defineProperty(this, "onFivePanoArrived", {
4438
4438
  enumerable: true,
4439
4439
  configurable: true,
4440
4440
  writable: true,
@@ -4446,31 +4446,28 @@ class TopviewFloorplanPluginController {
4446
4446
  this.floorIndex = this.five.work.observers[index].floorIndex;
4447
4447
  }
4448
4448
  });
4449
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
4450
- Object.defineProperty(this, "handleWantsMoveToPano", {
4449
+ Object.defineProperty(this, "onFivePanGesture", {
4451
4450
  enumerable: true,
4452
4451
  configurable: true,
4453
4452
  writable: true,
4454
4453
  value: () => {
4455
4454
  if (!this.visible)
4456
4455
  return;
4457
- if (this.configs.preventRoomClick)
4458
- return false;
4459
- return;
4456
+ this.updatePosition();
4460
4457
  }
4461
4458
  });
4462
- /** 在户型图展示时阻止 Five 滑动行为 */
4463
- Object.defineProperty(this, "handleWantsPanGesture", {
4459
+ Object.defineProperty(this, "onFivePinchGesture", {
4464
4460
  enumerable: true,
4465
4461
  configurable: true,
4466
4462
  writable: true,
4467
4463
  value: () => {
4468
4464
  if (!this.visible)
4469
4465
  return;
4470
- return false;
4466
+ this.updatePosition();
4467
+ this.updateSize();
4471
4468
  }
4472
4469
  });
4473
- Object.defineProperty(this, "handleModelLoaded", {
4470
+ Object.defineProperty(this, "onFiveModelLoaded", {
4474
4471
  enumerable: true,
4475
4472
  configurable: true,
4476
4473
  writable: true,
@@ -4487,7 +4484,7 @@ class TopviewFloorplanPluginController {
4487
4484
  }
4488
4485
  });
4489
4486
  /** 非 Topview 态隐藏户型图 */
4490
- Object.defineProperty(this, "handleModeChange", {
4487
+ Object.defineProperty(this, "onFiveModeChange", {
4491
4488
  enumerable: true,
4492
4489
  configurable: true,
4493
4490
  writable: true,
@@ -4497,7 +4494,7 @@ class TopviewFloorplanPluginController {
4497
4494
  }
4498
4495
  });
4499
4496
  /** 动画结束后是 Topview 态就展示户型图 */
4500
- Object.defineProperty(this, "handleInitAnimationEnded", {
4497
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
4501
4498
  enumerable: true,
4502
4499
  configurable: true,
4503
4500
  writable: true,
@@ -4537,24 +4534,30 @@ class TopviewFloorplanPluginController {
4537
4534
  this.five = five;
4538
4535
  this.selector = params.selector;
4539
4536
  this.configs = omit(params, ['selector']);
4537
+ this.five.addExtraElement(this.container);
4540
4538
  // 设置 container 样式
4541
4539
  this.container.classList.add('floorplan-plugin');
4542
4540
  Object.assign(this.container.style, pluginStyle$1);
4543
4541
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4544
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
4542
+ this.five.model.loaded
4543
+ ? this.onFiveModelLoaded()
4544
+ : five.once('modelLoaded', this.onFiveModelLoaded);
4545
4545
  this.five.once('dispose', this.dispose);
4546
- this.five.on('modeChange', this.handleModeChange);
4547
- this.five.on('panoArrived', this.handlePanoArrived);
4548
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
4546
+ this.five.on('modeChange', this.onFiveModeChange);
4547
+ this.five.on('panGesture', this.onFivePanGesture);
4548
+ this.five.on('mouseWheel', this.onFivePinchGesture);
4549
+ this.five.on('panoArrived', this.onFivePanoArrived);
4550
+ this.five.on('pinchGesture', this.onFivePinchGesture);
4551
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
4552
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4553
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4549
4554
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4550
4555
  }
4551
4556
  /** 加载户型图数据 */
4552
- load(data) {
4553
- return __awaiter(this, void 0, void 0, function* () {
4554
- const copyData = JSON.parse(JSON.stringify(data));
4555
- this.floorplanData = yield formatData(copyData);
4556
- this.render();
4557
- });
4557
+ async load(data) {
4558
+ const copyData = JSON.parse(JSON.stringify(data));
4559
+ this.floorplanData = await formatData(copyData);
4560
+ this.render();
4558
4561
  }
4559
4562
  /** 把插件的渲染DOM插入到对应的容器中去 */
4560
4563
  appendTo(wrapper) {
@@ -4565,6 +4568,7 @@ class TopviewFloorplanPluginController {
4565
4568
  show() {
4566
4569
  this.visible = true;
4567
4570
  this.five.model.show(this.floorIndex);
4571
+ this.updatePosition();
4568
4572
  this.updateSize();
4569
4573
  const renderDuration = 500;
4570
4574
  const modelOpacity = this.configs.modelOpacity;
@@ -4572,8 +4576,6 @@ class TopviewFloorplanPluginController {
4572
4576
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4573
4577
  }
4574
4578
  this.render(renderDuration);
4575
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4576
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4577
4579
  }
4578
4580
  hide() {
4579
4581
  const modelOpacity = 1;
@@ -4581,20 +4583,28 @@ class TopviewFloorplanPluginController {
4581
4583
  this.visible = false;
4582
4584
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4583
4585
  this.render();
4584
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4585
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4586
+ }
4587
+ /** 更新户型图位置 */
4588
+ updatePosition() {
4589
+ var _a;
4590
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3());
4591
+ if (!modelCenter)
4592
+ return;
4593
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
4594
+ const left = (ndcModelCenter.x + 1) / 2;
4595
+ const top = -(ndcModelCenter.y - 1) / 2;
4596
+ this.container.style.left = left * 100 + '%';
4597
+ this.container.style.top = top * 100 + '%';
4586
4598
  }
4587
4599
  render(duration) {
4588
4600
  if (!this.container || !this.floorplanData)
4589
4601
  return;
4590
4602
  if (this.size.width === 0)
4591
4603
  return;
4592
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4593
- const handleClick = preventRoomClick ? () => false : undefined;
4604
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4594
4605
  const props = {
4606
+ getLabelElement,
4595
4607
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4596
- five: this.five,
4597
- pxmm: this.pxmm,
4598
4608
  cameraImageUrl,
4599
4609
  visible: this.visible,
4600
4610
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -4606,8 +4616,6 @@ class TopviewFloorplanPluginController {
4606
4616
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4607
4617
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4608
4618
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4609
- getLabelElement,
4610
- onRoomHeightClick: handleClick,
4611
4619
  };
4612
4620
  if (!this.app) {
4613
4621
  this.app = new Main$1({
@@ -5489,9 +5497,9 @@ class PanoFloorplanRadarPluginController {
5489
5497
  enumerable: true,
5490
5498
  configurable: true,
5491
5499
  writable: true,
5492
- value: (data) => __awaiter(this, void 0, void 0, function* () {
5500
+ value: async (data) => {
5493
5501
  const copyData = JSON.parse(JSON.stringify(data));
5494
- const floorplanData = yield formatData(copyData);
5502
+ const floorplanData = await formatData(copyData);
5495
5503
  this.data = floorplanData;
5496
5504
  // const loadImage = async () => {
5497
5505
  // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
@@ -5509,7 +5517,7 @@ class PanoFloorplanRadarPluginController {
5509
5517
  // }
5510
5518
  // await loadImage()
5511
5519
  this.render();
5512
- })
5520
+ }
5513
5521
  });
5514
5522
  this.five = five;
5515
5523
  (params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
@@ -5569,24 +5577,37 @@ const PanoFloorplanRadarPlugin = (five, params) => {
5569
5577
  return new PanoFloorplanRadarPluginController(five, params);
5570
5578
  };
5571
5579
 
5580
+ var FloorplanErrorType;
5581
+ (function (FloorplanErrorType) {
5582
+ FloorplanErrorType["UnknownError"] = "UnknowError";
5583
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5584
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5585
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5586
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5587
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5588
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5589
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
5590
+ /** 户型图展示 & 模型消失的默认时间 */
5591
+ const SHOW_ANIME_DURATION = 500;
5592
+ /** Five camera 默认 fov */
5593
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
5594
+
5572
5595
  /**
5573
5596
  * 传入一个 Promise
5574
5597
  * 无异常,返回 [null, data]
5575
5598
  * 有异常,则返回 [Error, undefined]
5576
5599
  * 用于替代 try&catch 处理 await 异常的方案
5577
5600
  */
5578
- function to(promise) {
5579
- return __awaiter(this, void 0, void 0, function* () {
5580
- try {
5581
- const data = yield promise;
5582
- return [null, data];
5583
- }
5584
- catch (error) {
5585
- if (error instanceof Error)
5586
- return [error, null];
5587
- return [new Error(''), null];
5588
- }
5589
- });
5601
+ async function to(promise) {
5602
+ try {
5603
+ const data = await promise;
5604
+ return [null, data];
5605
+ }
5606
+ catch (error) {
5607
+ if (error instanceof Error)
5608
+ return [error, null];
5609
+ return [new Error(''), null];
5610
+ }
5590
5611
  }
5591
5612
 
5592
5613
  /**
@@ -5694,38 +5715,21 @@ function equal(value, other, opt = { deep: false }) {
5694
5715
  return isDeepEqual(value, other);
5695
5716
  }
5696
5717
 
5697
- function changeMode(five, ...changeModeParams) {
5698
- return __awaiter(this, void 0, void 0, function* () {
5699
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
5700
- if (changeModeError)
5701
- throw changeModeError;
5702
- yield new Promise((reslove, reject) => {
5703
- five.once('initAnimationEnded', reslove);
5704
- const handleModeChange = (mode) => {
5705
- if (mode !== changeModeParams[0])
5706
- reject('changeMode 被中断');
5707
- five.off('modeChange', handleModeChange);
5708
- };
5709
- five.on('modeChange', handleModeChange);
5710
- });
5718
+ async function changeMode(five, ...changeModeParams) {
5719
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
5720
+ if (changeModeError)
5721
+ throw changeModeError;
5722
+ await new Promise((reslove, reject) => {
5723
+ five.once('initAnimationEnded', reslove);
5724
+ const handleModeChange = (mode) => {
5725
+ if (mode !== changeModeParams[0])
5726
+ reject('changeMode 被中断');
5727
+ five.off('modeChange', handleModeChange);
5728
+ };
5729
+ five.on('modeChange', handleModeChange);
5711
5730
  });
5712
5731
  }
5713
5732
 
5714
- var FloorplanErrorType;
5715
- (function (FloorplanErrorType) {
5716
- FloorplanErrorType["UnknownError"] = "UnknowError";
5717
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5718
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5719
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5720
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5721
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5722
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5723
- })(FloorplanErrorType || (FloorplanErrorType = {}));
5724
- /** 户型图展示 & 模型消失的默认时间 */
5725
- const SHOW_ANIME_DURATION = 500;
5726
- /** Five camera 默认 fov */
5727
- const FIVE_CAMERA_DEFAULT_FOV = 80;
5728
-
5729
5733
  /**
5730
5734
  * 比较两个数字近似相等
5731
5735
  * @param num1 数字1
@@ -5752,32 +5756,30 @@ function checkShowState(five$1, showState) {
5752
5756
  * 2. 内置了相应的动画时间计算
5753
5757
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
5754
5758
  */
5755
- function correctFiveState(five$1, showState, userAction = true) {
5756
- return __awaiter(this, void 0, void 0, function* () {
5757
- // 当前已满足状态,不需要变更
5759
+ async function correctFiveState(five$1, showState, userAction = true) {
5760
+ // 当前已满足状态,不需要变更
5761
+ const result = checkShowState(five$1, showState);
5762
+ if (result === true)
5763
+ return;
5764
+ // 纠正 mode
5765
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5766
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5767
+ if (changeModeError)
5768
+ throw changeModeError;
5769
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5758
5770
  const result = checkShowState(five$1, showState);
5759
- if (result === true)
5760
- return;
5761
- // 纠正 mode
5762
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5763
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5764
- if (changeModeError)
5765
- throw changeModeError;
5766
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5767
- const result = checkShowState(five$1, showState);
5768
- if (result === false)
5769
- throw new Error(FloorplanErrorType.ChangeModeError);
5770
- return;
5771
- }
5772
- // 纠正相机状态
5773
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5774
- const { latitude, longitude, fov } = five$1.getCurrentState();
5775
- const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5776
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
5777
- if (updateCameraError)
5778
- throw new Error(FloorplanErrorType.UpdateCameraError);
5771
+ if (result === false)
5772
+ throw new Error(FloorplanErrorType.ChangeModeError);
5779
5773
  return;
5780
- });
5774
+ }
5775
+ // 纠正相机状态
5776
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5777
+ const { latitude, longitude, fov } = five$1.getCurrentState();
5778
+ const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5779
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
5780
+ if (updateCameraError)
5781
+ throw new Error(FloorplanErrorType.UpdateCameraError);
5782
+ return;
5781
5783
  }
5782
5784
 
5783
5785
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
@@ -5966,12 +5968,12 @@ class ModelFloorplanPluginController {
5966
5968
  enumerable: true,
5967
5969
  configurable: true,
5968
5970
  writable: true,
5969
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
5970
- var _b, _c;
5971
+ value: async (opts) => {
5972
+ var _a, _b;
5971
5973
  // 已经在展示中了
5972
5974
  if (!this.showPromise && this.visible)
5973
5975
  return true;
5974
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
5976
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
5975
5977
  throw new Error(FloorplanErrorType.ModelNotLoaded);
5976
5978
  if (!this.floorplanData)
5977
5979
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -5981,18 +5983,18 @@ class ModelFloorplanPluginController {
5981
5983
  if (!!this.showPromise && sameWithLastOpts)
5982
5984
  return this.showPromise;
5983
5985
  if (!!this.showPromise && !sameWithLastOpts)
5984
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
5986
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
5985
5987
  }
5986
5988
  this.ModelFloorplanPluginsShowOpts = opts;
5987
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
5988
- var _d, _e;
5989
+ const getShowPromise = async () => {
5990
+ var _a, _b;
5989
5991
  let hasRejected = false;
5990
5992
  let externalErrorMsg;
5991
5993
  this.showRejection = (errorMsg) => {
5992
5994
  hasRejected = true;
5993
5995
  externalErrorMsg = errorMsg;
5994
5996
  };
5995
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5997
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5996
5998
  if (correctError)
5997
5999
  throw correctError;
5998
6000
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -6011,7 +6013,7 @@ class ModelFloorplanPluginController {
6011
6013
  this.floorIndex = opts.floorIndex;
6012
6014
  this.five.model.show(this.floorIndex);
6013
6015
  // 模型消失, 渲染户型图
6014
- const modelOpacity = (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _d !== void 0 ? _d : this.configs.modelOpacity) !== null && _e !== void 0 ? _e : 1;
6016
+ const modelOpacity = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _a !== void 0 ? _a : this.configs.modelOpacity) !== null && _b !== void 0 ? _b : 1;
6015
6017
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
6016
6018
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
6017
6019
  this.render(renderDuration);
@@ -6019,7 +6021,7 @@ class ModelFloorplanPluginController {
6019
6021
  this.five.on('wantsGesture', this.handleWantsGesture);
6020
6022
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
6021
6023
  return true;
6022
- });
6024
+ };
6023
6025
  const showPromise = getShowPromise()
6024
6026
  .then(() => {
6025
6027
  var _a;
@@ -6041,7 +6043,7 @@ class ModelFloorplanPluginController {
6041
6043
  });
6042
6044
  this.showPromise = showPromise;
6043
6045
  return showPromise;
6044
- })
6046
+ }
6045
6047
  });
6046
6048
  /** 隐藏户型图 */
6047
6049
  Object.defineProperty(this, "hide", {
@@ -6071,8 +6073,13 @@ class ModelFloorplanPluginController {
6071
6073
  configurable: true,
6072
6074
  writable: true,
6073
6075
  value: (shownFloor) => {
6074
- if (shownFloor === null)
6076
+ if (this.floorIndex === shownFloor)
6075
6077
  return;
6078
+ if (shownFloor === null) {
6079
+ const panoIndex = this.five.getCurrentState().panoIndex;
6080
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
6081
+ return;
6082
+ }
6076
6083
  this.floorIndex = shownFloor;
6077
6084
  this.updateSize();
6078
6085
  this.render();
@@ -6185,7 +6192,9 @@ class ModelFloorplanPluginController {
6185
6192
  enumerable: true,
6186
6193
  configurable: true,
6187
6194
  writable: true,
6188
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
6195
+ value: async ({ latitude, longitude }, isFinal) => {
6196
+ if (this.five.getCurrentState().mode !== 'Floorplan')
6197
+ return;
6189
6198
  if (this.configs.autoShowEnable === false)
6190
6199
  return;
6191
6200
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -6206,16 +6215,16 @@ class ModelFloorplanPluginController {
6206
6215
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
6207
6216
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
6208
6217
  // 当手指离开时需要等惯性结束之后在进行判断
6209
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
6218
+ const handleInteriaPan = async (any, isFinal) => {
6210
6219
  if (!isFinal)
6211
6220
  return;
6212
6221
  this.five.off('interiaPan', handleInteriaPan);
6213
- yield this.show({ isAutoShow: true });
6214
- });
6222
+ await this.show({ isAutoShow: true });
6223
+ };
6215
6224
  this.five.on('interiaPan', handleInteriaPan);
6216
6225
  return;
6217
6226
  }
6218
- })
6227
+ }
6219
6228
  });
6220
6229
  this.five = five$1;
6221
6230
  this.hooks = new five.Subscribe();
@@ -6229,9 +6238,9 @@ class ModelFloorplanPluginController {
6229
6238
  left: '50%',
6230
6239
  top: '50%',
6231
6240
  transform: 'translate(-50%, -50%)',
6232
- pointerEvents: 'none',
6233
6241
  zIndex: 10,
6234
6242
  });
6243
+ this.five.addExtraElement(this.container);
6235
6244
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
6236
6245
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
6237
6246
  five$1.once('dispose', this.dispose);
@@ -6242,12 +6251,10 @@ class ModelFloorplanPluginController {
6242
6251
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
6243
6252
  }
6244
6253
  /** 加载户型图数据 */
6245
- load(data) {
6246
- return __awaiter(this, void 0, void 0, function* () {
6247
- const copyData = JSON.parse(JSON.stringify(data));
6248
- this.floorplanData = yield formatData(copyData);
6249
- this.render();
6250
- });
6254
+ async load(data) {
6255
+ const copyData = JSON.parse(JSON.stringify(data));
6256
+ this.floorplanData = await formatData(copyData);
6257
+ this.render();
6251
6258
  }
6252
6259
  /** 把插件的渲染DOM插入到对应的容器中去 */
6253
6260
  appendTo(wrapper) {
@@ -6258,8 +6265,6 @@ class ModelFloorplanPluginController {
6258
6265
  /** 更改户型图楼层 */
6259
6266
  changeFloor(floorIndex) {
6260
6267
  this.five.model.show(floorIndex);
6261
- this.floorIndex = floorIndex;
6262
- this.render();
6263
6268
  }
6264
6269
  changeConfigs(params) {
6265
6270
  Object.assign(this.configs, params);
@@ -6274,10 +6279,9 @@ class ModelFloorplanPluginController {
6274
6279
  return;
6275
6280
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
6276
6281
  const props = {
6277
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6278
- five: this.five,
6279
- pxmm: this.pxmm,
6280
6282
  cameraImageUrl,
6283
+ getLabelElement,
6284
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6281
6285
  visible: this.visible,
6282
6286
  duration: duration !== null && duration !== void 0 ? duration : 0,
6283
6287
  panoIndex: this.panoIndex,
@@ -6288,8 +6292,6 @@ class ModelFloorplanPluginController {
6288
6292
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
6289
6293
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
6290
6294
  lastPanoramaLongitude: this.lastPanoramaLongitude,
6291
- getLabelElement,
6292
- onRoomHeightClick: this.handleClick,
6293
6295
  };
6294
6296
  if (!this.app) {
6295
6297
  this.app = new Main$1({
@@ -6359,7 +6361,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6359
6361
  const defaultNorthRad = params.north_rad || undefined;
6360
6362
  // 局部状态
6361
6363
  const state = {};
6362
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6364
+ const load = async (data) => {
6363
6365
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
6364
6366
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
6365
6367
  if (!northRad) {
@@ -6370,7 +6372,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6370
6372
  const zOffset = bounding.max.z - bounding.min.z;
6371
6373
  const maxOffset = Math.max(xOffset, zOffset);
6372
6374
  const fbxLoader = new FBXLoader.FBXLoader();
6373
- const object = yield fbxLoader.loadAsync(fbxUrl);
6375
+ const object = await fbxLoader.loadAsync(fbxUrl);
6374
6376
  transfromToMeshBasicMaterial(object, {
6375
6377
  transparent: true,
6376
6378
  side: THREE__namespace.DoubleSide,
@@ -6384,7 +6386,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6384
6386
  bject3d2LocalMatrix(object, { position, rotation, scale });
6385
6387
  state.object = object;
6386
6388
  return true;
6387
- });
6389
+ };
6388
6390
  const onCameraUpdate = ({ latitude }) => {
6389
6391
  if (!state.object)
6390
6392
  return;
@@ -6454,25 +6456,25 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6454
6456
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
6455
6457
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
6456
6458
  const mixers = [];
6457
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6458
- var _d, _e, _f, _g, _h, _j, _k;
6459
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
6459
+ const load = async (data) => {
6460
+ var _a, _b, _c, _d, _e, _f, _g;
6461
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
6460
6462
  if (!position)
6461
6463
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
6462
6464
  const modelPosition = transformPositionToVector3(position);
6463
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
6464
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
6465
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
6466
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
6465
6467
  state.rad = rad;
6466
6468
  if (rad === undefined)
6467
6469
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
6468
6470
  // 加载模型
6469
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6471
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6470
6472
  // 设置位置
6471
6473
  object.position.copy(modelPosition);
6472
6474
  object.rotation.z = rad;
6473
6475
  object.scale.set(0.8, 0.8, 0.8);
6474
6476
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
6475
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
6477
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
6476
6478
  if (!textMesh)
6477
6479
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
6478
6480
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -6480,7 +6482,7 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6480
6482
  object.children[0].add(textMesh);
6481
6483
  state.object = object;
6482
6484
  return true;
6483
- });
6485
+ };
6484
6486
  const initAnimation = () => {
6485
6487
  if (state.animation)
6486
6488
  return;
@@ -6717,21 +6719,21 @@ const getLongitudeParams = (from, to, rotation) => {
6717
6719
  */
6718
6720
  const CameraMovementPlugin = (five$1) => {
6719
6721
  const state = {};
6720
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
6722
+ const move = async (args, duration, opts = { preload: true }) => {
6721
6723
  if (state.interruptCallback) {
6722
6724
  state.interruptCallback(false);
6723
6725
  }
6724
6726
  if (opts.asyncStartCallback) {
6725
- yield opts.asyncStartCallback();
6727
+ await opts.asyncStartCallback();
6726
6728
  }
6727
6729
  if (args.mode && args.mode !== five$1.currentMode) {
6728
- yield five$1.changeMode(args.mode);
6730
+ await five$1.changeMode(args.mode);
6729
6731
  }
6730
6732
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6731
- yield five$1.preloadPano(args.panoIndex);
6733
+ await five$1.preloadPano(args.panoIndex);
6732
6734
  }
6733
6735
  if (opts.asyncEndCallback) {
6734
- yield opts.asyncEndCallback();
6736
+ await opts.asyncEndCallback();
6735
6737
  }
6736
6738
  if (args.panoIndex === undefined &&
6737
6739
  args.fov === undefined &&
@@ -6739,7 +6741,7 @@ const CameraMovementPlugin = (five$1) => {
6739
6741
  args.longitude === undefined) {
6740
6742
  return true;
6741
6743
  }
6742
- return yield new Promise((resolve, reject) => {
6744
+ return await new Promise((resolve, reject) => {
6743
6745
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
6744
6746
  if (panoIndex !== undefined) {
6745
6747
  five$1.moveToPano(panoIndex, Object.assign({
@@ -6752,7 +6754,7 @@ const CameraMovementPlugin = (five$1) => {
6752
6754
  reject(false);
6753
6755
  }
6754
6756
  });
6755
- });
6757
+ };
6756
6758
  const getAnimeParams = (args) => {
6757
6759
  const currentFiveState = five$1.state;
6758
6760
  // latitude
@@ -6768,20 +6770,20 @@ const CameraMovementPlugin = (five$1) => {
6768
6770
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
6769
6771
  };
6770
6772
  };
6771
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
6773
+ const rotate = async (args, duration, opts = {}) => {
6772
6774
  if (state.interruptCallback) {
6773
6775
  state.interruptCallback(false);
6774
6776
  }
6775
6777
  if (opts.asyncStartCallback) {
6776
- yield opts.asyncStartCallback();
6778
+ await opts.asyncStartCallback();
6777
6779
  }
6778
6780
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
6779
- yield five$1.changeMode(five.Five.Mode.Panorama);
6781
+ await five$1.changeMode(five.Five.Mode.Panorama);
6780
6782
  }
6781
6783
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6782
6784
  if (opts.preload)
6783
- yield five$1.preloadPano(args.panoIndex);
6784
- yield new Promise((resolve, reject) => {
6785
+ await five$1.preloadPano(args.panoIndex);
6786
+ await new Promise((resolve, reject) => {
6785
6787
  if (!args.panoIndex) {
6786
6788
  resolve(true);
6787
6789
  return;
@@ -6793,10 +6795,10 @@ const CameraMovementPlugin = (five$1) => {
6793
6795
  });
6794
6796
  }
6795
6797
  if (opts.asyncEndCallback) {
6796
- yield opts.asyncEndCallback();
6798
+ await opts.asyncEndCallback();
6797
6799
  }
6798
6800
  const { from, to } = getAnimeParams(args);
6799
- return yield new Promise((resolve) => {
6801
+ return await new Promise((resolve) => {
6800
6802
  const onUpdate = ({ progress }) => {
6801
6803
  const state = {};
6802
6804
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -6838,7 +6840,7 @@ const CameraMovementPlugin = (five$1) => {
6838
6840
  state.interruptCallback(true);
6839
6841
  }, duration);
6840
6842
  });
6841
- });
6843
+ };
6842
6844
  return {
6843
6845
  move,
6844
6846
  rotate,
@@ -7197,7 +7199,7 @@ const PanoRulerPlugin = (five$1, params) => {
7197
7199
  state.loaded = true;
7198
7200
  return true;
7199
7201
  };
7200
- const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
7202
+ const load = async (_roomInfo, _roomRules, options) => {
7201
7203
  const roomInfo = _roomInfo || params.roomInfo;
7202
7204
  const roomRules = _roomRules || params.roomRules;
7203
7205
  if (!roomInfo || !roomRules) {
@@ -7208,9 +7210,9 @@ const PanoRulerPlugin = (five$1, params) => {
7208
7210
  return _load(roomInfo, roomRules);
7209
7211
  }
7210
7212
  else {
7211
- return yield new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7213
+ return await new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7212
7214
  }
7213
- });
7215
+ };
7214
7216
  if (params.roomInfo && params.roomRules) {
7215
7217
  load(params.roomInfo, params.roomRules);
7216
7218
  }
@@ -7475,14 +7477,12 @@ function getRoomInfoInstance() {
7475
7477
  }
7476
7478
 
7477
7479
  const textureLoader = new THREE__namespace.TextureLoader();
7478
- function loadTexture(url) {
7479
- return __awaiter(this, void 0, void 0, function* () {
7480
- return new Promise((resolve, reject) => {
7481
- textureLoader.load(url, resolve, undefined, reject);
7482
- }).then((texture) => {
7483
- texture.encoding = THREE__namespace.sRGBEncoding;
7484
- return texture;
7485
- });
7480
+ async function loadTexture(url) {
7481
+ return new Promise((resolve, reject) => {
7482
+ textureLoader.load(url, resolve, undefined, reject);
7483
+ }).then((texture) => {
7484
+ texture.encoding = THREE__namespace.sRGBEncoding;
7485
+ return texture;
7486
7486
  });
7487
7487
  }
7488
7488
 
@@ -7722,65 +7722,59 @@ class PanoCompassController {
7722
7722
  if (this.modelLoaded)
7723
7723
  this.init();
7724
7724
  }
7725
- init() {
7726
- return __awaiter(this, void 0, void 0, function* () {
7727
- if (!this.data || !this.modelLoaded)
7728
- return;
7729
- const northRad = this.data.north_rad;
7730
- if (northRad != null) {
7731
- this.compassMesh = yield this.loadCompassMesh();
7732
- this.compassMesh.rotateX(-Math.PI / 2);
7733
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
7734
- this.group.add(this.compassMesh);
7735
- }
7736
- if (this.data.entrance != null) {
7737
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
7738
- this.roomInfoWrapperInstance = this.loadRoomInfo();
7739
- this.roomInfoInstance = getRoomInfoInstance();
7740
- this.entryDoorMesh.rotateX(-Math.PI / 2);
7741
- if (this.roomInfoWrapperInstance)
7742
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7743
- this.group.add(this.entryDoorMesh);
7744
- }
7745
- this.onFivePanoArrived(this.five.panoIndex || 0);
7746
- this.five.needsRender = true;
7747
- });
7748
- }
7749
- loadCompassMesh() {
7725
+ async init() {
7726
+ if (!this.data || !this.modelLoaded)
7727
+ return;
7728
+ const northRad = this.data.north_rad;
7729
+ if (northRad != null) {
7730
+ this.compassMesh = await this.loadCompassMesh();
7731
+ this.compassMesh.rotateX(-Math.PI / 2);
7732
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
7733
+ this.group.add(this.compassMesh);
7734
+ }
7735
+ if (this.data.entrance != null) {
7736
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
7737
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
7738
+ this.roomInfoInstance = getRoomInfoInstance();
7739
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
7740
+ if (this.roomInfoWrapperInstance)
7741
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7742
+ this.group.add(this.entryDoorMesh);
7743
+ }
7744
+ this.onFivePanoArrived(this.five.panoIndex || 0);
7745
+ this.five.needsRender = true;
7746
+ }
7747
+ async loadCompassMesh() {
7750
7748
  var _a;
7751
- return __awaiter(this, void 0, void 0, function* () {
7752
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7753
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7754
- const compassTexture = yield loadTexture(compassImageUrl);
7755
- const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7756
- const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7757
- map: compassTexture,
7758
- transparent: true,
7759
- opacity: 0,
7760
- depthTest: false,
7761
- });
7762
- const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7763
- compassMesh.name = 'pano-compass-mesh';
7764
- return compassMesh;
7749
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7750
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7751
+ const compassTexture = await loadTexture(compassImageUrl);
7752
+ const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7753
+ const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7754
+ map: compassTexture,
7755
+ transparent: true,
7756
+ opacity: 0,
7757
+ depthTest: false,
7765
7758
  });
7759
+ const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7760
+ compassMesh.name = 'pano-compass-mesh';
7761
+ return compassMesh;
7766
7762
  }
7767
- loadEntryDoorMesh() {
7763
+ async loadEntryDoorMesh() {
7768
7764
  var _a;
7769
- return __awaiter(this, void 0, void 0, function* () {
7770
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7771
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7772
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
7773
- const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7774
- const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7775
- map: entryDoorTexture,
7776
- transparent: true,
7777
- opacity: 0.8,
7778
- depthTest: false,
7779
- });
7780
- const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7781
- entryDoorMesh.name = 'pano-compass-entry-door';
7782
- return entryDoorMesh;
7765
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7766
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7767
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
7768
+ const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7769
+ const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7770
+ map: entryDoorTexture,
7771
+ transparent: true,
7772
+ opacity: 0.8,
7773
+ depthTest: false,
7783
7774
  });
7775
+ const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7776
+ entryDoorMesh.name = 'pano-compass-entry-door';
7777
+ return entryDoorMesh;
7784
7778
  }
7785
7779
  loadRoomInfo() {
7786
7780
  const points = [
@@ -15060,7 +15054,7 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15060
15054
  xhr.send();
15061
15055
  });
15062
15056
  };
15063
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
15057
+ const load = async (data, videoElement) => {
15064
15058
  const { video_src, video_poster_src, points } = data;
15065
15059
  state.videoSource = video_src;
15066
15060
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -15070,11 +15064,11 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15070
15064
  if (videoElement) {
15071
15065
  state.videoElement = videoElement;
15072
15066
  }
15073
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
15067
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
15074
15068
  state.enabled = !!data.enable;
15075
15069
  if (state.enabled)
15076
15070
  enable();
15077
- });
15071
+ };
15078
15072
  const dispose = () => {
15079
15073
  disable();
15080
15074
  state.videoTexture = undefined;