@realsee/dnalogel 2.0.0-alpha.16 → 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 (180) hide show
  1. package/CHANGELOG.md +13 -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/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
package/dist/index.umd.js CHANGED
@@ -24,21 +24,6 @@
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
27
- function _mergeNamespaces(n, m) {
28
- m.forEach(function (e) {
29
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
30
- if (k !== 'default' && !(k in n)) {
31
- var d = Object.getOwnPropertyDescriptor(e, k);
32
- Object.defineProperty(n, k, d.get ? d : {
33
- enumerable: true,
34
- get: function () { return e[k]; }
35
- });
36
- }
37
- });
38
- });
39
- return Object.freeze(n);
40
- }
41
-
42
27
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
43
28
  var TWEEN__namespace = /*#__PURE__*/_interopNamespace(TWEEN);
44
29
  var TWEEN__default = /*#__PURE__*/_interopDefaultLegacy(TWEEN);
@@ -493,8 +478,8 @@
493
478
 
494
479
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
495
480
 
496
- function add_css$l(target) {
497
- internal.append_styles(target, "svelte-17nkflf", ".room-label-item.svelte-17nkflf{position:absolute;font-size:8px;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none}.room-label-item__text.svelte-17nkflf{position:absolute;left:0;top:-64px;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:20px;min-width:32px;padding:0 6px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-17nkflf{position:absolute;top:-44px;height:48px;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-17nkflf{font-size:10px}");
481
+ function add_css$m(target) {
482
+ 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}");
498
483
  }
499
484
 
500
485
  function create_fragment$q(ctx) {
@@ -514,11 +499,11 @@
514
499
  t0 = internal.text(t0_value);
515
500
  t1 = internal.space();
516
501
  div0 = internal.element("div");
517
- internal.attr(span, "class", "room-label-item__text svelte-17nkflf");
502
+ internal.attr(span, "class", "room-label-item__text svelte-1ak9fbs");
518
503
  internal.set_style(span, "background-image", "url(" + ROOM_LABEL_BG + ")");
519
504
  internal.toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
520
- internal.attr(div0, "class", "room-label-item__bar svelte-17nkflf");
521
- internal.attr(div1, "class", "room-label-item svelte-17nkflf");
505
+ internal.attr(div0, "class", "room-label-item__bar svelte-1ak9fbs");
506
+ internal.attr(div1, "class", "room-label-item svelte-1ak9fbs");
522
507
  internal.set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
523
508
  internal.set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
524
509
  internal.set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
@@ -587,24 +572,24 @@
587
572
  class RoomLabelItem extends internal.SvelteComponent {
588
573
  constructor(options) {
589
574
  super();
590
- internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$l);
575
+ internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$m);
591
576
  }
592
577
  }
593
578
 
594
579
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
595
580
 
596
- function add_css$k(target) {
597
- internal.append_styles(target, "svelte-185yvaa", ".room-labels-container.svelte-185yvaa{width:100%;height:100%;position:relative;color:#fff}");
581
+ function add_css$l(target) {
582
+ internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
598
583
  }
599
584
 
600
- function get_each_context$8(ctx, list, i) {
585
+ function get_each_context$9(ctx, list, i) {
601
586
  const child_ctx = ctx.slice();
602
587
  child_ctx[9] = list[i];
603
588
  return child_ctx;
604
589
  }
605
590
 
606
591
  // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
607
- function create_each_block$8(key_1, ctx) {
592
+ function create_each_block$9(key_1, ctx) {
608
593
  let first;
609
594
  let roomlabelitem;
610
595
  let current;
@@ -662,9 +647,9 @@
662
647
  const get_key = ctx => /*roomLableItem*/ ctx[9].id;
663
648
 
664
649
  for (let i = 0; i < each_value.length; i += 1) {
665
- let child_ctx = get_each_context$8(ctx, each_value, i);
650
+ let child_ctx = get_each_context$9(ctx, each_value, i);
666
651
  let key = get_key(child_ctx);
667
- each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
652
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx));
668
653
  }
669
654
 
670
655
  return {
@@ -675,7 +660,7 @@
675
660
  each_blocks[i].c();
676
661
  }
677
662
 
678
- internal.attr(div, "class", "room-labels-container svelte-185yvaa");
663
+ internal.attr(div, "class", "room-labels-container svelte-9eg4zi");
679
664
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[4].call(div));
680
665
  },
681
666
  m(target, anchor) {
@@ -692,7 +677,7 @@
692
677
  if (dirty & /*roomLabels, five*/ 3) {
693
678
  each_value = /*roomLabels*/ ctx[0];
694
679
  internal.group_outros();
695
- 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);
680
+ 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);
696
681
  internal.check_outros();
697
682
  }
698
683
  },
@@ -815,7 +800,7 @@
815
800
  class RoomLabelItems extends internal.SvelteComponent {
816
801
  constructor(options) {
817
802
  super();
818
- internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$k);
803
+ internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$l);
819
804
  }
820
805
  }
821
806
 
@@ -986,37 +971,11 @@
986
971
  FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
987
972
  })(exports.FLOOR_PLAN_ATTACHED_TO || (exports.FLOOR_PLAN_ATTACHED_TO = {}));
988
973
 
989
- /*! *****************************************************************************
990
- Copyright (c) Microsoft Corporation.
991
-
992
- Permission to use, copy, modify, and/or distribute this software for any
993
- purpose with or without fee is hereby granted.
994
-
995
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
996
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
997
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
998
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
999
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1000
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1001
- PERFORMANCE OF THIS SOFTWARE.
1002
- ***************************************************************************** */
1003
-
1004
- function __awaiter(thisArg, _arguments, P, generator) {
1005
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1006
- return new (P || (P = Promise))(function (resolve, reject) {
1007
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1008
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1009
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1010
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1011
- });
1012
- }
1013
-
1014
974
  const pluginStyle$1 = {
1015
975
  position: 'absolute',
1016
976
  left: '50%',
1017
977
  top: '50%',
1018
978
  transform: 'translate(-50%, -50%)',
1019
- pointerEvents: 'none',
1020
979
  zIndex: '10',
1021
980
  };
1022
981
 
@@ -1043,9 +1002,9 @@
1043
1002
  return d + (needZ ? 'Z' : '');
1044
1003
  }
1045
1004
  /** 把户型图上点点位转换到 SVG 上的点位 */
1046
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1005
+ function formatFloorplanPoint({ x, y }, bounding) {
1047
1006
  const { max, min } = bounding;
1048
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1007
+ return { x: x - min.x, y: max.y - y };
1049
1008
  }
1050
1009
  /** 模型坐标转户型图坐标 */
1051
1010
  function modelPosition2FloorplanPosition(position, floorplanData) {
@@ -1073,26 +1032,22 @@
1073
1032
  return floorIndex;
1074
1033
  }
1075
1034
 
1076
- function formatOutlines(outlines) {
1077
- return __awaiter(this, void 0, void 0, function* () {
1078
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1079
- const getOutlineItem = function (item) {
1080
- return __awaiter(this, void 0, void 0, function* () {
1081
- const outlineItem = {
1082
- index: item.index,
1083
- url: item.url,
1084
- svgUrl: item.svg_url,
1085
- };
1086
- if (item.svg_url) {
1087
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1088
- outlineItem.svgContent = svgContent;
1089
- }
1090
- return outlineItem;
1091
- });
1035
+ async function formatOutlines(outlines) {
1036
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1037
+ const getOutlineItem = async function (item) {
1038
+ const outlineItem = {
1039
+ index: item.index,
1040
+ url: item.url,
1041
+ svgUrl: item.svg_url,
1092
1042
  };
1093
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1094
- return svgOutlineItems;
1095
- });
1043
+ if (item.svg_url) {
1044
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1045
+ outlineItem.svgContent = svgContent;
1046
+ }
1047
+ return outlineItem;
1048
+ };
1049
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1050
+ return svgOutlineItems;
1096
1051
  }
1097
1052
  function formatRoom(data) {
1098
1053
  const floorplanRoomItem = {
@@ -1138,21 +1093,19 @@
1138
1093
  };
1139
1094
  return floorplanEntrance;
1140
1095
  }
1141
- function formatData(data) {
1142
- return __awaiter(this, void 0, void 0, function* () {
1143
- const outlines = yield formatOutlines(data.outlines);
1144
- const bounding = data.computed_data.bounding;
1145
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1146
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1147
- const floorplanData = {
1148
- outlines,
1149
- entrance,
1150
- bounding,
1151
- floorDatas,
1152
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1153
- };
1154
- return floorplanData;
1155
- });
1096
+ async function formatData(data) {
1097
+ const outlines = await formatOutlines(data.outlines);
1098
+ const bounding = data.computed_data.bounding;
1099
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1100
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1101
+ const floorplanData = {
1102
+ outlines,
1103
+ entrance,
1104
+ bounding,
1105
+ floorDatas,
1106
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1107
+ };
1108
+ return floorplanData;
1156
1109
  }
1157
1110
  function formatExtraObjects(data, five, floorplanData) {
1158
1111
  const extraObjects = data.map((object) => {
@@ -1172,35 +1125,6 @@
1172
1125
  return extraObjects;
1173
1126
  }
1174
1127
 
1175
- /**
1176
- * 把第一个参数传入第二个参数(函数)中并执行
1177
- * 一般用于执行函数后返回变量。
1178
- * @param {any} something
1179
- * @param {function} callback
1180
- * @return {any}
1181
- */
1182
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1183
- function tap(something, callback) {
1184
- callback(something);
1185
- return something;
1186
- }
1187
-
1188
- /**
1189
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1190
- * @param object
1191
- * @param props 排除的属性
1192
- * @return
1193
- */
1194
- function omit(object, props) {
1195
- return tap({}, (result) => {
1196
- for (const name in object) {
1197
- if (props.indexOf(name) !== -1)
1198
- continue;
1199
- result[name] = object[name];
1200
- }
1201
- });
1202
- }
1203
-
1204
1128
  /**
1205
1129
  * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
1206
1130
  * @param five five
@@ -1234,16 +1158,45 @@
1234
1158
  return pxmm;
1235
1159
  }
1236
1160
 
1161
+ /**
1162
+ * 把第一个参数传入第二个参数(函数)中并执行
1163
+ * 一般用于执行函数后返回变量。
1164
+ * @param {any} something
1165
+ * @param {function} callback
1166
+ * @return {any}
1167
+ */
1168
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1169
+ function tap(something, callback) {
1170
+ callback(something);
1171
+ return something;
1172
+ }
1173
+
1174
+ /**
1175
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1176
+ * @param object
1177
+ * @param props 排除的属性
1178
+ * @return
1179
+ */
1180
+ function omit(object, props) {
1181
+ return tap({}, (result) => {
1182
+ for (const name in object) {
1183
+ if (props.indexOf(name) !== -1)
1184
+ continue;
1185
+ result[name] = object[name];
1186
+ }
1187
+ });
1188
+ }
1189
+
1237
1190
  const CAMERA_IMAGE = 'data:image/png;base64,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';
1238
1191
 
1239
1192
  function rad2Deg$1(rad) {
1240
1193
  return (rad * 180) / Math.PI;
1241
1194
  }
1242
1195
 
1243
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
1196
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
1244
1197
 
1245
- function add_css$j(target) {
1246
- internal.append_styles(target, "svelte-e8a2kn", ".floorplan__camera-position.svelte-e8a2kn{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-e8a2kn{position:absolute;background-repeat:no-repeat;background-size:100%}");
1198
+ function add_css$k(target) {
1199
+ 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%}");
1247
1200
  }
1248
1201
 
1249
1202
  function create_fragment$o(ctx) {
@@ -1254,7 +1207,7 @@
1254
1207
  c() {
1255
1208
  div1 = internal.element("div");
1256
1209
  div0 = internal.element("div");
1257
- internal.attr(div0, "class", "floorplan__camera-rotate svelte-e8a2kn");
1210
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-17cl35n");
1258
1211
  internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
1259
1212
  internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
1260
1213
  internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
@@ -1262,7 +1215,7 @@
1262
1215
  internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
1263
1216
  internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
1264
1217
  internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
1265
- internal.attr(div1, "class", "floorplan__camera-position svelte-e8a2kn");
1218
+ internal.attr(div1, "class", "floorplan__camera-position svelte-17cl35n");
1266
1219
  internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
1267
1220
  internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
1268
1221
  },
@@ -1338,17 +1291,17 @@
1338
1291
  lastPanoramaLongitude: 7,
1339
1292
  cameraImageUrl: 0
1340
1293
  },
1341
- add_css$j
1294
+ add_css$k
1342
1295
  );
1343
1296
  }
1344
1297
  }
1345
1298
 
1346
1299
  const COMPASS_IMAGE = 'data:image/png;base64,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';
1347
1300
 
1348
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
1301
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
1349
1302
 
1350
- function add_css$i(target) {
1351
- internal.append_styles(target, "svelte-5l80pv", ".floorplan-plugin__compass.svelte-5l80pv{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-5l80pv{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-5l80pv{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
1303
+ function add_css$j(target) {
1304
+ 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}");
1352
1305
  }
1353
1306
 
1354
1307
  // (13:0) {#if northRad}
@@ -1366,10 +1319,10 @@
1366
1319
  t0 = internal.space();
1367
1320
  span = internal.element("span");
1368
1321
  t1 = internal.text(/*northDesc*/ ctx[0]);
1369
- internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-5l80pv");
1322
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-1q44ru9");
1370
1323
  internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
1371
- internal.attr(span, "class", "floorplan-plugin__compass-text svelte-5l80pv");
1372
- internal.attr(div1, "class", "floorplan-plugin__compass svelte-5l80pv");
1324
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-1q44ru9");
1325
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-1q44ru9");
1373
1326
  internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
1374
1327
  },
1375
1328
  m(target, anchor) {
@@ -1440,345 +1393,271 @@
1440
1393
  class Compass extends internal.SvelteComponent {
1441
1394
  constructor(options) {
1442
1395
  super();
1443
- internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$i);
1396
+ internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$j);
1444
1397
  }
1445
1398
  }
1446
1399
 
1447
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1400
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1448
1401
 
1449
- function add_css$h(target) {
1450
- internal.append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item.svelte-1ashbdx{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:15px;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-1ashbdx{opacity:0.45}");
1402
+ function add_css$i(target) {
1403
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1451
1404
  }
1452
1405
 
1453
- // (22:30)
1454
- function create_if_block_1$4(ctx) {
1455
- let html_tag;
1456
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1457
- let html_anchor;
1406
+ function create_fragment$m(ctx) {
1407
+ let img;
1408
+ let img_src_value;
1458
1409
 
1459
1410
  return {
1460
1411
  c() {
1461
- html_tag = new internal.HtmlTag();
1462
- html_anchor = internal.empty();
1463
- html_tag.a = html_anchor;
1412
+ img = internal.element("img");
1413
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1414
+ internal.attr(img, "alt", "floorplan iamge");
1415
+ internal.attr(img, "class", "svelte-1gfoniz");
1464
1416
  },
1465
1417
  m(target, anchor) {
1466
- html_tag.m(raw_value, target, anchor);
1467
- internal.insert(target, html_anchor, anchor);
1418
+ internal.insert(target, img, anchor);
1468
1419
  },
1469
- p(ctx, dirty) {
1470
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1420
+ p(ctx, [dirty]) {
1421
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1422
+ internal.attr(img, "src", img_src_value);
1423
+ }
1471
1424
  },
1425
+ i: internal.noop,
1426
+ o: internal.noop,
1472
1427
  d(detaching) {
1473
- if (detaching) internal.detach(html_anchor);
1474
- if (detaching) html_tag.d();
1428
+ if (detaching) internal.detach(img);
1475
1429
  }
1476
1430
  };
1477
1431
  }
1478
1432
 
1479
- // (16:2) {#if getLabelElement === undefined}
1480
- function create_if_block$7(ctx) {
1481
- let span0;
1482
- let t0_value = /*room*/ ctx[0].name + "";
1483
- let t0;
1484
- let t1;
1485
- let span1;
1433
+ function instance$m($$self, $$props, $$invalidate) {
1434
+ let { url } = $$props;
1486
1435
 
1487
- return {
1488
- c() {
1489
- span0 = internal.element("span");
1490
- t0 = internal.text(t0_value);
1491
- t1 = internal.space();
1492
- span1 = internal.element("span");
1493
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1494
- internal.attr(span0, "class", "floorplan-plugin__room-name");
1495
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
1496
- },
1497
- m(target, anchor) {
1498
- internal.insert(target, span0, anchor);
1499
- internal.append(span0, t0);
1500
- internal.insert(target, t1, anchor);
1501
- internal.insert(target, span1, anchor);
1502
- },
1503
- p(ctx, dirty) {
1504
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1505
- },
1506
- d(detaching) {
1507
- if (detaching) internal.detach(span0);
1508
- if (detaching) internal.detach(t1);
1509
- if (detaching) internal.detach(span1);
1510
- }
1436
+ $$self.$$set = $$props => {
1437
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1511
1438
  };
1512
- }
1513
1439
 
1514
- function create_fragment$m(ctx) {
1515
- let div;
1440
+ return [url];
1441
+ }
1516
1442
 
1517
- function select_block_type(ctx, dirty) {
1518
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$7;
1519
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
1443
+ class Normalmage extends internal.SvelteComponent {
1444
+ constructor(options) {
1445
+ super();
1446
+ internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { url: 0 }, add_css$i);
1520
1447
  }
1448
+ }
1521
1449
 
1522
- let current_block_type = select_block_type(ctx);
1523
- let if_block = current_block_type && current_block_type(ctx);
1450
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1451
+
1452
+ function add_css$h(target) {
1453
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1454
+ }
1455
+
1456
+ function create_fragment$l(ctx) {
1457
+ let div;
1458
+ let html_tag;
1459
+ let t;
1460
+ let html_tag_1;
1524
1461
 
1525
1462
  return {
1526
1463
  c() {
1527
1464
  div = internal.element("div");
1528
- if (if_block) if_block.c();
1529
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
1530
- internal.set_style(div, "left", /*left*/ ctx[4], false);
1531
- internal.set_style(div, "top", /*top*/ ctx[5], false);
1532
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1465
+ html_tag = new internal.HtmlTag();
1466
+ t = internal.space();
1467
+ html_tag_1 = new internal.HtmlTag();
1468
+ html_tag.a = t;
1469
+ html_tag_1.a = null;
1470
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1533
1471
  },
1534
1472
  m(target, anchor) {
1535
1473
  internal.insert(target, div, anchor);
1536
- if (if_block) if_block.m(div, null);
1474
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1475
+ internal.append(div, t);
1476
+ html_tag_1.m(/*content*/ ctx[0], div);
1537
1477
  },
1538
1478
  p(ctx, [dirty]) {
1539
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1540
- if_block.p(ctx, dirty);
1541
- } else {
1542
- if (if_block) if_block.d(1);
1543
- if_block = current_block_type && current_block_type(ctx);
1544
-
1545
- if (if_block) {
1546
- if_block.c();
1547
- if_block.m(div, null);
1548
- }
1549
- }
1479
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1550
1480
  },
1551
1481
  i: internal.noop,
1552
1482
  o: internal.noop,
1553
1483
  d(detaching) {
1554
1484
  if (detaching) internal.detach(div);
1555
-
1556
- if (if_block) {
1557
- if_block.d();
1558
- }
1559
1485
  }
1560
1486
  };
1561
1487
  }
1562
1488
 
1563
- function instance$m($$self, $$props, $$invalidate) {
1564
- let userConfigElement;
1565
- let { room } = $$props;
1566
- let { getLabelElement } = $$props;
1567
-
1568
- // TODO: 统一这里的判断条件,目前写了多处
1569
- const bodyWidth = document.body.clientWidth;
1489
+ function instance$l($$self, $$props, $$invalidate) {
1490
+ let { content } = $$props;
1570
1491
 
1571
- const bodyHeight = document.body.clientHeight;
1572
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1573
- const roomLabel = room.roomLabel;
1574
- const left = roomLabel.positionInImage.x * 100 + '%';
1575
- const top = roomLabel.positionInImage.y * 100 + '%';
1576
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1492
+ const svgStyle = `
1493
+ <style>
1494
+ svg [type='lineGroup'] path {
1495
+ fill: #ffffff;
1496
+ stroke: #ffffff;
1497
+ }
1498
+ svg [type='lineItemGroup'] g g g g {
1499
+ stroke: #ffffff;
1500
+ }</style>
1501
+ `;
1577
1502
 
1578
1503
  $$self.$$set = $$props => {
1579
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
1580
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1581
- };
1582
-
1583
- $$self.$$.update = () => {
1584
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1585
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1586
- ? void 0
1587
- : getLabelElement(room));
1588
- }
1504
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1589
1505
  };
1590
1506
 
1591
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1507
+ return [content, svgStyle];
1592
1508
  }
1593
1509
 
1594
- class RoomLabel extends internal.SvelteComponent {
1510
+ class SvgImage extends internal.SvelteComponent {
1595
1511
  constructor(options) {
1596
1512
  super();
1597
- internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$h);
1513
+ internal.init(this, options, instance$l, create_fragment$l, internal.safe_not_equal, { content: 0 }, add_css$h);
1598
1514
  }
1599
1515
  }
1600
1516
 
1601
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1517
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1602
1518
 
1603
1519
  function add_css$g(target) {
1604
- internal.append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels.svelte-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
1605
- }
1606
-
1607
- function get_each_context$7(ctx, list, i) {
1608
- const child_ctx = ctx.slice();
1609
- child_ctx[4] = list[i];
1610
- return child_ctx;
1520
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1611
1521
  }
1612
1522
 
1613
- // (8:0) {#if rooms}
1614
- function create_if_block$6(ctx) {
1615
- let div;
1616
- let each_blocks = [];
1617
- let each_1_lookup = new Map();
1523
+ // (13:22)
1524
+ function create_if_block_1$4(ctx) {
1525
+ let normalimage;
1618
1526
  let current;
1619
- let each_value = /*rooms*/ ctx[1];
1620
- const get_key = ctx => /*room*/ ctx[4].id;
1621
-
1622
- for (let i = 0; i < each_value.length; i += 1) {
1623
- let child_ctx = get_each_context$7(ctx, each_value, i);
1624
- let key = get_key(child_ctx);
1625
- each_1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
1626
- }
1527
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1627
1528
 
1628
1529
  return {
1629
1530
  c() {
1630
- div = internal.element("div");
1631
-
1632
- for (let i = 0; i < each_blocks.length; i += 1) {
1633
- each_blocks[i].c();
1634
- }
1635
-
1636
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
1531
+ internal.create_component(normalimage.$$.fragment);
1637
1532
  },
1638
1533
  m(target, anchor) {
1639
- internal.insert(target, div, anchor);
1640
-
1641
- for (let i = 0; i < each_blocks.length; i += 1) {
1642
- each_blocks[i].m(div, null);
1643
- }
1644
-
1534
+ internal.mount_component(normalimage, target, anchor);
1645
1535
  current = true;
1646
1536
  },
1647
1537
  p(ctx, dirty) {
1648
- if (dirty & /*rooms, getLabelElement*/ 3) {
1649
- each_value = /*rooms*/ ctx[1];
1650
- internal.group_outros();
1651
- 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);
1652
- internal.check_outros();
1653
- }
1538
+ const normalimage_changes = {};
1539
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1540
+ normalimage.$set(normalimage_changes);
1654
1541
  },
1655
1542
  i(local) {
1656
1543
  if (current) return;
1657
-
1658
- for (let i = 0; i < each_value.length; i += 1) {
1659
- internal.transition_in(each_blocks[i]);
1660
- }
1661
-
1544
+ internal.transition_in(normalimage.$$.fragment, local);
1662
1545
  current = true;
1663
1546
  },
1664
1547
  o(local) {
1665
- for (let i = 0; i < each_blocks.length; i += 1) {
1666
- internal.transition_out(each_blocks[i]);
1667
- }
1668
-
1548
+ internal.transition_out(normalimage.$$.fragment, local);
1669
1549
  current = false;
1670
1550
  },
1671
1551
  d(detaching) {
1672
- if (detaching) internal.detach(div);
1673
-
1674
- for (let i = 0; i < each_blocks.length; i += 1) {
1675
- each_blocks[i].d();
1676
- }
1552
+ internal.destroy_component(normalimage, detaching);
1677
1553
  }
1678
1554
  };
1679
1555
  }
1680
1556
 
1681
- // (10:4) {#each rooms as room (room.id)}
1682
- function create_each_block$7(key_1, ctx) {
1683
- let first;
1684
- let roomlabel;
1557
+ // (11:2) {#if svgContent}
1558
+ function create_if_block$7(ctx) {
1559
+ let svgimage;
1685
1560
  let current;
1686
1561
 
1687
- const roomlabel_spread_levels = [
1688
- {
1689
- room: /*room*/ ctx[4],
1690
- getLabelElement: /*getLabelElement*/ ctx[0]
1691
- }
1692
- ];
1693
-
1694
- let roomlabel_props = {};
1695
-
1696
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1697
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1698
- }
1699
-
1700
- roomlabel = new RoomLabel({ props: roomlabel_props });
1562
+ svgimage = new SvgImage({
1563
+ props: { content: /*svgContent*/ ctx[0] }
1564
+ });
1701
1565
 
1702
1566
  return {
1703
- key: key_1,
1704
- first: null,
1705
1567
  c() {
1706
- first = internal.empty();
1707
- internal.create_component(roomlabel.$$.fragment);
1708
- this.first = first;
1568
+ internal.create_component(svgimage.$$.fragment);
1709
1569
  },
1710
1570
  m(target, anchor) {
1711
- internal.insert(target, first, anchor);
1712
- internal.mount_component(roomlabel, target, anchor);
1571
+ internal.mount_component(svgimage, target, anchor);
1713
1572
  current = true;
1714
1573
  },
1715
- p(new_ctx, dirty) {
1716
- ctx = new_ctx;
1717
-
1718
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1719
- ? internal.get_spread_update(roomlabel_spread_levels, [
1720
- {
1721
- room: /*room*/ ctx[4],
1722
- getLabelElement: /*getLabelElement*/ ctx[0]
1723
- }
1724
- ])
1725
- : {};
1726
-
1727
- roomlabel.$set(roomlabel_changes);
1574
+ p(ctx, dirty) {
1575
+ const svgimage_changes = {};
1576
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1577
+ svgimage.$set(svgimage_changes);
1728
1578
  },
1729
1579
  i(local) {
1730
1580
  if (current) return;
1731
- internal.transition_in(roomlabel.$$.fragment, local);
1581
+ internal.transition_in(svgimage.$$.fragment, local);
1732
1582
  current = true;
1733
1583
  },
1734
1584
  o(local) {
1735
- internal.transition_out(roomlabel.$$.fragment, local);
1585
+ internal.transition_out(svgimage.$$.fragment, local);
1736
1586
  current = false;
1737
1587
  },
1738
1588
  d(detaching) {
1739
- if (detaching) internal.detach(first);
1740
- internal.destroy_component(roomlabel, detaching);
1589
+ internal.destroy_component(svgimage, detaching);
1741
1590
  }
1742
1591
  };
1743
1592
  }
1744
1593
 
1745
- function create_fragment$l(ctx) {
1746
- let if_block_anchor;
1594
+ function create_fragment$k(ctx) {
1595
+ let div;
1596
+ let current_block_type_index;
1597
+ let if_block;
1747
1598
  let current;
1748
- let if_block = /*rooms*/ ctx[1] && create_if_block$6(ctx);
1599
+ const if_block_creators = [create_if_block$7, create_if_block_1$4];
1600
+ const if_blocks = [];
1601
+
1602
+ function select_block_type(ctx, dirty) {
1603
+ if (/*svgContent*/ ctx[0]) return 0;
1604
+ if (/*imageData*/ ctx[1]) return 1;
1605
+ return -1;
1606
+ }
1607
+
1608
+ if (~(current_block_type_index = select_block_type(ctx))) {
1609
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1610
+ }
1749
1611
 
1750
1612
  return {
1751
1613
  c() {
1614
+ div = internal.element("div");
1752
1615
  if (if_block) if_block.c();
1753
- if_block_anchor = internal.empty();
1616
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1754
1617
  },
1755
1618
  m(target, anchor) {
1756
- if (if_block) if_block.m(target, anchor);
1757
- internal.insert(target, if_block_anchor, anchor);
1619
+ internal.insert(target, div, anchor);
1620
+
1621
+ if (~current_block_type_index) {
1622
+ if_blocks[current_block_type_index].m(div, null);
1623
+ }
1624
+
1758
1625
  current = true;
1759
1626
  },
1760
1627
  p(ctx, [dirty]) {
1761
- if (/*rooms*/ ctx[1]) {
1628
+ let previous_block_index = current_block_type_index;
1629
+ current_block_type_index = select_block_type(ctx);
1630
+
1631
+ if (current_block_type_index === previous_block_index) {
1632
+ if (~current_block_type_index) {
1633
+ if_blocks[current_block_type_index].p(ctx, dirty);
1634
+ }
1635
+ } else {
1762
1636
  if (if_block) {
1763
- if_block.p(ctx, dirty);
1637
+ internal.group_outros();
1764
1638
 
1765
- if (dirty & /*rooms*/ 2) {
1766
- internal.transition_in(if_block, 1);
1767
- }
1768
- } else {
1769
- if_block = create_if_block$6(ctx);
1770
- if_block.c();
1771
- internal.transition_in(if_block, 1);
1772
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
1639
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1640
+ if_blocks[previous_block_index] = null;
1641
+ });
1642
+
1643
+ internal.check_outros();
1773
1644
  }
1774
- } else if (if_block) {
1775
- internal.group_outros();
1776
1645
 
1777
- internal.transition_out(if_block, 1, 1, () => {
1778
- if_block = null;
1779
- });
1646
+ if (~current_block_type_index) {
1647
+ if_block = if_blocks[current_block_type_index];
1780
1648
 
1781
- internal.check_outros();
1649
+ if (!if_block) {
1650
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1651
+ if_block.c();
1652
+ } else {
1653
+ if_block.p(ctx, dirty);
1654
+ }
1655
+
1656
+ internal.transition_in(if_block, 1);
1657
+ if_block.m(div, null);
1658
+ } else {
1659
+ if_block = null;
1660
+ }
1782
1661
  }
1783
1662
  },
1784
1663
  i(local) {
@@ -1791,434 +1670,230 @@
1791
1670
  current = false;
1792
1671
  },
1793
1672
  d(detaching) {
1794
- if (if_block) if_block.d(detaching);
1795
- if (detaching) internal.detach(if_block_anchor);
1673
+ if (detaching) internal.detach(div);
1674
+
1675
+ if (~current_block_type_index) {
1676
+ if_blocks[current_block_type_index].d();
1677
+ }
1796
1678
  }
1797
1679
  };
1798
1680
  }
1799
1681
 
1800
- function instance$l($$self, $$props, $$invalidate) {
1801
- let rooms;
1682
+ function instance$k($$self, $$props, $$invalidate) {
1683
+ let imageData;
1684
+ let svgContent;
1685
+ var _a, _b;
1802
1686
  let { floorIndex } = $$props;
1803
1687
  let { floorplanData } = $$props;
1804
- let { getLabelElement } = $$props;
1805
1688
 
1806
1689
  $$self.$$set = $$props => {
1807
1690
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1808
1691
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1809
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1810
1692
  };
1811
1693
 
1812
1694
  $$self.$$.update = () => {
1813
1695
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1814
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1696
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1697
+ }
1698
+
1699
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1700
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1701
+ ? void 0
1702
+ : _a[floorIndex]) === null || _b === void 0
1703
+ ? void 0
1704
+ : _b.svgContent);
1815
1705
  }
1816
1706
  };
1817
1707
 
1818
- return [getLabelElement, rooms, floorIndex, floorplanData];
1708
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1819
1709
  }
1820
1710
 
1821
- class RoomLabels extends internal.SvelteComponent {
1711
+ class BaseImage extends internal.SvelteComponent {
1822
1712
  constructor(options) {
1823
1713
  super();
1824
-
1825
- internal.init(
1826
- this,
1827
- options,
1828
- instance$l,
1829
- create_fragment$l,
1830
- internal.safe_not_equal,
1831
- {
1832
- floorIndex: 2,
1833
- floorplanData: 3,
1834
- getLabelElement: 0
1835
- },
1836
- add_css$g
1837
- );
1714
+ internal.init(this, options, instance$k, create_fragment$k, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$g);
1838
1715
  }
1839
1716
  }
1840
1717
 
1841
- /**
1842
- * 判断对象是否为`null`或`undefined`。
1843
- * @param
1844
- * @return
1845
- */
1846
- /**
1847
- * 判断对象不为`null`或`undefined`。
1848
- */
1849
- function notNil(value) {
1850
- return value !== null && value !== undefined;
1851
- }
1852
-
1853
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1718
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1854
1719
 
1855
1720
  function add_css$f(target) {
1856
- internal.append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1rr09in{transform:translate(-50%, -50%)}");
1857
- }
1858
-
1859
- function get_each_context$6(ctx, list, i) {
1860
- const child_ctx = ctx.slice();
1861
- child_ctx[24] = list[i];
1862
- child_ctx[26] = i;
1863
- return child_ctx;
1864
- }
1865
-
1866
- function get_each_context_1(ctx, list, i) {
1867
- const child_ctx = ctx.slice();
1868
- child_ctx[27] = list[i];
1869
- child_ctx[29] = i;
1870
- return child_ctx;
1721
+ 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}");
1871
1722
  }
1872
1723
 
1873
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
1874
- function create_each_block_1(key_1, ctx) {
1875
- let div;
1876
- let style_left = `${/*position*/ ctx[27]}px`;
1724
+ // (22:30)
1725
+ function create_if_block_1$3(ctx) {
1726
+ let html_tag;
1727
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1728
+ let html_anchor;
1877
1729
 
1878
1730
  return {
1879
- key: key_1,
1880
- first: null,
1881
1731
  c() {
1882
- div = internal.element("div");
1883
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
1884
- internal.set_style(div, "left", style_left, false);
1885
- this.first = div;
1732
+ html_tag = new internal.HtmlTag();
1733
+ html_anchor = internal.empty();
1734
+ html_tag.a = html_anchor;
1886
1735
  },
1887
1736
  m(target, anchor) {
1888
- internal.insert(target, div, anchor);
1889
- },
1890
- p(new_ctx, dirty) {
1891
- ctx = new_ctx;
1737
+ html_tag.m(raw_value, target, anchor);
1738
+ internal.insert(target, html_anchor, anchor);
1739
+ },
1740
+ p(ctx, dirty) {
1741
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1892
1742
  },
1893
1743
  d(detaching) {
1894
- if (detaching) internal.detach(div);
1744
+ if (detaching) internal.detach(html_anchor);
1745
+ if (detaching) html_tag.d();
1895
1746
  }
1896
1747
  };
1897
1748
  }
1898
1749
 
1899
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
1900
- function create_each_block$6(key_1, ctx) {
1901
- let div;
1902
- let span;
1903
- let t0_value = /*textItem*/ ctx[24].distance + "";
1750
+ // (16:2) {#if getLabelElement === undefined}
1751
+ function create_if_block$6(ctx) {
1752
+ let span0;
1753
+ let t0_value = /*room*/ ctx[0].name + "";
1904
1754
  let t0;
1905
1755
  let t1;
1906
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
1756
+ let span1;
1907
1757
 
1908
1758
  return {
1909
- key: key_1,
1910
- first: null,
1911
1759
  c() {
1912
- div = internal.element("div");
1913
- span = internal.element("span");
1760
+ span0 = internal.element("span");
1914
1761
  t0 = internal.text(t0_value);
1915
1762
  t1 = internal.space();
1916
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
1917
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
1918
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
1919
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
1920
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
1921
- internal.set_style(div, "left", style_left, false);
1922
- this.first = div;
1763
+ span1 = internal.element("span");
1764
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1765
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
1766
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1923
1767
  },
1924
1768
  m(target, anchor) {
1925
- internal.insert(target, div, anchor);
1926
- internal.append(div, span);
1927
- internal.append(span, t0);
1928
- internal.append(div, t1);
1769
+ internal.insert(target, span0, anchor);
1770
+ internal.append(span0, t0);
1771
+ internal.insert(target, t1, anchor);
1772
+ internal.insert(target, span1, anchor);
1929
1773
  },
1930
- p(new_ctx, dirty) {
1931
- ctx = new_ctx;
1774
+ p(ctx, dirty) {
1775
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1932
1776
  },
1933
1777
  d(detaching) {
1934
- if (detaching) internal.detach(div);
1778
+ if (detaching) internal.detach(span0);
1779
+ if (detaching) internal.detach(t1);
1780
+ if (detaching) internal.detach(span1);
1935
1781
  }
1936
1782
  };
1937
1783
  }
1938
1784
 
1939
- function create_fragment$k(ctx) {
1940
- let div1;
1941
- let div0;
1942
- let t0;
1943
- let each_blocks_1 = [];
1944
- let each0_lookup = new Map();
1945
- let t1;
1946
- let each_blocks = [];
1947
- let each1_lookup = new Map();
1948
- let div1_class_value;
1949
- let each_value_1 = /*positionPxArray*/ ctx[6];
1950
- const get_key = ctx => /*positionIndex*/ ctx[29];
1785
+ function create_fragment$j(ctx) {
1786
+ let div;
1951
1787
 
1952
- for (let i = 0; i < each_value_1.length; i += 1) {
1953
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
1954
- let key = get_key(child_ctx);
1955
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
1788
+ function select_block_type(ctx, dirty) {
1789
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$6;
1790
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
1956
1791
  }
1957
1792
 
1958
- let each_value = /*textArray*/ ctx[10];
1959
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
1960
-
1961
- for (let i = 0; i < each_value.length; i += 1) {
1962
- let child_ctx = get_each_context$6(ctx, each_value, i);
1963
- let key = get_key_1(child_ctx);
1964
- each1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
1965
- }
1793
+ let current_block_type = select_block_type(ctx);
1794
+ let if_block = current_block_type && current_block_type(ctx);
1966
1795
 
1967
1796
  return {
1968
1797
  c() {
1969
- div1 = internal.element("div");
1970
- div0 = internal.element("div");
1971
- t0 = internal.space();
1972
-
1973
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1974
- each_blocks_1[i].c();
1975
- }
1976
-
1977
- t1 = internal.space();
1978
-
1979
- for (let i = 0; i < each_blocks.length; i += 1) {
1980
- each_blocks[i].c();
1981
- }
1982
-
1983
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
1984
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
1985
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
1986
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
1987
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
1798
+ div = internal.element("div");
1799
+ if (if_block) if_block.c();
1800
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1801
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
1802
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
1803
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1988
1804
  },
1989
1805
  m(target, anchor) {
1990
- internal.insert(target, div1, anchor);
1991
- internal.append(div1, div0);
1992
- internal.append(div1, t0);
1993
-
1994
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1995
- each_blocks_1[i].m(div1, null);
1996
- }
1997
-
1998
- internal.append(div1, t1);
1999
-
2000
- for (let i = 0; i < each_blocks.length; i += 1) {
2001
- each_blocks[i].m(div1, null);
2002
- }
1806
+ internal.insert(target, div, anchor);
1807
+ if (if_block) if_block.m(div, null);
2003
1808
  },
2004
1809
  p(ctx, [dirty]) {
2005
- if (dirty & /*positionPxArray*/ 64) {
2006
- each_value_1 = /*positionPxArray*/ ctx[6];
2007
- 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);
2008
- }
2009
-
2010
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
2011
- each_value = /*textArray*/ ctx[10];
2012
- 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);
2013
- }
1810
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1811
+ if_block.p(ctx, dirty);
1812
+ } else {
1813
+ if (if_block) if_block.d(1);
1814
+ if_block = current_block_type && current_block_type(ctx);
2014
1815
 
2015
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
2016
- internal.attr(div1, "class", div1_class_value);
1816
+ if (if_block) {
1817
+ if_block.c();
1818
+ if_block.m(div, null);
1819
+ }
2017
1820
  }
2018
1821
  },
2019
1822
  i: internal.noop,
2020
1823
  o: internal.noop,
2021
1824
  d(detaching) {
2022
- if (detaching) internal.detach(div1);
2023
-
2024
- for (let i = 0; i < each_blocks_1.length; i += 1) {
2025
- each_blocks_1[i].d();
2026
- }
1825
+ if (detaching) internal.detach(div);
2027
1826
 
2028
- for (let i = 0; i < each_blocks.length; i += 1) {
2029
- each_blocks[i].d();
1827
+ if (if_block) {
1828
+ if_block.d();
2030
1829
  }
2031
1830
  }
2032
1831
  };
2033
1832
  }
2034
1833
 
2035
- const padding = 1000;
2036
-
2037
- function instance$k($$self, $$props, $$invalidate) {
2038
- let { pxmm } = $$props;
2039
- let { type } = $$props;
2040
- let { data } = $$props;
2041
- let { bounding } = $$props;
2042
- const isTop = type === 'top';
2043
- const isBottom = type === 'bottom';
2044
- const isLeft = type === 'left';
2045
- const isRight = type === 'right';
2046
- const isRow = isTop || isBottom;
1834
+ function instance$j($$self, $$props, $$invalidate) {
1835
+ let userConfigElement;
1836
+ let { room } = $$props;
1837
+ let { getLabelElement } = $$props;
2047
1838
 
2048
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2049
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2050
- if (index === 0) return true;
2051
- return x !== arr[index - 1];
2052
- });
1839
+ // TODO: 统一这里的判断条件,目前写了多处
1840
+ const bodyWidth = document.body.clientWidth;
2053
1841
 
2054
- const minPosition = positionArray[0];
2055
- const maxPosition = positionArray.slice(-1)[0];
2056
- const length = maxPosition - minPosition;
2057
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
2058
- const lengthPx = length * pxmm;
2059
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
2060
-
2061
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
2062
- const translateMain = (minPosition - minBounding) * pxmm;
2063
-
2064
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
2065
- const translateSecond = 27 - padding * pxmm;
2066
-
2067
- const translate = (() => {
2068
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
2069
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
2070
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
2071
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
2072
- })();
2073
-
2074
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
2075
- const transform = `${translate} ${rotate}`;
2076
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
2077
- const width = lengthPx + 'px';
2078
-
2079
- // 把点位的户型图坐标转成距离起始位置的像素值
2080
- const textArray = positionArray.map((position, index, array) => {
2081
- if (index === 0) return null;
2082
- const distance = position - array[index - 1];
2083
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
2084
- return { distance, positionPx };
2085
- }).filter(notNil).filter(item => item.distance / length > 0.12);
1842
+ const bodyHeight = document.body.clientHeight;
1843
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1844
+ const roomLabel = room.roomLabel;
1845
+ const left = roomLabel.positionInImage.x * 100 + '%';
1846
+ const top = roomLabel.positionInImage.y * 100 + '%';
1847
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
2086
1848
 
2087
1849
  $$self.$$set = $$props => {
2088
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
2089
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
2090
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
2091
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1850
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
1851
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
2092
1852
  };
2093
1853
 
2094
- return [
2095
- type,
2096
- isTop,
2097
- isBottom,
2098
- isLeft,
2099
- isRight,
2100
- isRow,
2101
- positionPxArray,
2102
- transform,
2103
- transformOrigin,
2104
- width,
2105
- textArray,
2106
- pxmm,
2107
- data,
2108
- bounding
2109
- ];
1854
+ $$self.$$.update = () => {
1855
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1856
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1857
+ ? void 0
1858
+ : getLabelElement(room));
1859
+ }
1860
+ };
1861
+
1862
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
2110
1863
  }
2111
1864
 
2112
- class RuleItem extends internal.SvelteComponent {
1865
+ class RoomLabel extends internal.SvelteComponent {
2113
1866
  constructor(options) {
2114
1867
  super();
2115
-
2116
- internal.init(
2117
- this,
2118
- options,
2119
- instance$k,
2120
- create_fragment$k,
2121
- internal.safe_not_equal,
2122
- {
2123
- pxmm: 11,
2124
- type: 0,
2125
- data: 12,
2126
- bounding: 13
2127
- },
2128
- add_css$f
2129
- );
1868
+ internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$f);
2130
1869
  }
2131
1870
  }
2132
1871
 
2133
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1872
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
2134
1873
 
2135
- function get_each_context$5(ctx, list, i) {
2136
- const child_ctx = ctx.slice();
2137
- child_ctx[7] = list[i][0];
2138
- child_ctx[8] = list[i][1];
2139
- return child_ctx;
1874
+ function add_css$e(target) {
1875
+ 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}");
2140
1876
  }
2141
1877
 
2142
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
2143
- function create_each_block$5(key_1, ctx) {
2144
- let first;
2145
- let ruleitem;
2146
- let current;
2147
-
2148
- const ruleitem_spread_levels = [
2149
- {
2150
- type: /*type*/ ctx[7],
2151
- data: /*data*/ ctx[8],
2152
- pxmm: /*pxmm*/ ctx[0],
2153
- bounding: /*bounding*/ ctx[2]
2154
- }
2155
- ];
2156
-
2157
- let ruleitem_props = {};
2158
-
2159
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2160
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2161
- }
2162
-
2163
- ruleitem = new RuleItem({ props: ruleitem_props });
2164
-
2165
- return {
2166
- key: key_1,
2167
- first: null,
2168
- c() {
2169
- first = internal.empty();
2170
- internal.create_component(ruleitem.$$.fragment);
2171
- this.first = first;
2172
- },
2173
- m(target, anchor) {
2174
- internal.insert(target, first, anchor);
2175
- internal.mount_component(ruleitem, target, anchor);
2176
- current = true;
2177
- },
2178
- p(new_ctx, dirty) {
2179
- ctx = new_ctx;
2180
-
2181
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
2182
- ? internal.get_spread_update(ruleitem_spread_levels, [
2183
- {
2184
- type: /*type*/ ctx[7],
2185
- data: /*data*/ ctx[8],
2186
- pxmm: /*pxmm*/ ctx[0],
2187
- bounding: /*bounding*/ ctx[2]
2188
- }
2189
- ])
2190
- : {};
2191
-
2192
- ruleitem.$set(ruleitem_changes);
2193
- },
2194
- i(local) {
2195
- if (current) return;
2196
- internal.transition_in(ruleitem.$$.fragment, local);
2197
- current = true;
2198
- },
2199
- o(local) {
2200
- internal.transition_out(ruleitem.$$.fragment, local);
2201
- current = false;
2202
- },
2203
- d(detaching) {
2204
- if (detaching) internal.detach(first);
2205
- internal.destroy_component(ruleitem, detaching);
2206
- }
2207
- };
1878
+ function get_each_context$8(ctx, list, i) {
1879
+ const child_ctx = ctx.slice();
1880
+ child_ctx[4] = list[i];
1881
+ return child_ctx;
2208
1882
  }
2209
1883
 
2210
- function create_fragment$j(ctx) {
1884
+ // (8:0) {#if rooms}
1885
+ function create_if_block$5(ctx) {
2211
1886
  let div;
2212
1887
  let each_blocks = [];
2213
1888
  let each_1_lookup = new Map();
2214
1889
  let current;
2215
- let each_value = /*ruleLabelArray*/ ctx[1];
2216
- const get_key = ctx => /*type*/ ctx[7];
1890
+ let each_value = /*rooms*/ ctx[1];
1891
+ const get_key = ctx => /*room*/ ctx[4].id;
2217
1892
 
2218
1893
  for (let i = 0; i < each_value.length; i += 1) {
2219
- let child_ctx = get_each_context$5(ctx, each_value, i);
1894
+ let child_ctx = get_each_context$8(ctx, each_value, i);
2220
1895
  let key = get_key(child_ctx);
2221
- each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1896
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
2222
1897
  }
2223
1898
 
2224
1899
  return {
@@ -2229,7 +1904,7 @@
2229
1904
  each_blocks[i].c();
2230
1905
  }
2231
1906
 
2232
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
1907
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
2233
1908
  },
2234
1909
  m(target, anchor) {
2235
1910
  internal.insert(target, div, anchor);
@@ -2240,11 +1915,11 @@
2240
1915
 
2241
1916
  current = true;
2242
1917
  },
2243
- p(ctx, [dirty]) {
2244
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
2245
- each_value = /*ruleLabelArray*/ ctx[1];
1918
+ p(ctx, dirty) {
1919
+ if (dirty & /*rooms, getLabelElement*/ 3) {
1920
+ each_value = /*rooms*/ ctx[1];
2246
1921
  internal.group_outros();
2247
- 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);
1922
+ 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);
2248
1923
  internal.check_outros();
2249
1924
  }
2250
1925
  },
@@ -2274,373 +1949,670 @@
2274
1949
  };
2275
1950
  }
2276
1951
 
2277
- function instance$j($$self, $$props, $$invalidate) {
2278
- let bounding;
2279
- let ruleLabelData;
2280
- let ruleLabelDataKeys;
2281
- let ruleLabelArray;
2282
- let { pxmm } = $$props;
2283
- let { floorIndex } = $$props;
2284
- let { floorplanData } = $$props;
2285
-
2286
- $$self.$$set = $$props => {
2287
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2288
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2289
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2290
- };
2291
-
2292
- $$self.$$.update = () => {
2293
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
2294
- $$invalidate(2, bounding = floorplanData.bounding);
2295
- }
1952
+ // (10:4) {#each rooms as room (room.id)}
1953
+ function create_each_block$8(key_1, ctx) {
1954
+ let first;
1955
+ let roomlabel;
1956
+ let current;
2296
1957
 
2297
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2298
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1958
+ const roomlabel_spread_levels = [
1959
+ {
1960
+ room: /*room*/ ctx[4],
1961
+ getLabelElement: /*getLabelElement*/ ctx[0]
2299
1962
  }
1963
+ ];
2300
1964
 
2301
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
2302
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
2303
- }
1965
+ let roomlabel_props = {};
2304
1966
 
2305
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
2306
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2307
- }
2308
- };
1967
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1968
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1969
+ }
2309
1970
 
2310
- return [
2311
- pxmm,
2312
- ruleLabelArray,
2313
- bounding,
2314
- floorIndex,
2315
- floorplanData,
2316
- ruleLabelData,
2317
- ruleLabelDataKeys
2318
- ];
2319
- }
1971
+ roomlabel = new RoomLabel({ props: roomlabel_props });
2320
1972
 
2321
- class RuleLabels extends internal.SvelteComponent {
2322
- constructor(options) {
2323
- super();
2324
- internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
2325
- }
2326
- }
1973
+ return {
1974
+ key: key_1,
1975
+ first: null,
1976
+ c() {
1977
+ first = internal.empty();
1978
+ internal.create_component(roomlabel.$$.fragment);
1979
+ this.first = first;
1980
+ },
1981
+ m(target, anchor) {
1982
+ internal.insert(target, first, anchor);
1983
+ internal.mount_component(roomlabel, target, anchor);
1984
+ current = true;
1985
+ },
1986
+ p(new_ctx, dirty) {
1987
+ ctx = new_ctx;
2327
1988
 
2328
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1989
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1990
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1991
+ {
1992
+ room: /*room*/ ctx[4],
1993
+ getLabelElement: /*getLabelElement*/ ctx[0]
1994
+ }
1995
+ ])
1996
+ : {};
2329
1997
 
2330
- function add_css$e(target) {
2331
- internal.append_styles(target, "svelte-1cuuebb", "img.svelte-1cuuebb{width:100%;height:100%}");
1998
+ roomlabel.$set(roomlabel_changes);
1999
+ },
2000
+ i(local) {
2001
+ if (current) return;
2002
+ internal.transition_in(roomlabel.$$.fragment, local);
2003
+ current = true;
2004
+ },
2005
+ o(local) {
2006
+ internal.transition_out(roomlabel.$$.fragment, local);
2007
+ current = false;
2008
+ },
2009
+ d(detaching) {
2010
+ if (detaching) internal.detach(first);
2011
+ internal.destroy_component(roomlabel, detaching);
2012
+ }
2013
+ };
2332
2014
  }
2333
2015
 
2334
2016
  function create_fragment$i(ctx) {
2335
- let img;
2336
- let img_src_value;
2017
+ let if_block_anchor;
2018
+ let current;
2019
+ let if_block = /*rooms*/ ctx[1] && create_if_block$5(ctx);
2337
2020
 
2338
2021
  return {
2339
2022
  c() {
2340
- img = internal.element("img");
2341
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
2342
- internal.attr(img, "alt", "floorplan iamge");
2343
- internal.attr(img, "class", "svelte-1cuuebb");
2023
+ if (if_block) if_block.c();
2024
+ if_block_anchor = internal.empty();
2344
2025
  },
2345
2026
  m(target, anchor) {
2346
- internal.insert(target, img, anchor);
2027
+ if (if_block) if_block.m(target, anchor);
2028
+ internal.insert(target, if_block_anchor, anchor);
2029
+ current = true;
2347
2030
  },
2348
2031
  p(ctx, [dirty]) {
2349
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
2350
- internal.attr(img, "src", img_src_value);
2032
+ if (/*rooms*/ ctx[1]) {
2033
+ if (if_block) {
2034
+ if_block.p(ctx, dirty);
2035
+
2036
+ if (dirty & /*rooms*/ 2) {
2037
+ internal.transition_in(if_block, 1);
2038
+ }
2039
+ } else {
2040
+ if_block = create_if_block$5(ctx);
2041
+ if_block.c();
2042
+ internal.transition_in(if_block, 1);
2043
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2044
+ }
2045
+ } else if (if_block) {
2046
+ internal.group_outros();
2047
+
2048
+ internal.transition_out(if_block, 1, 1, () => {
2049
+ if_block = null;
2050
+ });
2051
+
2052
+ internal.check_outros();
2351
2053
  }
2352
2054
  },
2353
- i: internal.noop,
2354
- o: internal.noop,
2055
+ i(local) {
2056
+ if (current) return;
2057
+ internal.transition_in(if_block);
2058
+ current = true;
2059
+ },
2060
+ o(local) {
2061
+ internal.transition_out(if_block);
2062
+ current = false;
2063
+ },
2355
2064
  d(detaching) {
2356
- if (detaching) internal.detach(img);
2065
+ if (if_block) if_block.d(detaching);
2066
+ if (detaching) internal.detach(if_block_anchor);
2357
2067
  }
2358
2068
  };
2359
2069
  }
2360
2070
 
2361
2071
  function instance$i($$self, $$props, $$invalidate) {
2362
- let { url } = $$props;
2072
+ let rooms;
2073
+ let { floorIndex } = $$props;
2074
+ let { floorplanData } = $$props;
2075
+ let { getLabelElement } = $$props;
2363
2076
 
2364
2077
  $$self.$$set = $$props => {
2365
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
2078
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2079
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2080
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
2366
2081
  };
2367
2082
 
2368
- return [url];
2083
+ $$self.$$.update = () => {
2084
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2085
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
2086
+ }
2087
+ };
2088
+
2089
+ return [getLabelElement, rooms, floorIndex, floorplanData];
2369
2090
  }
2370
2091
 
2371
- class Normalmage extends internal.SvelteComponent {
2092
+ class RoomLabels extends internal.SvelteComponent {
2372
2093
  constructor(options) {
2373
2094
  super();
2374
- internal.init(this, options, instance$i, create_fragment$i, internal.safe_not_equal, { url: 0 }, add_css$e);
2095
+
2096
+ internal.init(
2097
+ this,
2098
+ options,
2099
+ instance$i,
2100
+ create_fragment$i,
2101
+ internal.safe_not_equal,
2102
+ {
2103
+ floorIndex: 2,
2104
+ floorplanData: 3,
2105
+ getLabelElement: 0
2106
+ },
2107
+ add_css$e
2108
+ );
2375
2109
  }
2376
2110
  }
2377
2111
 
2378
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
2112
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
2379
2113
 
2380
2114
  function add_css$d(target) {
2381
- internal.append_styles(target, "svelte-1qqy56u", ".floorplan-plugin__base-image.svelte-1qqy56u{width:100%;height:100%}");
2115
+ 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}");
2382
2116
  }
2383
2117
 
2384
- function create_fragment$h(ctx) {
2118
+ function get_each_context$7(ctx, list, i) {
2119
+ const child_ctx = ctx.slice();
2120
+ child_ctx[10] = list[i];
2121
+ child_ctx[12] = i;
2122
+ return child_ctx;
2123
+ }
2124
+
2125
+ function get_each_context_1(ctx, list, i) {
2126
+ const child_ctx = ctx.slice();
2127
+ child_ctx[13] = list[i];
2128
+ return child_ctx;
2129
+ }
2130
+
2131
+ // (53:4) {#each rulerLabels as rulerLabel}
2132
+ function create_each_block_1(ctx) {
2385
2133
  let div;
2386
- let html_tag;
2387
- let t;
2388
- let html_tag_1;
2389
2134
 
2390
2135
  return {
2391
2136
  c() {
2392
2137
  div = internal.element("div");
2393
- html_tag = new internal.HtmlTag();
2394
- t = internal.space();
2395
- html_tag_1 = new internal.HtmlTag();
2396
- html_tag.a = t;
2397
- html_tag_1.a = null;
2398
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-1qqy56u");
2138
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
2139
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
2140
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
2399
2141
  },
2400
2142
  m(target, anchor) {
2401
2143
  internal.insert(target, div, anchor);
2402
- html_tag.m(/*svgStyle*/ ctx[1], div);
2403
- internal.append(div, t);
2404
- html_tag_1.m(/*content*/ ctx[0], div);
2144
+ },
2145
+ p: internal.noop,
2146
+ d(detaching) {
2147
+ if (detaching) internal.detach(div);
2148
+ }
2149
+ };
2150
+ }
2151
+
2152
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
2153
+ function create_each_block$7(key_1, ctx) {
2154
+ let div1;
2155
+ let div0;
2156
+ let t0_value = /*textItem*/ ctx[10].distance + "";
2157
+ let t0;
2158
+ let t1;
2159
+
2160
+ return {
2161
+ key: key_1,
2162
+ first: null,
2163
+ c() {
2164
+ div1 = internal.element("div");
2165
+ div0 = internal.element("div");
2166
+ t0 = internal.text(t0_value);
2167
+ t1 = internal.space();
2168
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
2169
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
2170
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
2171
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
2172
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
2173
+ this.first = div1;
2174
+ },
2175
+ m(target, anchor) {
2176
+ internal.insert(target, div1, anchor);
2177
+ internal.append(div1, div0);
2178
+ internal.append(div0, t0);
2179
+ internal.append(div1, t1);
2180
+ },
2181
+ p(new_ctx, dirty) {
2182
+ ctx = new_ctx;
2183
+ },
2184
+ d(detaching) {
2185
+ if (detaching) internal.detach(div1);
2186
+ }
2187
+ };
2188
+ }
2189
+
2190
+ function create_fragment$h(ctx) {
2191
+ let div3;
2192
+ let div0;
2193
+ let t0;
2194
+ let div1;
2195
+ let t1;
2196
+ let div2;
2197
+ let each_blocks = [];
2198
+ let each1_lookup = new Map();
2199
+ let div3_class_value;
2200
+ let each_value_1 = /*rulerLabels*/ ctx[2];
2201
+ let each_blocks_1 = [];
2202
+
2203
+ for (let i = 0; i < each_value_1.length; i += 1) {
2204
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
2205
+ }
2206
+
2207
+ let each_value = /*rulerTexts*/ ctx[3];
2208
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
2209
+
2210
+ for (let i = 0; i < each_value.length; i += 1) {
2211
+ let child_ctx = get_each_context$7(ctx, each_value, i);
2212
+ let key = get_key(child_ctx);
2213
+ each1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
2214
+ }
2215
+
2216
+ return {
2217
+ c() {
2218
+ div3 = internal.element("div");
2219
+ div0 = internal.element("div");
2220
+ t0 = internal.space();
2221
+ div1 = internal.element("div");
2222
+
2223
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2224
+ each_blocks_1[i].c();
2225
+ }
2226
+
2227
+ t1 = internal.space();
2228
+ div2 = internal.element("div");
2229
+
2230
+ for (let i = 0; i < each_blocks.length; i += 1) {
2231
+ each_blocks[i].c();
2232
+ }
2233
+
2234
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
2235
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
2236
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
2237
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
2238
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
2239
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2240
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2241
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2242
+ },
2243
+ m(target, anchor) {
2244
+ internal.insert(target, div3, anchor);
2245
+ internal.append(div3, div0);
2246
+ internal.append(div3, t0);
2247
+ internal.append(div3, div1);
2248
+
2249
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2250
+ each_blocks_1[i].m(div1, null);
2251
+ }
2252
+
2253
+ internal.append(div3, t1);
2254
+ internal.append(div3, div2);
2255
+
2256
+ for (let i = 0; i < each_blocks.length; i += 1) {
2257
+ each_blocks[i].m(div2, null);
2258
+ }
2405
2259
  },
2406
2260
  p(ctx, [dirty]) {
2407
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
2261
+ if (dirty & /*rulerLabels*/ 4) {
2262
+ each_value_1 = /*rulerLabels*/ ctx[2];
2263
+ let i;
2264
+
2265
+ for (i = 0; i < each_value_1.length; i += 1) {
2266
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
2267
+
2268
+ if (each_blocks_1[i]) {
2269
+ each_blocks_1[i].p(child_ctx, dirty);
2270
+ } else {
2271
+ each_blocks_1[i] = create_each_block_1(child_ctx);
2272
+ each_blocks_1[i].c();
2273
+ each_blocks_1[i].m(div1, null);
2274
+ }
2275
+ }
2276
+
2277
+ for (; i < each_blocks_1.length; i += 1) {
2278
+ each_blocks_1[i].d(1);
2279
+ }
2280
+
2281
+ each_blocks_1.length = each_value_1.length;
2282
+ }
2283
+
2284
+ if (dirty & /*rulerTexts, isRow*/ 10) {
2285
+ each_value = /*rulerTexts*/ ctx[3];
2286
+ 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);
2287
+ }
2288
+
2289
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
2290
+ internal.attr(div3, "class", div3_class_value);
2291
+ }
2292
+
2293
+ if (dirty & /*type, isRow*/ 3) {
2294
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2295
+ }
2408
2296
  },
2409
2297
  i: internal.noop,
2410
2298
  o: internal.noop,
2411
2299
  d(detaching) {
2412
- if (detaching) internal.detach(div);
2300
+ if (detaching) internal.detach(div3);
2301
+ internal.destroy_each(each_blocks_1, detaching);
2302
+
2303
+ for (let i = 0; i < each_blocks.length; i += 1) {
2304
+ each_blocks[i].d();
2305
+ }
2413
2306
  }
2414
2307
  };
2415
2308
  }
2416
2309
 
2310
+ const padding$1 = 1000;
2311
+ const exteriorWallOffset$1 = 180;
2312
+
2417
2313
  function instance$h($$self, $$props, $$invalidate) {
2418
- let { content } = $$props;
2314
+ let { type } = $$props;
2315
+ let { data } = $$props;
2316
+ let { bounding } = $$props;
2317
+ const isRow = type === 'top' || type === 'bottom';
2318
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
2319
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
2419
2320
 
2420
- const svgStyle = `
2421
- <style>
2422
- svg [type='lineGroup'] path {
2423
- fill: #ffffff;
2424
- stroke: #ffffff;
2425
- }
2426
- svg [type='lineItemGroup'] g g g g {
2427
- stroke: #ffffff;
2428
- }
2429
- </style>
2430
- `;
2321
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2322
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2323
+ // 筛除重复数据
2324
+ if (index === 0) return true;
2325
+
2326
+ return x !== arr[index - 1];
2327
+ });
2328
+
2329
+ const rulerLabels = rulerPoints.map(num => {
2330
+ const left = isRow
2331
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2332
+ : 0;
2333
+
2334
+ const bottom = !isRow
2335
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2336
+ : 0;
2337
+
2338
+ return { left, bottom };
2339
+ });
2340
+
2341
+ rulerLabels.unshift({ left: 0, bottom: 0 });
2342
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
2343
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
2344
+
2345
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
2346
+ const distance = index === 0 ? 0 : num - arr[index - 1];
2347
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
2348
+
2349
+ const left = isRow
2350
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2351
+ : 0;
2352
+
2353
+ const bottom = !isRow
2354
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2355
+ : 0;
2356
+
2357
+ return { left, bottom, distance };
2358
+ }).filter(({ distance }) => distance / length > 0.1);
2431
2359
 
2432
2360
  $$self.$$set = $$props => {
2433
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
2361
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
2362
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
2363
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
2434
2364
  };
2435
2365
 
2436
- return [content, svgStyle];
2366
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
2437
2367
  }
2438
2368
 
2439
- class SvgImage extends internal.SvelteComponent {
2369
+ class RuleItem extends internal.SvelteComponent {
2440
2370
  constructor(options) {
2441
2371
  super();
2442
- internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { content: 0 }, add_css$d);
2372
+ internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$d);
2443
2373
  }
2444
2374
  }
2445
2375
 
2446
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
2376
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
2447
2377
 
2448
2378
  function add_css$c(target) {
2449
- internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
2379
+ 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}");
2450
2380
  }
2451
2381
 
2452
- // (13:22)
2453
- function create_if_block_1$3(ctx) {
2454
- let normalimage;
2382
+ function get_each_context$6(ctx, list, i) {
2383
+ const child_ctx = ctx.slice();
2384
+ child_ctx[12] = list[i][0];
2385
+ child_ctx[13] = list[i][1];
2386
+ return child_ctx;
2387
+ }
2388
+
2389
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
2390
+ function create_each_block$6(key_1, ctx) {
2391
+ let first;
2392
+ let ruleitem;
2455
2393
  let current;
2456
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
2457
2394
 
2458
- return {
2459
- c() {
2460
- internal.create_component(normalimage.$$.fragment);
2461
- },
2462
- m(target, anchor) {
2463
- internal.mount_component(normalimage, target, anchor);
2464
- current = true;
2465
- },
2466
- p(ctx, dirty) {
2467
- const normalimage_changes = {};
2468
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
2469
- normalimage.$set(normalimage_changes);
2470
- },
2471
- i(local) {
2472
- if (current) return;
2473
- internal.transition_in(normalimage.$$.fragment, local);
2474
- current = true;
2475
- },
2476
- o(local) {
2477
- internal.transition_out(normalimage.$$.fragment, local);
2478
- current = false;
2479
- },
2480
- d(detaching) {
2481
- internal.destroy_component(normalimage, detaching);
2395
+ const ruleitem_spread_levels = [
2396
+ {
2397
+ type: /*type*/ ctx[12],
2398
+ data: /*data*/ ctx[13],
2399
+ bounding: /*bounding*/ ctx[0]
2482
2400
  }
2483
- };
2484
- }
2401
+ ];
2485
2402
 
2486
- // (11:2) {#if svgContent}
2487
- function create_if_block$5(ctx) {
2488
- let svgimage;
2489
- let current;
2403
+ let ruleitem_props = {};
2490
2404
 
2491
- svgimage = new SvgImage({
2492
- props: { content: /*svgContent*/ ctx[0] }
2493
- });
2405
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2406
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2407
+ }
2408
+
2409
+ ruleitem = new RuleItem({ props: ruleitem_props });
2494
2410
 
2495
2411
  return {
2412
+ key: key_1,
2413
+ first: null,
2496
2414
  c() {
2497
- internal.create_component(svgimage.$$.fragment);
2415
+ first = internal.empty();
2416
+ internal.create_component(ruleitem.$$.fragment);
2417
+ this.first = first;
2498
2418
  },
2499
2419
  m(target, anchor) {
2500
- internal.mount_component(svgimage, target, anchor);
2420
+ internal.insert(target, first, anchor);
2421
+ internal.mount_component(ruleitem, target, anchor);
2501
2422
  current = true;
2502
2423
  },
2503
- p(ctx, dirty) {
2504
- const svgimage_changes = {};
2505
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
2506
- svgimage.$set(svgimage_changes);
2424
+ p(new_ctx, dirty) {
2425
+ ctx = new_ctx;
2426
+
2427
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
2428
+ ? internal.get_spread_update(ruleitem_spread_levels, [
2429
+ {
2430
+ type: /*type*/ ctx[12],
2431
+ data: /*data*/ ctx[13],
2432
+ bounding: /*bounding*/ ctx[0]
2433
+ }
2434
+ ])
2435
+ : {};
2436
+
2437
+ ruleitem.$set(ruleitem_changes);
2507
2438
  },
2508
2439
  i(local) {
2509
2440
  if (current) return;
2510
- internal.transition_in(svgimage.$$.fragment, local);
2441
+ internal.transition_in(ruleitem.$$.fragment, local);
2511
2442
  current = true;
2512
2443
  },
2513
2444
  o(local) {
2514
- internal.transition_out(svgimage.$$.fragment, local);
2445
+ internal.transition_out(ruleitem.$$.fragment, local);
2515
2446
  current = false;
2516
2447
  },
2517
2448
  d(detaching) {
2518
- internal.destroy_component(svgimage, detaching);
2449
+ if (detaching) internal.detach(first);
2450
+ internal.destroy_component(ruleitem, detaching);
2519
2451
  }
2520
2452
  };
2521
2453
  }
2522
2454
 
2523
2455
  function create_fragment$g(ctx) {
2524
2456
  let div;
2525
- let current_block_type_index;
2526
- let if_block;
2457
+ let each_blocks = [];
2458
+ let each_1_lookup = new Map();
2527
2459
  let current;
2528
- const if_block_creators = [create_if_block$5, create_if_block_1$3];
2529
- const if_blocks = [];
2530
-
2531
- function select_block_type(ctx, dirty) {
2532
- if (/*svgContent*/ ctx[0]) return 0;
2533
- if (/*imageData*/ ctx[1]) return 1;
2534
- return -1;
2535
- }
2460
+ let each_value = /*ruleLabelArray*/ ctx[3];
2461
+ const get_key = ctx => /*type*/ ctx[12];
2536
2462
 
2537
- if (~(current_block_type_index = select_block_type(ctx))) {
2538
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2463
+ for (let i = 0; i < each_value.length; i += 1) {
2464
+ let child_ctx = get_each_context$6(ctx, each_value, i);
2465
+ let key = get_key(child_ctx);
2466
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
2539
2467
  }
2540
2468
 
2541
2469
  return {
2542
2470
  c() {
2543
2471
  div = internal.element("div");
2544
- if (if_block) if_block.c();
2545
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
2472
+
2473
+ for (let i = 0; i < each_blocks.length; i += 1) {
2474
+ each_blocks[i].c();
2475
+ }
2476
+
2477
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
2478
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2479
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2546
2480
  },
2547
2481
  m(target, anchor) {
2548
2482
  internal.insert(target, div, anchor);
2549
2483
 
2550
- if (~current_block_type_index) {
2551
- if_blocks[current_block_type_index].m(div, null);
2484
+ for (let i = 0; i < each_blocks.length; i += 1) {
2485
+ each_blocks[i].m(div, null);
2552
2486
  }
2553
2487
 
2554
2488
  current = true;
2555
2489
  },
2556
2490
  p(ctx, [dirty]) {
2557
- let previous_block_index = current_block_type_index;
2558
- current_block_type_index = select_block_type(ctx);
2559
-
2560
- if (current_block_type_index === previous_block_index) {
2561
- if (~current_block_type_index) {
2562
- if_blocks[current_block_type_index].p(ctx, dirty);
2563
- }
2564
- } else {
2565
- if (if_block) {
2566
- internal.group_outros();
2567
-
2568
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2569
- if_blocks[previous_block_index] = null;
2570
- });
2571
-
2572
- internal.check_outros();
2573
- }
2574
-
2575
- if (~current_block_type_index) {
2576
- if_block = if_blocks[current_block_type_index];
2491
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
2492
+ each_value = /*ruleLabelArray*/ ctx[3];
2493
+ internal.group_outros();
2494
+ 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);
2495
+ internal.check_outros();
2496
+ }
2577
2497
 
2578
- if (!if_block) {
2579
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2580
- if_block.c();
2581
- } else {
2582
- if_block.p(ctx, dirty);
2583
- }
2498
+ if (dirty & /*width*/ 4) {
2499
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2500
+ }
2584
2501
 
2585
- internal.transition_in(if_block, 1);
2586
- if_block.m(div, null);
2587
- } else {
2588
- if_block = null;
2589
- }
2502
+ if (dirty & /*height*/ 2) {
2503
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2590
2504
  }
2591
2505
  },
2592
2506
  i(local) {
2593
2507
  if (current) return;
2594
- internal.transition_in(if_block);
2508
+
2509
+ for (let i = 0; i < each_value.length; i += 1) {
2510
+ internal.transition_in(each_blocks[i]);
2511
+ }
2512
+
2595
2513
  current = true;
2596
2514
  },
2597
2515
  o(local) {
2598
- internal.transition_out(if_block);
2516
+ for (let i = 0; i < each_blocks.length; i += 1) {
2517
+ internal.transition_out(each_blocks[i]);
2518
+ }
2519
+
2599
2520
  current = false;
2600
2521
  },
2601
2522
  d(detaching) {
2602
2523
  if (detaching) internal.detach(div);
2603
2524
 
2604
- if (~current_block_type_index) {
2605
- if_blocks[current_block_type_index].d();
2525
+ for (let i = 0; i < each_blocks.length; i += 1) {
2526
+ each_blocks[i].d();
2606
2527
  }
2607
2528
  }
2608
2529
  };
2609
2530
  }
2610
2531
 
2532
+ const padding = 1000;
2533
+ const exteriorWallOffset = 180;
2534
+
2611
2535
  function instance$g($$self, $$props, $$invalidate) {
2612
- let imageData;
2613
- let svgContent;
2614
- var _a, _b;
2536
+ let bounding;
2537
+ let ruleLabelData;
2538
+ let ruleLabelDataKeys;
2539
+ let ruleLabelArray;
2540
+ let boundingWidth;
2541
+ let boundingHeight;
2542
+ let contentWidth;
2543
+ let contentHeight;
2544
+ let width;
2545
+ let height;
2615
2546
  let { floorIndex } = $$props;
2616
2547
  let { floorplanData } = $$props;
2617
2548
 
2618
2549
  $$self.$$set = $$props => {
2619
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2620
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2550
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
2551
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2621
2552
  };
2622
2553
 
2623
2554
  $$self.$$.update = () => {
2624
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2625
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
2555
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
2556
+ $$invalidate(0, bounding = floorplanData.bounding);
2626
2557
  }
2627
2558
 
2628
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
2629
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
2630
- ? void 0
2631
- : _a[floorIndex]) === null || _b === void 0
2632
- ? void 0
2633
- : _b.svgContent);
2559
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
2560
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
2561
+ }
2562
+
2563
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
2564
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
2565
+ }
2566
+
2567
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
2568
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2569
+ }
2570
+
2571
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2572
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
2573
+ }
2574
+
2575
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2576
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
2577
+ }
2578
+
2579
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2580
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
2581
+ }
2582
+
2583
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2584
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
2585
+ }
2586
+
2587
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
2588
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
2589
+ }
2590
+
2591
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
2592
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
2634
2593
  }
2635
2594
  };
2636
2595
 
2637
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
2596
+ return [
2597
+ bounding,
2598
+ height,
2599
+ width,
2600
+ ruleLabelArray,
2601
+ floorIndex,
2602
+ floorplanData,
2603
+ boundingHeight,
2604
+ contentHeight,
2605
+ boundingWidth,
2606
+ contentWidth,
2607
+ ruleLabelData,
2608
+ ruleLabelDataKeys
2609
+ ];
2638
2610
  }
2639
2611
 
2640
- class BaseImage extends internal.SvelteComponent {
2612
+ class RuleLabels extends internal.SvelteComponent {
2641
2613
  constructor(options) {
2642
2614
  super();
2643
- internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$c);
2615
+ internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$c);
2644
2616
  }
2645
2617
  }
2646
2618
 
@@ -2911,20 +2883,20 @@
2911
2883
  /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
2912
2884
 
2913
2885
  function add_css$b(target) {
2914
- internal.append_styles(target, "svelte-1b0icjc", "svg.svelte-1b0icjc{position:absolute;width:100%;height:100%;overflow:visible}");
2886
+ internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
2915
2887
  }
2916
2888
 
2917
- function get_each_context$4(ctx, list, i) {
2889
+ function get_each_context$5(ctx, list, i) {
2918
2890
  const child_ctx = ctx.slice();
2919
- child_ctx[4] = list[i];
2891
+ child_ctx[5] = list[i];
2920
2892
  return child_ctx;
2921
2893
  }
2922
2894
 
2923
- // (18:6) {:else}
2895
+ // (19:6) {:else}
2924
2896
  function create_else_block(ctx) {
2925
2897
  let roommaterial_1;
2926
2898
  let current;
2927
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2899
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2928
2900
 
2929
2901
  return {
2930
2902
  c() {
@@ -2936,7 +2908,7 @@
2936
2908
  },
2937
2909
  p(ctx, dirty) {
2938
2910
  const roommaterial_1_changes = {};
2939
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2911
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2940
2912
  roommaterial_1.$set(roommaterial_1_changes);
2941
2913
  },
2942
2914
  i(local) {
@@ -2954,11 +2926,11 @@
2954
2926
  };
2955
2927
  }
2956
2928
 
2957
- // (16:37)
2929
+ // (17:37)
2958
2930
  function create_if_block_1$2(ctx) {
2959
2931
  let roommaterial_2;
2960
2932
  let current;
2961
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2933
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2962
2934
 
2963
2935
  return {
2964
2936
  c() {
@@ -2970,7 +2942,7 @@
2970
2942
  },
2971
2943
  p(ctx, dirty) {
2972
2944
  const roommaterial_2_changes = {};
2973
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2945
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2974
2946
  roommaterial_2.$set(roommaterial_2_changes);
2975
2947
  },
2976
2948
  i(local) {
@@ -2988,11 +2960,11 @@
2988
2960
  };
2989
2961
  }
2990
2962
 
2991
- // (14:6) {#if room.floorType === 1}
2963
+ // (15:6) {#if room.floorType === 1}
2992
2964
  function create_if_block$4(ctx) {
2993
2965
  let roommaterial_0;
2994
2966
  let current;
2995
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2967
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
2996
2968
 
2997
2969
  return {
2998
2970
  c() {
@@ -3004,7 +2976,7 @@
3004
2976
  },
3005
2977
  p(ctx, dirty) {
3006
2978
  const roommaterial_0_changes = {};
3007
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2979
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
3008
2980
  roommaterial_0.$set(roommaterial_0_changes);
3009
2981
  },
3010
2982
  i(local) {
@@ -3022,18 +2994,19 @@
3022
2994
  };
3023
2995
  }
3024
2996
 
3025
- // (12:2) {#each rooms as room}
3026
- function create_each_block$4(ctx) {
2997
+ // (13:2) {#each rooms as room}
2998
+ function create_each_block$5(ctx) {
3027
2999
  let svg;
3028
3000
  let current_block_type_index;
3029
3001
  let if_block;
3002
+ let svg_viewBox_value;
3030
3003
  let current;
3031
3004
  const if_block_creators = [create_if_block$4, create_if_block_1$2, create_else_block];
3032
3005
  const if_blocks = [];
3033
3006
 
3034
3007
  function select_block_type(ctx, dirty) {
3035
- if (/*room*/ ctx[4].floorType === 1) return 0;
3036
- if (/*room*/ ctx[4].floorType === 0) return 1;
3008
+ if (/*room*/ ctx[5].floorType === 1) return 0;
3009
+ if (/*room*/ ctx[5].floorType === 0) return 1;
3037
3010
  return 2;
3038
3011
  }
3039
3012
 
@@ -3044,7 +3017,10 @@
3044
3017
  c() {
3045
3018
  svg = internal.svg_element("svg");
3046
3019
  if_block.c();
3047
- internal.attr(svg, "class", "svelte-1b0icjc");
3020
+ internal.attr(svg, "width", "100%");
3021
+ internal.attr(svg, "height", "100%");
3022
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
3023
+ internal.attr(svg, "class", "svelte-1d4xj70");
3048
3024
  },
3049
3025
  m(target, anchor) {
3050
3026
  internal.insert(target, svg, anchor);
@@ -3101,7 +3077,7 @@
3101
3077
  let each_blocks = [];
3102
3078
 
3103
3079
  for (let i = 0; i < each_value.length; i += 1) {
3104
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3080
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3105
3081
  }
3106
3082
 
3107
3083
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -3128,18 +3104,18 @@
3128
3104
  current = true;
3129
3105
  },
3130
3106
  p(ctx, [dirty]) {
3131
- if (dirty & /*rooms*/ 1) {
3107
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
3132
3108
  each_value = /*rooms*/ ctx[0];
3133
3109
  let i;
3134
3110
 
3135
3111
  for (i = 0; i < each_value.length; i += 1) {
3136
- const child_ctx = get_each_context$4(ctx, each_value, i);
3112
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3137
3113
 
3138
3114
  if (each_blocks[i]) {
3139
3115
  each_blocks[i].p(child_ctx, dirty);
3140
3116
  internal.transition_in(each_blocks[i], 1);
3141
3117
  } else {
3142
- each_blocks[i] = create_each_block$4(child_ctx);
3118
+ each_blocks[i] = create_each_block$5(child_ctx);
3143
3119
  each_blocks[i].c();
3144
3120
  internal.transition_in(each_blocks[i], 1);
3145
3121
  each_blocks[i].m(div, null);
@@ -3183,37 +3159,37 @@
3183
3159
  function instance$c($$self, $$props, $$invalidate) {
3184
3160
  let rooms;
3185
3161
  let { floorIndex } = $$props;
3186
- let { pxmm } = $$props;
3187
3162
  let { floorplanData } = $$props;
3163
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3164
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3188
3165
 
3189
3166
  $$self.$$set = $$props => {
3190
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3191
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
3192
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3167
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
3168
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
3193
3169
  };
3194
3170
 
3195
3171
  $$self.$$.update = () => {
3196
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
3172
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
3197
3173
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
3198
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
3174
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
3199
3175
  })));
3200
3176
  }
3201
3177
  };
3202
3178
 
3203
- return [rooms, floorIndex, pxmm, floorplanData];
3179
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
3204
3180
  }
3205
3181
 
3206
3182
  class RoomMaterial extends internal.SvelteComponent {
3207
3183
  constructor(options) {
3208
3184
  super();
3209
- internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$b);
3185
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$b);
3210
3186
  }
3211
3187
  }
3212
3188
 
3213
3189
  /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
3214
3190
 
3215
3191
  function add_css$a(target) {
3216
- internal.append_styles(target, "svelte-11takew", "path.svelte-11takew{opacity:0}path.svelte-11takew:hover{opacity:0.1}");
3192
+ internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
3217
3193
  }
3218
3194
 
3219
3195
  function create_fragment$b(ctx) {
@@ -3224,7 +3200,7 @@
3224
3200
  path = internal.svg_element("path");
3225
3201
  internal.attr(path, "d", /*_pathD*/ ctx[0]);
3226
3202
  internal.attr(path, "fill", `#fff`);
3227
- internal.attr(path, "class", "svelte-11takew");
3203
+ internal.attr(path, "class", "svelte-19uvvss");
3228
3204
  },
3229
3205
  m(target, anchor) {
3230
3206
  internal.insert(target, path, anchor);
@@ -3239,55 +3215,52 @@
3239
3215
  }
3240
3216
 
3241
3217
  function instance$b($$self, $$props, $$invalidate) {
3242
- let { pxmm } = $$props;
3243
3218
  let { room } = $$props;
3244
3219
  let { floorplanData } = $$props;
3245
3220
  const { bounding } = floorplanData;
3246
3221
 
3247
3222
  const _pathD = pathD(room.path, {
3248
3223
  needZ: true,
3249
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
3224
+ format: vector => formatFloorplanPoint(vector, bounding)
3250
3225
  });
3251
3226
 
3252
3227
  $$self.$$set = $$props => {
3253
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3254
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
3255
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3228
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
3229
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3256
3230
  };
3257
3231
 
3258
- return [_pathD, pxmm, room, floorplanData];
3232
+ return [_pathD, room, floorplanData];
3259
3233
  }
3260
3234
 
3261
3235
  class Room extends internal.SvelteComponent {
3262
3236
  constructor(options) {
3263
3237
  super();
3264
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$a);
3238
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$a);
3265
3239
  }
3266
3240
  }
3267
3241
 
3268
3242
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
3269
3243
 
3270
3244
  function add_css$9(target) {
3271
- internal.append_styles(target, "svelte-1aais5l", ".floorplan-plugin__room-highlight.svelte-1aais5l{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-1aais5l{width:100%;height:100%;overflow:visible}");
3245
+ 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}");
3272
3246
  }
3273
3247
 
3274
- function get_each_context$3(ctx, list, i) {
3248
+ function get_each_context$4(ctx, list, i) {
3275
3249
  const child_ctx = ctx.slice();
3276
- child_ctx[12] = list[i];
3250
+ child_ctx[4] = list[i];
3277
3251
  return child_ctx;
3278
3252
  }
3279
3253
 
3280
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3281
- function create_each_block$3(key_1, ctx) {
3254
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3255
+ function create_each_block$4(key_1, ctx) {
3282
3256
  let first;
3283
3257
  let room;
3284
3258
  let current;
3285
3259
 
3286
3260
  const room_spread_levels = [
3287
3261
  {
3288
- room: /*room*/ ctx[12],
3289
- floorplanData: /*floorplanData*/ ctx[2],
3290
- pxmm: /*pxmm*/ ctx[0]
3262
+ room: /*room*/ ctx[4],
3263
+ floorplanData: /*floorplanData*/ ctx[1]
3291
3264
  }
3292
3265
  ];
3293
3266
 
@@ -3315,12 +3288,11 @@
3315
3288
  p(new_ctx, dirty) {
3316
3289
  ctx = new_ctx;
3317
3290
 
3318
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
3291
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
3319
3292
  ? internal.get_spread_update(room_spread_levels, [
3320
3293
  {
3321
- room: /*room*/ ctx[12],
3322
- floorplanData: /*floorplanData*/ ctx[2],
3323
- pxmm: /*pxmm*/ ctx[0]
3294
+ room: /*room*/ ctx[4],
3295
+ floorplanData: /*floorplanData*/ ctx[1]
3324
3296
  }
3325
3297
  ])
3326
3298
  : {};
@@ -3348,17 +3320,14 @@
3348
3320
  let svg;
3349
3321
  let each_blocks = [];
3350
3322
  let each_1_lookup = new Map();
3351
- let div_resize_listener;
3352
3323
  let current;
3353
- let mounted;
3354
- let dispose;
3355
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3356
- const get_key = ctx => /*room*/ ctx[12].id;
3324
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3325
+ const get_key = ctx => /*room*/ ctx[4].id;
3357
3326
 
3358
3327
  for (let i = 0; i < each_value.length; i += 1) {
3359
- let child_ctx = get_each_context$3(ctx, each_value, i);
3328
+ let child_ctx = get_each_context$4(ctx, each_value, i);
3360
3329
  let key = get_key(child_ctx);
3361
- each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
3330
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3362
3331
  }
3363
3332
 
3364
3333
  return {
@@ -3370,9 +3339,11 @@
3370
3339
  each_blocks[i].c();
3371
3340
  }
3372
3341
 
3373
- internal.attr(svg, "class", "svelte-1aais5l");
3374
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1aais5l");
3375
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
3342
+ internal.attr(svg, "width", "100%");
3343
+ internal.attr(svg, "height", "100%");
3344
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
3345
+ internal.attr(svg, "class", "svelte-1kqo6e4");
3346
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
3376
3347
  },
3377
3348
  m(target, anchor) {
3378
3349
  internal.insert(target, div, anchor);
@@ -3382,20 +3353,13 @@
3382
3353
  each_blocks[i].m(svg, null);
3383
3354
  }
3384
3355
 
3385
- /*div_binding*/ ctx[9](div);
3386
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
3387
3356
  current = true;
3388
-
3389
- if (!mounted) {
3390
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
3391
- mounted = true;
3392
- }
3393
3357
  },
3394
3358
  p(ctx, [dirty]) {
3395
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
3396
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3359
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
3360
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3397
3361
  internal.group_outros();
3398
- 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);
3362
+ 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);
3399
3363
  internal.check_outros();
3400
3364
  }
3401
3365
  },
@@ -3421,127 +3385,46 @@
3421
3385
  for (let i = 0; i < each_blocks.length; i += 1) {
3422
3386
  each_blocks[i].d();
3423
3387
  }
3424
-
3425
- /*div_binding*/ ctx[9](null);
3426
- div_resize_listener();
3427
- mounted = false;
3428
- dispose();
3429
3388
  }
3430
3389
  };
3431
3390
  }
3432
3391
 
3433
3392
  function instance$a($$self, $$props, $$invalidate) {
3434
- let { five } = $$props;
3435
- let { pxmm } = $$props;
3436
3393
  let { floorIndex } = $$props;
3437
3394
  let { floorplanData } = $$props;
3438
- let { onRoomHeightClick } = $$props;
3439
- let clientWidth;
3440
- let clientHeight;
3441
- let highlightContainerDom;
3442
- const { observers: floorplan_observers } = floorplanData;
3443
-
3444
- const handleClick = function (e) {
3445
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
3446
- ? void 0
3447
- : onRoomHeightClick(e)) === false) return;
3448
-
3449
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
3450
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
3451
-
3452
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
3453
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
3454
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
3455
-
3456
- // px 转换为 百分比
3457
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
3458
-
3459
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
3460
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
3461
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
3462
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
3463
- })[0];
3464
-
3465
- five.moveToPano(closestPoint.index);
3466
- };
3467
-
3468
- function div_binding($$value) {
3469
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3470
- highlightContainerDom = $$value;
3471
- $$invalidate(5, highlightContainerDom);
3472
- });
3473
- }
3474
-
3475
- function div_elementresize_handler() {
3476
- clientWidth = this.clientWidth;
3477
- clientHeight = this.clientHeight;
3478
- $$invalidate(3, clientWidth);
3479
- $$invalidate(4, clientHeight);
3480
- }
3395
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3396
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3481
3397
 
3482
3398
  $$self.$$set = $$props => {
3483
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
3484
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3485
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3486
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3487
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
3399
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
3400
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
3488
3401
  };
3489
3402
 
3490
- return [
3491
- pxmm,
3492
- floorIndex,
3493
- floorplanData,
3494
- clientWidth,
3495
- clientHeight,
3496
- highlightContainerDom,
3497
- handleClick,
3498
- five,
3499
- onRoomHeightClick,
3500
- div_binding,
3501
- div_elementresize_handler
3502
- ];
3403
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
3503
3404
  }
3504
3405
 
3505
3406
  class RoomHighlight extends internal.SvelteComponent {
3506
3407
  constructor(options) {
3507
3408
  super();
3508
-
3509
- internal.init(
3510
- this,
3511
- options,
3512
- instance$a,
3513
- create_fragment$a,
3514
- internal.safe_not_equal,
3515
- {
3516
- five: 7,
3517
- pxmm: 0,
3518
- floorIndex: 1,
3519
- floorplanData: 2,
3520
- onRoomHeightClick: 8
3521
- },
3522
- add_css$9
3523
- );
3409
+ internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$9);
3524
3410
  }
3525
3411
  }
3526
3412
 
3527
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
3413
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
3528
3414
 
3529
3415
  function add_css$8(target) {
3530
- internal.append_styles(target, "svelte-3pdgs4", ".floorplan-current-floor.svelte-3pdgs4{position:relative;width:100%;height:100%}");
3416
+ 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}");
3531
3417
  }
3532
3418
 
3533
- // (19:2) {#if hoverEnable}
3419
+ // (17:2) {#if hoverEnable}
3534
3420
  function create_if_block_2(ctx) {
3535
3421
  let roomhighlight;
3536
3422
  let current;
3537
3423
 
3538
3424
  const roomhighlight_spread_levels = [
3539
3425
  {
3540
- five: /*five*/ ctx[1],
3541
- pxmm: /*pxmm*/ ctx[0],
3542
- floorIndex: /*floorIndex*/ ctx[2],
3543
- floorplanData: /*floorplanData*/ ctx[6],
3544
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3426
+ floorIndex: /*floorIndex*/ ctx[1],
3427
+ floorplanData: /*floorplanData*/ ctx[5]
3545
3428
  }
3546
3429
  ];
3547
3430
 
@@ -3562,14 +3445,11 @@
3562
3445
  current = true;
3563
3446
  },
3564
3447
  p(ctx, dirty) {
3565
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
3448
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3566
3449
  ? internal.get_spread_update(roomhighlight_spread_levels, [
3567
3450
  {
3568
- five: /*five*/ ctx[1],
3569
- pxmm: /*pxmm*/ ctx[0],
3570
- floorIndex: /*floorIndex*/ ctx[2],
3571
- floorplanData: /*floorplanData*/ ctx[6],
3572
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3451
+ floorIndex: /*floorIndex*/ ctx[1],
3452
+ floorplanData: /*floorplanData*/ ctx[5]
3573
3453
  }
3574
3454
  ])
3575
3455
  : {};
@@ -3591,16 +3471,16 @@
3591
3471
  };
3592
3472
  }
3593
3473
 
3594
- // (23:2) {#if roomLabelsEnable}
3474
+ // (21:2) {#if roomLabelsEnable}
3595
3475
  function create_if_block_1$1(ctx) {
3596
3476
  let roomlabels;
3597
3477
  let current;
3598
3478
 
3599
3479
  const roomlabels_spread_levels = [
3600
3480
  {
3601
- floorplanData: /*floorplanData*/ ctx[6],
3602
- floorIndex: /*floorIndex*/ ctx[2],
3603
- getLabelElement: /*getLabelElement*/ ctx[8]
3481
+ floorplanData: /*floorplanData*/ ctx[5],
3482
+ floorIndex: /*floorIndex*/ ctx[1],
3483
+ getLabelElement: /*getLabelElement*/ ctx[6]
3604
3484
  }
3605
3485
  ];
3606
3486
 
@@ -3621,12 +3501,12 @@
3621
3501
  current = true;
3622
3502
  },
3623
3503
  p(ctx, dirty) {
3624
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
3504
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
3625
3505
  ? internal.get_spread_update(roomlabels_spread_levels, [
3626
3506
  {
3627
- floorplanData: /*floorplanData*/ ctx[6],
3628
- floorIndex: /*floorIndex*/ ctx[2],
3629
- getLabelElement: /*getLabelElement*/ ctx[8]
3507
+ floorplanData: /*floorplanData*/ ctx[5],
3508
+ floorIndex: /*floorIndex*/ ctx[1],
3509
+ getLabelElement: /*getLabelElement*/ ctx[6]
3630
3510
  }
3631
3511
  ])
3632
3512
  : {};
@@ -3648,16 +3528,15 @@
3648
3528
  };
3649
3529
  }
3650
3530
 
3651
- // (26:2) {#if ruleLabelsEnable}
3531
+ // (24:2) {#if ruleLabelsEnable}
3652
3532
  function create_if_block$3(ctx) {
3653
3533
  let rulelabels;
3654
3534
  let current;
3655
3535
 
3656
3536
  const rulelabels_spread_levels = [
3657
3537
  {
3658
- floorplanData: /*floorplanData*/ ctx[6],
3659
- floorIndex: /*floorIndex*/ ctx[2],
3660
- pxmm: /*pxmm*/ ctx[0]
3538
+ floorplanData: /*floorplanData*/ ctx[5],
3539
+ floorIndex: /*floorIndex*/ ctx[1]
3661
3540
  }
3662
3541
  ];
3663
3542
 
@@ -3678,12 +3557,11 @@
3678
3557
  current = true;
3679
3558
  },
3680
3559
  p(ctx, dirty) {
3681
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
3560
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3682
3561
  ? internal.get_spread_update(rulelabels_spread_levels, [
3683
3562
  {
3684
- floorplanData: /*floorplanData*/ ctx[6],
3685
- floorIndex: /*floorIndex*/ ctx[2],
3686
- pxmm: /*pxmm*/ ctx[0]
3563
+ floorplanData: /*floorplanData*/ ctx[5],
3564
+ floorIndex: /*floorIndex*/ ctx[1]
3687
3565
  }
3688
3566
  ])
3689
3567
  : {};
@@ -3713,13 +3591,13 @@
3713
3591
  let baseimage;
3714
3592
  let t2;
3715
3593
  let t3;
3594
+ let div_class_value;
3716
3595
  let current;
3717
3596
 
3718
3597
  const roommaterial_spread_levels = [
3719
3598
  {
3720
- floorIndex: /*floorIndex*/ ctx[2],
3721
- floorplanData: /*floorplanData*/ ctx[6],
3722
- pxmm: /*pxmm*/ ctx[0]
3599
+ floorIndex: /*floorIndex*/ ctx[1],
3600
+ floorplanData: /*floorplanData*/ ctx[5]
3723
3601
  }
3724
3602
  ];
3725
3603
 
@@ -3730,12 +3608,12 @@
3730
3608
  }
3731
3609
 
3732
3610
  roommaterial = new RoomMaterial({ props: roommaterial_props });
3733
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
3611
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
3734
3612
 
3735
3613
  const baseimage_spread_levels = [
3736
3614
  {
3737
- floorplanData: /*floorplanData*/ ctx[6],
3738
- floorIndex: /*floorIndex*/ ctx[2]
3615
+ floorplanData: /*floorplanData*/ ctx[5],
3616
+ floorIndex: /*floorIndex*/ ctx[1]
3739
3617
  }
3740
3618
  ];
3741
3619
 
@@ -3746,8 +3624,8 @@
3746
3624
  }
3747
3625
 
3748
3626
  baseimage = new BaseImage({ props: baseimage_props });
3749
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
3750
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$3(ctx);
3627
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
3628
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$3(ctx);
3751
3629
 
3752
3630
  return {
3753
3631
  c() {
@@ -3761,7 +3639,10 @@
3761
3639
  if (if_block1) if_block1.c();
3762
3640
  t3 = internal.space();
3763
3641
  if (if_block2) if_block2.c();
3764
- internal.attr(div, "class", "floorplan-current-floor svelte-3pdgs4");
3642
+
3643
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3644
+ ? ' floorplan-plugin__floor--is-current'
3645
+ : ''}`) + " svelte-bl8zrz"));
3765
3646
  },
3766
3647
  m(target, anchor) {
3767
3648
  internal.insert(target, div, anchor);
@@ -3777,23 +3658,22 @@
3777
3658
  current = true;
3778
3659
  },
3779
3660
  p(ctx, [dirty]) {
3780
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
3661
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3781
3662
  ? internal.get_spread_update(roommaterial_spread_levels, [
3782
3663
  {
3783
- floorIndex: /*floorIndex*/ ctx[2],
3784
- floorplanData: /*floorplanData*/ ctx[6],
3785
- pxmm: /*pxmm*/ ctx[0]
3664
+ floorIndex: /*floorIndex*/ ctx[1],
3665
+ floorplanData: /*floorplanData*/ ctx[5]
3786
3666
  }
3787
3667
  ])
3788
3668
  : {};
3789
3669
 
3790
3670
  roommaterial.$set(roommaterial_changes);
3791
3671
 
3792
- if (/*hoverEnable*/ ctx[3]) {
3672
+ if (/*hoverEnable*/ ctx[2]) {
3793
3673
  if (if_block0) {
3794
3674
  if_block0.p(ctx, dirty);
3795
3675
 
3796
- if (dirty & /*hoverEnable*/ 8) {
3676
+ if (dirty & /*hoverEnable*/ 4) {
3797
3677
  internal.transition_in(if_block0, 1);
3798
3678
  }
3799
3679
  } else {
@@ -3812,22 +3692,22 @@
3812
3692
  internal.check_outros();
3813
3693
  }
3814
3694
 
3815
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
3695
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3816
3696
  ? internal.get_spread_update(baseimage_spread_levels, [
3817
3697
  {
3818
- floorplanData: /*floorplanData*/ ctx[6],
3819
- floorIndex: /*floorIndex*/ ctx[2]
3698
+ floorplanData: /*floorplanData*/ ctx[5],
3699
+ floorIndex: /*floorIndex*/ ctx[1]
3820
3700
  }
3821
3701
  ])
3822
3702
  : {};
3823
3703
 
3824
3704
  baseimage.$set(baseimage_changes);
3825
3705
 
3826
- if (/*roomLabelsEnable*/ ctx[4]) {
3706
+ if (/*roomLabelsEnable*/ ctx[3]) {
3827
3707
  if (if_block1) {
3828
3708
  if_block1.p(ctx, dirty);
3829
3709
 
3830
- if (dirty & /*roomLabelsEnable*/ 16) {
3710
+ if (dirty & /*roomLabelsEnable*/ 8) {
3831
3711
  internal.transition_in(if_block1, 1);
3832
3712
  }
3833
3713
  } else {
@@ -3846,11 +3726,11 @@
3846
3726
  internal.check_outros();
3847
3727
  }
3848
3728
 
3849
- if (/*ruleLabelsEnable*/ ctx[5]) {
3729
+ if (/*ruleLabelsEnable*/ ctx[4]) {
3850
3730
  if (if_block2) {
3851
3731
  if_block2.p(ctx, dirty);
3852
3732
 
3853
- if (dirty & /*ruleLabelsEnable*/ 32) {
3733
+ if (dirty & /*ruleLabelsEnable*/ 16) {
3854
3734
  internal.transition_in(if_block2, 1);
3855
3735
  }
3856
3736
  } else {
@@ -3868,6 +3748,12 @@
3868
3748
 
3869
3749
  internal.check_outros();
3870
3750
  }
3751
+
3752
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3753
+ ? ' floorplan-plugin__floor--is-current'
3754
+ : ''}`) + " svelte-bl8zrz"))) {
3755
+ internal.attr(div, "class", div_class_value);
3756
+ }
3871
3757
  },
3872
3758
  i(local) {
3873
3759
  if (current) return;
@@ -3898,37 +3784,31 @@
3898
3784
  }
3899
3785
 
3900
3786
  function instance$9($$self, $$props, $$invalidate) {
3901
- let { pxmm } = $$props;
3902
- let { five } = $$props;
3787
+ let { isCurrent } = $$props;
3903
3788
  let { floorIndex } = $$props;
3904
3789
  let { hoverEnable } = $$props;
3905
3790
  let { roomLabelsEnable } = $$props;
3906
3791
  let { ruleLabelsEnable } = $$props;
3907
3792
  let { floorplanData } = $$props;
3908
- let { onRoomHeightClick } = $$props;
3909
3793
  let { getLabelElement } = $$props;
3910
3794
 
3911
3795
  $$self.$$set = $$props => {
3912
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3913
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3914
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
3915
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
3916
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
3917
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
3918
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
3919
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
3920
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3796
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3797
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3798
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3799
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3800
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3801
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3802
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3921
3803
  };
3922
3804
 
3923
3805
  return [
3924
- pxmm,
3925
- five,
3806
+ isCurrent,
3926
3807
  floorIndex,
3927
3808
  hoverEnable,
3928
3809
  roomLabelsEnable,
3929
3810
  ruleLabelsEnable,
3930
3811
  floorplanData,
3931
- onRoomHeightClick,
3932
3812
  getLabelElement
3933
3813
  ];
3934
3814
  }
@@ -3944,65 +3824,56 @@
3944
3824
  create_fragment$9,
3945
3825
  internal.safe_not_equal,
3946
3826
  {
3947
- pxmm: 0,
3948
- five: 1,
3949
- floorIndex: 2,
3950
- hoverEnable: 3,
3951
- roomLabelsEnable: 4,
3952
- ruleLabelsEnable: 5,
3953
- floorplanData: 6,
3954
- onRoomHeightClick: 7,
3955
- getLabelElement: 8
3827
+ isCurrent: 0,
3828
+ floorIndex: 1,
3829
+ hoverEnable: 2,
3830
+ roomLabelsEnable: 3,
3831
+ ruleLabelsEnable: 4,
3832
+ floorplanData: 5,
3833
+ getLabelElement: 6
3956
3834
  },
3957
3835
  add_css$8
3958
3836
  );
3959
3837
  }
3960
3838
  }
3961
3839
 
3962
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3840
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3963
3841
 
3964
3842
  function add_css$7(target) {
3965
- internal.append_styles(target, "svelte-177x2q7", ".floorplan-main.svelte-177x2q7{width:100%;height:100%}");
3843
+ internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
3844
+ }
3845
+
3846
+ function get_each_context$3(ctx, list, i) {
3847
+ const child_ctx = ctx.slice();
3848
+ child_ctx[13] = list[i];
3849
+ return child_ctx;
3966
3850
  }
3967
3851
 
3968
- // (24:0) {#if visible}
3852
+ // (21:0) {#if visible}
3969
3853
  function create_if_block$2(ctx) {
3970
3854
  let div;
3971
- let currentfloor;
3972
3855
  let t0;
3973
3856
  let camera;
3974
3857
  let t1;
3975
3858
  let div_intro;
3976
3859
  let current;
3860
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3861
+ let each_blocks = [];
3977
3862
 
3978
- const currentfloor_spread_levels = [
3979
- {
3980
- five: /*five*/ ctx[2],
3981
- pxmm: /*pxmm*/ ctx[1],
3982
- floorIndex: /*floorIndex*/ ctx[6],
3983
- hoverEnable: /*hoverEnable*/ ctx[7],
3984
- floorplanData: /*floorplanData*/ ctx[11],
3985
- getLabelElement: /*getLabelElement*/ ctx[15],
3986
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3987
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3988
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3989
- }
3990
- ];
3991
-
3992
- let currentfloor_props = {};
3993
-
3994
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3995
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3863
+ for (let i = 0; i < each_value.length; i += 1) {
3864
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
3996
3865
  }
3997
3866
 
3998
- currentfloor = new CurrentFloor$1({ props: currentfloor_props });
3867
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3868
+ each_blocks[i] = null;
3869
+ });
3999
3870
 
4000
3871
  const camera_spread_levels = [
4001
3872
  {
4002
- panoIndex: /*panoIndex*/ ctx[5],
4003
- floorplanData: /*floorplanData*/ ctx[11],
4004
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4005
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3873
+ panoIndex: /*panoIndex*/ ctx[3],
3874
+ floorplanData: /*floorplanData*/ ctx[9],
3875
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3876
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4006
3877
  }
4007
3878
  ];
4008
3879
 
@@ -4013,21 +3884,29 @@
4013
3884
  }
4014
3885
 
4015
3886
  camera = new Camera$1({ props: camera_props });
4016
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
3887
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
4017
3888
 
4018
3889
  return {
4019
3890
  c() {
4020
3891
  div = internal.element("div");
4021
- internal.create_component(currentfloor.$$.fragment);
3892
+
3893
+ for (let i = 0; i < each_blocks.length; i += 1) {
3894
+ each_blocks[i].c();
3895
+ }
3896
+
4022
3897
  t0 = internal.space();
4023
3898
  internal.create_component(camera.$$.fragment);
4024
3899
  t1 = internal.space();
4025
3900
  if (if_block) if_block.c();
4026
- internal.attr(div, "class", "floorplan-main svelte-177x2q7");
3901
+ internal.attr(div, "class", "floorplan-main svelte-q5wdnn");
4027
3902
  },
4028
3903
  m(target, anchor) {
4029
3904
  internal.insert(target, div, anchor);
4030
- internal.mount_component(currentfloor, div, null);
3905
+
3906
+ for (let i = 0; i < each_blocks.length; i += 1) {
3907
+ each_blocks[i].m(div, null);
3908
+ }
3909
+
4031
3910
  internal.append(div, t0);
4032
3911
  internal.mount_component(camera, div, null);
4033
3912
  internal.append(div, t1);
@@ -4037,42 +3916,51 @@
4037
3916
  p(new_ctx, dirty) {
4038
3917
  ctx = new_ctx;
4039
3918
 
4040
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
4041
- ? internal.get_spread_update(currentfloor_spread_levels, [
4042
- {
4043
- five: /*five*/ ctx[2],
4044
- pxmm: /*pxmm*/ ctx[1],
4045
- floorIndex: /*floorIndex*/ ctx[6],
4046
- hoverEnable: /*hoverEnable*/ ctx[7],
4047
- floorplanData: /*floorplanData*/ ctx[11],
4048
- getLabelElement: /*getLabelElement*/ ctx[15],
4049
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
4050
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
4051
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3919
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
3920
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3921
+ let i;
3922
+
3923
+ for (i = 0; i < each_value.length; i += 1) {
3924
+ const child_ctx = get_each_context$3(ctx, each_value, i);
3925
+
3926
+ if (each_blocks[i]) {
3927
+ each_blocks[i].p(child_ctx, dirty);
3928
+ internal.transition_in(each_blocks[i], 1);
3929
+ } else {
3930
+ each_blocks[i] = create_each_block$3(child_ctx);
3931
+ each_blocks[i].c();
3932
+ internal.transition_in(each_blocks[i], 1);
3933
+ each_blocks[i].m(div, t0);
4052
3934
  }
4053
- ])
4054
- : {};
3935
+ }
4055
3936
 
4056
- currentfloor.$set(currentfloor_changes);
3937
+ internal.group_outros();
3938
+
3939
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3940
+ out(i);
3941
+ }
3942
+
3943
+ internal.check_outros();
3944
+ }
4057
3945
 
4058
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
3946
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
4059
3947
  ? internal.get_spread_update(camera_spread_levels, [
4060
3948
  {
4061
- panoIndex: /*panoIndex*/ ctx[5],
4062
- floorplanData: /*floorplanData*/ ctx[11],
4063
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4064
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3949
+ panoIndex: /*panoIndex*/ ctx[3],
3950
+ floorplanData: /*floorplanData*/ ctx[9],
3951
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3952
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4065
3953
  }
4066
3954
  ])
4067
3955
  : {};
4068
3956
 
4069
3957
  camera.$set(camera_changes);
4070
3958
 
4071
- if (/*compassEnable*/ ctx[8]) {
3959
+ if (/*compassEnable*/ ctx[6]) {
4072
3960
  if (if_block) {
4073
3961
  if_block.p(ctx, dirty);
4074
3962
 
4075
- if (dirty & /*compassEnable*/ 256) {
3963
+ if (dirty & /*compassEnable*/ 64) {
4076
3964
  internal.transition_in(if_block, 1);
4077
3965
  }
4078
3966
  } else {
@@ -4093,14 +3981,18 @@
4093
3981
  },
4094
3982
  i(local) {
4095
3983
  if (current) return;
4096
- internal.transition_in(currentfloor.$$.fragment, local);
3984
+
3985
+ for (let i = 0; i < each_value.length; i += 1) {
3986
+ internal.transition_in(each_blocks[i]);
3987
+ }
3988
+
4097
3989
  internal.transition_in(camera.$$.fragment, local);
4098
3990
  internal.transition_in(if_block);
4099
3991
 
4100
3992
  if (!div_intro) {
4101
3993
  internal.add_render_callback(() => {
4102
3994
  div_intro = internal.create_in_transition(div, transition.fade, {
4103
- duration: /*duration*/ ctx[3],
3995
+ duration: /*duration*/ ctx[0],
4104
3996
  easing: easing.linear
4105
3997
  });
4106
3998
 
@@ -4111,29 +4003,107 @@
4111
4003
  current = true;
4112
4004
  },
4113
4005
  o(local) {
4114
- internal.transition_out(currentfloor.$$.fragment, local);
4006
+ each_blocks = each_blocks.filter(Boolean);
4007
+
4008
+ for (let i = 0; i < each_blocks.length; i += 1) {
4009
+ internal.transition_out(each_blocks[i]);
4010
+ }
4011
+
4115
4012
  internal.transition_out(camera.$$.fragment, local);
4116
4013
  internal.transition_out(if_block);
4117
4014
  current = false;
4118
4015
  },
4119
4016
  d(detaching) {
4120
4017
  if (detaching) internal.detach(div);
4121
- internal.destroy_component(currentfloor);
4018
+ internal.destroy_each(each_blocks, detaching);
4122
4019
  internal.destroy_component(camera);
4123
4020
  if (if_block) if_block.d();
4124
4021
  }
4125
4022
  };
4126
4023
  }
4127
4024
 
4128
- // (40:4) {#if compassEnable}
4025
+ // (23:4) {#each floorplanData.floorDatas as floorData}
4026
+ function create_each_block$3(ctx) {
4027
+ let currentfloor;
4028
+ let current;
4029
+
4030
+ const currentfloor_spread_levels = [
4031
+ {
4032
+ hoverEnable: /*hoverEnable*/ ctx[5],
4033
+ floorplanData: /*floorplanData*/ ctx[9],
4034
+ getLabelElement: /*getLabelElement*/ ctx[12],
4035
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4036
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4037
+ },
4038
+ {
4039
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4040
+ },
4041
+ {
4042
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4043
+ }
4044
+ ];
4045
+
4046
+ let currentfloor_props = {};
4047
+
4048
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4049
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
4050
+ }
4051
+
4052
+ currentfloor = new CurrentFloor$1({ props: currentfloor_props });
4053
+
4054
+ return {
4055
+ c() {
4056
+ internal.create_component(currentfloor.$$.fragment);
4057
+ },
4058
+ m(target, anchor) {
4059
+ internal.mount_component(currentfloor, target, anchor);
4060
+ current = true;
4061
+ },
4062
+ p(ctx, dirty) {
4063
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
4064
+ ? internal.get_spread_update(currentfloor_spread_levels, [
4065
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
4066
+ hoverEnable: /*hoverEnable*/ ctx[5],
4067
+ floorplanData: /*floorplanData*/ ctx[9],
4068
+ getLabelElement: /*getLabelElement*/ ctx[12],
4069
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4070
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4071
+ },
4072
+ dirty & /*floorplanData*/ 512 && {
4073
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4074
+ },
4075
+ dirty & /*floorplanData, floorIndex*/ 528 && {
4076
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4077
+ }
4078
+ ])
4079
+ : {};
4080
+
4081
+ currentfloor.$set(currentfloor_changes);
4082
+ },
4083
+ i(local) {
4084
+ if (current) return;
4085
+ internal.transition_in(currentfloor.$$.fragment, local);
4086
+ current = true;
4087
+ },
4088
+ o(local) {
4089
+ internal.transition_out(currentfloor.$$.fragment, local);
4090
+ current = false;
4091
+ },
4092
+ d(detaching) {
4093
+ internal.destroy_component(currentfloor, detaching);
4094
+ }
4095
+ };
4096
+ }
4097
+
4098
+ // (37:4) {#if compassEnable}
4129
4099
  function create_if_block_1(ctx) {
4130
4100
  let compass;
4131
4101
  let current;
4132
4102
 
4133
4103
  compass = new Compass({
4134
4104
  props: {
4135
- floorplanData: /*floorplanData*/ ctx[11],
4136
- northDesc: /*northDesc*/ ctx[0]
4105
+ floorplanData: /*floorplanData*/ ctx[9],
4106
+ northDesc: /*northDesc*/ ctx[2]
4137
4107
  }
4138
4108
  });
4139
4109
 
@@ -4147,8 +4117,8 @@
4147
4117
  },
4148
4118
  p(ctx, dirty) {
4149
4119
  const compass_changes = {};
4150
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
4151
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
4120
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
4121
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
4152
4122
  compass.$set(compass_changes);
4153
4123
  },
4154
4124
  i(local) {
@@ -4169,7 +4139,7 @@
4169
4139
  function create_fragment$8(ctx) {
4170
4140
  let if_block_anchor;
4171
4141
  let current;
4172
- let if_block = /*visible*/ ctx[4] && create_if_block$2(ctx);
4142
+ let if_block = /*visible*/ ctx[1] && create_if_block$2(ctx);
4173
4143
 
4174
4144
  return {
4175
4145
  c() {
@@ -4182,11 +4152,11 @@
4182
4152
  current = true;
4183
4153
  },
4184
4154
  p(ctx, [dirty]) {
4185
- if (/*visible*/ ctx[4]) {
4155
+ if (/*visible*/ ctx[1]) {
4186
4156
  if (if_block) {
4187
4157
  if_block.p(ctx, dirty);
4188
4158
 
4189
- if (dirty & /*visible*/ 16) {
4159
+ if (dirty & /*visible*/ 2) {
4190
4160
  internal.transition_in(if_block, 1);
4191
4161
  }
4192
4162
  } else {
@@ -4222,11 +4192,9 @@
4222
4192
  }
4223
4193
 
4224
4194
  function instance$8($$self, $$props, $$invalidate) {
4225
- let { northDesc } = $$props;
4226
- let { pxmm } = $$props;
4227
- let { five } = $$props;
4228
4195
  let { duration = 0 } = $$props;
4229
4196
  let { visible } = $$props;
4197
+ let { northDesc } = $$props;
4230
4198
  let { panoIndex } = $$props;
4231
4199
  let { floorIndex } = $$props;
4232
4200
  let { hoverEnable } = $$props;
@@ -4236,34 +4204,28 @@
4236
4204
  let { floorplanData } = $$props;
4237
4205
  let { lastPanoramaLongitude } = $$props;
4238
4206
  let { cameraImageUrl } = $$props;
4239
- let { onRoomHeightClick } = $$props;
4240
4207
  let { getLabelElement } = $$props;
4241
4208
 
4242
4209
  $$self.$$set = $$props => {
4243
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
4244
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
4245
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
4246
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
4247
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
4248
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
4249
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
4250
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
4251
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
4252
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
4253
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
4254
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
4255
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4256
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
4257
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
4258
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
4210
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
4211
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
4212
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
4213
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
4214
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
4215
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
4216
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
4217
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
4218
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
4219
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
4220
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4221
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
4222
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
4259
4223
  };
4260
4224
 
4261
4225
  return [
4262
- northDesc,
4263
- pxmm,
4264
- five,
4265
4226
  duration,
4266
4227
  visible,
4228
+ northDesc,
4267
4229
  panoIndex,
4268
4230
  floorIndex,
4269
4231
  hoverEnable,
@@ -4273,7 +4235,6 @@
4273
4235
  floorplanData,
4274
4236
  lastPanoramaLongitude,
4275
4237
  cameraImageUrl,
4276
- onRoomHeightClick,
4277
4238
  getLabelElement
4278
4239
  ];
4279
4240
  }
@@ -4289,22 +4250,19 @@
4289
4250
  create_fragment$8,
4290
4251
  internal.safe_not_equal,
4291
4252
  {
4292
- northDesc: 0,
4293
- pxmm: 1,
4294
- five: 2,
4295
- duration: 3,
4296
- visible: 4,
4297
- panoIndex: 5,
4298
- floorIndex: 6,
4299
- hoverEnable: 7,
4300
- compassEnable: 8,
4301
- roomLabelsEnable: 9,
4302
- ruleLabelsEnable: 10,
4303
- floorplanData: 11,
4304
- lastPanoramaLongitude: 12,
4305
- cameraImageUrl: 13,
4306
- onRoomHeightClick: 14,
4307
- getLabelElement: 15
4253
+ duration: 0,
4254
+ visible: 1,
4255
+ northDesc: 2,
4256
+ panoIndex: 3,
4257
+ floorIndex: 4,
4258
+ hoverEnable: 5,
4259
+ compassEnable: 6,
4260
+ roomLabelsEnable: 7,
4261
+ ruleLabelsEnable: 8,
4262
+ floorplanData: 9,
4263
+ lastPanoramaLongitude: 10,
4264
+ cameraImageUrl: 11,
4265
+ getLabelElement: 12
4308
4266
  },
4309
4267
  add_css$7
4310
4268
  );
@@ -4414,32 +4372,58 @@
4414
4372
  value: () => {
4415
4373
  var _a, _b;
4416
4374
  this.hide();
4417
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
4418
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
4419
- this.five.off('modeChange', this.handleModeChange);
4420
- this.five.off('panoArrived', this.handlePanoArrived);
4421
- this.five.off('modelLoaded', this.handleModelLoaded);
4422
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
4423
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
4424
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
4375
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
4376
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
4377
+ this.five.off('modeChange', this.onFiveModeChange);
4378
+ this.five.off('panGesture', this.onFivePanGesture);
4379
+ this.five.off('panoArrived', this.onFivePanoArrived);
4380
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
4381
+ this.five.off('pinchGesture', this.onFivePinchGesture);
4382
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
4383
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4384
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4425
4385
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
4426
4386
  }
4427
4387
  });
4428
- /** 模型楼层高亮改变时,自动进行楼层切换 */
4388
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
4389
+ enumerable: true,
4390
+ configurable: true,
4391
+ writable: true,
4392
+ value: () => {
4393
+ if (this.visible && this.configs.preventRoomClick)
4394
+ return false;
4395
+ }
4396
+ });
4397
+ Object.defineProperty(this, "onFiveWantsGesture", {
4398
+ enumerable: true,
4399
+ configurable: true,
4400
+ writable: true,
4401
+ value: (type) => {
4402
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
4403
+ return;
4404
+ if (this.visible && !this.configs.gestureEnable)
4405
+ return false;
4406
+ }
4407
+ });
4429
4408
  Object.defineProperty(this, "onModelShownFloorChange", {
4430
4409
  enumerable: true,
4431
4410
  configurable: true,
4432
4411
  writable: true,
4433
4412
  value: (shownFloor) => {
4434
- if (shownFloor === null)
4413
+ if (this.floorIndex === shownFloor)
4414
+ return;
4415
+ if (shownFloor === null) {
4416
+ const panoIndex = this.five.getCurrentState().panoIndex;
4417
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4435
4418
  return;
4419
+ }
4420
+ // 模型楼层高亮改变时,自动进行楼层切换
4436
4421
  this.floorIndex = shownFloor;
4437
4422
  this.updateSize();
4438
4423
  this.render();
4439
4424
  }
4440
4425
  });
4441
- /** panoIndex 改变时,更新 floorIndex */
4442
- Object.defineProperty(this, "handlePanoArrived", {
4426
+ Object.defineProperty(this, "onFivePanoArrived", {
4443
4427
  enumerable: true,
4444
4428
  configurable: true,
4445
4429
  writable: true,
@@ -4451,31 +4435,28 @@
4451
4435
  this.floorIndex = this.five.work.observers[index].floorIndex;
4452
4436
  }
4453
4437
  });
4454
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
4455
- Object.defineProperty(this, "handleWantsMoveToPano", {
4438
+ Object.defineProperty(this, "onFivePanGesture", {
4456
4439
  enumerable: true,
4457
4440
  configurable: true,
4458
4441
  writable: true,
4459
4442
  value: () => {
4460
4443
  if (!this.visible)
4461
4444
  return;
4462
- if (this.configs.preventRoomClick)
4463
- return false;
4464
- return;
4445
+ this.updatePosition();
4465
4446
  }
4466
4447
  });
4467
- /** 在户型图展示时阻止 Five 滑动行为 */
4468
- Object.defineProperty(this, "handleWantsPanGesture", {
4448
+ Object.defineProperty(this, "onFivePinchGesture", {
4469
4449
  enumerable: true,
4470
4450
  configurable: true,
4471
4451
  writable: true,
4472
4452
  value: () => {
4473
4453
  if (!this.visible)
4474
4454
  return;
4475
- return false;
4455
+ this.updatePosition();
4456
+ this.updateSize();
4476
4457
  }
4477
4458
  });
4478
- Object.defineProperty(this, "handleModelLoaded", {
4459
+ Object.defineProperty(this, "onFiveModelLoaded", {
4479
4460
  enumerable: true,
4480
4461
  configurable: true,
4481
4462
  writable: true,
@@ -4492,7 +4473,7 @@
4492
4473
  }
4493
4474
  });
4494
4475
  /** 非 Topview 态隐藏户型图 */
4495
- Object.defineProperty(this, "handleModeChange", {
4476
+ Object.defineProperty(this, "onFiveModeChange", {
4496
4477
  enumerable: true,
4497
4478
  configurable: true,
4498
4479
  writable: true,
@@ -4502,7 +4483,7 @@
4502
4483
  }
4503
4484
  });
4504
4485
  /** 动画结束后是 Topview 态就展示户型图 */
4505
- Object.defineProperty(this, "handleInitAnimationEnded", {
4486
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
4506
4487
  enumerable: true,
4507
4488
  configurable: true,
4508
4489
  writable: true,
@@ -4542,24 +4523,30 @@
4542
4523
  this.five = five;
4543
4524
  this.selector = params.selector;
4544
4525
  this.configs = omit(params, ['selector']);
4526
+ this.five.addExtraElement(this.container);
4545
4527
  // 设置 container 样式
4546
4528
  this.container.classList.add('floorplan-plugin');
4547
4529
  Object.assign(this.container.style, pluginStyle$1);
4548
4530
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4549
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
4531
+ this.five.model.loaded
4532
+ ? this.onFiveModelLoaded()
4533
+ : five.once('modelLoaded', this.onFiveModelLoaded);
4550
4534
  this.five.once('dispose', this.dispose);
4551
- this.five.on('modeChange', this.handleModeChange);
4552
- this.five.on('panoArrived', this.handlePanoArrived);
4553
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
4535
+ this.five.on('modeChange', this.onFiveModeChange);
4536
+ this.five.on('panGesture', this.onFivePanGesture);
4537
+ this.five.on('mouseWheel', this.onFivePinchGesture);
4538
+ this.five.on('panoArrived', this.onFivePanoArrived);
4539
+ this.five.on('pinchGesture', this.onFivePinchGesture);
4540
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
4541
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4542
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4554
4543
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4555
4544
  }
4556
4545
  /** 加载户型图数据 */
4557
- load(data) {
4558
- return __awaiter(this, void 0, void 0, function* () {
4559
- const copyData = JSON.parse(JSON.stringify(data));
4560
- this.floorplanData = yield formatData(copyData);
4561
- this.render();
4562
- });
4546
+ async load(data) {
4547
+ const copyData = JSON.parse(JSON.stringify(data));
4548
+ this.floorplanData = await formatData(copyData);
4549
+ this.render();
4563
4550
  }
4564
4551
  /** 把插件的渲染DOM插入到对应的容器中去 */
4565
4552
  appendTo(wrapper) {
@@ -4570,6 +4557,7 @@
4570
4557
  show() {
4571
4558
  this.visible = true;
4572
4559
  this.five.model.show(this.floorIndex);
4560
+ this.updatePosition();
4573
4561
  this.updateSize();
4574
4562
  const renderDuration = 500;
4575
4563
  const modelOpacity = this.configs.modelOpacity;
@@ -4577,8 +4565,6 @@
4577
4565
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4578
4566
  }
4579
4567
  this.render(renderDuration);
4580
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4581
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4582
4568
  }
4583
4569
  hide() {
4584
4570
  const modelOpacity = 1;
@@ -4586,20 +4572,28 @@
4586
4572
  this.visible = false;
4587
4573
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4588
4574
  this.render();
4589
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4590
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4575
+ }
4576
+ /** 更新户型图位置 */
4577
+ updatePosition() {
4578
+ var _a;
4579
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3());
4580
+ if (!modelCenter)
4581
+ return;
4582
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
4583
+ const left = (ndcModelCenter.x + 1) / 2;
4584
+ const top = -(ndcModelCenter.y - 1) / 2;
4585
+ this.container.style.left = left * 100 + '%';
4586
+ this.container.style.top = top * 100 + '%';
4591
4587
  }
4592
4588
  render(duration) {
4593
4589
  if (!this.container || !this.floorplanData)
4594
4590
  return;
4595
4591
  if (this.size.width === 0)
4596
4592
  return;
4597
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4598
- const handleClick = preventRoomClick ? () => false : undefined;
4593
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4599
4594
  const props = {
4595
+ getLabelElement,
4600
4596
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4601
- five: this.five,
4602
- pxmm: this.pxmm,
4603
4597
  cameraImageUrl,
4604
4598
  visible: this.visible,
4605
4599
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -4611,8 +4605,6 @@
4611
4605
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4612
4606
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4613
4607
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4614
- getLabelElement,
4615
- onRoomHeightClick: handleClick,
4616
4608
  };
4617
4609
  if (!this.app) {
4618
4610
  this.app = new Main$1({
@@ -4653,7 +4645,7 @@
4653
4645
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
4654
4646
 
4655
4647
  function add_css$6(target) {
4656
- internal.append_styles(target, "svelte-o7uo2v", ".plugin-radar__camera-wrapper.svelte-o7uo2v{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-o7uo2v{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-o7uo2v{position:absolute;left:-15px;top:-15px;width:17px;height:17px;transform-origin:15px 15px;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
4648
+ internal.append_styles(target, "svelte-1ty3s4p", ".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
4657
4649
  }
4658
4650
 
4659
4651
  function create_fragment$7(ctx) {
@@ -4666,12 +4658,12 @@
4666
4658
  div2 = internal.element("div");
4667
4659
  div1 = internal.element("div");
4668
4660
  div0 = internal.element("div");
4669
- internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-o7uo2v");
4661
+ internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-1ty3s4p");
4670
4662
  internal.set_style(div0, "background-image", "url(" + (/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE) + ")");
4671
4663
  internal.set_style(div0, "transform", /*rotateTransform*/ ctx[1], false);
4672
- internal.attr(div1, "class", "plugin-radar__camera-position svelte-o7uo2v");
4664
+ internal.attr(div1, "class", "plugin-radar__camera-position svelte-1ty3s4p");
4673
4665
  internal.set_style(div1, "transform", /*positionTransform*/ ctx[2], false);
4674
- internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-o7uo2v");
4666
+ internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-1ty3s4p");
4675
4667
  },
4676
4668
  m(target, anchor) {
4677
4669
  internal.insert(target, div2, anchor);
@@ -4787,7 +4779,7 @@
4787
4779
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte generated by Svelte v3.47.0 */
4788
4780
 
4789
4781
  function add_css$5(target) {
4790
- internal.append_styles(target, "svelte-8n0d4v", ".plugin-pano-floorplan__extra-objects.svelte-8n0d4v{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-8n0d4v{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-8n0d4v{transform:translate(-50%, -50%)}");
4782
+ internal.append_styles(target, "svelte-1i87fz7", ".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}");
4791
4783
  }
4792
4784
 
4793
4785
  function get_each_context$2(ctx, list, i) {
@@ -4813,11 +4805,11 @@
4813
4805
  div1 = internal.element("div");
4814
4806
  div0 = internal.element("div");
4815
4807
  t = internal.space();
4816
- internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-8n0d4v");
4808
+ internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-1i87fz7");
4817
4809
  internal.set_style(div0, "background-image", `url(${/*extraObject*/ ctx[1].icon.url})`);
4818
4810
  internal.set_style(div0, "width", style_width, false);
4819
4811
  internal.set_style(div0, "height", style_height, false);
4820
- internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-8n0d4v");
4812
+ internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7");
4821
4813
  internal.set_style(div1, "top", style_top, false);
4822
4814
  internal.set_style(div1, "left", style_left, false);
4823
4815
  this.first = div1;
@@ -4877,7 +4869,7 @@
4877
4869
  each_blocks[i].c();
4878
4870
  }
4879
4871
 
4880
- internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-8n0d4v");
4872
+ internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-1i87fz7");
4881
4873
  },
4882
4874
  m(target, anchor) {
4883
4875
  internal.insert(target, div, anchor);
@@ -5151,7 +5143,7 @@
5151
5143
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
5152
5144
 
5153
5145
  function add_css$4(target) {
5154
- internal.append_styles(target, "svelte-7d8ub2", ".plugin-floorplan-radar.svelte-7d8ub2{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-7d8ub2{position:relative}");
5146
+ internal.append_styles(target, "svelte-1mvqyqq", ".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}");
5155
5147
  }
5156
5148
 
5157
5149
  // (41:2) {#if clientWidth !== 0}
@@ -5206,7 +5198,7 @@
5206
5198
  internal.create_component(currentfloor.$$.fragment);
5207
5199
  t = internal.space();
5208
5200
  internal.create_component(camera.$$.fragment);
5209
- internal.attr(div, "class", "plugin-floorplan-radar-container svelte-7d8ub2");
5201
+ internal.attr(div, "class", "plugin-floorplan-radar-container svelte-1mvqyqq");
5210
5202
  internal.set_style(div, "width", style_width, false);
5211
5203
  internal.set_style(div, "height", style_height, false);
5212
5204
  },
@@ -5283,7 +5275,7 @@
5283
5275
  c() {
5284
5276
  div = internal.element("div");
5285
5277
  if (if_block) if_block.c();
5286
- internal.attr(div, "class", "plugin-floorplan-radar svelte-7d8ub2");
5278
+ internal.attr(div, "class", "plugin-floorplan-radar svelte-1mvqyqq");
5287
5279
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[11].call(div));
5288
5280
  },
5289
5281
  m(target, anchor) {
@@ -5494,9 +5486,9 @@
5494
5486
  enumerable: true,
5495
5487
  configurable: true,
5496
5488
  writable: true,
5497
- value: (data) => __awaiter(this, void 0, void 0, function* () {
5489
+ value: async (data) => {
5498
5490
  const copyData = JSON.parse(JSON.stringify(data));
5499
- const floorplanData = yield formatData(copyData);
5491
+ const floorplanData = await formatData(copyData);
5500
5492
  this.data = floorplanData;
5501
5493
  // const loadImage = async () => {
5502
5494
  // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
@@ -5514,7 +5506,7 @@
5514
5506
  // }
5515
5507
  // await loadImage()
5516
5508
  this.render();
5517
- })
5509
+ }
5518
5510
  });
5519
5511
  this.five = five;
5520
5512
  (params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
@@ -5574,24 +5566,37 @@
5574
5566
  return new PanoFloorplanRadarPluginController(five, params);
5575
5567
  };
5576
5568
 
5569
+ var FloorplanErrorType;
5570
+ (function (FloorplanErrorType) {
5571
+ FloorplanErrorType["UnknownError"] = "UnknowError";
5572
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5573
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5574
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5575
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5576
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5577
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5578
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
5579
+ /** 户型图展示 & 模型消失的默认时间 */
5580
+ const SHOW_ANIME_DURATION = 500;
5581
+ /** Five camera 默认 fov */
5582
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
5583
+
5577
5584
  /**
5578
5585
  * 传入一个 Promise
5579
5586
  * 无异常,返回 [null, data]
5580
5587
  * 有异常,则返回 [Error, undefined]
5581
5588
  * 用于替代 try&catch 处理 await 异常的方案
5582
5589
  */
5583
- function to(promise) {
5584
- return __awaiter(this, void 0, void 0, function* () {
5585
- try {
5586
- const data = yield promise;
5587
- return [null, data];
5588
- }
5589
- catch (error) {
5590
- if (error instanceof Error)
5591
- return [error, null];
5592
- return [new Error(''), null];
5593
- }
5594
- });
5590
+ async function to(promise) {
5591
+ try {
5592
+ const data = await promise;
5593
+ return [null, data];
5594
+ }
5595
+ catch (error) {
5596
+ if (error instanceof Error)
5597
+ return [error, null];
5598
+ return [new Error(''), null];
5599
+ }
5595
5600
  }
5596
5601
 
5597
5602
  /**
@@ -5699,38 +5704,21 @@
5699
5704
  return isDeepEqual(value, other);
5700
5705
  }
5701
5706
 
5702
- function changeMode(five, ...changeModeParams) {
5703
- return __awaiter(this, void 0, void 0, function* () {
5704
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
5705
- if (changeModeError)
5706
- throw changeModeError;
5707
- yield new Promise((reslove, reject) => {
5708
- five.once('initAnimationEnded', reslove);
5709
- const handleModeChange = (mode) => {
5710
- if (mode !== changeModeParams[0])
5711
- reject('changeMode 被中断');
5712
- five.off('modeChange', handleModeChange);
5713
- };
5714
- five.on('modeChange', handleModeChange);
5715
- });
5707
+ async function changeMode(five, ...changeModeParams) {
5708
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
5709
+ if (changeModeError)
5710
+ throw changeModeError;
5711
+ await new Promise((reslove, reject) => {
5712
+ five.once('initAnimationEnded', reslove);
5713
+ const handleModeChange = (mode) => {
5714
+ if (mode !== changeModeParams[0])
5715
+ reject('changeMode 被中断');
5716
+ five.off('modeChange', handleModeChange);
5717
+ };
5718
+ five.on('modeChange', handleModeChange);
5716
5719
  });
5717
5720
  }
5718
5721
 
5719
- var FloorplanErrorType;
5720
- (function (FloorplanErrorType) {
5721
- FloorplanErrorType["UnknownError"] = "UnknowError";
5722
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5723
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5724
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5725
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5726
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5727
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5728
- })(FloorplanErrorType || (FloorplanErrorType = {}));
5729
- /** 户型图展示 & 模型消失的默认时间 */
5730
- const SHOW_ANIME_DURATION = 500;
5731
- /** Five camera 默认 fov */
5732
- const FIVE_CAMERA_DEFAULT_FOV = 80;
5733
-
5734
5722
  /**
5735
5723
  * 比较两个数字近似相等
5736
5724
  * @param num1 数字1
@@ -5757,32 +5745,30 @@
5757
5745
  * 2. 内置了相应的动画时间计算
5758
5746
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
5759
5747
  */
5760
- function correctFiveState(five$1, showState, userAction = true) {
5761
- return __awaiter(this, void 0, void 0, function* () {
5762
- // 当前已满足状态,不需要变更
5748
+ async function correctFiveState(five$1, showState, userAction = true) {
5749
+ // 当前已满足状态,不需要变更
5750
+ const result = checkShowState(five$1, showState);
5751
+ if (result === true)
5752
+ return;
5753
+ // 纠正 mode
5754
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5755
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5756
+ if (changeModeError)
5757
+ throw changeModeError;
5758
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5763
5759
  const result = checkShowState(five$1, showState);
5764
- if (result === true)
5765
- return;
5766
- // 纠正 mode
5767
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5768
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5769
- if (changeModeError)
5770
- throw changeModeError;
5771
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5772
- const result = checkShowState(five$1, showState);
5773
- if (result === false)
5774
- throw new Error(FloorplanErrorType.ChangeModeError);
5775
- return;
5776
- }
5777
- // 纠正相机状态
5778
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5779
- const { latitude, longitude, fov } = five$1.getCurrentState();
5780
- 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));
5781
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
5782
- if (updateCameraError)
5783
- throw new Error(FloorplanErrorType.UpdateCameraError);
5760
+ if (result === false)
5761
+ throw new Error(FloorplanErrorType.ChangeModeError);
5784
5762
  return;
5785
- });
5763
+ }
5764
+ // 纠正相机状态
5765
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5766
+ const { latitude, longitude, fov } = five$1.getCurrentState();
5767
+ 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));
5768
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
5769
+ if (updateCameraError)
5770
+ throw new Error(FloorplanErrorType.UpdateCameraError);
5771
+ return;
5786
5772
  }
5787
5773
 
5788
5774
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
@@ -5971,12 +5957,12 @@
5971
5957
  enumerable: true,
5972
5958
  configurable: true,
5973
5959
  writable: true,
5974
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
5975
- var _b, _c;
5960
+ value: async (opts) => {
5961
+ var _a, _b;
5976
5962
  // 已经在展示中了
5977
5963
  if (!this.showPromise && this.visible)
5978
5964
  return true;
5979
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
5965
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
5980
5966
  throw new Error(FloorplanErrorType.ModelNotLoaded);
5981
5967
  if (!this.floorplanData)
5982
5968
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -5986,18 +5972,18 @@
5986
5972
  if (!!this.showPromise && sameWithLastOpts)
5987
5973
  return this.showPromise;
5988
5974
  if (!!this.showPromise && !sameWithLastOpts)
5989
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
5975
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
5990
5976
  }
5991
5977
  this.ModelFloorplanPluginsShowOpts = opts;
5992
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
5993
- var _d, _e;
5978
+ const getShowPromise = async () => {
5979
+ var _a, _b;
5994
5980
  let hasRejected = false;
5995
5981
  let externalErrorMsg;
5996
5982
  this.showRejection = (errorMsg) => {
5997
5983
  hasRejected = true;
5998
5984
  externalErrorMsg = errorMsg;
5999
5985
  };
6000
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5986
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
6001
5987
  if (correctError)
6002
5988
  throw correctError;
6003
5989
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -6016,7 +6002,7 @@
6016
6002
  this.floorIndex = opts.floorIndex;
6017
6003
  this.five.model.show(this.floorIndex);
6018
6004
  // 模型消失, 渲染户型图
6019
- 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;
6005
+ 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;
6020
6006
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
6021
6007
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
6022
6008
  this.render(renderDuration);
@@ -6024,7 +6010,7 @@
6024
6010
  this.five.on('wantsGesture', this.handleWantsGesture);
6025
6011
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
6026
6012
  return true;
6027
- });
6013
+ };
6028
6014
  const showPromise = getShowPromise()
6029
6015
  .then(() => {
6030
6016
  var _a;
@@ -6046,7 +6032,7 @@
6046
6032
  });
6047
6033
  this.showPromise = showPromise;
6048
6034
  return showPromise;
6049
- })
6035
+ }
6050
6036
  });
6051
6037
  /** 隐藏户型图 */
6052
6038
  Object.defineProperty(this, "hide", {
@@ -6076,8 +6062,13 @@
6076
6062
  configurable: true,
6077
6063
  writable: true,
6078
6064
  value: (shownFloor) => {
6079
- if (shownFloor === null)
6065
+ if (this.floorIndex === shownFloor)
6080
6066
  return;
6067
+ if (shownFloor === null) {
6068
+ const panoIndex = this.five.getCurrentState().panoIndex;
6069
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
6070
+ return;
6071
+ }
6081
6072
  this.floorIndex = shownFloor;
6082
6073
  this.updateSize();
6083
6074
  this.render();
@@ -6190,7 +6181,9 @@
6190
6181
  enumerable: true,
6191
6182
  configurable: true,
6192
6183
  writable: true,
6193
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
6184
+ value: async ({ latitude, longitude }, isFinal) => {
6185
+ if (this.five.getCurrentState().mode !== 'Floorplan')
6186
+ return;
6194
6187
  if (this.configs.autoShowEnable === false)
6195
6188
  return;
6196
6189
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -6211,16 +6204,16 @@
6211
6204
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
6212
6205
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
6213
6206
  // 当手指离开时需要等惯性结束之后在进行判断
6214
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
6207
+ const handleInteriaPan = async (any, isFinal) => {
6215
6208
  if (!isFinal)
6216
6209
  return;
6217
6210
  this.five.off('interiaPan', handleInteriaPan);
6218
- yield this.show({ isAutoShow: true });
6219
- });
6211
+ await this.show({ isAutoShow: true });
6212
+ };
6220
6213
  this.five.on('interiaPan', handleInteriaPan);
6221
6214
  return;
6222
6215
  }
6223
- })
6216
+ }
6224
6217
  });
6225
6218
  this.five = five$1;
6226
6219
  this.hooks = new five.Subscribe();
@@ -6234,9 +6227,9 @@
6234
6227
  left: '50%',
6235
6228
  top: '50%',
6236
6229
  transform: 'translate(-50%, -50%)',
6237
- pointerEvents: 'none',
6238
6230
  zIndex: 10,
6239
6231
  });
6232
+ this.five.addExtraElement(this.container);
6240
6233
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
6241
6234
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
6242
6235
  five$1.once('dispose', this.dispose);
@@ -6247,12 +6240,10 @@
6247
6240
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
6248
6241
  }
6249
6242
  /** 加载户型图数据 */
6250
- load(data) {
6251
- return __awaiter(this, void 0, void 0, function* () {
6252
- const copyData = JSON.parse(JSON.stringify(data));
6253
- this.floorplanData = yield formatData(copyData);
6254
- this.render();
6255
- });
6243
+ async load(data) {
6244
+ const copyData = JSON.parse(JSON.stringify(data));
6245
+ this.floorplanData = await formatData(copyData);
6246
+ this.render();
6256
6247
  }
6257
6248
  /** 把插件的渲染DOM插入到对应的容器中去 */
6258
6249
  appendTo(wrapper) {
@@ -6263,8 +6254,6 @@
6263
6254
  /** 更改户型图楼层 */
6264
6255
  changeFloor(floorIndex) {
6265
6256
  this.five.model.show(floorIndex);
6266
- this.floorIndex = floorIndex;
6267
- this.render();
6268
6257
  }
6269
6258
  changeConfigs(params) {
6270
6259
  Object.assign(this.configs, params);
@@ -6279,10 +6268,9 @@
6279
6268
  return;
6280
6269
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
6281
6270
  const props = {
6282
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6283
- five: this.five,
6284
- pxmm: this.pxmm,
6285
6271
  cameraImageUrl,
6272
+ getLabelElement,
6273
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6286
6274
  visible: this.visible,
6287
6275
  duration: duration !== null && duration !== void 0 ? duration : 0,
6288
6276
  panoIndex: this.panoIndex,
@@ -6293,8 +6281,6 @@
6293
6281
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
6294
6282
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
6295
6283
  lastPanoramaLongitude: this.lastPanoramaLongitude,
6296
- getLabelElement,
6297
- onRoomHeightClick: this.handleClick,
6298
6284
  };
6299
6285
  if (!this.app) {
6300
6286
  this.app = new Main$1({
@@ -6364,7 +6350,7 @@
6364
6350
  const defaultNorthRad = params.north_rad || undefined;
6365
6351
  // 局部状态
6366
6352
  const state = {};
6367
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6353
+ const load = async (data) => {
6368
6354
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
6369
6355
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
6370
6356
  if (!northRad) {
@@ -6375,7 +6361,7 @@
6375
6361
  const zOffset = bounding.max.z - bounding.min.z;
6376
6362
  const maxOffset = Math.max(xOffset, zOffset);
6377
6363
  const fbxLoader = new FBXLoader.FBXLoader();
6378
- const object = yield fbxLoader.loadAsync(fbxUrl);
6364
+ const object = await fbxLoader.loadAsync(fbxUrl);
6379
6365
  transfromToMeshBasicMaterial(object, {
6380
6366
  transparent: true,
6381
6367
  side: THREE__namespace.DoubleSide,
@@ -6389,7 +6375,7 @@
6389
6375
  bject3d2LocalMatrix(object, { position, rotation, scale });
6390
6376
  state.object = object;
6391
6377
  return true;
6392
- });
6378
+ };
6393
6379
  const onCameraUpdate = ({ latitude }) => {
6394
6380
  if (!state.object)
6395
6381
  return;
@@ -6459,25 +6445,25 @@
6459
6445
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
6460
6446
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
6461
6447
  const mixers = [];
6462
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6463
- var _d, _e, _f, _g, _h, _j, _k;
6464
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
6448
+ const load = async (data) => {
6449
+ var _a, _b, _c, _d, _e, _f, _g;
6450
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
6465
6451
  if (!position)
6466
6452
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
6467
6453
  const modelPosition = transformPositionToVector3(position);
6468
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
6469
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
6454
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
6455
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
6470
6456
  state.rad = rad;
6471
6457
  if (rad === undefined)
6472
6458
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
6473
6459
  // 加载模型
6474
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6460
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6475
6461
  // 设置位置
6476
6462
  object.position.copy(modelPosition);
6477
6463
  object.rotation.z = rad;
6478
6464
  object.scale.set(0.8, 0.8, 0.8);
6479
6465
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
6480
- 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();
6466
+ 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();
6481
6467
  if (!textMesh)
6482
6468
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
6483
6469
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -6485,7 +6471,7 @@
6485
6471
  object.children[0].add(textMesh);
6486
6472
  state.object = object;
6487
6473
  return true;
6488
- });
6474
+ };
6489
6475
  const initAnimation = () => {
6490
6476
  if (state.animation)
6491
6477
  return;
@@ -6722,21 +6708,21 @@
6722
6708
  */
6723
6709
  const CameraMovementPlugin = (five$1) => {
6724
6710
  const state = {};
6725
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
6711
+ const move = async (args, duration, opts = { preload: true }) => {
6726
6712
  if (state.interruptCallback) {
6727
6713
  state.interruptCallback(false);
6728
6714
  }
6729
6715
  if (opts.asyncStartCallback) {
6730
- yield opts.asyncStartCallback();
6716
+ await opts.asyncStartCallback();
6731
6717
  }
6732
6718
  if (args.mode && args.mode !== five$1.currentMode) {
6733
- yield five$1.changeMode(args.mode);
6719
+ await five$1.changeMode(args.mode);
6734
6720
  }
6735
6721
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6736
- yield five$1.preloadPano(args.panoIndex);
6722
+ await five$1.preloadPano(args.panoIndex);
6737
6723
  }
6738
6724
  if (opts.asyncEndCallback) {
6739
- yield opts.asyncEndCallback();
6725
+ await opts.asyncEndCallback();
6740
6726
  }
6741
6727
  if (args.panoIndex === undefined &&
6742
6728
  args.fov === undefined &&
@@ -6744,7 +6730,7 @@
6744
6730
  args.longitude === undefined) {
6745
6731
  return true;
6746
6732
  }
6747
- return yield new Promise((resolve, reject) => {
6733
+ return await new Promise((resolve, reject) => {
6748
6734
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
6749
6735
  if (panoIndex !== undefined) {
6750
6736
  five$1.moveToPano(panoIndex, Object.assign({
@@ -6757,7 +6743,7 @@
6757
6743
  reject(false);
6758
6744
  }
6759
6745
  });
6760
- });
6746
+ };
6761
6747
  const getAnimeParams = (args) => {
6762
6748
  const currentFiveState = five$1.state;
6763
6749
  // latitude
@@ -6773,20 +6759,20 @@
6773
6759
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
6774
6760
  };
6775
6761
  };
6776
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
6762
+ const rotate = async (args, duration, opts = {}) => {
6777
6763
  if (state.interruptCallback) {
6778
6764
  state.interruptCallback(false);
6779
6765
  }
6780
6766
  if (opts.asyncStartCallback) {
6781
- yield opts.asyncStartCallback();
6767
+ await opts.asyncStartCallback();
6782
6768
  }
6783
6769
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
6784
- yield five$1.changeMode(five.Five.Mode.Panorama);
6770
+ await five$1.changeMode(five.Five.Mode.Panorama);
6785
6771
  }
6786
6772
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6787
6773
  if (opts.preload)
6788
- yield five$1.preloadPano(args.panoIndex);
6789
- yield new Promise((resolve, reject) => {
6774
+ await five$1.preloadPano(args.panoIndex);
6775
+ await new Promise((resolve, reject) => {
6790
6776
  if (!args.panoIndex) {
6791
6777
  resolve(true);
6792
6778
  return;
@@ -6798,10 +6784,10 @@
6798
6784
  });
6799
6785
  }
6800
6786
  if (opts.asyncEndCallback) {
6801
- yield opts.asyncEndCallback();
6787
+ await opts.asyncEndCallback();
6802
6788
  }
6803
6789
  const { from, to } = getAnimeParams(args);
6804
- return yield new Promise((resolve) => {
6790
+ return await new Promise((resolve) => {
6805
6791
  const onUpdate = ({ progress }) => {
6806
6792
  const state = {};
6807
6793
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -6843,7 +6829,7 @@
6843
6829
  state.interruptCallback(true);
6844
6830
  }, duration);
6845
6831
  });
6846
- });
6832
+ };
6847
6833
  return {
6848
6834
  move,
6849
6835
  rotate,
@@ -7202,7 +7188,7 @@
7202
7188
  state.loaded = true;
7203
7189
  return true;
7204
7190
  };
7205
- const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
7191
+ const load = async (_roomInfo, _roomRules, options) => {
7206
7192
  const roomInfo = _roomInfo || params.roomInfo;
7207
7193
  const roomRules = _roomRules || params.roomRules;
7208
7194
  if (!roomInfo || !roomRules) {
@@ -7213,9 +7199,9 @@
7213
7199
  return _load(roomInfo, roomRules);
7214
7200
  }
7215
7201
  else {
7216
- return yield new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7202
+ return await new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7217
7203
  }
7218
- });
7204
+ };
7219
7205
  if (params.roomInfo && params.roomRules) {
7220
7206
  load(params.roomInfo, params.roomRules);
7221
7207
  }
@@ -7480,14 +7466,12 @@
7480
7466
  }
7481
7467
 
7482
7468
  const textureLoader = new THREE__namespace.TextureLoader();
7483
- function loadTexture(url) {
7484
- return __awaiter(this, void 0, void 0, function* () {
7485
- return new Promise((resolve, reject) => {
7486
- textureLoader.load(url, resolve, undefined, reject);
7487
- }).then((texture) => {
7488
- texture.encoding = THREE__namespace.sRGBEncoding;
7489
- return texture;
7490
- });
7469
+ async function loadTexture(url) {
7470
+ return new Promise((resolve, reject) => {
7471
+ textureLoader.load(url, resolve, undefined, reject);
7472
+ }).then((texture) => {
7473
+ texture.encoding = THREE__namespace.sRGBEncoding;
7474
+ return texture;
7491
7475
  });
7492
7476
  }
7493
7477
 
@@ -7727,65 +7711,59 @@
7727
7711
  if (this.modelLoaded)
7728
7712
  this.init();
7729
7713
  }
7730
- init() {
7731
- return __awaiter(this, void 0, void 0, function* () {
7732
- if (!this.data || !this.modelLoaded)
7733
- return;
7734
- const northRad = this.data.north_rad;
7735
- if (northRad != null) {
7736
- this.compassMesh = yield this.loadCompassMesh();
7737
- this.compassMesh.rotateX(-Math.PI / 2);
7738
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
7739
- this.group.add(this.compassMesh);
7740
- }
7741
- if (this.data.entrance != null) {
7742
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
7743
- this.roomInfoWrapperInstance = this.loadRoomInfo();
7744
- this.roomInfoInstance = getRoomInfoInstance();
7745
- this.entryDoorMesh.rotateX(-Math.PI / 2);
7746
- if (this.roomInfoWrapperInstance)
7747
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7748
- this.group.add(this.entryDoorMesh);
7749
- }
7750
- this.onFivePanoArrived(this.five.panoIndex || 0);
7751
- this.five.needsRender = true;
7752
- });
7753
- }
7754
- loadCompassMesh() {
7714
+ async init() {
7715
+ if (!this.data || !this.modelLoaded)
7716
+ return;
7717
+ const northRad = this.data.north_rad;
7718
+ if (northRad != null) {
7719
+ this.compassMesh = await this.loadCompassMesh();
7720
+ this.compassMesh.rotateX(-Math.PI / 2);
7721
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
7722
+ this.group.add(this.compassMesh);
7723
+ }
7724
+ if (this.data.entrance != null) {
7725
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
7726
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
7727
+ this.roomInfoInstance = getRoomInfoInstance();
7728
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
7729
+ if (this.roomInfoWrapperInstance)
7730
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7731
+ this.group.add(this.entryDoorMesh);
7732
+ }
7733
+ this.onFivePanoArrived(this.five.panoIndex || 0);
7734
+ this.five.needsRender = true;
7735
+ }
7736
+ async loadCompassMesh() {
7755
7737
  var _a;
7756
- return __awaiter(this, void 0, void 0, function* () {
7757
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7758
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7759
- const compassTexture = yield loadTexture(compassImageUrl);
7760
- const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7761
- const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7762
- map: compassTexture,
7763
- transparent: true,
7764
- opacity: 0,
7765
- depthTest: false,
7766
- });
7767
- const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7768
- compassMesh.name = 'pano-compass-mesh';
7769
- return compassMesh;
7738
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7739
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7740
+ const compassTexture = await loadTexture(compassImageUrl);
7741
+ const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7742
+ const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7743
+ map: compassTexture,
7744
+ transparent: true,
7745
+ opacity: 0,
7746
+ depthTest: false,
7770
7747
  });
7748
+ const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7749
+ compassMesh.name = 'pano-compass-mesh';
7750
+ return compassMesh;
7771
7751
  }
7772
- loadEntryDoorMesh() {
7752
+ async loadEntryDoorMesh() {
7773
7753
  var _a;
7774
- return __awaiter(this, void 0, void 0, function* () {
7775
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7776
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7777
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
7778
- const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7779
- const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7780
- map: entryDoorTexture,
7781
- transparent: true,
7782
- opacity: 0.8,
7783
- depthTest: false,
7784
- });
7785
- const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7786
- entryDoorMesh.name = 'pano-compass-entry-door';
7787
- return entryDoorMesh;
7754
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7755
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7756
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
7757
+ const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7758
+ const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7759
+ map: entryDoorTexture,
7760
+ transparent: true,
7761
+ opacity: 0.8,
7762
+ depthTest: false,
7788
7763
  });
7764
+ const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7765
+ entryDoorMesh.name = 'pano-compass-entry-door';
7766
+ return entryDoorMesh;
7789
7767
  }
7790
7768
  loadRoomInfo() {
7791
7769
  const points = [
@@ -10650,11 +10628,6 @@
10650
10628
 
10651
10629
  var Hammer = hammer.exports;
10652
10630
 
10653
- var Hammer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
10654
- __proto__: null,
10655
- 'default': Hammer
10656
- }, [hammer.exports]));
10657
-
10658
10631
  // uuid
10659
10632
  function S4() {
10660
10633
  return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
@@ -11650,7 +11623,7 @@
11650
11623
  const fiveElement = this.five.getElement();
11651
11624
  if (fiveElement) {
11652
11625
  this.fiveElement = fiveElement;
11653
- const hammer = new Hammer$1(fiveElement);
11626
+ const hammer = new Hammer(fiveElement);
11654
11627
  this.hammer = hammer;
11655
11628
  hammer.on('tap', this.onTap);
11656
11629
  hammer.on('pan', this.onPan);
@@ -13213,7 +13186,7 @@
13213
13186
  /* src/PanoSpatialTagPlugin/Components/origins.svelte generated by Svelte v3.47.0 */
13214
13187
 
13215
13188
  function add_css$3(target) {
13216
- internal.append_styles(target, "svelte-scnx9u", ".PanoSpatialTagPlugin__tag-origin.svelte-scnx9u{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-scnx9u:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-scnx9u{transform:translate(-50%, -50%) scale(0.6);animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}");
13189
+ internal.append_styles(target, "svelte-1kuu68s", ".PanoSpatialTagPlugin__tag-origin.svelte-1kuu68s{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;-webkit-animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin 1.2s forwards;animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-1kuu68s:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-1kuu68s{transform:translate(-50%, -50%) scale(0.6);-webkit-animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s;animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@-webkit-keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@-webkit-keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}@keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}");
13217
13190
  }
13218
13191
 
13219
13192
  function get_each_context$1(ctx, list, i) {
@@ -13237,7 +13210,7 @@
13237
13210
  return {
13238
13211
  c() {
13239
13212
  i = internal.element("i");
13240
- internal.attr(i, "class", "svelte-scnx9u");
13213
+ internal.attr(i, "class", "svelte-1kuu68s");
13241
13214
  internal.toggle_class(i, "PanoSpatialTagPlugin__tag-origin", true);
13242
13215
  internal.toggle_class(i, "PanoSpatialTagPlugin__tag-origin-destroy", /*origin*/ ctx[3].destroying);
13243
13216
  internal.set_style(i, "top", style_top, false);
@@ -13362,7 +13335,7 @@
13362
13335
  /* src/PanoSpatialTagPlugin/Components/tag.svelte generated by Svelte v3.47.0 */
13363
13336
 
13364
13337
  function add_css$2(target) {
13365
- internal.append_styles(target, "svelte-1c0xhg0", ".PanoSpatialTagPlugin__tag-x.svelte-1c0xhg0.svelte-1c0xhg0{position:relative;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0.svelte-1c0xhg0{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0{animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0{animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0.svelte-1c0xhg0{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line.svelte-1c0xhg0{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1c0xhg0.svelte-1c0xhg0{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-animate.svelte-1c0xhg0{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content .svelte-1c0xhg0{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}");
13338
+ internal.append_styles(target, "svelte-1wukaol", ".PanoSpatialTagPlugin__tag-x.svelte-1wukaol.svelte-1wukaol{position:relative;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol.svelte-1wukaol{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1wukaol.svelte-1wukaol{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-line1.svelte-1wukaol{-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-line2.svelte-1wukaol{-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol.svelte-1wukaol{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-line.svelte-1wukaol{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1wukaol.svelte-1wukaol{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-animate.svelte-1wukaol{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1wukaol.svelte-1wukaol{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-content .svelte-1wukaol{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-line1.svelte-1wukaol{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-line2.svelte-1wukaol{opacity:0.5;transform:translate(-50%, 0) scaleY(0);-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}");
13366
13339
  }
13367
13340
 
13368
13341
  function create_fragment$2(ctx) {
@@ -13396,19 +13369,19 @@
13396
13369
  t3 = internal.space();
13397
13370
  div3 = internal.element("div");
13398
13371
  div2 = internal.element("div");
13399
- internal.attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-1c0xhg0");
13372
+ internal.attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-1wukaol");
13400
13373
  internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
13401
- internal.attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-1c0xhg0");
13374
+ internal.attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-1wukaol");
13402
13375
  internal.set_style(i0, "width", /*lineWidthZoom*/ ctx[4] + "rem");
13403
- internal.attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-1c0xhg0");
13404
- internal.attr(i2, "class", "PanoSpatialTagPlugin__tag-line2 svelte-1c0xhg0");
13405
- internal.attr(div1, "class", "PanoSpatialTagPlugin__tag-line svelte-1c0xhg0");
13406
- internal.attr(div2, "class", "PanoSpatialTagPlugin__tag-content svelte-1c0xhg0");
13407
- internal.attr(div3, "class", "PanoSpatialTagPlugin__tag-animate svelte-1c0xhg0");
13376
+ internal.attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-1wukaol");
13377
+ internal.attr(i2, "class", "PanoSpatialTagPlugin__tag-line2 svelte-1wukaol");
13378
+ internal.attr(div1, "class", "PanoSpatialTagPlugin__tag-line svelte-1wukaol");
13379
+ internal.attr(div2, "class", "PanoSpatialTagPlugin__tag-content svelte-1wukaol");
13380
+ internal.attr(div3, "class", "PanoSpatialTagPlugin__tag-animate svelte-1wukaol");
13408
13381
  internal.set_style(div3, "transform", "scale(" + /*contentZoom*/ ctx[3] * 3 + ")");
13409
13382
  internal.attr(div4, "id", div4_id_value = 'PanoSpatialTagPlugin__' + /*id*/ ctx[0]);
13410
13383
  internal.set_style(div4, "height", 20 * /*lineHeightZoom*/ ctx[5] + "rem");
13411
- internal.attr(div4, "class", "svelte-1c0xhg0");
13384
+ internal.attr(div4, "class", "svelte-1wukaol");
13412
13385
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-x", true);
13413
13386
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-upside-down", /*upsideDown*/ ctx[1]);
13414
13387
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-show", /*show*/ ctx[10]);
@@ -14275,7 +14248,7 @@
14275
14248
  /* src/ModelItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
14276
14249
 
14277
14250
  function add_css$1(target) {
14278
- internal.append_styles(target, "svelte-1mttyji", ".item-label-item.svelte-1mttyji{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1mttyji{opacity:1;animation:svelte-1mttyji-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1mttyji::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(16px);z-index:-1}.item-label-item__text-wrap.svelte-1mttyji{padding:6px 6px 0;position:absolute;height:20px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:10px;font-size:11px;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1mttyji{padding-bottom:4px;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1mttyji{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1mttyji-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
14251
+ internal.append_styles(target, "svelte-1hzvil1", ".item-label-item.svelte-1hzvil1{position:absolute;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;opacity:0}.item-label-item.visible.svelte-1hzvil1{opacity:1;-webkit-animation:svelte-1hzvil1-fadeIn .3s ease-in;animation:svelte-1hzvil1-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1hzvil1::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-1hzvil1{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1hzvil1{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1hzvil1{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@-webkit-keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}@keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
14279
14252
  }
14280
14253
 
14281
14254
  function create_fragment$1(ctx) {
@@ -14302,12 +14275,12 @@
14302
14275
  t0 = internal.text(t0_value);
14303
14276
  t1 = internal.space();
14304
14277
  div1 = internal.element("div");
14305
- internal.attr(span, "class", "item-label-item__text svelte-1mttyji");
14306
- internal.attr(div0, "class", "item-label-item__text-wrap svelte-1mttyji");
14278
+ internal.attr(span, "class", "item-label-item__text svelte-1hzvil1");
14279
+ internal.attr(div0, "class", "item-label-item__text-wrap svelte-1hzvil1");
14307
14280
  internal.set_style(div0, "top", `-${/*itemLabel*/ ctx[0].strokeLength + 26}px`);
14308
- internal.attr(div1, "class", "item-label-item__bar svelte-1mttyji");
14281
+ internal.attr(div1, "class", "item-label-item__bar svelte-1hzvil1");
14309
14282
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
14310
- internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"));
14283
+ internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"));
14311
14284
  internal.set_style(div2, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
14312
14285
  internal.set_style(div2, "transform", /*itemLabel*/ ctx[0].transform, false);
14313
14286
  },
@@ -14337,7 +14310,7 @@
14337
14310
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
14338
14311
  }
14339
14312
 
14340
- if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"))) {
14313
+ if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"))) {
14341
14314
  internal.attr(div2, "class", div2_class_value);
14342
14315
  }
14343
14316
 
@@ -14401,7 +14374,7 @@
14401
14374
  /* src/ModelItemLabelPlugin/ItemLabelComponent.svelte generated by Svelte v3.47.0 */
14402
14375
 
14403
14376
  function add_css(target) {
14404
- internal.append_styles(target, "svelte-rmdeb", ".item-labels-container.svelte-rmdeb{width:100%;height:100%;position:relative}");
14377
+ internal.append_styles(target, "svelte-gk8s47", ".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}");
14405
14378
  }
14406
14379
 
14407
14380
  function get_each_context(ctx, list, i) {
@@ -14482,7 +14455,7 @@
14482
14455
  each_blocks[i].c();
14483
14456
  }
14484
14457
 
14485
- internal.attr(div, "class", "item-labels-container svelte-rmdeb");
14458
+ internal.attr(div, "class", "item-labels-container svelte-gk8s47");
14486
14459
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
14487
14460
  internal.set_style(div, "opacity", /*itemsVisible*/ ctx[4] ? 1 : 0, false);
14488
14461
  },
@@ -15070,7 +15043,7 @@
15070
15043
  xhr.send();
15071
15044
  });
15072
15045
  };
15073
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
15046
+ const load = async (data, videoElement) => {
15074
15047
  const { video_src, video_poster_src, points } = data;
15075
15048
  state.videoSource = video_src;
15076
15049
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -15080,11 +15053,11 @@
15080
15053
  if (videoElement) {
15081
15054
  state.videoElement = videoElement;
15082
15055
  }
15083
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
15056
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
15084
15057
  state.enabled = !!data.enable;
15085
15058
  if (state.enabled)
15086
15059
  enable();
15087
- });
15060
+ };
15088
15061
  const dispose = () => {
15089
15062
  disable();
15090
15063
  state.videoTexture = undefined;