@realsee/dnalogel 2.0.0-alpha.18 → 2.0.0-alpha.20

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 (177) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  10. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  11. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  13. package/dist/ModelTVVideoPlugin/index.js +3 -28
  14. package/dist/PanoCompassPlugin/index.js +53 -86
  15. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  16. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  17. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  19. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  21. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  22. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  23. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  25. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  27. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  28. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  33. package/dist/PanoMeasurePlugin/index.js +2 -0
  34. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  35. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  36. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  37. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  38. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  41. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  42. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  43. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  44. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  45. package/dist/PanoRulerPlugin/index.js +3 -28
  46. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  47. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  48. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  49. package/dist/floorplan/ModelFloorplanPlugin/index.js +1253 -1284
  50. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +61 -183
  51. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  52. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  53. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1243 -1235
  54. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  55. package/dist/index.es.js +1431 -1435
  56. package/dist/index.js +1430 -1434
  57. package/dist/index.umd.js +1430 -1434
  58. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  59. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  60. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  61. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  62. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  63. package/docs/assets/search.js +1 -1
  64. package/docs/classes/ModelRoomLabelController.html +6 -6
  65. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  66. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  67. package/docs/interfaces/LineJson.html +1 -1
  68. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  69. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  70. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  72. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  73. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  74. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  75. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  76. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  78. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  80. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  82. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  83. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  84. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  85. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  87. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/RoomLabel.html +7 -7
  93. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  94. package/docs/modules.html +12 -12
  95. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  96. package/libs/CameraMovementPlugin/index.js +15 -24
  97. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  98. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  99. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  100. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  101. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  102. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  103. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  104. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  105. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  106. package/libs/ModelTVVideoPlugin/index.js +3 -12
  107. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  108. package/libs/PanoCompassPlugin/index.js +49 -64
  109. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  110. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  111. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  112. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  113. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  114. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  115. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  116. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  117. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  118. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  119. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  120. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  121. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  122. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  123. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  124. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  125. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  126. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +2 -0
  128. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  130. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  133. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  135. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  136. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  138. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  139. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  140. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  141. package/libs/PanoRulerPlugin/index.js +3 -12
  142. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  143. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  144. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  145. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  146. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  149. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  150. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  152. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  153. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  154. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  156. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  157. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  158. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  159. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  160. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  161. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  162. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  163. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  164. package/libs/floorplan/utils/formatData.js +28 -43
  165. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  166. package/libs/floorplan/utils/formatPosition.js +2 -2
  167. package/libs/shared-utils/five/changeMode.js +12 -23
  168. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  169. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  170. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  171. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  172. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  173. package/libs/shared-utils/three/loadTexture.js +6 -17
  174. package/libs/shared-utils/to.js +10 -21
  175. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  176. package/package.json +2 -2
  177. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
@@ -27,37 +27,11 @@ function _interopNamespace(e) {
27
27
 
28
28
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
29
29
 
30
- /*! *****************************************************************************
31
- Copyright (c) Microsoft Corporation.
32
-
33
- Permission to use, copy, modify, and/or distribute this software for any
34
- purpose with or without fee is hereby granted.
35
-
36
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
- PERFORMANCE OF THIS SOFTWARE.
43
- ***************************************************************************** */
44
-
45
- function __awaiter(thisArg, _arguments, P, generator) {
46
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
47
- return new (P || (P = Promise))(function (resolve, reject) {
48
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
49
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
50
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
51
- step((generator = generator.apply(thisArg, _arguments || [])).next());
52
- });
53
- }
54
-
55
30
  const pluginStyle = {
56
31
  position: 'absolute',
57
32
  left: '50%',
58
33
  top: '50%',
59
34
  transform: 'translate(-50%, -50%)',
60
- pointerEvents: 'none',
61
35
  zIndex: '10',
62
36
  };
63
37
 
@@ -82,31 +56,27 @@ function pathD(points, options = {}) {
82
56
  return d + (needZ ? 'Z' : '');
83
57
  }
84
58
  /** 把户型图上点点位转换到 SVG 上的点位 */
85
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
59
+ function formatFloorplanPoint({ x, y }, bounding) {
86
60
  const { max, min } = bounding;
87
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
88
- }
89
-
90
- function formatOutlines(outlines) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const headers = new Headers({ 'Content-Type': 'text/plain' });
93
- const getOutlineItem = function (item) {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- const outlineItem = {
96
- index: item.index,
97
- url: item.url,
98
- svgUrl: item.svg_url,
99
- };
100
- if (item.svg_url) {
101
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
102
- outlineItem.svgContent = svgContent;
103
- }
104
- return outlineItem;
105
- });
61
+ return { x: x - min.x, y: max.y - y };
62
+ }
63
+
64
+ async function formatOutlines(outlines) {
65
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
66
+ const getOutlineItem = async function (item) {
67
+ const outlineItem = {
68
+ index: item.index,
69
+ url: item.url,
70
+ svgUrl: item.svg_url,
106
71
  };
107
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
108
- return svgOutlineItems;
109
- });
72
+ if (item.svg_url) {
73
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
74
+ outlineItem.svgContent = svgContent;
75
+ }
76
+ return outlineItem;
77
+ };
78
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
79
+ return svgOutlineItems;
110
80
  }
111
81
  function formatRoom(data) {
112
82
  const floorplanRoomItem = {
@@ -152,50 +122,19 @@ function formatFloorplanEntrance(data) {
152
122
  };
153
123
  return floorplanEntrance;
154
124
  }
155
- function formatData(data) {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const outlines = yield formatOutlines(data.outlines);
158
- const bounding = data.computed_data.bounding;
159
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
160
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
161
- const floorplanData = {
162
- outlines,
163
- entrance,
164
- bounding,
165
- floorDatas,
166
- observers: data.computed_data.observers.map(formateFloorplanObserver),
167
- };
168
- return floorplanData;
169
- });
170
- }
171
-
172
- /**
173
- * 把第一个参数传入第二个参数(函数)中并执行
174
- * 一般用于执行函数后返回变量。
175
- * @param {any} something
176
- * @param {function} callback
177
- * @return {any}
178
- */
179
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
180
- function tap(something, callback) {
181
- callback(something);
182
- return something;
183
- }
184
-
185
- /**
186
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
187
- * @param object
188
- * @param props 排除的属性
189
- * @return
190
- */
191
- function omit(object, props) {
192
- return tap({}, (result) => {
193
- for (const name in object) {
194
- if (props.indexOf(name) !== -1)
195
- continue;
196
- result[name] = object[name];
197
- }
198
- });
125
+ async function formatData(data) {
126
+ const outlines = await formatOutlines(data.outlines);
127
+ const bounding = data.computed_data.bounding;
128
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
129
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
130
+ const floorplanData = {
131
+ outlines,
132
+ entrance,
133
+ bounding,
134
+ floorDatas,
135
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
136
+ };
137
+ return floorplanData;
199
138
  }
200
139
 
201
140
  var FLOOR_PLAN_ATTACHED_TO;
@@ -238,15 +177,44 @@ function getPxmm(five, container, floorIndex, options) {
238
177
  return pxmm;
239
178
  }
240
179
 
180
+ /**
181
+ * 把第一个参数传入第二个参数(函数)中并执行
182
+ * 一般用于执行函数后返回变量。
183
+ * @param {any} something
184
+ * @param {function} callback
185
+ * @return {any}
186
+ */
187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
+ function tap(something, callback) {
189
+ callback(something);
190
+ return something;
191
+ }
192
+
193
+ /**
194
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
195
+ * @param object
196
+ * @param props 排除的属性
197
+ * @return
198
+ */
199
+ function omit(object, props) {
200
+ return tap({}, (result) => {
201
+ for (const name in object) {
202
+ if (props.indexOf(name) !== -1)
203
+ continue;
204
+ result[name] = object[name];
205
+ }
206
+ });
207
+ }
208
+
241
209
  const CAMERA_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/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GFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==';
242
210
 
243
211
  function rad2Deg$1(rad) {
244
212
  return (rad * 180) / Math.PI;
245
213
  }
246
214
 
247
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
215
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
248
216
 
249
- function add_css$c(target) {
217
+ function add_css$d(target) {
250
218
  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%}");
251
219
  }
252
220
 
@@ -342,16 +310,16 @@ class Camera extends internal.SvelteComponent {
342
310
  lastPanoramaLongitude: 7,
343
311
  cameraImageUrl: 0
344
312
  },
345
-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TsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=';
351
319
 
352
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
320
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
353
321
 
354
- function add_css$b(target) {
322
+ function add_css$c(target) {
355
323
  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}");
356
324
  }
357
325
 
@@ -444,345 +412,271 @@ function instance$f($$self, $$props, $$invalidate) {
444
412
  class Compass extends internal.SvelteComponent {
445
413
  constructor(options) {
446
414
  super();
447
- internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$b);
415
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$c);
448
416
  }
449
417
  }
450
418
 
451
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
419
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
452
420
 
453
- function add_css$a(target) {
454
- 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}");
421
+ function add_css$b(target) {
422
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
455
423
  }
456
424
 
457
- // (22:30)
458
- function create_if_block_1$4(ctx) {
459
- let html_tag;
460
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
461
- let html_anchor;
425
+ function create_fragment$e(ctx) {
426
+ let img;
427
+ let img_src_value;
462
428
 
463
429
  return {
464
430
  c() {
465
- html_tag = new internal.HtmlTag();
466
- html_anchor = internal.empty();
467
- html_tag.a = html_anchor;
431
+ img = internal.element("img");
432
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
433
+ internal.attr(img, "alt", "floorplan iamge");
434
+ internal.attr(img, "class", "svelte-1gfoniz");
468
435
  },
469
436
  m(target, anchor) {
470
- html_tag.m(raw_value, target, anchor);
471
- internal.insert(target, html_anchor, anchor);
437
+ internal.insert(target, img, anchor);
472
438
  },
473
- p(ctx, dirty) {
474
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
439
+ p(ctx, [dirty]) {
440
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
441
+ internal.attr(img, "src", img_src_value);
442
+ }
475
443
  },
444
+ i: internal.noop,
445
+ o: internal.noop,
476
446
  d(detaching) {
477
- if (detaching) internal.detach(html_anchor);
478
- if (detaching) html_tag.d();
447
+ if (detaching) internal.detach(img);
479
448
  }
480
449
  };
481
450
  }
482
451
 
483
- // (16:2) {#if getLabelElement === undefined}
484
- function create_if_block$5(ctx) {
485
- let span0;
486
- let t0_value = /*room*/ ctx[0].name + "";
487
- let t0;
488
- let t1;
489
- let span1;
452
+ function instance$e($$self, $$props, $$invalidate) {
453
+ let { url } = $$props;
490
454
 
491
- return {
492
- c() {
493
- span0 = internal.element("span");
494
- t0 = internal.text(t0_value);
495
- t1 = internal.space();
496
- span1 = internal.element("span");
497
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
498
- internal.attr(span0, "class", "floorplan-plugin__room-name");
499
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
500
- },
501
- m(target, anchor) {
502
- internal.insert(target, span0, anchor);
503
- internal.append(span0, t0);
504
- internal.insert(target, t1, anchor);
505
- internal.insert(target, span1, anchor);
506
- },
507
- p(ctx, dirty) {
508
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
509
- },
510
- d(detaching) {
511
- if (detaching) internal.detach(span0);
512
- if (detaching) internal.detach(t1);
513
- if (detaching) internal.detach(span1);
514
- }
455
+ $$self.$$set = $$props => {
456
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
515
457
  };
516
- }
517
458
 
518
- function create_fragment$e(ctx) {
519
- let div;
459
+ return [url];
460
+ }
520
461
 
521
- function select_block_type(ctx, dirty) {
522
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$5;
523
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
462
+ class Normalmage extends internal.SvelteComponent {
463
+ constructor(options) {
464
+ super();
465
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { url: 0 }, add_css$b);
524
466
  }
467
+ }
525
468
 
526
- let current_block_type = select_block_type(ctx);
527
- let if_block = current_block_type && current_block_type(ctx);
469
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
470
+
471
+ function add_css$a(target) {
472
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
473
+ }
474
+
475
+ function create_fragment$d(ctx) {
476
+ let div;
477
+ let html_tag;
478
+ let t;
479
+ let html_tag_1;
528
480
 
529
481
  return {
530
482
  c() {
531
483
  div = internal.element("div");
532
- if (if_block) if_block.c();
533
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
534
- internal.set_style(div, "left", /*left*/ ctx[4], false);
535
- internal.set_style(div, "top", /*top*/ ctx[5], false);
536
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
484
+ html_tag = new internal.HtmlTag();
485
+ t = internal.space();
486
+ html_tag_1 = new internal.HtmlTag();
487
+ html_tag.a = t;
488
+ html_tag_1.a = null;
489
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
537
490
  },
538
491
  m(target, anchor) {
539
492
  internal.insert(target, div, anchor);
540
- if (if_block) if_block.m(div, null);
493
+ html_tag.m(/*svgStyle*/ ctx[1], div);
494
+ internal.append(div, t);
495
+ html_tag_1.m(/*content*/ ctx[0], div);
541
496
  },
542
497
  p(ctx, [dirty]) {
543
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
544
- if_block.p(ctx, dirty);
545
- } else {
546
- if (if_block) if_block.d(1);
547
- if_block = current_block_type && current_block_type(ctx);
548
-
549
- if (if_block) {
550
- if_block.c();
551
- if_block.m(div, null);
552
- }
553
- }
498
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
554
499
  },
555
500
  i: internal.noop,
556
501
  o: internal.noop,
557
502
  d(detaching) {
558
503
  if (detaching) internal.detach(div);
559
-
560
- if (if_block) {
561
- if_block.d();
562
- }
563
504
  }
564
505
  };
565
506
  }
566
507
 
567
- function instance$e($$self, $$props, $$invalidate) {
568
- let userConfigElement;
569
- let { room } = $$props;
570
- let { getLabelElement } = $$props;
571
-
572
- // TODO: 统一这里的判断条件,目前写了多处
573
- const bodyWidth = document.body.clientWidth;
508
+ function instance$d($$self, $$props, $$invalidate) {
509
+ let { content } = $$props;
574
510
 
575
- const bodyHeight = document.body.clientHeight;
576
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
577
- const roomLabel = room.roomLabel;
578
- const left = roomLabel.positionInImage.x * 100 + '%';
579
- const top = roomLabel.positionInImage.y * 100 + '%';
580
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
511
+ const svgStyle = `
512
+ <style>
513
+ svg [type='lineGroup'] path {
514
+ fill: #ffffff;
515
+ stroke: #ffffff;
516
+ }
517
+ svg [type='lineItemGroup'] g g g g {
518
+ stroke: #ffffff;
519
+ }</style>
520
+ `;
581
521
 
582
522
  $$self.$$set = $$props => {
583
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
584
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
585
- };
586
-
587
- $$self.$$.update = () => {
588
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
589
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
590
- ? void 0
591
- : getLabelElement(room));
592
- }
523
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
593
524
  };
594
525
 
595
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
526
+ return [content, svgStyle];
596
527
  }
597
528
 
598
- class RoomLabel extends internal.SvelteComponent {
529
+ class SvgImage extends internal.SvelteComponent {
599
530
  constructor(options) {
600
531
  super();
601
- internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$a);
532
+ internal.init(this, options, instance$d, create_fragment$d, internal.safe_not_equal, { content: 0 }, add_css$a);
602
533
  }
603
534
  }
604
535
 
605
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
536
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
606
537
 
607
538
  function add_css$9(target) {
608
- internal.append_styles(target, "svelte-vkeyjz", ".floorplan-plugin__room-labels.svelte-vkeyjz{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
609
- }
610
-
611
- function get_each_context$4(ctx, list, i) {
612
- const child_ctx = ctx.slice();
613
- child_ctx[4] = list[i];
614
- return child_ctx;
539
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
615
540
  }
616
541
 
617
- // (8:0) {#if rooms}
618
- function create_if_block$4(ctx) {
619
- let div;
620
- let each_blocks = [];
621
- let each_1_lookup = new Map();
542
+ // (13:22)
543
+ function create_if_block_1$4(ctx) {
544
+ let normalimage;
622
545
  let current;
623
- let each_value = /*rooms*/ ctx[1];
624
- const get_key = ctx => /*room*/ ctx[4].id;
625
-
626
- for (let i = 0; i < each_value.length; i += 1) {
627
- let child_ctx = get_each_context$4(ctx, each_value, i);
628
- let key = get_key(child_ctx);
629
- each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
630
- }
546
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
631
547
 
632
548
  return {
633
549
  c() {
634
- div = internal.element("div");
635
-
636
- for (let i = 0; i < each_blocks.length; i += 1) {
637
- each_blocks[i].c();
638
- }
639
-
640
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-vkeyjz");
550
+ internal.create_component(normalimage.$$.fragment);
641
551
  },
642
552
  m(target, anchor) {
643
- internal.insert(target, div, anchor);
644
-
645
- for (let i = 0; i < each_blocks.length; i += 1) {
646
- each_blocks[i].m(div, null);
647
- }
648
-
553
+ internal.mount_component(normalimage, target, anchor);
649
554
  current = true;
650
555
  },
651
556
  p(ctx, dirty) {
652
- if (dirty & /*rooms, getLabelElement*/ 3) {
653
- each_value = /*rooms*/ ctx[1];
654
- internal.group_outros();
655
- 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$4, null, get_each_context$4);
656
- internal.check_outros();
657
- }
557
+ const normalimage_changes = {};
558
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
559
+ normalimage.$set(normalimage_changes);
658
560
  },
659
561
  i(local) {
660
562
  if (current) return;
661
-
662
- for (let i = 0; i < each_value.length; i += 1) {
663
- internal.transition_in(each_blocks[i]);
664
- }
665
-
563
+ internal.transition_in(normalimage.$$.fragment, local);
666
564
  current = true;
667
565
  },
668
566
  o(local) {
669
- for (let i = 0; i < each_blocks.length; i += 1) {
670
- internal.transition_out(each_blocks[i]);
671
- }
672
-
567
+ internal.transition_out(normalimage.$$.fragment, local);
673
568
  current = false;
674
569
  },
675
570
  d(detaching) {
676
- if (detaching) internal.detach(div);
677
-
678
- for (let i = 0; i < each_blocks.length; i += 1) {
679
- each_blocks[i].d();
680
- }
571
+ internal.destroy_component(normalimage, detaching);
681
572
  }
682
573
  };
683
574
  }
684
575
 
685
- // (10:4) {#each rooms as room (room.id)}
686
- function create_each_block$4(key_1, ctx) {
687
- let first;
688
- let roomlabel;
576
+ // (11:2) {#if svgContent}
577
+ function create_if_block$5(ctx) {
578
+ let svgimage;
689
579
  let current;
690
580
 
691
- const roomlabel_spread_levels = [
692
- {
693
- room: /*room*/ ctx[4],
694
- getLabelElement: /*getLabelElement*/ ctx[0]
695
- }
696
- ];
697
-
698
- let roomlabel_props = {};
699
-
700
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
701
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
702
- }
703
-
704
- roomlabel = new RoomLabel({ props: roomlabel_props });
581
+ svgimage = new SvgImage({
582
+ props: { content: /*svgContent*/ ctx[0] }
583
+ });
705
584
 
706
585
  return {
707
- key: key_1,
708
- first: null,
709
586
  c() {
710
- first = internal.empty();
711
- internal.create_component(roomlabel.$$.fragment);
712
- this.first = first;
587
+ internal.create_component(svgimage.$$.fragment);
713
588
  },
714
589
  m(target, anchor) {
715
- internal.insert(target, first, anchor);
716
- internal.mount_component(roomlabel, target, anchor);
590
+ internal.mount_component(svgimage, target, anchor);
717
591
  current = true;
718
592
  },
719
- p(new_ctx, dirty) {
720
- ctx = new_ctx;
721
-
722
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
723
- ? internal.get_spread_update(roomlabel_spread_levels, [
724
- {
725
- room: /*room*/ ctx[4],
726
- getLabelElement: /*getLabelElement*/ ctx[0]
727
- }
728
- ])
729
- : {};
730
-
731
- roomlabel.$set(roomlabel_changes);
593
+ p(ctx, dirty) {
594
+ const svgimage_changes = {};
595
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
596
+ svgimage.$set(svgimage_changes);
732
597
  },
733
598
  i(local) {
734
599
  if (current) return;
735
- internal.transition_in(roomlabel.$$.fragment, local);
600
+ internal.transition_in(svgimage.$$.fragment, local);
736
601
  current = true;
737
602
  },
738
603
  o(local) {
739
- internal.transition_out(roomlabel.$$.fragment, local);
604
+ internal.transition_out(svgimage.$$.fragment, local);
740
605
  current = false;
741
606
  },
742
607
  d(detaching) {
743
- if (detaching) internal.detach(first);
744
- internal.destroy_component(roomlabel, detaching);
608
+ internal.destroy_component(svgimage, detaching);
745
609
  }
746
610
  };
747
611
  }
748
612
 
749
- function create_fragment$d(ctx) {
750
- let if_block_anchor;
613
+ function create_fragment$c(ctx) {
614
+ let div;
615
+ let current_block_type_index;
616
+ let if_block;
751
617
  let current;
752
- let if_block = /*rooms*/ ctx[1] && create_if_block$4(ctx);
618
+ const if_block_creators = [create_if_block$5, create_if_block_1$4];
619
+ const if_blocks = [];
620
+
621
+ function select_block_type(ctx, dirty) {
622
+ if (/*svgContent*/ ctx[0]) return 0;
623
+ if (/*imageData*/ ctx[1]) return 1;
624
+ return -1;
625
+ }
626
+
627
+ if (~(current_block_type_index = select_block_type(ctx))) {
628
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
629
+ }
753
630
 
754
631
  return {
755
632
  c() {
633
+ div = internal.element("div");
756
634
  if (if_block) if_block.c();
757
- if_block_anchor = internal.empty();
635
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
758
636
  },
759
637
  m(target, anchor) {
760
- if (if_block) if_block.m(target, anchor);
761
- internal.insert(target, if_block_anchor, anchor);
638
+ internal.insert(target, div, anchor);
639
+
640
+ if (~current_block_type_index) {
641
+ if_blocks[current_block_type_index].m(div, null);
642
+ }
643
+
762
644
  current = true;
763
645
  },
764
646
  p(ctx, [dirty]) {
765
- if (/*rooms*/ ctx[1]) {
647
+ let previous_block_index = current_block_type_index;
648
+ current_block_type_index = select_block_type(ctx);
649
+
650
+ if (current_block_type_index === previous_block_index) {
651
+ if (~current_block_type_index) {
652
+ if_blocks[current_block_type_index].p(ctx, dirty);
653
+ }
654
+ } else {
766
655
  if (if_block) {
767
- if_block.p(ctx, dirty);
656
+ internal.group_outros();
768
657
 
769
- if (dirty & /*rooms*/ 2) {
770
- internal.transition_in(if_block, 1);
771
- }
772
- } else {
773
- if_block = create_if_block$4(ctx);
774
- if_block.c();
775
- internal.transition_in(if_block, 1);
776
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
658
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
659
+ if_blocks[previous_block_index] = null;
660
+ });
661
+
662
+ internal.check_outros();
777
663
  }
778
- } else if (if_block) {
779
- internal.group_outros();
780
664
 
781
- internal.transition_out(if_block, 1, 1, () => {
782
- if_block = null;
783
- });
665
+ if (~current_block_type_index) {
666
+ if_block = if_blocks[current_block_type_index];
784
667
 
785
- internal.check_outros();
668
+ if (!if_block) {
669
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
670
+ if_block.c();
671
+ } else {
672
+ if_block.p(ctx, dirty);
673
+ }
674
+
675
+ internal.transition_in(if_block, 1);
676
+ if_block.m(div, null);
677
+ } else {
678
+ if_block = null;
679
+ }
786
680
  }
787
681
  },
788
682
  i(local) {
@@ -795,434 +689,230 @@ function create_fragment$d(ctx) {
795
689
  current = false;
796
690
  },
797
691
  d(detaching) {
798
- if (if_block) if_block.d(detaching);
799
- if (detaching) internal.detach(if_block_anchor);
692
+ if (detaching) internal.detach(div);
693
+
694
+ if (~current_block_type_index) {
695
+ if_blocks[current_block_type_index].d();
696
+ }
800
697
  }
801
698
  };
802
699
  }
803
700
 
804
- function instance$d($$self, $$props, $$invalidate) {
805
- let rooms;
701
+ function instance$c($$self, $$props, $$invalidate) {
702
+ let imageData;
703
+ let svgContent;
704
+ var _a, _b;
806
705
  let { floorIndex } = $$props;
807
706
  let { floorplanData } = $$props;
808
- let { getLabelElement } = $$props;
809
707
 
810
708
  $$self.$$set = $$props => {
811
709
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
812
710
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
813
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
814
711
  };
815
712
 
816
713
  $$self.$$.update = () => {
817
714
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
818
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
715
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
716
+ }
717
+
718
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
719
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
720
+ ? void 0
721
+ : _a[floorIndex]) === null || _b === void 0
722
+ ? void 0
723
+ : _b.svgContent);
819
724
  }
820
725
  };
821
726
 
822
- return [getLabelElement, rooms, floorIndex, floorplanData];
727
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
823
728
  }
824
729
 
825
- class RoomLabels extends internal.SvelteComponent {
730
+ class BaseImage extends internal.SvelteComponent {
826
731
  constructor(options) {
827
732
  super();
828
-
829
- internal.init(
830
- this,
831
- options,
832
- instance$d,
833
- create_fragment$d,
834
- internal.safe_not_equal,
835
- {
836
- floorIndex: 2,
837
- floorplanData: 3,
838
- getLabelElement: 0
839
- },
840
- add_css$9
841
- );
733
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$9);
842
734
  }
843
735
  }
844
736
 
845
- /**
846
- * 判断对象是否为`null`或`undefined`。
847
- * @param
848
- * @return
849
- */
850
- /**
851
- * 判断对象不为`null`或`undefined`。
852
- */
853
- function notNil(value) {
854
- return value !== null && value !== undefined;
855
- }
856
-
857
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
737
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
858
738
 
859
739
  function add_css$8(target) {
860
- internal.append_styles(target, "svelte-1d5a0k4", ".floorplan-plugin__rule-labels.svelte-1d5a0k4{position:absolute;height:0.26042rem;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1d5a0k4{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1d5a0k4{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1d5a0k4{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1d5a0k4{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1d5a0k4{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1d5a0k4{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:0.26042rem}.floorplan-plugin__text-wrapper.svelte-1d5a0k4{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1d5a0k4{top:0.52083rem}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1d5a0k4{bottom:0.52083rem}.floorplan-plugin__rule-text.svelte-1d5a0k4{position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:0.52083rem;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1d5a0k4{transform:translate(-50%, -50%)}");
861
- }
862
-
863
- function get_each_context$3(ctx, list, i) {
864
- const child_ctx = ctx.slice();
865
- child_ctx[24] = list[i];
866
- child_ctx[26] = i;
867
- return child_ctx;
868
- }
869
-
870
- function get_each_context_1(ctx, list, i) {
871
- const child_ctx = ctx.slice();
872
- child_ctx[27] = list[i];
873
- child_ctx[29] = i;
874
- return child_ctx;
740
+ 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}");
875
741
  }
876
742
 
877
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
878
- function create_each_block_1(key_1, ctx) {
879
- let div;
880
- let style_left = `${/*position*/ ctx[27]}px`;
743
+ // (22:30)
744
+ function create_if_block_1$3(ctx) {
745
+ let html_tag;
746
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
747
+ let html_anchor;
881
748
 
882
749
  return {
883
- key: key_1,
884
- first: null,
885
750
  c() {
886
- div = internal.element("div");
887
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1d5a0k4");
888
- internal.set_style(div, "left", style_left, false);
889
- this.first = div;
751
+ html_tag = new internal.HtmlTag();
752
+ html_anchor = internal.empty();
753
+ html_tag.a = html_anchor;
890
754
  },
891
755
  m(target, anchor) {
892
- internal.insert(target, div, anchor);
756
+ html_tag.m(raw_value, target, anchor);
757
+ internal.insert(target, html_anchor, anchor);
893
758
  },
894
- p(new_ctx, dirty) {
895
- ctx = new_ctx;
759
+ p(ctx, dirty) {
760
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
896
761
  },
897
762
  d(detaching) {
898
- if (detaching) internal.detach(div);
763
+ if (detaching) internal.detach(html_anchor);
764
+ if (detaching) html_tag.d();
899
765
  }
900
766
  };
901
767
  }
902
768
 
903
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
904
- function create_each_block$3(key_1, ctx) {
905
- let div;
906
- let span;
907
- let t0_value = /*textItem*/ ctx[24].distance + "";
908
- let t0;
909
- let t1;
910
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
769
+ // (16:2) {#if getLabelElement === undefined}
770
+ function create_if_block$4(ctx) {
771
+ let span0;
772
+ let t0_value = /*room*/ ctx[0].name + "";
773
+ let t0;
774
+ let t1;
775
+ let span1;
911
776
 
912
777
  return {
913
- key: key_1,
914
- first: null,
915
778
  c() {
916
- div = internal.element("div");
917
- span = internal.element("span");
779
+ span0 = internal.element("span");
918
780
  t0 = internal.text(t0_value);
919
781
  t1 = internal.space();
920
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1d5a0k4");
921
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
922
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1d5a0k4");
923
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
924
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
925
- internal.set_style(div, "left", style_left, false);
926
- this.first = div;
782
+ span1 = internal.element("span");
783
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
784
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
785
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
927
786
  },
928
787
  m(target, anchor) {
929
- internal.insert(target, div, anchor);
930
- internal.append(div, span);
931
- internal.append(span, t0);
932
- internal.append(div, t1);
788
+ internal.insert(target, span0, anchor);
789
+ internal.append(span0, t0);
790
+ internal.insert(target, t1, anchor);
791
+ internal.insert(target, span1, anchor);
933
792
  },
934
- p(new_ctx, dirty) {
935
- ctx = new_ctx;
793
+ p(ctx, dirty) {
794
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
936
795
  },
937
796
  d(detaching) {
938
- if (detaching) internal.detach(div);
797
+ if (detaching) internal.detach(span0);
798
+ if (detaching) internal.detach(t1);
799
+ if (detaching) internal.detach(span1);
939
800
  }
940
801
  };
941
802
  }
942
803
 
943
- function create_fragment$c(ctx) {
944
- let div1;
945
- let div0;
946
- let t0;
947
- let each_blocks_1 = [];
948
- let each0_lookup = new Map();
949
- let t1;
950
- let each_blocks = [];
951
- let each1_lookup = new Map();
952
- let div1_class_value;
953
- let each_value_1 = /*positionPxArray*/ ctx[6];
954
- const get_key = ctx => /*positionIndex*/ ctx[29];
804
+ function create_fragment$b(ctx) {
805
+ let div;
955
806
 
956
- for (let i = 0; i < each_value_1.length; i += 1) {
957
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
958
- let key = get_key(child_ctx);
959
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
807
+ function select_block_type(ctx, dirty) {
808
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$4;
809
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
960
810
  }
961
811
 
962
- let each_value = /*textArray*/ ctx[10];
963
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
964
-
965
- for (let i = 0; i < each_value.length; i += 1) {
966
- let child_ctx = get_each_context$3(ctx, each_value, i);
967
- let key = get_key_1(child_ctx);
968
- each1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
969
- }
812
+ let current_block_type = select_block_type(ctx);
813
+ let if_block = current_block_type && current_block_type(ctx);
970
814
 
971
815
  return {
972
816
  c() {
973
- div1 = internal.element("div");
974
- div0 = internal.element("div");
975
- t0 = internal.space();
976
-
977
- for (let i = 0; i < each_blocks_1.length; i += 1) {
978
- each_blocks_1[i].c();
979
- }
980
-
981
- t1 = internal.space();
982
-
983
- for (let i = 0; i < each_blocks.length; i += 1) {
984
- each_blocks[i].c();
985
- }
986
-
987
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1d5a0k4");
988
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4");
989
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
990
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
991
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
817
+ div = internal.element("div");
818
+ if (if_block) if_block.c();
819
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
820
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
821
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
822
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
992
823
  },
993
824
  m(target, anchor) {
994
- internal.insert(target, div1, anchor);
995
- internal.append(div1, div0);
996
- internal.append(div1, t0);
997
-
998
- for (let i = 0; i < each_blocks_1.length; i += 1) {
999
- each_blocks_1[i].m(div1, null);
1000
- }
1001
-
1002
- internal.append(div1, t1);
1003
-
1004
- for (let i = 0; i < each_blocks.length; i += 1) {
1005
- each_blocks[i].m(div1, null);
1006
- }
825
+ internal.insert(target, div, anchor);
826
+ if (if_block) if_block.m(div, null);
1007
827
  },
1008
828
  p(ctx, [dirty]) {
1009
- if (dirty & /*positionPxArray*/ 64) {
1010
- each_value_1 = /*positionPxArray*/ ctx[6];
1011
- 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);
1012
- }
1013
-
1014
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
1015
- each_value = /*textArray*/ ctx[10];
1016
- 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$3, null, get_each_context$3);
1017
- }
829
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
830
+ if_block.p(ctx, dirty);
831
+ } else {
832
+ if (if_block) if_block.d(1);
833
+ if_block = current_block_type && current_block_type(ctx);
1018
834
 
1019
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1d5a0k4")) {
1020
- internal.attr(div1, "class", div1_class_value);
835
+ if (if_block) {
836
+ if_block.c();
837
+ if_block.m(div, null);
838
+ }
1021
839
  }
1022
840
  },
1023
841
  i: internal.noop,
1024
842
  o: internal.noop,
1025
843
  d(detaching) {
1026
- if (detaching) internal.detach(div1);
1027
-
1028
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1029
- each_blocks_1[i].d();
1030
- }
844
+ if (detaching) internal.detach(div);
1031
845
 
1032
- for (let i = 0; i < each_blocks.length; i += 1) {
1033
- each_blocks[i].d();
846
+ if (if_block) {
847
+ if_block.d();
1034
848
  }
1035
849
  }
1036
850
  };
1037
851
  }
1038
852
 
1039
- const padding = 1000;
1040
-
1041
- function instance$c($$self, $$props, $$invalidate) {
1042
- let { pxmm } = $$props;
1043
- let { type } = $$props;
1044
- let { data } = $$props;
1045
- let { bounding } = $$props;
1046
- const isTop = type === 'top';
1047
- const isBottom = type === 'bottom';
1048
- const isLeft = type === 'left';
1049
- const isRight = type === 'right';
1050
- const isRow = isTop || isBottom;
853
+ function instance$b($$self, $$props, $$invalidate) {
854
+ let userConfigElement;
855
+ let { room } = $$props;
856
+ let { getLabelElement } = $$props;
1051
857
 
1052
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1053
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1054
- if (index === 0) return true;
1055
- return x !== arr[index - 1];
1056
- });
858
+ // TODO: 统一这里的判断条件,目前写了多处
859
+ const bodyWidth = document.body.clientWidth;
1057
860
 
1058
- const minPosition = positionArray[0];
1059
- const maxPosition = positionArray.slice(-1)[0];
1060
- const length = maxPosition - minPosition;
1061
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
1062
- const lengthPx = length * pxmm;
1063
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
1064
-
1065
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
1066
- const translateMain = (minPosition - minBounding) * pxmm;
1067
-
1068
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
1069
- const translateSecond = 27 - padding * pxmm;
1070
-
1071
- const translate = (() => {
1072
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
1073
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
1074
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
1075
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
1076
- })();
1077
-
1078
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
1079
- const transform = `${translate} ${rotate}`;
1080
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
1081
- const width = lengthPx + 'px';
1082
-
1083
- // 把点位的户型图坐标转成距离起始位置的像素值
1084
- const textArray = positionArray.map((position, index, array) => {
1085
- if (index === 0) return null;
1086
- const distance = position - array[index - 1];
1087
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
1088
- return { distance, positionPx };
1089
- }).filter(notNil).filter(item => item.distance / length > 0.12);
861
+ const bodyHeight = document.body.clientHeight;
862
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
863
+ const roomLabel = room.roomLabel;
864
+ const left = roomLabel.positionInImage.x * 100 + '%';
865
+ const top = roomLabel.positionInImage.y * 100 + '%';
866
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1090
867
 
1091
868
  $$self.$$set = $$props => {
1092
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
1093
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
1094
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
1095
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
869
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
870
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1096
871
  };
1097
872
 
1098
- return [
1099
- type,
1100
- isTop,
1101
- isBottom,
1102
- isLeft,
1103
- isRight,
1104
- isRow,
1105
- positionPxArray,
1106
- transform,
1107
- transformOrigin,
1108
- width,
1109
- textArray,
1110
- pxmm,
1111
- data,
1112
- bounding
1113
- ];
873
+ $$self.$$.update = () => {
874
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
875
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
876
+ ? void 0
877
+ : getLabelElement(room));
878
+ }
879
+ };
880
+
881
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1114
882
  }
1115
883
 
1116
- class RuleItem extends internal.SvelteComponent {
884
+ class RoomLabel extends internal.SvelteComponent {
1117
885
  constructor(options) {
1118
886
  super();
1119
-
1120
- internal.init(
1121
- this,
1122
- options,
1123
- instance$c,
1124
- create_fragment$c,
1125
- internal.safe_not_equal,
1126
- {
1127
- pxmm: 11,
1128
- type: 0,
1129
- data: 12,
1130
- bounding: 13
1131
- },
1132
- add_css$8
1133
- );
887
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$8);
1134
888
  }
1135
889
  }
1136
890
 
1137
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
891
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1138
892
 
1139
- function get_each_context$2(ctx, list, i) {
1140
- const child_ctx = ctx.slice();
1141
- child_ctx[7] = list[i][0];
1142
- child_ctx[8] = list[i][1];
1143
- return child_ctx;
893
+ function add_css$7(target) {
894
+ 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}");
1144
895
  }
1145
896
 
1146
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
1147
- function create_each_block$2(key_1, ctx) {
1148
- let first;
1149
- let ruleitem;
1150
- let current;
1151
-
1152
- const ruleitem_spread_levels = [
1153
- {
1154
- type: /*type*/ ctx[7],
1155
- data: /*data*/ ctx[8],
1156
- pxmm: /*pxmm*/ ctx[0],
1157
- bounding: /*bounding*/ ctx[2]
1158
- }
1159
- ];
1160
-
1161
- let ruleitem_props = {};
1162
-
1163
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1164
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1165
- }
1166
-
1167
- ruleitem = new RuleItem({ props: ruleitem_props });
1168
-
1169
- return {
1170
- key: key_1,
1171
- first: null,
1172
- c() {
1173
- first = internal.empty();
1174
- internal.create_component(ruleitem.$$.fragment);
1175
- this.first = first;
1176
- },
1177
- m(target, anchor) {
1178
- internal.insert(target, first, anchor);
1179
- internal.mount_component(ruleitem, target, anchor);
1180
- current = true;
1181
- },
1182
- p(new_ctx, dirty) {
1183
- ctx = new_ctx;
1184
-
1185
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
1186
- ? internal.get_spread_update(ruleitem_spread_levels, [
1187
- {
1188
- type: /*type*/ ctx[7],
1189
- data: /*data*/ ctx[8],
1190
- pxmm: /*pxmm*/ ctx[0],
1191
- bounding: /*bounding*/ ctx[2]
1192
- }
1193
- ])
1194
- : {};
1195
-
1196
- ruleitem.$set(ruleitem_changes);
1197
- },
1198
- i(local) {
1199
- if (current) return;
1200
- internal.transition_in(ruleitem.$$.fragment, local);
1201
- current = true;
1202
- },
1203
- o(local) {
1204
- internal.transition_out(ruleitem.$$.fragment, local);
1205
- current = false;
1206
- },
1207
- d(detaching) {
1208
- if (detaching) internal.detach(first);
1209
- internal.destroy_component(ruleitem, detaching);
1210
- }
1211
- };
897
+ function get_each_context$5(ctx, list, i) {
898
+ const child_ctx = ctx.slice();
899
+ child_ctx[4] = list[i];
900
+ return child_ctx;
1212
901
  }
1213
902
 
1214
- function create_fragment$b(ctx) {
903
+ // (8:0) {#if rooms}
904
+ function create_if_block$3(ctx) {
1215
905
  let div;
1216
906
  let each_blocks = [];
1217
907
  let each_1_lookup = new Map();
1218
908
  let current;
1219
- let each_value = /*ruleLabelArray*/ ctx[1];
1220
- const get_key = ctx => /*type*/ ctx[7];
909
+ let each_value = /*rooms*/ ctx[1];
910
+ const get_key = ctx => /*room*/ ctx[4].id;
1221
911
 
1222
912
  for (let i = 0; i < each_value.length; i += 1) {
1223
- let child_ctx = get_each_context$2(ctx, each_value, i);
913
+ let child_ctx = get_each_context$5(ctx, each_value, i);
1224
914
  let key = get_key(child_ctx);
1225
- each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx));
915
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1226
916
  }
1227
917
 
1228
918
  return {
@@ -1233,7 +923,7 @@ function create_fragment$b(ctx) {
1233
923
  each_blocks[i].c();
1234
924
  }
1235
925
 
1236
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
926
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
1237
927
  },
1238
928
  m(target, anchor) {
1239
929
  internal.insert(target, div, anchor);
@@ -1244,11 +934,11 @@ function create_fragment$b(ctx) {
1244
934
 
1245
935
  current = true;
1246
936
  },
1247
- p(ctx, [dirty]) {
1248
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
1249
- each_value = /*ruleLabelArray*/ ctx[1];
937
+ p(ctx, dirty) {
938
+ if (dirty & /*rooms, getLabelElement*/ 3) {
939
+ each_value = /*rooms*/ ctx[1];
1250
940
  internal.group_outros();
1251
- 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$2, null, get_each_context$2);
941
+ 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);
1252
942
  internal.check_outros();
1253
943
  }
1254
944
  },
@@ -1278,372 +968,670 @@ function create_fragment$b(ctx) {
1278
968
  };
1279
969
  }
1280
970
 
1281
- function instance$b($$self, $$props, $$invalidate) {
1282
- let bounding;
1283
- let ruleLabelData;
1284
- let ruleLabelDataKeys;
1285
- let ruleLabelArray;
1286
- let { pxmm } = $$props;
1287
- let { floorIndex } = $$props;
1288
- let { floorplanData } = $$props;
1289
-
1290
- $$self.$$set = $$props => {
1291
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
1292
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
1293
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
1294
- };
971
+ // (10:4) {#each rooms as room (room.id)}
972
+ function create_each_block$5(key_1, ctx) {
973
+ let first;
974
+ let roomlabel;
975
+ let current;
1295
976
 
1296
- $$self.$$.update = () => {
1297
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
1298
- $$invalidate(2, bounding = floorplanData.bounding);
977
+ const roomlabel_spread_levels = [
978
+ {
979
+ room: /*room*/ ctx[4],
980
+ getLabelElement: /*getLabelElement*/ ctx[0]
1299
981
  }
982
+ ];
1300
983
 
1301
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
1302
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1303
- }
984
+ let roomlabel_props = {};
1304
985
 
1305
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
1306
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
1307
- }
986
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
987
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
988
+ }
1308
989
 
1309
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
1310
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1311
- }
1312
- };
990
+ roomlabel = new RoomLabel({ props: roomlabel_props });
1313
991
 
1314
- return [
1315
- pxmm,
1316
- ruleLabelArray,
1317
- bounding,
1318
- floorIndex,
1319
- floorplanData,
1320
- ruleLabelData,
1321
- ruleLabelDataKeys
1322
- ];
1323
- }
1324
-
1325
- class RuleLabels extends internal.SvelteComponent {
1326
- constructor(options) {
1327
- super();
1328
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
1329
- }
1330
- }
992
+ return {
993
+ key: key_1,
994
+ first: null,
995
+ c() {
996
+ first = internal.empty();
997
+ internal.create_component(roomlabel.$$.fragment);
998
+ this.first = first;
999
+ },
1000
+ m(target, anchor) {
1001
+ internal.insert(target, first, anchor);
1002
+ internal.mount_component(roomlabel, target, anchor);
1003
+ current = true;
1004
+ },
1005
+ p(new_ctx, dirty) {
1006
+ ctx = new_ctx;
1331
1007
 
1332
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1008
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1009
+ ? internal.get_spread_update(roomlabel_spread_levels, [
1010
+ {
1011
+ room: /*room*/ ctx[4],
1012
+ getLabelElement: /*getLabelElement*/ ctx[0]
1013
+ }
1014
+ ])
1015
+ : {};
1333
1016
 
1334
- function add_css$7(target) {
1335
- internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1017
+ roomlabel.$set(roomlabel_changes);
1018
+ },
1019
+ i(local) {
1020
+ if (current) return;
1021
+ internal.transition_in(roomlabel.$$.fragment, local);
1022
+ current = true;
1023
+ },
1024
+ o(local) {
1025
+ internal.transition_out(roomlabel.$$.fragment, local);
1026
+ current = false;
1027
+ },
1028
+ d(detaching) {
1029
+ if (detaching) internal.detach(first);
1030
+ internal.destroy_component(roomlabel, detaching);
1031
+ }
1032
+ };
1336
1033
  }
1337
1034
 
1338
1035
  function create_fragment$a(ctx) {
1339
- let img;
1340
- let img_src_value;
1036
+ let if_block_anchor;
1037
+ let current;
1038
+ let if_block = /*rooms*/ ctx[1] && create_if_block$3(ctx);
1341
1039
 
1342
1040
  return {
1343
1041
  c() {
1344
- img = internal.element("img");
1345
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1346
- internal.attr(img, "alt", "floorplan iamge");
1347
- internal.attr(img, "class", "svelte-1gfoniz");
1042
+ if (if_block) if_block.c();
1043
+ if_block_anchor = internal.empty();
1348
1044
  },
1349
1045
  m(target, anchor) {
1350
- internal.insert(target, img, anchor);
1046
+ if (if_block) if_block.m(target, anchor);
1047
+ internal.insert(target, if_block_anchor, anchor);
1048
+ current = true;
1351
1049
  },
1352
1050
  p(ctx, [dirty]) {
1353
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1354
- internal.attr(img, "src", img_src_value);
1051
+ if (/*rooms*/ ctx[1]) {
1052
+ if (if_block) {
1053
+ if_block.p(ctx, dirty);
1054
+
1055
+ if (dirty & /*rooms*/ 2) {
1056
+ internal.transition_in(if_block, 1);
1057
+ }
1058
+ } else {
1059
+ if_block = create_if_block$3(ctx);
1060
+ if_block.c();
1061
+ internal.transition_in(if_block, 1);
1062
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
1063
+ }
1064
+ } else if (if_block) {
1065
+ internal.group_outros();
1066
+
1067
+ internal.transition_out(if_block, 1, 1, () => {
1068
+ if_block = null;
1069
+ });
1070
+
1071
+ internal.check_outros();
1355
1072
  }
1356
1073
  },
1357
- i: internal.noop,
1358
- o: internal.noop,
1074
+ i(local) {
1075
+ if (current) return;
1076
+ internal.transition_in(if_block);
1077
+ current = true;
1078
+ },
1079
+ o(local) {
1080
+ internal.transition_out(if_block);
1081
+ current = false;
1082
+ },
1359
1083
  d(detaching) {
1360
- if (detaching) internal.detach(img);
1084
+ if (if_block) if_block.d(detaching);
1085
+ if (detaching) internal.detach(if_block_anchor);
1361
1086
  }
1362
1087
  };
1363
1088
  }
1364
1089
 
1365
1090
  function instance$a($$self, $$props, $$invalidate) {
1366
- let { url } = $$props;
1091
+ let rooms;
1092
+ let { floorIndex } = $$props;
1093
+ let { floorplanData } = $$props;
1094
+ let { getLabelElement } = $$props;
1367
1095
 
1368
1096
  $$self.$$set = $$props => {
1369
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
1097
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1098
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1099
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1370
1100
  };
1371
1101
 
1372
- return [url];
1102
+ $$self.$$.update = () => {
1103
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1104
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1105
+ }
1106
+ };
1107
+
1108
+ return [getLabelElement, rooms, floorIndex, floorplanData];
1373
1109
  }
1374
1110
 
1375
- class Normalmage extends internal.SvelteComponent {
1111
+ class RoomLabels extends internal.SvelteComponent {
1376
1112
  constructor(options) {
1377
1113
  super();
1378
- internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { url: 0 }, add_css$7);
1114
+
1115
+ internal.init(
1116
+ this,
1117
+ options,
1118
+ instance$a,
1119
+ create_fragment$a,
1120
+ internal.safe_not_equal,
1121
+ {
1122
+ floorIndex: 2,
1123
+ floorplanData: 3,
1124
+ getLabelElement: 0
1125
+ },
1126
+ add_css$7
1127
+ );
1379
1128
  }
1380
1129
  }
1381
1130
 
1382
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1131
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1383
1132
 
1384
1133
  function add_css$6(target) {
1385
- internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1134
+ 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}");
1386
1135
  }
1387
1136
 
1388
- function create_fragment$9(ctx) {
1137
+ function get_each_context$4(ctx, list, i) {
1138
+ const child_ctx = ctx.slice();
1139
+ child_ctx[10] = list[i];
1140
+ child_ctx[12] = i;
1141
+ return child_ctx;
1142
+ }
1143
+
1144
+ function get_each_context_1(ctx, list, i) {
1145
+ const child_ctx = ctx.slice();
1146
+ child_ctx[13] = list[i];
1147
+ return child_ctx;
1148
+ }
1149
+
1150
+ // (53:4) {#each rulerLabels as rulerLabel}
1151
+ function create_each_block_1(ctx) {
1389
1152
  let div;
1390
- let html_tag;
1391
- let t;
1392
- let html_tag_1;
1393
1153
 
1394
1154
  return {
1395
1155
  c() {
1396
1156
  div = internal.element("div");
1397
- html_tag = new internal.HtmlTag();
1398
- t = internal.space();
1399
- html_tag_1 = new internal.HtmlTag();
1400
- html_tag.a = t;
1401
- html_tag_1.a = null;
1402
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1157
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
1158
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
1159
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
1403
1160
  },
1404
1161
  m(target, anchor) {
1405
1162
  internal.insert(target, div, anchor);
1406
- html_tag.m(/*svgStyle*/ ctx[1], div);
1407
- internal.append(div, t);
1408
- html_tag_1.m(/*content*/ ctx[0], div);
1163
+ },
1164
+ p: internal.noop,
1165
+ d(detaching) {
1166
+ if (detaching) internal.detach(div);
1167
+ }
1168
+ };
1169
+ }
1170
+
1171
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
1172
+ function create_each_block$4(key_1, ctx) {
1173
+ let div1;
1174
+ let div0;
1175
+ let t0_value = /*textItem*/ ctx[10].distance + "";
1176
+ let t0;
1177
+ let t1;
1178
+
1179
+ return {
1180
+ key: key_1,
1181
+ first: null,
1182
+ c() {
1183
+ div1 = internal.element("div");
1184
+ div0 = internal.element("div");
1185
+ t0 = internal.text(t0_value);
1186
+ t1 = internal.space();
1187
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
1188
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
1189
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
1190
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
1191
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
1192
+ this.first = div1;
1193
+ },
1194
+ m(target, anchor) {
1195
+ internal.insert(target, div1, anchor);
1196
+ internal.append(div1, div0);
1197
+ internal.append(div0, t0);
1198
+ internal.append(div1, t1);
1199
+ },
1200
+ p(new_ctx, dirty) {
1201
+ ctx = new_ctx;
1202
+ },
1203
+ d(detaching) {
1204
+ if (detaching) internal.detach(div1);
1205
+ }
1206
+ };
1207
+ }
1208
+
1209
+ function create_fragment$9(ctx) {
1210
+ let div3;
1211
+ let div0;
1212
+ let t0;
1213
+ let div1;
1214
+ let t1;
1215
+ let div2;
1216
+ let each_blocks = [];
1217
+ let each1_lookup = new Map();
1218
+ let div3_class_value;
1219
+ let each_value_1 = /*rulerLabels*/ ctx[2];
1220
+ let each_blocks_1 = [];
1221
+
1222
+ for (let i = 0; i < each_value_1.length; i += 1) {
1223
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
1224
+ }
1225
+
1226
+ let each_value = /*rulerTexts*/ ctx[3];
1227
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
1228
+
1229
+ for (let i = 0; i < each_value.length; i += 1) {
1230
+ let child_ctx = get_each_context$4(ctx, each_value, i);
1231
+ let key = get_key(child_ctx);
1232
+ each1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
1233
+ }
1234
+
1235
+ return {
1236
+ c() {
1237
+ div3 = internal.element("div");
1238
+ div0 = internal.element("div");
1239
+ t0 = internal.space();
1240
+ div1 = internal.element("div");
1241
+
1242
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1243
+ each_blocks_1[i].c();
1244
+ }
1245
+
1246
+ t1 = internal.space();
1247
+ div2 = internal.element("div");
1248
+
1249
+ for (let i = 0; i < each_blocks.length; i += 1) {
1250
+ each_blocks[i].c();
1251
+ }
1252
+
1253
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
1254
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
1255
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
1256
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
1257
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
1258
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1259
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1260
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
1261
+ },
1262
+ m(target, anchor) {
1263
+ internal.insert(target, div3, anchor);
1264
+ internal.append(div3, div0);
1265
+ internal.append(div3, t0);
1266
+ internal.append(div3, div1);
1267
+
1268
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
1269
+ each_blocks_1[i].m(div1, null);
1270
+ }
1271
+
1272
+ internal.append(div3, t1);
1273
+ internal.append(div3, div2);
1274
+
1275
+ for (let i = 0; i < each_blocks.length; i += 1) {
1276
+ each_blocks[i].m(div2, null);
1277
+ }
1409
1278
  },
1410
1279
  p(ctx, [dirty]) {
1411
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1280
+ if (dirty & /*rulerLabels*/ 4) {
1281
+ each_value_1 = /*rulerLabels*/ ctx[2];
1282
+ let i;
1283
+
1284
+ for (i = 0; i < each_value_1.length; i += 1) {
1285
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
1286
+
1287
+ if (each_blocks_1[i]) {
1288
+ each_blocks_1[i].p(child_ctx, dirty);
1289
+ } else {
1290
+ each_blocks_1[i] = create_each_block_1(child_ctx);
1291
+ each_blocks_1[i].c();
1292
+ each_blocks_1[i].m(div1, null);
1293
+ }
1294
+ }
1295
+
1296
+ for (; i < each_blocks_1.length; i += 1) {
1297
+ each_blocks_1[i].d(1);
1298
+ }
1299
+
1300
+ each_blocks_1.length = each_value_1.length;
1301
+ }
1302
+
1303
+ if (dirty & /*rulerTexts, isRow*/ 10) {
1304
+ each_value = /*rulerTexts*/ ctx[3];
1305
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$4, null, get_each_context$4);
1306
+ }
1307
+
1308
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
1309
+ internal.attr(div3, "class", div3_class_value);
1310
+ }
1311
+
1312
+ if (dirty & /*type, isRow*/ 3) {
1313
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
1314
+ }
1412
1315
  },
1413
1316
  i: internal.noop,
1414
1317
  o: internal.noop,
1415
1318
  d(detaching) {
1416
- if (detaching) internal.detach(div);
1319
+ if (detaching) internal.detach(div3);
1320
+ internal.destroy_each(each_blocks_1, detaching);
1321
+
1322
+ for (let i = 0; i < each_blocks.length; i += 1) {
1323
+ each_blocks[i].d();
1324
+ }
1417
1325
  }
1418
1326
  };
1419
1327
  }
1420
1328
 
1329
+ const padding$1 = 1000;
1330
+ const exteriorWallOffset$1 = 180;
1331
+
1421
1332
  function instance$9($$self, $$props, $$invalidate) {
1422
- let { content } = $$props;
1333
+ let { type } = $$props;
1334
+ let { data } = $$props;
1335
+ let { bounding } = $$props;
1336
+ const isRow = type === 'top' || type === 'bottom';
1337
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
1338
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
1423
1339
 
1424
- const svgStyle = `
1425
- <style>
1426
- svg [type='lineGroup'] path {
1427
- fill: #ffffff;
1428
- stroke: #ffffff;
1429
- }
1430
- svg [type='lineItemGroup'] g g g g {
1431
- stroke: #ffffff;
1432
- }</style>
1433
- `;
1340
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1341
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1342
+ // 筛除重复数据
1343
+ if (index === 0) return true;
1344
+
1345
+ return x !== arr[index - 1];
1346
+ });
1347
+
1348
+ const rulerLabels = rulerPoints.map(num => {
1349
+ const left = isRow
1350
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1351
+ : 0;
1352
+
1353
+ const bottom = !isRow
1354
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1355
+ : 0;
1356
+
1357
+ return { left, bottom };
1358
+ });
1359
+
1360
+ rulerLabels.unshift({ left: 0, bottom: 0 });
1361
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
1362
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
1363
+
1364
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
1365
+ const distance = index === 0 ? 0 : num - arr[index - 1];
1366
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
1367
+
1368
+ const left = isRow
1369
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
1370
+ : 0;
1371
+
1372
+ const bottom = !isRow
1373
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
1374
+ : 0;
1375
+
1376
+ return { left, bottom, distance };
1377
+ }).filter(({ distance }) => distance / length > 0.1);
1434
1378
 
1435
1379
  $$self.$$set = $$props => {
1436
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
1380
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1381
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
1382
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
1437
1383
  };
1438
1384
 
1439
- return [content, svgStyle];
1385
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
1440
1386
  }
1441
1387
 
1442
- class SvgImage extends internal.SvelteComponent {
1388
+ class RuleItem extends internal.SvelteComponent {
1443
1389
  constructor(options) {
1444
1390
  super();
1445
- internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { content: 0 }, add_css$6);
1391
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$6);
1446
1392
  }
1447
1393
  }
1448
1394
 
1449
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1395
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1450
1396
 
1451
1397
  function add_css$5(target) {
1452
- internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1398
+ 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}");
1453
1399
  }
1454
1400
 
1455
- // (13:22)
1456
- function create_if_block_1$3(ctx) {
1457
- let normalimage;
1401
+ function get_each_context$3(ctx, list, i) {
1402
+ const child_ctx = ctx.slice();
1403
+ child_ctx[12] = list[i][0];
1404
+ child_ctx[13] = list[i][1];
1405
+ return child_ctx;
1406
+ }
1407
+
1408
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
1409
+ function create_each_block$3(key_1, ctx) {
1410
+ let first;
1411
+ let ruleitem;
1458
1412
  let current;
1459
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1460
1413
 
1461
- return {
1462
- c() {
1463
- internal.create_component(normalimage.$$.fragment);
1464
- },
1465
- m(target, anchor) {
1466
- internal.mount_component(normalimage, target, anchor);
1467
- current = true;
1468
- },
1469
- p(ctx, dirty) {
1470
- const normalimage_changes = {};
1471
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1472
- normalimage.$set(normalimage_changes);
1473
- },
1474
- i(local) {
1475
- if (current) return;
1476
- internal.transition_in(normalimage.$$.fragment, local);
1477
- current = true;
1478
- },
1479
- o(local) {
1480
- internal.transition_out(normalimage.$$.fragment, local);
1481
- current = false;
1482
- },
1483
- d(detaching) {
1484
- internal.destroy_component(normalimage, detaching);
1414
+ const ruleitem_spread_levels = [
1415
+ {
1416
+ type: /*type*/ ctx[12],
1417
+ data: /*data*/ ctx[13],
1418
+ bounding: /*bounding*/ ctx[0]
1485
1419
  }
1486
- };
1487
- }
1420
+ ];
1488
1421
 
1489
- // (11:2) {#if svgContent}
1490
- function create_if_block$3(ctx) {
1491
- let svgimage;
1492
- let current;
1422
+ let ruleitem_props = {};
1493
1423
 
1494
- svgimage = new SvgImage({
1495
- props: { content: /*svgContent*/ ctx[0] }
1496
- });
1424
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1425
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1426
+ }
1427
+
1428
+ ruleitem = new RuleItem({ props: ruleitem_props });
1497
1429
 
1498
1430
  return {
1431
+ key: key_1,
1432
+ first: null,
1499
1433
  c() {
1500
- internal.create_component(svgimage.$$.fragment);
1434
+ first = internal.empty();
1435
+ internal.create_component(ruleitem.$$.fragment);
1436
+ this.first = first;
1501
1437
  },
1502
1438
  m(target, anchor) {
1503
- internal.mount_component(svgimage, target, anchor);
1439
+ internal.insert(target, first, anchor);
1440
+ internal.mount_component(ruleitem, target, anchor);
1504
1441
  current = true;
1505
1442
  },
1506
- p(ctx, dirty) {
1507
- const svgimage_changes = {};
1508
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1509
- svgimage.$set(svgimage_changes);
1443
+ p(new_ctx, dirty) {
1444
+ ctx = new_ctx;
1445
+
1446
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
1447
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1448
+ {
1449
+ type: /*type*/ ctx[12],
1450
+ data: /*data*/ ctx[13],
1451
+ bounding: /*bounding*/ ctx[0]
1452
+ }
1453
+ ])
1454
+ : {};
1455
+
1456
+ ruleitem.$set(ruleitem_changes);
1510
1457
  },
1511
1458
  i(local) {
1512
1459
  if (current) return;
1513
- internal.transition_in(svgimage.$$.fragment, local);
1460
+ internal.transition_in(ruleitem.$$.fragment, local);
1514
1461
  current = true;
1515
1462
  },
1516
1463
  o(local) {
1517
- internal.transition_out(svgimage.$$.fragment, local);
1464
+ internal.transition_out(ruleitem.$$.fragment, local);
1518
1465
  current = false;
1519
1466
  },
1520
1467
  d(detaching) {
1521
- internal.destroy_component(svgimage, detaching);
1468
+ if (detaching) internal.detach(first);
1469
+ internal.destroy_component(ruleitem, detaching);
1522
1470
  }
1523
1471
  };
1524
1472
  }
1525
1473
 
1526
1474
  function create_fragment$8(ctx) {
1527
1475
  let div;
1528
- let current_block_type_index;
1529
- let if_block;
1476
+ let each_blocks = [];
1477
+ let each_1_lookup = new Map();
1530
1478
  let current;
1531
- const if_block_creators = [create_if_block$3, create_if_block_1$3];
1532
- const if_blocks = [];
1533
-
1534
- function select_block_type(ctx, dirty) {
1535
- if (/*svgContent*/ ctx[0]) return 0;
1536
- if (/*imageData*/ ctx[1]) return 1;
1537
- return -1;
1538
- }
1479
+ let each_value = /*ruleLabelArray*/ ctx[3];
1480
+ const get_key = ctx => /*type*/ ctx[12];
1539
1481
 
1540
- if (~(current_block_type_index = select_block_type(ctx))) {
1541
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1482
+ for (let i = 0; i < each_value.length; i += 1) {
1483
+ let child_ctx = get_each_context$3(ctx, each_value, i);
1484
+ let key = get_key(child_ctx);
1485
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
1542
1486
  }
1543
1487
 
1544
1488
  return {
1545
1489
  c() {
1546
1490
  div = internal.element("div");
1547
- if (if_block) if_block.c();
1548
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1491
+
1492
+ for (let i = 0; i < each_blocks.length; i += 1) {
1493
+ each_blocks[i].c();
1494
+ }
1495
+
1496
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
1497
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1498
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1549
1499
  },
1550
1500
  m(target, anchor) {
1551
1501
  internal.insert(target, div, anchor);
1552
1502
 
1553
- if (~current_block_type_index) {
1554
- if_blocks[current_block_type_index].m(div, null);
1503
+ for (let i = 0; i < each_blocks.length; i += 1) {
1504
+ each_blocks[i].m(div, null);
1555
1505
  }
1556
1506
 
1557
1507
  current = true;
1558
1508
  },
1559
1509
  p(ctx, [dirty]) {
1560
- let previous_block_index = current_block_type_index;
1561
- current_block_type_index = select_block_type(ctx);
1562
-
1563
- if (current_block_type_index === previous_block_index) {
1564
- if (~current_block_type_index) {
1565
- if_blocks[current_block_type_index].p(ctx, dirty);
1566
- }
1567
- } else {
1568
- if (if_block) {
1569
- internal.group_outros();
1570
-
1571
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1572
- if_blocks[previous_block_index] = null;
1573
- });
1574
-
1575
- internal.check_outros();
1576
- }
1577
-
1578
- if (~current_block_type_index) {
1579
- if_block = if_blocks[current_block_type_index];
1510
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
1511
+ each_value = /*ruleLabelArray*/ ctx[3];
1512
+ internal.group_outros();
1513
+ 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$3, null, get_each_context$3);
1514
+ internal.check_outros();
1515
+ }
1580
1516
 
1581
- if (!if_block) {
1582
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1583
- if_block.c();
1584
- } else {
1585
- if_block.p(ctx, dirty);
1586
- }
1517
+ if (dirty & /*width*/ 4) {
1518
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
1519
+ }
1587
1520
 
1588
- internal.transition_in(if_block, 1);
1589
- if_block.m(div, null);
1590
- } else {
1591
- if_block = null;
1592
- }
1521
+ if (dirty & /*height*/ 2) {
1522
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
1593
1523
  }
1594
1524
  },
1595
1525
  i(local) {
1596
1526
  if (current) return;
1597
- internal.transition_in(if_block);
1527
+
1528
+ for (let i = 0; i < each_value.length; i += 1) {
1529
+ internal.transition_in(each_blocks[i]);
1530
+ }
1531
+
1598
1532
  current = true;
1599
1533
  },
1600
1534
  o(local) {
1601
- internal.transition_out(if_block);
1535
+ for (let i = 0; i < each_blocks.length; i += 1) {
1536
+ internal.transition_out(each_blocks[i]);
1537
+ }
1538
+
1602
1539
  current = false;
1603
1540
  },
1604
1541
  d(detaching) {
1605
1542
  if (detaching) internal.detach(div);
1606
1543
 
1607
- if (~current_block_type_index) {
1608
- if_blocks[current_block_type_index].d();
1544
+ for (let i = 0; i < each_blocks.length; i += 1) {
1545
+ each_blocks[i].d();
1609
1546
  }
1610
1547
  }
1611
1548
  };
1612
1549
  }
1613
1550
 
1551
+ const padding = 1000;
1552
+ const exteriorWallOffset = 180;
1553
+
1614
1554
  function instance$8($$self, $$props, $$invalidate) {
1615
- let imageData;
1616
- let svgContent;
1617
- var _a, _b;
1555
+ let bounding;
1556
+ let ruleLabelData;
1557
+ let ruleLabelDataKeys;
1558
+ let ruleLabelArray;
1559
+ let boundingWidth;
1560
+ let boundingHeight;
1561
+ let contentWidth;
1562
+ let contentHeight;
1563
+ let width;
1564
+ let height;
1618
1565
  let { floorIndex } = $$props;
1619
1566
  let { floorplanData } = $$props;
1620
1567
 
1621
1568
  $$self.$$set = $$props => {
1622
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1623
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1569
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
1570
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
1624
1571
  };
1625
1572
 
1626
1573
  $$self.$$.update = () => {
1627
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1628
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1574
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
1575
+ $$invalidate(0, bounding = floorplanData.bounding);
1629
1576
  }
1630
1577
 
1631
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1632
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1633
- ? void 0
1634
- : _a[floorIndex]) === null || _b === void 0
1635
- ? void 0
1636
- : _b.svgContent);
1578
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
1579
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1580
+ }
1581
+
1582
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
1583
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
1584
+ }
1585
+
1586
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
1587
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1588
+ }
1589
+
1590
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1591
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
1592
+ }
1593
+
1594
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1595
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
1596
+ }
1597
+
1598
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1599
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
1600
+ }
1601
+
1602
+ if ($$self.$$.dirty & /*bounding*/ 1) {
1603
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
1604
+ }
1605
+
1606
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
1607
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
1608
+ }
1609
+
1610
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
1611
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
1637
1612
  }
1638
1613
  };
1639
1614
 
1640
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1615
+ return [
1616
+ bounding,
1617
+ height,
1618
+ width,
1619
+ ruleLabelArray,
1620
+ floorIndex,
1621
+ floorplanData,
1622
+ boundingHeight,
1623
+ contentHeight,
1624
+ boundingWidth,
1625
+ contentWidth,
1626
+ ruleLabelData,
1627
+ ruleLabelDataKeys
1628
+ ];
1641
1629
  }
1642
1630
 
1643
- class BaseImage extends internal.SvelteComponent {
1631
+ class RuleLabels extends internal.SvelteComponent {
1644
1632
  constructor(options) {
1645
1633
  super();
1646
- internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$5);
1634
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$5);
1647
1635
  }
1648
1636
  }
1649
1637
 
@@ -1917,17 +1905,17 @@ function add_css$4(target) {
1917
1905
  internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
1918
1906
  }
1919
1907
 
1920
- function get_each_context$1(ctx, list, i) {
1908
+ function get_each_context$2(ctx, list, i) {
1921
1909
  const child_ctx = ctx.slice();
1922
- child_ctx[4] = list[i];
1910
+ child_ctx[5] = list[i];
1923
1911
  return child_ctx;
1924
1912
  }
1925
1913
 
1926
- // (18:6) {:else}
1914
+ // (19:6) {:else}
1927
1915
  function create_else_block(ctx) {
1928
1916
  let roommaterial_1;
1929
1917
  let current;
1930
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
1918
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
1931
1919
 
1932
1920
  return {
1933
1921
  c() {
@@ -1939,7 +1927,7 @@ function create_else_block(ctx) {
1939
1927
  },
1940
1928
  p(ctx, dirty) {
1941
1929
  const roommaterial_1_changes = {};
1942
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
1930
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
1943
1931
  roommaterial_1.$set(roommaterial_1_changes);
1944
1932
  },
1945
1933
  i(local) {
@@ -1957,11 +1945,11 @@ function create_else_block(ctx) {
1957
1945
  };
1958
1946
  }
1959
1947
 
1960
- // (16:37)
1948
+ // (17:37)
1961
1949
  function create_if_block_1$2(ctx) {
1962
1950
  let roommaterial_2;
1963
1951
  let current;
1964
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
1952
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
1965
1953
 
1966
1954
  return {
1967
1955
  c() {
@@ -1973,7 +1961,7 @@ function create_if_block_1$2(ctx) {
1973
1961
  },
1974
1962
  p(ctx, dirty) {
1975
1963
  const roommaterial_2_changes = {};
1976
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
1964
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
1977
1965
  roommaterial_2.$set(roommaterial_2_changes);
1978
1966
  },
1979
1967
  i(local) {
@@ -1991,11 +1979,11 @@ function create_if_block_1$2(ctx) {
1991
1979
  };
1992
1980
  }
1993
1981
 
1994
- // (14:6) {#if room.floorType === 1}
1982
+ // (15:6) {#if room.floorType === 1}
1995
1983
  function create_if_block$2(ctx) {
1996
1984
  let roommaterial_0;
1997
1985
  let current;
1998
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
1986
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
1999
1987
 
2000
1988
  return {
2001
1989
  c() {
@@ -2007,7 +1995,7 @@ function create_if_block$2(ctx) {
2007
1995
  },
2008
1996
  p(ctx, dirty) {
2009
1997
  const roommaterial_0_changes = {};
2010
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
1998
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
2011
1999
  roommaterial_0.$set(roommaterial_0_changes);
2012
2000
  },
2013
2001
  i(local) {
@@ -2025,18 +2013,19 @@ function create_if_block$2(ctx) {
2025
2013
  };
2026
2014
  }
2027
2015
 
2028
- // (12:2) {#each rooms as room}
2029
- function create_each_block$1(ctx) {
2016
+ // (13:2) {#each rooms as room}
2017
+ function create_each_block$2(ctx) {
2030
2018
  let svg;
2031
2019
  let current_block_type_index;
2032
2020
  let if_block;
2021
+ let svg_viewBox_value;
2033
2022
  let current;
2034
2023
  const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
2035
2024
  const if_blocks = [];
2036
2025
 
2037
2026
  function select_block_type(ctx, dirty) {
2038
- if (/*room*/ ctx[4].floorType === 1) return 0;
2039
- if (/*room*/ ctx[4].floorType === 0) return 1;
2027
+ if (/*room*/ ctx[5].floorType === 1) return 0;
2028
+ if (/*room*/ ctx[5].floorType === 0) return 1;
2040
2029
  return 2;
2041
2030
  }
2042
2031
 
@@ -2047,6 +2036,9 @@ function create_each_block$1(ctx) {
2047
2036
  c() {
2048
2037
  svg = internal.svg_element("svg");
2049
2038
  if_block.c();
2039
+ internal.attr(svg, "width", "100%");
2040
+ internal.attr(svg, "height", "100%");
2041
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
2050
2042
  internal.attr(svg, "class", "svelte-1d4xj70");
2051
2043
  },
2052
2044
  m(target, anchor) {
@@ -2104,7 +2096,7 @@ function create_fragment$4(ctx) {
2104
2096
  let each_blocks = [];
2105
2097
 
2106
2098
  for (let i = 0; i < each_value.length; i += 1) {
2107
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2099
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
2108
2100
  }
2109
2101
 
2110
2102
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -2131,18 +2123,18 @@ function create_fragment$4(ctx) {
2131
2123
  current = true;
2132
2124
  },
2133
2125
  p(ctx, [dirty]) {
2134
- if (dirty & /*rooms*/ 1) {
2126
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
2135
2127
  each_value = /*rooms*/ ctx[0];
2136
2128
  let i;
2137
2129
 
2138
2130
  for (i = 0; i < each_value.length; i += 1) {
2139
- const child_ctx = get_each_context$1(ctx, each_value, i);
2131
+ const child_ctx = get_each_context$2(ctx, each_value, i);
2140
2132
 
2141
2133
  if (each_blocks[i]) {
2142
2134
  each_blocks[i].p(child_ctx, dirty);
2143
2135
  internal.transition_in(each_blocks[i], 1);
2144
2136
  } else {
2145
- each_blocks[i] = create_each_block$1(child_ctx);
2137
+ each_blocks[i] = create_each_block$2(child_ctx);
2146
2138
  each_blocks[i].c();
2147
2139
  internal.transition_in(each_blocks[i], 1);
2148
2140
  each_blocks[i].m(div, null);
@@ -2186,30 +2178,30 @@ function create_fragment$4(ctx) {
2186
2178
  function instance$4($$self, $$props, $$invalidate) {
2187
2179
  let rooms;
2188
2180
  let { floorIndex } = $$props;
2189
- let { pxmm } = $$props;
2190
2181
  let { floorplanData } = $$props;
2182
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2183
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2191
2184
 
2192
2185
  $$self.$$set = $$props => {
2193
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2194
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
2195
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2186
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2187
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2196
2188
  };
2197
2189
 
2198
2190
  $$self.$$.update = () => {
2199
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
2191
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2200
2192
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
2201
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
2193
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
2202
2194
  })));
2203
2195
  }
2204
2196
  };
2205
2197
 
2206
- return [rooms, floorIndex, pxmm, floorplanData];
2198
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
2207
2199
  }
2208
2200
 
2209
2201
  class RoomMaterial extends internal.SvelteComponent {
2210
2202
  constructor(options) {
2211
2203
  super();
2212
- internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$4);
2204
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$4);
2213
2205
  }
2214
2206
  }
2215
2207
 
@@ -2242,55 +2234,52 @@ function create_fragment$3(ctx) {
2242
2234
  }
2243
2235
 
2244
2236
  function instance$3($$self, $$props, $$invalidate) {
2245
- let { pxmm } = $$props;
2246
2237
  let { room } = $$props;
2247
2238
  let { floorplanData } = $$props;
2248
2239
  const { bounding } = floorplanData;
2249
2240
 
2250
2241
  const _pathD = pathD(room.path, {
2251
2242
  needZ: true,
2252
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
2243
+ format: vector => formatFloorplanPoint(vector, bounding)
2253
2244
  });
2254
2245
 
2255
2246
  $$self.$$set = $$props => {
2256
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
2257
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
2258
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2247
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
2248
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2259
2249
  };
2260
2250
 
2261
- return [_pathD, pxmm, room, floorplanData];
2251
+ return [_pathD, room, floorplanData];
2262
2252
  }
2263
2253
 
2264
2254
  class Room extends internal.SvelteComponent {
2265
2255
  constructor(options) {
2266
2256
  super();
2267
- internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$3);
2257
+ internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$3);
2268
2258
  }
2269
2259
  }
2270
2260
 
2271
2261
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2272
2262
 
2273
2263
  function add_css$2(target) {
2274
- internal.append_styles(target, "svelte-klfhwd", ".floorplan-plugin__room-highlight.svelte-klfhwd{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-klfhwd{width:100%;height:100%;overflow:visible}");
2264
+ 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}");
2275
2265
  }
2276
2266
 
2277
- function get_each_context(ctx, list, i) {
2267
+ function get_each_context$1(ctx, list, i) {
2278
2268
  const child_ctx = ctx.slice();
2279
- child_ctx[12] = list[i];
2269
+ child_ctx[4] = list[i];
2280
2270
  return child_ctx;
2281
2271
  }
2282
2272
 
2283
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2284
- function create_each_block(key_1, ctx) {
2273
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2274
+ function create_each_block$1(key_1, ctx) {
2285
2275
  let first;
2286
2276
  let room;
2287
2277
  let current;
2288
2278
 
2289
2279
  const room_spread_levels = [
2290
2280
  {
2291
- room: /*room*/ ctx[12],
2292
- floorplanData: /*floorplanData*/ ctx[2],
2293
- pxmm: /*pxmm*/ ctx[0]
2281
+ room: /*room*/ ctx[4],
2282
+ floorplanData: /*floorplanData*/ ctx[1]
2294
2283
  }
2295
2284
  ];
2296
2285
 
@@ -2318,12 +2307,11 @@ function create_each_block(key_1, ctx) {
2318
2307
  p(new_ctx, dirty) {
2319
2308
  ctx = new_ctx;
2320
2309
 
2321
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
2310
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
2322
2311
  ? internal.get_spread_update(room_spread_levels, [
2323
2312
  {
2324
- room: /*room*/ ctx[12],
2325
- floorplanData: /*floorplanData*/ ctx[2],
2326
- pxmm: /*pxmm*/ ctx[0]
2313
+ room: /*room*/ ctx[4],
2314
+ floorplanData: /*floorplanData*/ ctx[1]
2327
2315
  }
2328
2316
  ])
2329
2317
  : {};
@@ -2351,17 +2339,14 @@ function create_fragment$2(ctx) {
2351
2339
  let svg;
2352
2340
  let each_blocks = [];
2353
2341
  let each_1_lookup = new Map();
2354
- let div_resize_listener;
2355
2342
  let current;
2356
- let mounted;
2357
- let dispose;
2358
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2359
- const get_key = ctx => /*room*/ ctx[12].id;
2343
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2344
+ const get_key = ctx => /*room*/ ctx[4].id;
2360
2345
 
2361
2346
  for (let i = 0; i < each_value.length; i += 1) {
2362
- let child_ctx = get_each_context(ctx, each_value, i);
2347
+ let child_ctx = get_each_context$1(ctx, each_value, i);
2363
2348
  let key = get_key(child_ctx);
2364
- each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
2349
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
2365
2350
  }
2366
2351
 
2367
2352
  return {
@@ -2373,9 +2358,11 @@ function create_fragment$2(ctx) {
2373
2358
  each_blocks[i].c();
2374
2359
  }
2375
2360
 
2376
- internal.attr(svg, "class", "svelte-klfhwd");
2377
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-klfhwd");
2378
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
2361
+ internal.attr(svg, "width", "100%");
2362
+ internal.attr(svg, "height", "100%");
2363
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
2364
+ internal.attr(svg, "class", "svelte-1kqo6e4");
2365
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
2379
2366
  },
2380
2367
  m(target, anchor) {
2381
2368
  internal.insert(target, div, anchor);
@@ -2385,20 +2372,13 @@ function create_fragment$2(ctx) {
2385
2372
  each_blocks[i].m(svg, null);
2386
2373
  }
2387
2374
 
2388
- /*div_binding*/ ctx[9](div);
2389
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
2390
2375
  current = true;
2391
-
2392
- if (!mounted) {
2393
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
2394
- mounted = true;
2395
- }
2396
2376
  },
2397
2377
  p(ctx, [dirty]) {
2398
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
2399
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2378
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
2379
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
2400
2380
  internal.group_outros();
2401
- 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, null, get_each_context);
2381
+ 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$1, null, get_each_context$1);
2402
2382
  internal.check_outros();
2403
2383
  }
2404
2384
  },
@@ -2424,127 +2404,46 @@ function create_fragment$2(ctx) {
2424
2404
  for (let i = 0; i < each_blocks.length; i += 1) {
2425
2405
  each_blocks[i].d();
2426
2406
  }
2427
-
2428
- /*div_binding*/ ctx[9](null);
2429
- div_resize_listener();
2430
- mounted = false;
2431
- dispose();
2432
2407
  }
2433
2408
  };
2434
2409
  }
2435
2410
 
2436
2411
  function instance$2($$self, $$props, $$invalidate) {
2437
- let { five } = $$props;
2438
- let { pxmm } = $$props;
2439
2412
  let { floorIndex } = $$props;
2440
2413
  let { floorplanData } = $$props;
2441
- let { onRoomHeightClick } = $$props;
2442
- let clientWidth;
2443
- let clientHeight;
2444
- let highlightContainerDom;
2445
- const { observers: floorplan_observers } = floorplanData;
2446
-
2447
- const handleClick = function (e) {
2448
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
2449
- ? void 0
2450
- : onRoomHeightClick(e)) === false) return;
2451
-
2452
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
2453
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
2454
-
2455
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
2456
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
2457
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
2458
-
2459
- // px 转换为 百分比
2460
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
2461
-
2462
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
2463
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
2464
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
2465
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
2466
- })[0];
2467
-
2468
- five.moveToPano(closestPoint.index);
2469
- };
2470
-
2471
- function div_binding($$value) {
2472
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
2473
- highlightContainerDom = $$value;
2474
- $$invalidate(5, highlightContainerDom);
2475
- });
2476
- }
2477
-
2478
- function div_elementresize_handler() {
2479
- clientWidth = this.clientWidth;
2480
- clientHeight = this.clientHeight;
2481
- $$invalidate(3, clientWidth);
2482
- $$invalidate(4, clientHeight);
2483
- }
2414
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
2415
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
2484
2416
 
2485
2417
  $$self.$$set = $$props => {
2486
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
2487
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2488
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2489
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2490
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
2418
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
2419
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
2491
2420
  };
2492
2421
 
2493
- return [
2494
- pxmm,
2495
- floorIndex,
2496
- floorplanData,
2497
- clientWidth,
2498
- clientHeight,
2499
- highlightContainerDom,
2500
- handleClick,
2501
- five,
2502
- onRoomHeightClick,
2503
- div_binding,
2504
- div_elementresize_handler
2505
- ];
2422
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
2506
2423
  }
2507
2424
 
2508
2425
  class RoomHighlight extends internal.SvelteComponent {
2509
2426
  constructor(options) {
2510
2427
  super();
2511
-
2512
- internal.init(
2513
- this,
2514
- options,
2515
- instance$2,
2516
- create_fragment$2,
2517
- internal.safe_not_equal,
2518
- {
2519
- five: 7,
2520
- pxmm: 0,
2521
- floorIndex: 1,
2522
- floorplanData: 2,
2523
- onRoomHeightClick: 8
2524
- },
2525
- add_css$2
2526
- );
2428
+ internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$2);
2527
2429
  }
2528
2430
  }
2529
2431
 
2530
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
2432
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
2531
2433
 
2532
2434
  function add_css$1(target) {
2533
- internal.append_styles(target, "svelte-tlo7rk", ".floorplan-current-floor.svelte-tlo7rk{position:relative;width:100%;height:100%}");
2435
+ 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}");
2534
2436
  }
2535
2437
 
2536
- // (19:2) {#if hoverEnable}
2438
+ // (17:2) {#if hoverEnable}
2537
2439
  function create_if_block_2(ctx) {
2538
2440
  let roomhighlight;
2539
2441
  let current;
2540
2442
 
2541
2443
  const roomhighlight_spread_levels = [
2542
2444
  {
2543
- five: /*five*/ ctx[1],
2544
- pxmm: /*pxmm*/ ctx[0],
2545
- floorIndex: /*floorIndex*/ ctx[2],
2546
- floorplanData: /*floorplanData*/ ctx[6],
2547
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2445
+ floorIndex: /*floorIndex*/ ctx[1],
2446
+ floorplanData: /*floorplanData*/ ctx[5]
2548
2447
  }
2549
2448
  ];
2550
2449
 
@@ -2565,14 +2464,11 @@ function create_if_block_2(ctx) {
2565
2464
  current = true;
2566
2465
  },
2567
2466
  p(ctx, dirty) {
2568
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
2467
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2569
2468
  ? internal.get_spread_update(roomhighlight_spread_levels, [
2570
2469
  {
2571
- five: /*five*/ ctx[1],
2572
- pxmm: /*pxmm*/ ctx[0],
2573
- floorIndex: /*floorIndex*/ ctx[2],
2574
- floorplanData: /*floorplanData*/ ctx[6],
2575
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2470
+ floorIndex: /*floorIndex*/ ctx[1],
2471
+ floorplanData: /*floorplanData*/ ctx[5]
2576
2472
  }
2577
2473
  ])
2578
2474
  : {};
@@ -2594,16 +2490,16 @@ function create_if_block_2(ctx) {
2594
2490
  };
2595
2491
  }
2596
2492
 
2597
- // (23:2) {#if roomLabelsEnable}
2493
+ // (21:2) {#if roomLabelsEnable}
2598
2494
  function create_if_block_1$1(ctx) {
2599
2495
  let roomlabels;
2600
2496
  let current;
2601
2497
 
2602
2498
  const roomlabels_spread_levels = [
2603
2499
  {
2604
- floorplanData: /*floorplanData*/ ctx[6],
2605
- floorIndex: /*floorIndex*/ ctx[2],
2606
- getLabelElement: /*getLabelElement*/ ctx[8]
2500
+ floorplanData: /*floorplanData*/ ctx[5],
2501
+ floorIndex: /*floorIndex*/ ctx[1],
2502
+ getLabelElement: /*getLabelElement*/ ctx[6]
2607
2503
  }
2608
2504
  ];
2609
2505
 
@@ -2624,12 +2520,12 @@ function create_if_block_1$1(ctx) {
2624
2520
  current = true;
2625
2521
  },
2626
2522
  p(ctx, dirty) {
2627
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
2523
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
2628
2524
  ? internal.get_spread_update(roomlabels_spread_levels, [
2629
2525
  {
2630
- floorplanData: /*floorplanData*/ ctx[6],
2631
- floorIndex: /*floorIndex*/ ctx[2],
2632
- getLabelElement: /*getLabelElement*/ ctx[8]
2526
+ floorplanData: /*floorplanData*/ ctx[5],
2527
+ floorIndex: /*floorIndex*/ ctx[1],
2528
+ getLabelElement: /*getLabelElement*/ ctx[6]
2633
2529
  }
2634
2530
  ])
2635
2531
  : {};
@@ -2651,16 +2547,15 @@ function create_if_block_1$1(ctx) {
2651
2547
  };
2652
2548
  }
2653
2549
 
2654
- // (26:2) {#if ruleLabelsEnable}
2550
+ // (24:2) {#if ruleLabelsEnable}
2655
2551
  function create_if_block$1(ctx) {
2656
2552
  let rulelabels;
2657
2553
  let current;
2658
2554
 
2659
2555
  const rulelabels_spread_levels = [
2660
2556
  {
2661
- floorplanData: /*floorplanData*/ ctx[6],
2662
- floorIndex: /*floorIndex*/ ctx[2],
2663
- pxmm: /*pxmm*/ ctx[0]
2557
+ floorplanData: /*floorplanData*/ ctx[5],
2558
+ floorIndex: /*floorIndex*/ ctx[1]
2664
2559
  }
2665
2560
  ];
2666
2561
 
@@ -2681,12 +2576,11 @@ function create_if_block$1(ctx) {
2681
2576
  current = true;
2682
2577
  },
2683
2578
  p(ctx, dirty) {
2684
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
2579
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2685
2580
  ? internal.get_spread_update(rulelabels_spread_levels, [
2686
2581
  {
2687
- floorplanData: /*floorplanData*/ ctx[6],
2688
- floorIndex: /*floorIndex*/ ctx[2],
2689
- pxmm: /*pxmm*/ ctx[0]
2582
+ floorplanData: /*floorplanData*/ ctx[5],
2583
+ floorIndex: /*floorIndex*/ ctx[1]
2690
2584
  }
2691
2585
  ])
2692
2586
  : {};
@@ -2716,13 +2610,13 @@ function create_fragment$1(ctx) {
2716
2610
  let baseimage;
2717
2611
  let t2;
2718
2612
  let t3;
2613
+ let div_class_value;
2719
2614
  let current;
2720
2615
 
2721
2616
  const roommaterial_spread_levels = [
2722
2617
  {
2723
- floorIndex: /*floorIndex*/ ctx[2],
2724
- floorplanData: /*floorplanData*/ ctx[6],
2725
- pxmm: /*pxmm*/ ctx[0]
2618
+ floorIndex: /*floorIndex*/ ctx[1],
2619
+ floorplanData: /*floorplanData*/ ctx[5]
2726
2620
  }
2727
2621
  ];
2728
2622
 
@@ -2733,12 +2627,12 @@ function create_fragment$1(ctx) {
2733
2627
  }
2734
2628
 
2735
2629
  roommaterial = new RoomMaterial({ props: roommaterial_props });
2736
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
2630
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
2737
2631
 
2738
2632
  const baseimage_spread_levels = [
2739
2633
  {
2740
- floorplanData: /*floorplanData*/ ctx[6],
2741
- floorIndex: /*floorIndex*/ ctx[2]
2634
+ floorplanData: /*floorplanData*/ ctx[5],
2635
+ floorIndex: /*floorIndex*/ ctx[1]
2742
2636
  }
2743
2637
  ];
2744
2638
 
@@ -2749,8 +2643,8 @@ function create_fragment$1(ctx) {
2749
2643
  }
2750
2644
 
2751
2645
  baseimage = new BaseImage({ props: baseimage_props });
2752
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
2753
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$1(ctx);
2646
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
2647
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$1(ctx);
2754
2648
 
2755
2649
  return {
2756
2650
  c() {
@@ -2764,7 +2658,10 @@ function create_fragment$1(ctx) {
2764
2658
  if (if_block1) if_block1.c();
2765
2659
  t3 = internal.space();
2766
2660
  if (if_block2) if_block2.c();
2767
- internal.attr(div, "class", "floorplan-current-floor svelte-tlo7rk");
2661
+
2662
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2663
+ ? ' floorplan-plugin__floor--is-current'
2664
+ : ''}`) + " svelte-bl8zrz"));
2768
2665
  },
2769
2666
  m(target, anchor) {
2770
2667
  internal.insert(target, div, anchor);
@@ -2780,23 +2677,22 @@ function create_fragment$1(ctx) {
2780
2677
  current = true;
2781
2678
  },
2782
2679
  p(ctx, [dirty]) {
2783
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
2680
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
2784
2681
  ? internal.get_spread_update(roommaterial_spread_levels, [
2785
2682
  {
2786
- floorIndex: /*floorIndex*/ ctx[2],
2787
- floorplanData: /*floorplanData*/ ctx[6],
2788
- pxmm: /*pxmm*/ ctx[0]
2683
+ floorIndex: /*floorIndex*/ ctx[1],
2684
+ floorplanData: /*floorplanData*/ ctx[5]
2789
2685
  }
2790
2686
  ])
2791
2687
  : {};
2792
2688
 
2793
2689
  roommaterial.$set(roommaterial_changes);
2794
2690
 
2795
- if (/*hoverEnable*/ ctx[3]) {
2691
+ if (/*hoverEnable*/ ctx[2]) {
2796
2692
  if (if_block0) {
2797
2693
  if_block0.p(ctx, dirty);
2798
2694
 
2799
- if (dirty & /*hoverEnable*/ 8) {
2695
+ if (dirty & /*hoverEnable*/ 4) {
2800
2696
  internal.transition_in(if_block0, 1);
2801
2697
  }
2802
2698
  } else {
@@ -2815,22 +2711,22 @@ function create_fragment$1(ctx) {
2815
2711
  internal.check_outros();
2816
2712
  }
2817
2713
 
2818
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
2714
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
2819
2715
  ? internal.get_spread_update(baseimage_spread_levels, [
2820
2716
  {
2821
- floorplanData: /*floorplanData*/ ctx[6],
2822
- floorIndex: /*floorIndex*/ ctx[2]
2717
+ floorplanData: /*floorplanData*/ ctx[5],
2718
+ floorIndex: /*floorIndex*/ ctx[1]
2823
2719
  }
2824
2720
  ])
2825
2721
  : {};
2826
2722
 
2827
2723
  baseimage.$set(baseimage_changes);
2828
2724
 
2829
- if (/*roomLabelsEnable*/ ctx[4]) {
2725
+ if (/*roomLabelsEnable*/ ctx[3]) {
2830
2726
  if (if_block1) {
2831
2727
  if_block1.p(ctx, dirty);
2832
2728
 
2833
- if (dirty & /*roomLabelsEnable*/ 16) {
2729
+ if (dirty & /*roomLabelsEnable*/ 8) {
2834
2730
  internal.transition_in(if_block1, 1);
2835
2731
  }
2836
2732
  } else {
@@ -2849,11 +2745,11 @@ function create_fragment$1(ctx) {
2849
2745
  internal.check_outros();
2850
2746
  }
2851
2747
 
2852
- if (/*ruleLabelsEnable*/ ctx[5]) {
2748
+ if (/*ruleLabelsEnable*/ ctx[4]) {
2853
2749
  if (if_block2) {
2854
2750
  if_block2.p(ctx, dirty);
2855
2751
 
2856
- if (dirty & /*ruleLabelsEnable*/ 32) {
2752
+ if (dirty & /*ruleLabelsEnable*/ 16) {
2857
2753
  internal.transition_in(if_block2, 1);
2858
2754
  }
2859
2755
  } else {
@@ -2871,6 +2767,12 @@ function create_fragment$1(ctx) {
2871
2767
 
2872
2768
  internal.check_outros();
2873
2769
  }
2770
+
2771
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
2772
+ ? ' floorplan-plugin__floor--is-current'
2773
+ : ''}`) + " svelte-bl8zrz"))) {
2774
+ internal.attr(div, "class", div_class_value);
2775
+ }
2874
2776
  },
2875
2777
  i(local) {
2876
2778
  if (current) return;
@@ -2901,37 +2803,31 @@ function create_fragment$1(ctx) {
2901
2803
  }
2902
2804
 
2903
2805
  function instance$1($$self, $$props, $$invalidate) {
2904
- let { pxmm } = $$props;
2905
- let { five } = $$props;
2806
+ let { isCurrent } = $$props;
2906
2807
  let { floorIndex } = $$props;
2907
2808
  let { hoverEnable } = $$props;
2908
2809
  let { roomLabelsEnable } = $$props;
2909
2810
  let { ruleLabelsEnable } = $$props;
2910
2811
  let { floorplanData } = $$props;
2911
- let { onRoomHeightClick } = $$props;
2912
2812
  let { getLabelElement } = $$props;
2913
2813
 
2914
2814
  $$self.$$set = $$props => {
2915
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2916
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
2917
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2918
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
2919
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
2920
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
2921
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
2922
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
2923
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
2815
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
2816
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2817
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
2818
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
2819
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
2820
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2821
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
2924
2822
  };
2925
2823
 
2926
2824
  return [
2927
- pxmm,
2928
- five,
2825
+ isCurrent,
2929
2826
  floorIndex,
2930
2827
  hoverEnable,
2931
2828
  roomLabelsEnable,
2932
2829
  ruleLabelsEnable,
2933
2830
  floorplanData,
2934
- onRoomHeightClick,
2935
2831
  getLabelElement
2936
2832
  ];
2937
2833
  }
@@ -2947,65 +2843,56 @@ class CurrentFloor extends internal.SvelteComponent {
2947
2843
  create_fragment$1,
2948
2844
  internal.safe_not_equal,
2949
2845
  {
2950
- pxmm: 0,
2951
- five: 1,
2952
- floorIndex: 2,
2953
- hoverEnable: 3,
2954
- roomLabelsEnable: 4,
2955
- ruleLabelsEnable: 5,
2956
- floorplanData: 6,
2957
- onRoomHeightClick: 7,
2958
- getLabelElement: 8
2846
+ isCurrent: 0,
2847
+ floorIndex: 1,
2848
+ hoverEnable: 2,
2849
+ roomLabelsEnable: 3,
2850
+ ruleLabelsEnable: 4,
2851
+ floorplanData: 5,
2852
+ getLabelElement: 6
2959
2853
  },
2960
2854
  add_css$1
2961
2855
  );
2962
2856
  }
2963
2857
  }
2964
2858
 
2965
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
2859
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
2966
2860
 
2967
2861
  function add_css(target) {
2968
2862
  internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
2969
2863
  }
2970
2864
 
2971
- // (24:0) {#if visible}
2865
+ function get_each_context(ctx, list, i) {
2866
+ const child_ctx = ctx.slice();
2867
+ child_ctx[13] = list[i];
2868
+ return child_ctx;
2869
+ }
2870
+
2871
+ // (21:0) {#if visible}
2972
2872
  function create_if_block(ctx) {
2973
2873
  let div;
2974
- let currentfloor;
2975
2874
  let t0;
2976
2875
  let camera;
2977
2876
  let t1;
2978
2877
  let div_intro;
2979
2878
  let current;
2879
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
2880
+ let each_blocks = [];
2980
2881
 
2981
- const currentfloor_spread_levels = [
2982
- {
2983
- five: /*five*/ ctx[2],
2984
- pxmm: /*pxmm*/ ctx[1],
2985
- floorIndex: /*floorIndex*/ ctx[6],
2986
- hoverEnable: /*hoverEnable*/ ctx[7],
2987
- floorplanData: /*floorplanData*/ ctx[11],
2988
- getLabelElement: /*getLabelElement*/ ctx[15],
2989
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
2990
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
2991
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2992
- }
2993
- ];
2994
-
2995
- let currentfloor_props = {};
2996
-
2997
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2998
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2882
+ for (let i = 0; i < each_value.length; i += 1) {
2883
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
2999
2884
  }
3000
2885
 
3001
- currentfloor = new CurrentFloor({ props: currentfloor_props });
2886
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
2887
+ each_blocks[i] = null;
2888
+ });
3002
2889
 
3003
2890
  const camera_spread_levels = [
3004
2891
  {
3005
- panoIndex: /*panoIndex*/ ctx[5],
3006
- floorplanData: /*floorplanData*/ ctx[11],
3007
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
3008
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2892
+ panoIndex: /*panoIndex*/ ctx[3],
2893
+ floorplanData: /*floorplanData*/ ctx[9],
2894
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2895
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3009
2896
  }
3010
2897
  ];
3011
2898
 
@@ -3016,12 +2903,16 @@ function create_if_block(ctx) {
3016
2903
  }
3017
2904
 
3018
2905
  camera = new Camera({ props: camera_props });
3019
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
2906
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
3020
2907
 
3021
2908
  return {
3022
2909
  c() {
3023
2910
  div = internal.element("div");
3024
- internal.create_component(currentfloor.$$.fragment);
2911
+
2912
+ for (let i = 0; i < each_blocks.length; i += 1) {
2913
+ each_blocks[i].c();
2914
+ }
2915
+
3025
2916
  t0 = internal.space();
3026
2917
  internal.create_component(camera.$$.fragment);
3027
2918
  t1 = internal.space();
@@ -3030,7 +2921,11 @@ function create_if_block(ctx) {
3030
2921
  },
3031
2922
  m(target, anchor) {
3032
2923
  internal.insert(target, div, anchor);
3033
- internal.mount_component(currentfloor, div, null);
2924
+
2925
+ for (let i = 0; i < each_blocks.length; i += 1) {
2926
+ each_blocks[i].m(div, null);
2927
+ }
2928
+
3034
2929
  internal.append(div, t0);
3035
2930
  internal.mount_component(camera, div, null);
3036
2931
  internal.append(div, t1);
@@ -3040,42 +2935,51 @@ function create_if_block(ctx) {
3040
2935
  p(new_ctx, dirty) {
3041
2936
  ctx = new_ctx;
3042
2937
 
3043
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
3044
- ? internal.get_spread_update(currentfloor_spread_levels, [
3045
- {
3046
- five: /*five*/ ctx[2],
3047
- pxmm: /*pxmm*/ ctx[1],
3048
- floorIndex: /*floorIndex*/ ctx[6],
3049
- hoverEnable: /*hoverEnable*/ ctx[7],
3050
- floorplanData: /*floorplanData*/ ctx[11],
3051
- getLabelElement: /*getLabelElement*/ ctx[15],
3052
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3053
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3054
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
2938
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
2939
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
2940
+ let i;
2941
+
2942
+ for (i = 0; i < each_value.length; i += 1) {
2943
+ const child_ctx = get_each_context(ctx, each_value, i);
2944
+
2945
+ if (each_blocks[i]) {
2946
+ each_blocks[i].p(child_ctx, dirty);
2947
+ internal.transition_in(each_blocks[i], 1);
2948
+ } else {
2949
+ each_blocks[i] = create_each_block(child_ctx);
2950
+ each_blocks[i].c();
2951
+ internal.transition_in(each_blocks[i], 1);
2952
+ each_blocks[i].m(div, t0);
3055
2953
  }
3056
- ])
3057
- : {};
2954
+ }
3058
2955
 
3059
- currentfloor.$set(currentfloor_changes);
2956
+ internal.group_outros();
2957
+
2958
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
2959
+ out(i);
2960
+ }
2961
+
2962
+ internal.check_outros();
2963
+ }
3060
2964
 
3061
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
2965
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
3062
2966
  ? internal.get_spread_update(camera_spread_levels, [
3063
2967
  {
3064
- panoIndex: /*panoIndex*/ ctx[5],
3065
- floorplanData: /*floorplanData*/ ctx[11],
3066
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
3067
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
2968
+ panoIndex: /*panoIndex*/ ctx[3],
2969
+ floorplanData: /*floorplanData*/ ctx[9],
2970
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
2971
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
3068
2972
  }
3069
2973
  ])
3070
2974
  : {};
3071
2975
 
3072
2976
  camera.$set(camera_changes);
3073
2977
 
3074
- if (/*compassEnable*/ ctx[8]) {
2978
+ if (/*compassEnable*/ ctx[6]) {
3075
2979
  if (if_block) {
3076
2980
  if_block.p(ctx, dirty);
3077
2981
 
3078
- if (dirty & /*compassEnable*/ 256) {
2982
+ if (dirty & /*compassEnable*/ 64) {
3079
2983
  internal.transition_in(if_block, 1);
3080
2984
  }
3081
2985
  } else {
@@ -3096,14 +3000,18 @@ function create_if_block(ctx) {
3096
3000
  },
3097
3001
  i(local) {
3098
3002
  if (current) return;
3099
- internal.transition_in(currentfloor.$$.fragment, local);
3003
+
3004
+ for (let i = 0; i < each_value.length; i += 1) {
3005
+ internal.transition_in(each_blocks[i]);
3006
+ }
3007
+
3100
3008
  internal.transition_in(camera.$$.fragment, local);
3101
3009
  internal.transition_in(if_block);
3102
3010
 
3103
3011
  if (!div_intro) {
3104
3012
  internal.add_render_callback(() => {
3105
3013
  div_intro = internal.create_in_transition(div, transition.fade, {
3106
- duration: /*duration*/ ctx[3],
3014
+ duration: /*duration*/ ctx[0],
3107
3015
  easing: easing.linear
3108
3016
  });
3109
3017
 
@@ -3114,29 +3022,107 @@ function create_if_block(ctx) {
3114
3022
  current = true;
3115
3023
  },
3116
3024
  o(local) {
3117
- internal.transition_out(currentfloor.$$.fragment, local);
3025
+ each_blocks = each_blocks.filter(Boolean);
3026
+
3027
+ for (let i = 0; i < each_blocks.length; i += 1) {
3028
+ internal.transition_out(each_blocks[i]);
3029
+ }
3030
+
3118
3031
  internal.transition_out(camera.$$.fragment, local);
3119
3032
  internal.transition_out(if_block);
3120
3033
  current = false;
3121
3034
  },
3122
3035
  d(detaching) {
3123
3036
  if (detaching) internal.detach(div);
3124
- internal.destroy_component(currentfloor);
3037
+ internal.destroy_each(each_blocks, detaching);
3125
3038
  internal.destroy_component(camera);
3126
3039
  if (if_block) if_block.d();
3127
3040
  }
3128
3041
  };
3129
3042
  }
3130
3043
 
3131
- // (40:4) {#if compassEnable}
3044
+ // (23:4) {#each floorplanData.floorDatas as floorData}
3045
+ function create_each_block(ctx) {
3046
+ let currentfloor;
3047
+ let current;
3048
+
3049
+ const currentfloor_spread_levels = [
3050
+ {
3051
+ hoverEnable: /*hoverEnable*/ ctx[5],
3052
+ floorplanData: /*floorplanData*/ ctx[9],
3053
+ getLabelElement: /*getLabelElement*/ ctx[12],
3054
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3055
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
3056
+ },
3057
+ {
3058
+ floorIndex: /*floorData*/ ctx[13].floorIndex
3059
+ },
3060
+ {
3061
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
3062
+ }
3063
+ ];
3064
+
3065
+ let currentfloor_props = {};
3066
+
3067
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
3068
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3069
+ }
3070
+
3071
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
3072
+
3073
+ return {
3074
+ c() {
3075
+ internal.create_component(currentfloor.$$.fragment);
3076
+ },
3077
+ m(target, anchor) {
3078
+ internal.mount_component(currentfloor, target, anchor);
3079
+ current = true;
3080
+ },
3081
+ p(ctx, dirty) {
3082
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
3083
+ ? internal.get_spread_update(currentfloor_spread_levels, [
3084
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
3085
+ hoverEnable: /*hoverEnable*/ ctx[5],
3086
+ floorplanData: /*floorplanData*/ ctx[9],
3087
+ getLabelElement: /*getLabelElement*/ ctx[12],
3088
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
3089
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
3090
+ },
3091
+ dirty & /*floorplanData*/ 512 && {
3092
+ floorIndex: /*floorData*/ ctx[13].floorIndex
3093
+ },
3094
+ dirty & /*floorplanData, floorIndex*/ 528 && {
3095
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
3096
+ }
3097
+ ])
3098
+ : {};
3099
+
3100
+ currentfloor.$set(currentfloor_changes);
3101
+ },
3102
+ i(local) {
3103
+ if (current) return;
3104
+ internal.transition_in(currentfloor.$$.fragment, local);
3105
+ current = true;
3106
+ },
3107
+ o(local) {
3108
+ internal.transition_out(currentfloor.$$.fragment, local);
3109
+ current = false;
3110
+ },
3111
+ d(detaching) {
3112
+ internal.destroy_component(currentfloor, detaching);
3113
+ }
3114
+ };
3115
+ }
3116
+
3117
+ // (37:4) {#if compassEnable}
3132
3118
  function create_if_block_1(ctx) {
3133
3119
  let compass;
3134
3120
  let current;
3135
3121
 
3136
3122
  compass = new Compass({
3137
3123
  props: {
3138
- floorplanData: /*floorplanData*/ ctx[11],
3139
- northDesc: /*northDesc*/ ctx[0]
3124
+ floorplanData: /*floorplanData*/ ctx[9],
3125
+ northDesc: /*northDesc*/ ctx[2]
3140
3126
  }
3141
3127
  });
3142
3128
 
@@ -3150,8 +3136,8 @@ function create_if_block_1(ctx) {
3150
3136
  },
3151
3137
  p(ctx, dirty) {
3152
3138
  const compass_changes = {};
3153
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
3154
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
3139
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
3140
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
3155
3141
  compass.$set(compass_changes);
3156
3142
  },
3157
3143
  i(local) {
@@ -3172,7 +3158,7 @@ function create_if_block_1(ctx) {
3172
3158
  function create_fragment(ctx) {
3173
3159
  let if_block_anchor;
3174
3160
  let current;
3175
- let if_block = /*visible*/ ctx[4] && create_if_block(ctx);
3161
+ let if_block = /*visible*/ ctx[1] && create_if_block(ctx);
3176
3162
 
3177
3163
  return {
3178
3164
  c() {
@@ -3185,11 +3171,11 @@ function create_fragment(ctx) {
3185
3171
  current = true;
3186
3172
  },
3187
3173
  p(ctx, [dirty]) {
3188
- if (/*visible*/ ctx[4]) {
3174
+ if (/*visible*/ ctx[1]) {
3189
3175
  if (if_block) {
3190
3176
  if_block.p(ctx, dirty);
3191
3177
 
3192
- if (dirty & /*visible*/ 16) {
3178
+ if (dirty & /*visible*/ 2) {
3193
3179
  internal.transition_in(if_block, 1);
3194
3180
  }
3195
3181
  } else {
@@ -3225,11 +3211,9 @@ function create_fragment(ctx) {
3225
3211
  }
3226
3212
 
3227
3213
  function instance($$self, $$props, $$invalidate) {
3228
- let { northDesc } = $$props;
3229
- let { pxmm } = $$props;
3230
- let { five } = $$props;
3231
3214
  let { duration = 0 } = $$props;
3232
3215
  let { visible } = $$props;
3216
+ let { northDesc } = $$props;
3233
3217
  let { panoIndex } = $$props;
3234
3218
  let { floorIndex } = $$props;
3235
3219
  let { hoverEnable } = $$props;
@@ -3239,34 +3223,28 @@ function instance($$self, $$props, $$invalidate) {
3239
3223
  let { floorplanData } = $$props;
3240
3224
  let { lastPanoramaLongitude } = $$props;
3241
3225
  let { cameraImageUrl } = $$props;
3242
- let { onRoomHeightClick } = $$props;
3243
3226
  let { getLabelElement } = $$props;
3244
3227
 
3245
3228
  $$self.$$set = $$props => {
3246
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
3247
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3248
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
3249
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
3250
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
3251
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
3252
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
3253
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
3254
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
3255
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
3256
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
3257
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
3258
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3259
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
3260
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
3261
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
3229
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
3230
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
3231
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
3232
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
3233
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
3234
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
3235
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
3236
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
3237
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
3238
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
3239
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3240
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
3241
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
3262
3242
  };
3263
3243
 
3264
3244
  return [
3265
- northDesc,
3266
- pxmm,
3267
- five,
3268
3245
  duration,
3269
3246
  visible,
3247
+ northDesc,
3270
3248
  panoIndex,
3271
3249
  floorIndex,
3272
3250
  hoverEnable,
@@ -3276,7 +3254,6 @@ function instance($$self, $$props, $$invalidate) {
3276
3254
  floorplanData,
3277
3255
  lastPanoramaLongitude,
3278
3256
  cameraImageUrl,
3279
- onRoomHeightClick,
3280
3257
  getLabelElement
3281
3258
  ];
3282
3259
  }
@@ -3292,22 +3269,19 @@ class Main extends internal.SvelteComponent {
3292
3269
  create_fragment,
3293
3270
  internal.safe_not_equal,
3294
3271
  {
3295
- northDesc: 0,
3296
- pxmm: 1,
3297
- five: 2,
3298
- duration: 3,
3299
- visible: 4,
3300
- panoIndex: 5,
3301
- floorIndex: 6,
3302
- hoverEnable: 7,
3303
- compassEnable: 8,
3304
- roomLabelsEnable: 9,
3305
- ruleLabelsEnable: 10,
3306
- floorplanData: 11,
3307
- lastPanoramaLongitude: 12,
3308
- cameraImageUrl: 13,
3309
- onRoomHeightClick: 14,
3310
- getLabelElement: 15
3272
+ duration: 0,
3273
+ visible: 1,
3274
+ northDesc: 2,
3275
+ panoIndex: 3,
3276
+ floorIndex: 4,
3277
+ hoverEnable: 5,
3278
+ compassEnable: 6,
3279
+ roomLabelsEnable: 7,
3280
+ ruleLabelsEnable: 8,
3281
+ floorplanData: 9,
3282
+ lastPanoramaLongitude: 10,
3283
+ cameraImageUrl: 11,
3284
+ getLabelElement: 12
3311
3285
  },
3312
3286
  add_css
3313
3287
  );
@@ -3417,32 +3391,58 @@ class TopviewFloorplanPluginController {
3417
3391
  value: () => {
3418
3392
  var _a, _b;
3419
3393
  this.hide();
3420
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
3421
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
3422
- this.five.off('modeChange', this.handleModeChange);
3423
- this.five.off('panoArrived', this.handlePanoArrived);
3424
- this.five.off('modelLoaded', this.handleModelLoaded);
3425
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
3426
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
3427
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
3394
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
3395
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
3396
+ this.five.off('modeChange', this.onFiveModeChange);
3397
+ this.five.off('panGesture', this.onFivePanGesture);
3398
+ this.five.off('panoArrived', this.onFivePanoArrived);
3399
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
3400
+ this.five.off('pinchGesture', this.onFivePinchGesture);
3401
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
3402
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
3403
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
3428
3404
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
3429
3405
  }
3430
3406
  });
3431
- /** 模型楼层高亮改变时,自动进行楼层切换 */
3407
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
3408
+ enumerable: true,
3409
+ configurable: true,
3410
+ writable: true,
3411
+ value: () => {
3412
+ if (this.visible && this.configs.preventRoomClick)
3413
+ return false;
3414
+ }
3415
+ });
3416
+ Object.defineProperty(this, "onFiveWantsGesture", {
3417
+ enumerable: true,
3418
+ configurable: true,
3419
+ writable: true,
3420
+ value: (type) => {
3421
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
3422
+ return;
3423
+ if (this.visible && !this.configs.gestureEnable)
3424
+ return false;
3425
+ }
3426
+ });
3432
3427
  Object.defineProperty(this, "onModelShownFloorChange", {
3433
3428
  enumerable: true,
3434
3429
  configurable: true,
3435
3430
  writable: true,
3436
3431
  value: (shownFloor) => {
3437
- if (shownFloor === null)
3432
+ if (this.floorIndex === shownFloor)
3438
3433
  return;
3434
+ if (shownFloor === null) {
3435
+ const panoIndex = this.five.getCurrentState().panoIndex;
3436
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
3437
+ return;
3438
+ }
3439
+ // 模型楼层高亮改变时,自动进行楼层切换
3439
3440
  this.floorIndex = shownFloor;
3440
3441
  this.updateSize();
3441
3442
  this.render();
3442
3443
  }
3443
3444
  });
3444
- /** panoIndex 改变时,更新 floorIndex */
3445
- Object.defineProperty(this, "handlePanoArrived", {
3445
+ Object.defineProperty(this, "onFivePanoArrived", {
3446
3446
  enumerable: true,
3447
3447
  configurable: true,
3448
3448
  writable: true,
@@ -3454,31 +3454,28 @@ class TopviewFloorplanPluginController {
3454
3454
  this.floorIndex = this.five.work.observers[index].floorIndex;
3455
3455
  }
3456
3456
  });
3457
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
3458
- Object.defineProperty(this, "handleWantsMoveToPano", {
3457
+ Object.defineProperty(this, "onFivePanGesture", {
3459
3458
  enumerable: true,
3460
3459
  configurable: true,
3461
3460
  writable: true,
3462
3461
  value: () => {
3463
3462
  if (!this.visible)
3464
3463
  return;
3465
- if (this.configs.preventRoomClick)
3466
- return false;
3467
- return;
3464
+ this.updatePosition();
3468
3465
  }
3469
3466
  });
3470
- /** 在户型图展示时阻止 Five 滑动行为 */
3471
- Object.defineProperty(this, "handleWantsPanGesture", {
3467
+ Object.defineProperty(this, "onFivePinchGesture", {
3472
3468
  enumerable: true,
3473
3469
  configurable: true,
3474
3470
  writable: true,
3475
3471
  value: () => {
3476
3472
  if (!this.visible)
3477
3473
  return;
3478
- return false;
3474
+ this.updatePosition();
3475
+ this.updateSize();
3479
3476
  }
3480
3477
  });
3481
- Object.defineProperty(this, "handleModelLoaded", {
3478
+ Object.defineProperty(this, "onFiveModelLoaded", {
3482
3479
  enumerable: true,
3483
3480
  configurable: true,
3484
3481
  writable: true,
@@ -3495,7 +3492,7 @@ class TopviewFloorplanPluginController {
3495
3492
  }
3496
3493
  });
3497
3494
  /** 非 Topview 态隐藏户型图 */
3498
- Object.defineProperty(this, "handleModeChange", {
3495
+ Object.defineProperty(this, "onFiveModeChange", {
3499
3496
  enumerable: true,
3500
3497
  configurable: true,
3501
3498
  writable: true,
@@ -3505,7 +3502,7 @@ class TopviewFloorplanPluginController {
3505
3502
  }
3506
3503
  });
3507
3504
  /** 动画结束后是 Topview 态就展示户型图 */
3508
- Object.defineProperty(this, "handleInitAnimationEnded", {
3505
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
3509
3506
  enumerable: true,
3510
3507
  configurable: true,
3511
3508
  writable: true,
@@ -3545,24 +3542,30 @@ class TopviewFloorplanPluginController {
3545
3542
  this.five = five;
3546
3543
  this.selector = params.selector;
3547
3544
  this.configs = omit(params, ['selector']);
3545
+ this.five.addExtraElement(this.container);
3548
3546
  // 设置 container 样式
3549
3547
  this.container.classList.add('floorplan-plugin');
3550
3548
  Object.assign(this.container.style, pluginStyle);
3551
3549
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
3552
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
3550
+ this.five.model.loaded
3551
+ ? this.onFiveModelLoaded()
3552
+ : five.once('modelLoaded', this.onFiveModelLoaded);
3553
3553
  this.five.once('dispose', this.dispose);
3554
- this.five.on('modeChange', this.handleModeChange);
3555
- this.five.on('panoArrived', this.handlePanoArrived);
3556
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
3554
+ this.five.on('modeChange', this.onFiveModeChange);
3555
+ this.five.on('panGesture', this.onFivePanGesture);
3556
+ this.five.on('mouseWheel', this.onFivePinchGesture);
3557
+ this.five.on('panoArrived', this.onFivePanoArrived);
3558
+ this.five.on('pinchGesture', this.onFivePinchGesture);
3559
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
3560
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
3561
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
3557
3562
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
3558
3563
  }
3559
3564
  /** 加载户型图数据 */
3560
- load(data) {
3561
- return __awaiter(this, void 0, void 0, function* () {
3562
- const copyData = JSON.parse(JSON.stringify(data));
3563
- this.floorplanData = yield formatData(copyData);
3564
- this.render();
3565
- });
3565
+ async load(data) {
3566
+ const copyData = JSON.parse(JSON.stringify(data));
3567
+ this.floorplanData = await formatData(copyData);
3568
+ this.render();
3566
3569
  }
3567
3570
  /** 把插件的渲染DOM插入到对应的容器中去 */
3568
3571
  appendTo(wrapper) {
@@ -3573,6 +3576,7 @@ class TopviewFloorplanPluginController {
3573
3576
  show() {
3574
3577
  this.visible = true;
3575
3578
  this.five.model.show(this.floorIndex);
3579
+ this.updatePosition();
3576
3580
  this.updateSize();
3577
3581
  const renderDuration = 500;
3578
3582
  const modelOpacity = this.configs.modelOpacity;
@@ -3580,8 +3584,6 @@ class TopviewFloorplanPluginController {
3580
3584
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3581
3585
  }
3582
3586
  this.render(renderDuration);
3583
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3584
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
3585
3587
  }
3586
3588
  hide() {
3587
3589
  const modelOpacity = 1;
@@ -3589,20 +3591,28 @@ class TopviewFloorplanPluginController {
3589
3591
  this.visible = false;
3590
3592
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3591
3593
  this.render();
3592
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3593
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
3594
+ }
3595
+ /** 更新户型图位置 */
3596
+ updatePosition() {
3597
+ var _a;
3598
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3());
3599
+ if (!modelCenter)
3600
+ return;
3601
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
3602
+ const left = (ndcModelCenter.x + 1) / 2;
3603
+ const top = -(ndcModelCenter.y - 1) / 2;
3604
+ this.container.style.left = left * 100 + '%';
3605
+ this.container.style.top = top * 100 + '%';
3594
3606
  }
3595
3607
  render(duration) {
3596
3608
  if (!this.container || !this.floorplanData)
3597
3609
  return;
3598
3610
  if (this.size.width === 0)
3599
3611
  return;
3600
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
3601
- const handleClick = preventRoomClick ? () => false : undefined;
3612
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
3602
3613
  const props = {
3614
+ getLabelElement,
3603
3615
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
3604
- five: this.five,
3605
- pxmm: this.pxmm,
3606
3616
  cameraImageUrl,
3607
3617
  visible: this.visible,
3608
3618
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -3614,8 +3624,6 @@ class TopviewFloorplanPluginController {
3614
3624
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
3615
3625
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
3616
3626
  lastPanoramaLongitude: this.lastPanoramaLongitude,
3617
- getLabelElement,
3618
- onRoomHeightClick: handleClick,
3619
3627
  };
3620
3628
  if (!this.app) {
3621
3629
  this.app = new Main({