@vertexvis/viewer 1.1.1-testing.3 → 1.1.1-testing.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/README.template.md +14 -8
  2. package/dist/cjs/{bundle-07I6_WqC.js → bundle-BCS0nA91.js} +28 -25
  3. package/dist/cjs/bundle-BCS0nA91.js.map +1 -0
  4. package/dist/cjs/{config-CepHuwRF.js → config-BY0v6BSK.js} +3 -3
  5. package/dist/cjs/{config-CepHuwRF.js.map → config-BY0v6BSK.js.map} +1 -1
  6. package/dist/cjs/{controller-Dklbe0Y6.js → controller-DvE3p6ta.js} +3 -3
  7. package/dist/cjs/{controller-Dklbe0Y6.js.map → controller-DvE3p6ta.js.map} +1 -1
  8. package/dist/cjs/{dom-Dlu6-7PF.js → dom-BuQSLPWr.js} +3 -3
  9. package/dist/cjs/{dom-Dlu6-7PF.js.map → dom-BuQSLPWr.js.map} +1 -1
  10. package/dist/cjs/{entities-BdWnb6KI.js → entities-CEaa12yP.js} +4 -4
  11. package/dist/cjs/{entities-BdWnb6KI.js.map → entities-CEaa12yP.js.map} +1 -1
  12. package/dist/cjs/{geometry_pb-BISQT2vx.js → geometry_pb-EVfAEuPO.js} +3 -3
  13. package/dist/cjs/{geometry_pb-BISQT2vx.js.map → geometry_pb-EVfAEuPO.js.map} +1 -1
  14. package/dist/cjs/grpc-D5Apx_zz.js.map +1 -1
  15. package/dist/cjs/index.cjs.js +13 -13
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/{markup-C-qyTwID.js → markup-Du4uVRo4.js} +3 -3
  18. package/dist/cjs/{markup-C-qyTwID.js.map → markup-Du4uVRo4.js.map} +1 -1
  19. package/dist/cjs/{model-Dy5FvjIA.js → model-BC6acIWJ.js} +3 -3
  20. package/dist/cjs/{model-Dy5FvjIA.js.map → model-BC6acIWJ.js.map} +1 -1
  21. package/dist/cjs/model-Bw4h8wNt.js.map +1 -1
  22. package/dist/cjs/{model-k5VBFN6C.js → model-DqxeakCS.js} +3 -3
  23. package/dist/cjs/{model-k5VBFN6C.js.map → model-DqxeakCS.js.map} +1 -1
  24. package/dist/cjs/{multiElementInteractionHandler-Bqpg2wVT.js → multiElementInteractionHandler-Bdeo6FYp.js} +6 -5
  25. package/dist/cjs/multiElementInteractionHandler-Bdeo6FYp.js.map +1 -0
  26. package/dist/cjs/{overlays-BujVkBnG.js → overlays-DASFbMSp.js} +3 -3
  27. package/dist/cjs/{overlays-BujVkBnG.js.map → overlays-DASFbMSp.js.map} +1 -1
  28. package/dist/cjs/{queries-GhYmoomu.js → queries-LthBzEHD.js} +5 -5
  29. package/dist/cjs/queries-LthBzEHD.js.map +1 -0
  30. package/dist/cjs/{regl-component-CB004H91.js → regl-component-B_JaaVlv.js} +6 -6
  31. package/dist/cjs/{regl-component-CB004H91.js.map → regl-component-B_JaaVlv.js.map} +1 -1
  32. package/dist/cjs/{representation_pb-CHCm5o1e.js → representation_pb-B6XR10pQ.js} +3 -3
  33. package/dist/cjs/{representation_pb-CHCm5o1e.js.map → representation_pb-B6XR10pQ.js.map} +1 -1
  34. package/dist/cjs/{results-BpfUIwa8.js → results-CU9Ctm2K.js} +3 -3
  35. package/dist/cjs/{results-BpfUIwa8.js.map → results-CU9Ctm2K.js.map} +1 -1
  36. package/dist/cjs/{streamAttributes-CJOD7AxG.js → streamAttributes-nCF7u7lv.js} +4 -4
  37. package/dist/cjs/{streamAttributes-CJOD7AxG.js.map → streamAttributes-nCF7u7lv.js.map} +1 -1
  38. package/dist/cjs/{util-smaTO4bk.js → util-gX3IGslq.js} +3 -3
  39. package/dist/cjs/{util-smaTO4bk.js.map → util-gX3IGslq.js.map} +1 -1
  40. package/dist/cjs/{utils-BsXO-wLi.js → utils-D5TGpFAV.js} +3 -3
  41. package/dist/cjs/utils-D5TGpFAV.js.map +1 -0
  42. package/dist/cjs/{utils-DY6afhh8.js → utils-opS9hsaU.js} +3 -3
  43. package/dist/cjs/{utils-DY6afhh8.js.map → utils-opS9hsaU.js.map} +1 -1
  44. package/dist/cjs/vertex-scene-tree-notification-banner_4.cjs.entry.js +1 -1
  45. package/dist/cjs/vertex-scene-tree-notification-banner_4.cjs.entry.js.map +1 -1
  46. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +2 -2
  47. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js.map +1 -1
  48. package/dist/cjs/vertex-scene-tree-table-column.cjs.entry.js.map +1 -1
  49. package/dist/cjs/vertex-scene-tree.cjs.entry.js +3 -3
  50. package/dist/cjs/vertex-scene-tree.cjs.entry.js.map +1 -1
  51. package/dist/cjs/vertex-viewer-annotation-callout.cjs.entry.js.map +1 -1
  52. package/dist/cjs/vertex-viewer-box-query-tool.cjs.entry.js +4 -4
  53. package/dist/cjs/vertex-viewer-box-query-tool.cjs.entry.js.map +1 -1
  54. package/dist/cjs/vertex-viewer-button_3.cjs.entry.js +6 -1
  55. package/dist/cjs/vertex-viewer-button_3.cjs.entry.js.map +1 -1
  56. package/dist/cjs/vertex-viewer-default-toolbar.cjs.entry.js +2 -2
  57. package/dist/cjs/vertex-viewer-default-toolbar.cjs.entry.js.map +1 -1
  58. package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +5 -5
  59. package/dist/cjs/vertex-viewer-dom-group.cjs.entry.js +1 -1
  60. package/dist/cjs/vertex-viewer-hit-result-indicator.cjs.entry.js +5 -5
  61. package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
  62. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
  63. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js.map +1 -1
  64. package/dist/cjs/vertex-viewer-markup.cjs.entry.js +3 -3
  65. package/dist/cjs/vertex-viewer-markup.cjs.entry.js.map +1 -1
  66. package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
  67. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +8 -8
  68. package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +5 -5
  69. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +7 -7
  70. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +7 -7
  71. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js.map +1 -1
  72. package/dist/cjs/vertex-viewer-pin-label_2.cjs.entry.js +7 -6
  73. package/dist/cjs/vertex-viewer-pin-label_2.cjs.entry.js.map +1 -1
  74. package/dist/cjs/vertex-viewer-pin-tool.cjs.entry.js +3 -3
  75. package/dist/cjs/vertex-viewer-spinner.cjs.entry.js.map +1 -1
  76. package/dist/cjs/vertex-viewer-teleport-tool.cjs.entry.js +2 -2
  77. package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js +6 -6
  78. package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js.map +1 -1
  79. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +2 -2
  80. package/dist/cjs/vertex-viewer-walk-mode-tool.cjs.entry.js +1 -1
  81. package/dist/cjs/vertex-viewer.cjs.entry.js +8 -8
  82. package/dist/cjs/viewer.cjs.js +1 -1
  83. package/dist/cjs/{viewport-B70DgDZj.js → viewport-BDbB9o9T.js} +3 -3
  84. package/dist/cjs/{viewport-B70DgDZj.js.map → viewport-BDbB9o9T.js.map} +1 -1
  85. package/dist/collection/components/scene-tree/scene-tree.css +2 -3
  86. package/dist/collection/components/scene-tree/scene-tree.js.map +1 -1
  87. package/dist/collection/components/scene-tree-notification-banner/scene-tree-notification-banner.css +1 -1
  88. package/dist/collection/components/scene-tree-search/scene-tree-search.css +1 -1
  89. package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.css +10 -10
  90. package/dist/collection/components/scene-tree-table-column/scene-tree-table-column.css +0 -1
  91. package/dist/collection/components/scene-tree-table-layout/scene-tree-table-layout.css +3 -3
  92. package/dist/collection/components/viewer-annotation-callout/viewer-annotation-callout.css +3 -4
  93. package/dist/collection/components/viewer-box-query-tool/types.js.map +1 -1
  94. package/dist/collection/components/viewer-box-query-tool/viewer-box-query-tool.css +9 -7
  95. package/dist/collection/components/viewer-button/viewer-button.js +32 -1
  96. package/dist/collection/components/viewer-button/viewer-button.js.map +1 -1
  97. package/dist/collection/components/viewer-default-toolbar/viewer-default-toolbar.css +2 -2
  98. package/dist/collection/components/viewer-default-toolbar/viewer-default-toolbar.js +1 -1
  99. package/dist/collection/components/viewer-default-toolbar/viewer-default-toolbar.js.map +1 -1
  100. package/dist/collection/components/viewer-markup/viewer-markup.js.map +1 -1
  101. package/dist/collection/components/viewer-markup-arrow/utils.js.map +1 -1
  102. package/dist/collection/components/viewer-markup-tool/viewer-markup-tool.css +2 -2
  103. package/dist/collection/components/viewer-pin-group/viewer-pin-group.css +12 -11
  104. package/dist/collection/components/viewer-pin-label/viewer-pin-label.css +21 -8
  105. package/dist/collection/components/viewer-pin-label/viewer-pin-label.js +2 -1
  106. package/dist/collection/components/viewer-pin-label/viewer-pin-label.js.map +1 -1
  107. package/dist/collection/components/viewer-pin-label-line/viewer-pin-label-line.css +5 -4
  108. package/dist/collection/components/viewer-spinner/viewer-spinner.css +2 -2
  109. package/dist/collection/components/viewer-transform-widget/viewer-transform-widget-components.js.map +1 -1
  110. package/dist/collection/components/viewer-transform-widget/viewer-transform-widget.css +1 -2
  111. package/dist/collection/lib/grpc.js.map +1 -1
  112. package/dist/collection/lib/interactions/baseInteractionHandler.js +2 -1
  113. package/dist/collection/lib/interactions/baseInteractionHandler.js.map +1 -1
  114. package/dist/collection/lib/scenes/scene.js.map +1 -1
  115. package/dist/collection/lib/scenes/sceneViewStateLoader.js.map +1 -1
  116. package/dist/collection/lib/stream/state.js.map +1 -1
  117. package/dist/collection/lib/types/loadableResource.js.map +1 -1
  118. package/dist/collection/lib/types/sceneViewStateIdentifier.js.map +1 -1
  119. package/dist/collection/lib/walk-mode/model.js.map +1 -1
  120. package/dist/components/index.js +1 -1
  121. package/dist/components/p-2UsvOTHJ.js +5 -0
  122. package/dist/components/p-2UsvOTHJ.js.map +1 -0
  123. package/dist/components/{p-garvKln8.js → p-BAuOB8M-.js} +2 -2
  124. package/dist/components/p-BAuOB8M-.js.map +1 -0
  125. package/dist/components/p-BFEV_v80.js +5 -0
  126. package/dist/components/p-BFEV_v80.js.map +1 -0
  127. package/dist/components/{p-C02XtMl4.js → p-BHyxBmg6.js} +2 -2
  128. package/dist/components/{p-CfTvpqud.js → p-BNRm88jS.js} +2 -2
  129. package/dist/components/{p-O1_Yvjd6.js → p-BT9d9jRt.js} +2 -2
  130. package/dist/components/{p-oDn1DcWj.js → p-BZDn1Vuv.js} +2 -2
  131. package/dist/components/{p-VEJB73Ei.js → p-Bdf4AcJ2.js} +2 -2
  132. package/dist/components/{p-CelQDFR0.js → p-C12jtCFb.js} +2 -2
  133. package/dist/components/{p-Dzs4u_ZY.js → p-CABws4i9.js} +2 -2
  134. package/dist/components/p-CIuxJYJL.js.map +1 -1
  135. package/dist/components/{p-CZgX-9yo.js → p-COznr3CH.js} +2 -2
  136. package/dist/components/{p-BqeEZXPn.js → p-CPROw2BU.js} +2 -2
  137. package/dist/components/{p-BKQMbekH.js → p-CWcvgy8e.js} +2 -2
  138. package/dist/components/{p-CMdP8O-G.js → p-Ca253f0h.js} +2 -2
  139. package/dist/components/{p-EG7pMA2M.js → p-CeZe0Qql.js} +2 -2
  140. package/dist/components/p-CioaIHsi.js.map +1 -1
  141. package/dist/components/{p-DH341c7b.js → p-Cku0WCYo.js} +2 -2
  142. package/dist/components/p-Cku0WCYo.js.map +1 -0
  143. package/dist/components/{p-Due5EmBt.js → p-Clyxptbp.js} +2 -2
  144. package/dist/components/{p-taOlygmc.js → p-Cs2aiMUK.js} +2 -2
  145. package/dist/components/p-Cs2aiMUK.js.map +1 -0
  146. package/dist/components/{p-DjrtwKcK.js → p-CvEK3ZK1.js} +2 -2
  147. package/dist/components/p-Cxz4L6FA.js +5 -0
  148. package/dist/components/p-Cxz4L6FA.js.map +1 -0
  149. package/dist/components/{p-MnZadXO8.js → p-D1Vdomj_.js} +2 -2
  150. package/dist/components/{p-DRGCkSEK.js → p-D3bzgaCV.js} +2 -2
  151. package/dist/components/{p-DnVcQAR9.js → p-D3in41xo.js} +2 -2
  152. package/dist/components/p-DTwJX9HL.js +5 -0
  153. package/dist/components/p-DTwJX9HL.js.map +1 -0
  154. package/dist/components/p-DUo-H-nW.js +5 -0
  155. package/dist/components/p-DUo-H-nW.js.map +1 -0
  156. package/dist/components/{p-DCTZZ5Rd.js → p-DjQ6RXWP.js} +2 -2
  157. package/dist/components/p-DxuSiXYg.js.map +1 -1
  158. package/dist/components/{p-CxzyM08j.js → p-DyL2wWm6.js} +2 -2
  159. package/dist/components/{p-avWSFTeP.js → p-JvS9LLoO.js} +2 -2
  160. package/dist/{viewer/p-7m7Vr5V7.js → components/p-Ng27jBsS.js} +2 -2
  161. package/dist/components/p-Ng27jBsS.js.map +1 -0
  162. package/dist/components/{p-BC777sCK.js → p-UJR-ixsy.js} +2 -2
  163. package/dist/components/{p-Ib4vgh2t.js → p-UrT4ZJv3.js} +2 -2
  164. package/dist/components/{p-Ib4vgh2t.js.map → p-UrT4ZJv3.js.map} +1 -1
  165. package/dist/components/p-Y8W_BXUk.js.map +1 -1
  166. package/dist/components/{p-mpsCUvSn.js → p-_qi2VkC2.js} +2 -2
  167. package/dist/components/{p-CNprIkKd.js → p-rDr0x5Z7.js} +2 -2
  168. package/dist/components/vertex-scene-tree-table-cell.js +1 -1
  169. package/dist/components/vertex-scene-tree-table-cell.js.map +1 -1
  170. package/dist/components/vertex-scene-tree-table-column.js.map +1 -1
  171. package/dist/components/vertex-scene-tree-table-layout.js +1 -1
  172. package/dist/components/vertex-scene-tree.js +1 -1
  173. package/dist/components/vertex-scene-tree.js.map +1 -1
  174. package/dist/components/vertex-viewer-annotation-callout.js.map +1 -1
  175. package/dist/components/vertex-viewer-box-query-tool.js +1 -1
  176. package/dist/components/vertex-viewer-box-query-tool.js.map +1 -1
  177. package/dist/components/vertex-viewer-button.js +1 -1
  178. package/dist/components/vertex-viewer-default-toolbar.js +1 -1
  179. package/dist/components/vertex-viewer-default-toolbar.js.map +1 -1
  180. package/dist/components/vertex-viewer-dom-element.js +1 -1
  181. package/dist/components/vertex-viewer-dom-group.js +1 -1
  182. package/dist/components/vertex-viewer-dom-renderer.js +1 -1
  183. package/dist/components/vertex-viewer-hit-result-indicator.js +1 -1
  184. package/dist/components/vertex-viewer-markup-arrow.js +1 -1
  185. package/dist/components/vertex-viewer-markup-circle.js +1 -1
  186. package/dist/components/vertex-viewer-markup-freeform.js +1 -1
  187. package/dist/components/vertex-viewer-markup-tool.js +1 -1
  188. package/dist/components/vertex-viewer-markup-tool.js.map +1 -1
  189. package/dist/components/vertex-viewer-markup.js +1 -1
  190. package/dist/components/vertex-viewer-markup.js.map +1 -1
  191. package/dist/components/vertex-viewer-measurement-details.js +1 -1
  192. package/dist/components/vertex-viewer-measurement-distance.js +1 -1
  193. package/dist/components/vertex-viewer-measurement-line.js +1 -1
  194. package/dist/components/vertex-viewer-measurement-overlays.js +1 -1
  195. package/dist/components/vertex-viewer-measurement-precise.js +1 -1
  196. package/dist/components/vertex-viewer-pin-group.js +1 -1
  197. package/dist/components/vertex-viewer-pin-label-line.js +1 -1
  198. package/dist/components/vertex-viewer-pin-label.js +1 -1
  199. package/dist/components/vertex-viewer-pin-tool.js +1 -1
  200. package/dist/components/vertex-viewer-teleport-tool.js +1 -1
  201. package/dist/components/vertex-viewer-transform-widget.js +1 -1
  202. package/dist/components/vertex-viewer-transform-widget.js.map +1 -1
  203. package/dist/components/vertex-viewer-view-cube.js +1 -1
  204. package/dist/components/vertex-viewer-walk-mode-tool.js +1 -1
  205. package/dist/components/vertex-viewer.js +1 -1
  206. package/dist/esm/{bundle-CZZALKHT.js → bundle-2UsvOTHJ.js} +28 -25
  207. package/dist/esm/bundle-2UsvOTHJ.js.map +1 -0
  208. package/dist/esm/{config-CyaUTJEG.js → config-ss9ha12b.js} +3 -3
  209. package/dist/esm/{config-CyaUTJEG.js.map → config-ss9ha12b.js.map} +1 -1
  210. package/dist/esm/{controller-ByBd8r3O.js → controller-BPECXXfj.js} +3 -3
  211. package/dist/esm/{controller-ByBd8r3O.js.map → controller-BPECXXfj.js.map} +1 -1
  212. package/dist/esm/{dom-Bbf2HAst.js → dom-DaP9SiyY.js} +3 -3
  213. package/dist/esm/{dom-Bbf2HAst.js.map → dom-DaP9SiyY.js.map} +1 -1
  214. package/dist/esm/{entities-DriL3zBC.js → entities-DEFAhYdV.js} +4 -4
  215. package/dist/esm/{entities-DriL3zBC.js.map → entities-DEFAhYdV.js.map} +1 -1
  216. package/dist/esm/{geometry_pb-BEB8SExe.js → geometry_pb-D7fM1PYG.js} +3 -3
  217. package/dist/esm/{geometry_pb-BEB8SExe.js.map → geometry_pb-D7fM1PYG.js.map} +1 -1
  218. package/dist/esm/grpc-hWL8wFvk.js.map +1 -1
  219. package/dist/esm/index.js +13 -13
  220. package/dist/esm/index.mjs +13 -13
  221. package/dist/esm/loader.js +1 -1
  222. package/dist/esm/loader.mjs +1 -1
  223. package/dist/esm/{markup-y96-uR-l.js → markup-B58g75Hr.js} +3 -3
  224. package/dist/esm/{markup-y96-uR-l.js.map → markup-B58g75Hr.js.map} +1 -1
  225. package/dist/esm/{model-BJQo0DxL.js → model-B5KuXEsl.js} +3 -3
  226. package/dist/esm/{model-BJQo0DxL.js.map → model-B5KuXEsl.js.map} +1 -1
  227. package/dist/esm/model-BHVr1tU0.js.map +1 -1
  228. package/dist/esm/{model-CTdG73h9.js → model-Dc6T63-k.js} +3 -3
  229. package/dist/esm/{model-CTdG73h9.js.map → model-Dc6T63-k.js.map} +1 -1
  230. package/dist/esm/{multiElementInteractionHandler-C45E8VzE.js → multiElementInteractionHandler-3tE3OPpw.js} +6 -5
  231. package/dist/esm/multiElementInteractionHandler-3tE3OPpw.js.map +1 -0
  232. package/dist/esm/{overlays-DmcRtaSn.js → overlays-BwIqsqLW.js} +3 -3
  233. package/dist/esm/{overlays-DmcRtaSn.js.map → overlays-BwIqsqLW.js.map} +1 -1
  234. package/dist/esm/{queries-DWjy-LsV.js → queries-BcmE5Zbq.js} +5 -5
  235. package/dist/esm/queries-BcmE5Zbq.js.map +1 -0
  236. package/dist/esm/{regl-component-zzdsBise.js → regl-component-gIonUTBJ.js} +6 -6
  237. package/dist/esm/{regl-component-zzdsBise.js.map → regl-component-gIonUTBJ.js.map} +1 -1
  238. package/dist/esm/{representation_pb-CQdJxiGO.js → representation_pb-Bf023NuN.js} +3 -3
  239. package/dist/esm/{representation_pb-CQdJxiGO.js.map → representation_pb-Bf023NuN.js.map} +1 -1
  240. package/dist/esm/{results-ClIgKssN.js → results-De9arm7M.js} +3 -3
  241. package/dist/esm/{results-ClIgKssN.js.map → results-De9arm7M.js.map} +1 -1
  242. package/dist/esm/{streamAttributes-CTs61PCl.js → streamAttributes-Bj2xDHfI.js} +3 -3
  243. package/dist/esm/{streamAttributes-CTs61PCl.js.map → streamAttributes-Bj2xDHfI.js.map} +1 -1
  244. package/dist/esm/{util-DUjEw5Kh.js → util-CMPFqnEv.js} +3 -3
  245. package/dist/esm/{util-DUjEw5Kh.js.map → util-CMPFqnEv.js.map} +1 -1
  246. package/dist/esm/{utils-DOjHP1wA.js → utils-B1mSYmAK.js} +3 -3
  247. package/dist/esm/{utils-DOjHP1wA.js.map → utils-B1mSYmAK.js.map} +1 -1
  248. package/dist/esm/{utils-DJ5FvINs.js → utils-c-mcLgsj.js} +3 -3
  249. package/dist/esm/utils-c-mcLgsj.js.map +1 -0
  250. package/dist/esm/vertex-scene-tree-notification-banner_4.entry.js +1 -1
  251. package/dist/esm/vertex-scene-tree-notification-banner_4.entry.js.map +1 -1
  252. package/dist/esm/vertex-scene-tree-table-cell.entry.js +2 -2
  253. package/dist/esm/vertex-scene-tree-table-cell.entry.js.map +1 -1
  254. package/dist/esm/vertex-scene-tree-table-column.entry.js.map +1 -1
  255. package/dist/esm/vertex-scene-tree.entry.js +3 -3
  256. package/dist/esm/vertex-scene-tree.entry.js.map +1 -1
  257. package/dist/esm/vertex-viewer-annotation-callout.entry.js.map +1 -1
  258. package/dist/esm/vertex-viewer-box-query-tool.entry.js +4 -4
  259. package/dist/esm/vertex-viewer-box-query-tool.entry.js.map +1 -1
  260. package/dist/esm/vertex-viewer-button_3.entry.js +6 -1
  261. package/dist/esm/vertex-viewer-button_3.entry.js.map +1 -1
  262. package/dist/esm/vertex-viewer-default-toolbar.entry.js +2 -2
  263. package/dist/esm/vertex-viewer-default-toolbar.entry.js.map +1 -1
  264. package/dist/esm/vertex-viewer-dom-element_2.entry.js +5 -5
  265. package/dist/esm/vertex-viewer-dom-group.entry.js +1 -1
  266. package/dist/esm/vertex-viewer-hit-result-indicator.entry.js +5 -5
  267. package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
  268. package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
  269. package/dist/esm/vertex-viewer-markup-tool.entry.js.map +1 -1
  270. package/dist/esm/vertex-viewer-markup.entry.js +3 -3
  271. package/dist/esm/vertex-viewer-markup.entry.js.map +1 -1
  272. package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
  273. package/dist/esm/vertex-viewer-measurement-distance.entry.js +8 -8
  274. package/dist/esm/vertex-viewer-measurement-line_2.entry.js +5 -5
  275. package/dist/esm/vertex-viewer-measurement-precise.entry.js +7 -7
  276. package/dist/esm/vertex-viewer-pin-group.entry.js +7 -7
  277. package/dist/esm/vertex-viewer-pin-group.entry.js.map +1 -1
  278. package/dist/esm/vertex-viewer-pin-label_2.entry.js +7 -6
  279. package/dist/esm/vertex-viewer-pin-label_2.entry.js.map +1 -1
  280. package/dist/esm/vertex-viewer-pin-tool.entry.js +3 -3
  281. package/dist/esm/vertex-viewer-spinner.entry.js.map +1 -1
  282. package/dist/esm/vertex-viewer-teleport-tool.entry.js +2 -2
  283. package/dist/esm/vertex-viewer-transform-widget.entry.js +6 -6
  284. package/dist/esm/vertex-viewer-transform-widget.entry.js.map +1 -1
  285. package/dist/esm/vertex-viewer-view-cube.entry.js +2 -2
  286. package/dist/esm/vertex-viewer-walk-mode-tool.entry.js +1 -1
  287. package/dist/esm/vertex-viewer.entry.js +8 -8
  288. package/dist/esm/viewer.js +1 -1
  289. package/dist/esm/{viewport-D90kzsD7.js → viewport-CHtidaFL.js} +3 -3
  290. package/dist/esm/{viewport-D90kzsD7.js.map → viewport-CHtidaFL.js.map} +1 -1
  291. package/dist/types/components/viewer-button/viewer-button.d.ts +5 -0
  292. package/dist/types/components.d.ts +14 -1
  293. package/dist/types/lib/walk-mode/model.d.ts +10 -10
  294. package/dist/types/regl-shape.d.ts +1 -5
  295. package/dist/viewer/index.esm.js +1 -1
  296. package/dist/viewer/{p-12a673f0.entry.js → p-00540193.entry.js} +2 -2
  297. package/dist/viewer/p-00540193.entry.js.map +1 -0
  298. package/dist/viewer/{p-78f422af.entry.js → p-287e0670.entry.js} +2 -2
  299. package/dist/viewer/{p-78f422af.entry.js.map → p-287e0670.entry.js.map} +1 -1
  300. package/dist/viewer/p-2UsvOTHJ.js +5 -0
  301. package/dist/viewer/p-2UsvOTHJ.js.map +1 -0
  302. package/dist/viewer/{p-510fd2e1.entry.js → p-2d2fa147.entry.js} +2 -2
  303. package/dist/viewer/{p-fe434552.entry.js → p-30a5748d.entry.js} +2 -2
  304. package/dist/viewer/p-32a51a21.entry.js +5 -0
  305. package/dist/viewer/p-32a51a21.entry.js.map +1 -0
  306. package/dist/viewer/{p-aa0359e0.entry.js → p-3c5dd716.entry.js} +2 -2
  307. package/dist/viewer/{p-9312a936.entry.js → p-48020de1.entry.js} +2 -2
  308. package/dist/viewer/{p-d5542b6a.entry.js → p-4dd67d16.entry.js} +2 -2
  309. package/dist/viewer/p-4dd67d16.entry.js.map +1 -0
  310. package/dist/viewer/p-504e77a7.entry.js +5 -0
  311. package/dist/viewer/{p-c2c3579f.entry.js.map → p-504e77a7.entry.js.map} +1 -1
  312. package/dist/viewer/{p-71c03352.entry.js → p-53f6cc59.entry.js} +2 -2
  313. package/dist/viewer/{p-7b4eec65.entry.js → p-5cfb3047.entry.js} +2 -2
  314. package/dist/viewer/{p-e3981cf8.entry.js → p-7cb9c9bb.entry.js} +2 -2
  315. package/dist/viewer/p-7cb9c9bb.entry.js.map +1 -0
  316. package/dist/viewer/{p-56e39cff.entry.js → p-83683307.entry.js} +2 -2
  317. package/dist/viewer/{p-a108a305.entry.js → p-9a39315d.entry.js} +2 -2
  318. package/dist/viewer/{p-O1_Yvjd6.js → p-BT9d9jRt.js} +2 -2
  319. package/dist/viewer/{p-O1_Yvjd6.js.map → p-BT9d9jRt.js.map} +1 -1
  320. package/dist/viewer/{p-VEJB73Ei.js → p-Bdf4AcJ2.js} +2 -2
  321. package/dist/viewer/{p-VEJB73Ei.js.map → p-Bdf4AcJ2.js.map} +1 -1
  322. package/dist/viewer/{p-Cr2EnhS-.js → p-BhKTTmpL.js} +2 -2
  323. package/dist/viewer/{p-Cr2EnhS-.js.map → p-BhKTTmpL.js.map} +1 -1
  324. package/dist/viewer/{p-CelQDFR0.js → p-C12jtCFb.js} +2 -2
  325. package/dist/viewer/{p-CelQDFR0.js.map → p-C12jtCFb.js.map} +1 -1
  326. package/dist/viewer/p-CEDqc5sS.js +5 -0
  327. package/dist/viewer/{p-BDy3SLKk.js.map → p-CEDqc5sS.js.map} +1 -1
  328. package/dist/viewer/{p-C6YtUG51.js → p-CS8PfgcI.js} +2 -2
  329. package/dist/viewer/{p-C6YtUG51.js.map → p-CS8PfgcI.js.map} +1 -1
  330. package/dist/viewer/{p-EG7pMA2M.js → p-CeZe0Qql.js} +2 -2
  331. package/dist/viewer/{p-EG7pMA2M.js.map → p-CeZe0Qql.js.map} +1 -1
  332. package/dist/viewer/p-CioaIHsi.js.map +1 -1
  333. package/dist/viewer/{p-EUeCUp3y.js → p-CxBXErQ8.js} +2 -2
  334. package/dist/viewer/{p-EUeCUp3y.js.map → p-CxBXErQ8.js.map} +1 -1
  335. package/dist/viewer/{p-BIR7Lfxx.js → p-CyiY_hsD.js} +2 -2
  336. package/dist/viewer/{p-BIR7Lfxx.js.map → p-CyiY_hsD.js.map} +1 -1
  337. package/dist/viewer/{p-CIBBr-p1.js → p-D0aTA_2m.js} +2 -2
  338. package/dist/viewer/{p-CIBBr-p1.js.map → p-D0aTA_2m.js.map} +1 -1
  339. package/dist/viewer/{p-C-huOg09.js → p-D2IEHEGM.js} +2 -2
  340. package/dist/viewer/{p-C-huOg09.js.map → p-D2IEHEGM.js.map} +1 -1
  341. package/dist/viewer/{p-UQXG8bCI.js → p-DBfvBC5O.js} +2 -2
  342. package/dist/viewer/p-DBfvBC5O.js.map +1 -0
  343. package/dist/viewer/{p-B-J4CqZy.js → p-DHK23fw4.js} +2 -2
  344. package/dist/viewer/{p-B-J4CqZy.js.map → p-DHK23fw4.js.map} +1 -1
  345. package/dist/{components/p-QhlhRt6X.js → viewer/p-DIbJ8Ijj.js} +2 -2
  346. package/dist/viewer/p-DIbJ8Ijj.js.map +1 -0
  347. package/dist/viewer/{p-CxzyM08j.js → p-DyL2wWm6.js} +2 -2
  348. package/dist/viewer/{p-CxzyM08j.js.map → p-DyL2wWm6.js.map} +1 -1
  349. package/dist/viewer/{p-avWSFTeP.js → p-JvS9LLoO.js} +2 -2
  350. package/dist/viewer/{p-avWSFTeP.js.map → p-JvS9LLoO.js.map} +1 -1
  351. package/dist/viewer/p-_LpaX1ga.js +5 -0
  352. package/dist/viewer/p-_LpaX1ga.js.map +1 -0
  353. package/dist/viewer/{p-mpsCUvSn.js → p-_qi2VkC2.js} +2 -2
  354. package/dist/viewer/{p-mpsCUvSn.js.map → p-_qi2VkC2.js.map} +1 -1
  355. package/dist/viewer/p-b5cc83a4.entry.js.map +1 -1
  356. package/dist/viewer/{p-82ed4346.entry.js → p-b79c295a.entry.js} +2 -2
  357. package/dist/viewer/{p-fc7d9b2b.entry.js → p-c531ca97.entry.js} +2 -2
  358. package/dist/viewer/{p-fc7d9b2b.entry.js.map → p-c531ca97.entry.js.map} +1 -1
  359. package/dist/viewer/p-c9dee5c4.entry.js +5 -0
  360. package/dist/viewer/p-c9dee5c4.entry.js.map +1 -0
  361. package/dist/viewer/{p-c2454523.entry.js → p-cc835213.entry.js} +2 -2
  362. package/dist/viewer/p-ce711ae0.entry.js +5 -0
  363. package/dist/viewer/p-ce711ae0.entry.js.map +1 -0
  364. package/dist/viewer/p-d357d235.entry.js.map +1 -1
  365. package/dist/viewer/{p-91fca24b.entry.js → p-d5a57757.entry.js} +2 -2
  366. package/dist/viewer/p-e4913b06.entry.js +5 -0
  367. package/dist/viewer/p-e4913b06.entry.js.map +1 -0
  368. package/dist/viewer/p-e98db875.entry.js.map +1 -1
  369. package/dist/viewer/{p-a893a299.entry.js → p-edc2f914.entry.js} +2 -2
  370. package/dist/viewer/{p-03a531d9.entry.js → p-ef9437ca.entry.js} +2 -2
  371. package/dist/viewer/{p-49578ec9.entry.js → p-fd3a5837.entry.js} +2 -2
  372. package/dist/viewer/p-fd3a5837.entry.js.map +1 -0
  373. package/dist/viewer/p-ipyYHvea.js.map +1 -1
  374. package/dist/viewer/{p-Ce1j43tF.js → p-kMZA0v7I.js} +2 -2
  375. package/dist/viewer/{p-Ce1j43tF.js.map → p-kMZA0v7I.js.map} +1 -1
  376. package/dist/viewer/viewer.esm.js +1 -1
  377. package/package.json +8 -8
  378. package/readme.md +14 -8
  379. package/dist/cjs/bundle-07I6_WqC.js.map +0 -1
  380. package/dist/cjs/multiElementInteractionHandler-Bqpg2wVT.js.map +0 -1
  381. package/dist/cjs/queries-GhYmoomu.js.map +0 -1
  382. package/dist/cjs/utils-BsXO-wLi.js.map +0 -1
  383. package/dist/components/p-B4sO9HdX.js +0 -5
  384. package/dist/components/p-B4sO9HdX.js.map +0 -1
  385. package/dist/components/p-C--Voxln.js +0 -5
  386. package/dist/components/p-C--Voxln.js.map +0 -1
  387. package/dist/components/p-CZZALKHT.js +0 -5
  388. package/dist/components/p-CZZALKHT.js.map +0 -1
  389. package/dist/components/p-Cn0vKqIN.js +0 -5
  390. package/dist/components/p-Cn0vKqIN.js.map +0 -1
  391. package/dist/components/p-DH341c7b.js.map +0 -1
  392. package/dist/components/p-Dmc49hX3.js +0 -5
  393. package/dist/components/p-Dmc49hX3.js.map +0 -1
  394. package/dist/components/p-QhlhRt6X.js.map +0 -1
  395. package/dist/components/p-garvKln8.js.map +0 -1
  396. package/dist/components/p-taOlygmc.js.map +0 -1
  397. package/dist/esm/bundle-CZZALKHT.js.map +0 -1
  398. package/dist/esm/multiElementInteractionHandler-C45E8VzE.js.map +0 -1
  399. package/dist/esm/queries-DWjy-LsV.js.map +0 -1
  400. package/dist/esm/utils-DJ5FvINs.js.map +0 -1
  401. package/dist/viewer/p-02384d83.entry.js +0 -5
  402. package/dist/viewer/p-02384d83.entry.js.map +0 -1
  403. package/dist/viewer/p-12a673f0.entry.js.map +0 -1
  404. package/dist/viewer/p-49578ec9.entry.js.map +0 -1
  405. package/dist/viewer/p-4c223366.entry.js +0 -5
  406. package/dist/viewer/p-4c223366.entry.js.map +0 -1
  407. package/dist/viewer/p-7m7Vr5V7.js.map +0 -1
  408. package/dist/viewer/p-8774425b.entry.js +0 -5
  409. package/dist/viewer/p-8774425b.entry.js.map +0 -1
  410. package/dist/viewer/p-9c02567d.entry.js +0 -5
  411. package/dist/viewer/p-9c02567d.entry.js.map +0 -1
  412. package/dist/viewer/p-BDy3SLKk.js +0 -5
  413. package/dist/viewer/p-CZZALKHT.js +0 -5
  414. package/dist/viewer/p-CZZALKHT.js.map +0 -1
  415. package/dist/viewer/p-Cju1inFh.js +0 -5
  416. package/dist/viewer/p-Cju1inFh.js.map +0 -1
  417. package/dist/viewer/p-UQXG8bCI.js.map +0 -1
  418. package/dist/viewer/p-c2c3579f.entry.js +0 -5
  419. package/dist/viewer/p-d5542b6a.entry.js.map +0 -1
  420. package/dist/viewer/p-e3981cf8.entry.js.map +0 -1
  421. /package/dist/components/{p-C02XtMl4.js.map → p-BHyxBmg6.js.map} +0 -0
  422. /package/dist/components/{p-CfTvpqud.js.map → p-BNRm88jS.js.map} +0 -0
  423. /package/dist/components/{p-O1_Yvjd6.js.map → p-BT9d9jRt.js.map} +0 -0
  424. /package/dist/components/{p-oDn1DcWj.js.map → p-BZDn1Vuv.js.map} +0 -0
  425. /package/dist/components/{p-VEJB73Ei.js.map → p-Bdf4AcJ2.js.map} +0 -0
  426. /package/dist/components/{p-CelQDFR0.js.map → p-C12jtCFb.js.map} +0 -0
  427. /package/dist/components/{p-Dzs4u_ZY.js.map → p-CABws4i9.js.map} +0 -0
  428. /package/dist/components/{p-CZgX-9yo.js.map → p-COznr3CH.js.map} +0 -0
  429. /package/dist/components/{p-BqeEZXPn.js.map → p-CPROw2BU.js.map} +0 -0
  430. /package/dist/components/{p-BKQMbekH.js.map → p-CWcvgy8e.js.map} +0 -0
  431. /package/dist/components/{p-CMdP8O-G.js.map → p-Ca253f0h.js.map} +0 -0
  432. /package/dist/components/{p-EG7pMA2M.js.map → p-CeZe0Qql.js.map} +0 -0
  433. /package/dist/components/{p-Due5EmBt.js.map → p-Clyxptbp.js.map} +0 -0
  434. /package/dist/components/{p-DjrtwKcK.js.map → p-CvEK3ZK1.js.map} +0 -0
  435. /package/dist/components/{p-MnZadXO8.js.map → p-D1Vdomj_.js.map} +0 -0
  436. /package/dist/components/{p-DRGCkSEK.js.map → p-D3bzgaCV.js.map} +0 -0
  437. /package/dist/components/{p-DnVcQAR9.js.map → p-D3in41xo.js.map} +0 -0
  438. /package/dist/components/{p-DCTZZ5Rd.js.map → p-DjQ6RXWP.js.map} +0 -0
  439. /package/dist/components/{p-CxzyM08j.js.map → p-DyL2wWm6.js.map} +0 -0
  440. /package/dist/components/{p-avWSFTeP.js.map → p-JvS9LLoO.js.map} +0 -0
  441. /package/dist/components/{p-BC777sCK.js.map → p-UJR-ixsy.js.map} +0 -0
  442. /package/dist/components/{p-mpsCUvSn.js.map → p-_qi2VkC2.js.map} +0 -0
  443. /package/dist/components/{p-CNprIkKd.js.map → p-rDr0x5Z7.js.map} +0 -0
  444. /package/dist/viewer/{p-510fd2e1.entry.js.map → p-2d2fa147.entry.js.map} +0 -0
  445. /package/dist/viewer/{p-fe434552.entry.js.map → p-30a5748d.entry.js.map} +0 -0
  446. /package/dist/viewer/{p-aa0359e0.entry.js.map → p-3c5dd716.entry.js.map} +0 -0
  447. /package/dist/viewer/{p-9312a936.entry.js.map → p-48020de1.entry.js.map} +0 -0
  448. /package/dist/viewer/{p-71c03352.entry.js.map → p-53f6cc59.entry.js.map} +0 -0
  449. /package/dist/viewer/{p-7b4eec65.entry.js.map → p-5cfb3047.entry.js.map} +0 -0
  450. /package/dist/viewer/{p-56e39cff.entry.js.map → p-83683307.entry.js.map} +0 -0
  451. /package/dist/viewer/{p-a108a305.entry.js.map → p-9a39315d.entry.js.map} +0 -0
  452. /package/dist/viewer/{p-82ed4346.entry.js.map → p-b79c295a.entry.js.map} +0 -0
  453. /package/dist/viewer/{p-c2454523.entry.js.map → p-cc835213.entry.js.map} +0 -0
  454. /package/dist/viewer/{p-91fca24b.entry.js.map → p-d5a57757.entry.js.map} +0 -0
  455. /package/dist/viewer/{p-a893a299.entry.js.map → p-edc2f914.entry.js.map} +0 -0
  456. /package/dist/viewer/{p-03a531d9.entry.js.map → p-ef9437ca.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["create","x","y","distance","a","b","delta","subtract","Math","sqrt","add","scaleProportional","pt","scale","magnitude","normalizeVector","magnitudeOfPoint","normalDirectionVector","ptA","ptB","orthogonalVector","unitVectorBetweenPoints","abs","vectorXValue","pow","vectorYValue","fromJson","json","obj","JSON","parse","Array","isArray","createArrowheadPoints","start","end","arrowSideLength","arrowHeadTheta","arrowOrthogonalVector","Point.orthogonalVector","normalizedDirection","Point.normalDirectionVector","arrowLeft","Point.subtract","Point.add","Point.scaleProportional","cos","sin","arrowRight","leftPoint","rightPoint","createLineAnchorStylePoints","triangleArrowAngle","lineArrowAngle","Point.distance","arrowHeadHeight","max","min","hashHeight","radius","triangleArrowRelativeHeight","triangleArrowBasePosition","triangleArrowTheta","Angle","toRadians","triangleArrowSideLength","triangleArrow","lineArrowTheta","lineArrowSideLength","lineArrow","hashLineTheta","hashLine","tip","base","arrowTriangle","arrowLine","hash","arrowheadPointsToPolygonPoints","points","scaledRight","scalePointProportional","scaledLeft","scaledBase","map","join","arrowheadPointsToPathPoints","arrowheadPointsToHashPoints","x1","y1","x2","y2","arrowheadPointsToCirclePoints","cx","cy","r","isVertexViewerArrowMarkup","el","HTMLElement","nodeName","parsePoint","value","Point.fromJson","basePoint","scaledPoint","isVertexViewerCircleMarkup","parseBounds","Rectangle","parsePoints","values","Point","stringify","isVertexViewerFreeformMarkup","getBoundingBox2dAnchorPosition","rect","position","width","height","center","translatePointToScreen","canvasDimensions","contentDimensions","centeringBehavior","canvasToContentScaleFactor","effectiveScalar","contentScaleFactor","getScaleFactor","contentRelativePoint","Dimensions","scaledContentWidth","scaledContentHeight","centerOffsetX","centerOffsetY","translateDimensionsToScreen","dimensions","contentRelativeDimensions","translateRectToScreen","fromPointAndDimensions","translatePointToRelative","offset","pointWithoutOffset","getWindowDevicePixelRatio","centeredContentPoint","contentCenterRelativePoint","translatePointsToBounds","original","bounds","createRectangle","initialPoint","currentPoint","maintainAspectRatio","fromPoints","fitBoundsSize","isPortrait","currentIsLeftOfInitial","currentIsAboveInitial","fitBoundsX","fitBoundsY","transformRectangle","current","anchor","left","top","w","h","right","bottom","topLeft","bottomLeft","topRight","bottomRight","isVertexViewerMarkupElement","isValidPointData","every","Number","isNaN","isValidStartEvent","event","target","mode","RelativeAnchor","id","transform","rotation","name","point","onPointerDown","children","class","style","onTouchStart","preventDefault","SvgShadow","effectiveScale","xOffset","yOffset","filterUnits","in","stdDeviation","dx","dy","result","in2","operator","MarkupInteractionHandler","constructor","scalingOptions","this","handlePointerDown","handleInteractionAttempt","handlePointerMove","handleInteractionMove","handlePointerUp","window","removeEventListener","handleInteractionEnd","resizeObserver","ResizeObserver","entry","elementBounds","computeBoundingRect","initialize","element","observe","addEventListener","dispose","disconnect","_a","undefined","updateScalingOptions","getScalingOptions","acceptInteraction"],"sources":["../geometry/src/point.ts","src/components/viewer-markup-arrow/utils.ts","src/components/viewer-markup-circle/utils.ts","src/components/viewer-markup-freeform/utils.ts","src/components/viewer-markup/markup-utils.ts","src/components/viewer-markup/viewer-markup-components.tsx","src/lib/markup/interactions.ts"],"sourcesContent":["import * as Angle from './angle';\nimport { lerp as lerpNumber } from './math';\n\n/**\n * A `Point` represents a cartesian coordinate with a horizontal and vertical\n * position or length.\n */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Returns a new `Point` with the given horizontal and vertical position.\n */\nexport function create(x = 0, y = 0): Point {\n return { x, y };\n}\n\n/**\n * Converts a polar coordinate (length and angle) into a Cartesian coordinate.\n */\nexport function polar(length: number, radians: Angle.Angle): Point {\n const x = Math.cos(radians) * length;\n const y = Math.sin(radians) * length;\n return create(x, y);\n}\n\n/**\n * Returns the distance between two points.\n */\nexport function distance(a: Point, b: Point): number {\n const delta = subtract(a, b);\n return Math.sqrt(delta.x * delta.x + delta.y * delta.y);\n}\n\n/**\n * Returns a new `Point` where `b` is subtracted from `a`.\n */\nexport function subtract(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y };\n}\n\n/**\n * Returns a new `Point` where `b` is added to `a`.\n */\nexport function add(a: Point, b: Point): Point {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\n/**\n * Returns `true` if the `x` and `y` positions of `a` and `b` are equal.\n */\nexport function isEqual(a: Point, b: Point): boolean {\n return a.x === b.x && a.y === b.y;\n}\n\n/**\n * Performs a linear interpolation between `a` and `b` and returns the result.\n * The value of `t` is clamped between `[0, 1]`.\n *\n * @param a The start value.\n * @param b The end value.\n * @param t A value between 0 and 1.\n * @returns A point between `a` and `b`.\n */\nexport function lerp(a: Point, b: Point, t: number): Point {\n return {\n x: lerpNumber(a.x, b.x, t),\n y: lerpNumber(a.y, b.y, t),\n };\n}\n\n/**\n * Returns a new `Point` where `x` and `y` are inverted.\n */\nexport function negate(pt: Point): Point {\n return create(-pt.x, -pt.y);\n}\n\n/**\n * Returns a new `Point` where `x` and `y` are multiplied by the given scale\n * factors.\n */\nexport function scale(pt: Point, scaleX: number, scaleY: number): Point {\n return {\n x: pt.x * scaleX,\n y: pt.y * scaleY,\n };\n}\n\n/**\n * Returns a new `Point` where `x` and `y` are multiplied by the given scale\n * factor.\n */\nexport function scaleProportional(pt: Point, scale: number): Point {\n return {\n x: pt.x * scale,\n y: pt.y * scale,\n };\n}\n\n/**\n * Returns the magnitude of a point.\n */\nexport function magnitude(pt: Point): number {\n return Math.sqrt(pt.x * pt.x + pt.y * pt.y);\n}\n\n/**\n * Transforms a vector into the corresponding normal (unit) vector.\n */\nexport function normalizeVector(pt: Point): Point {\n const magnitudeOfPoint = magnitude(pt);\n if (magnitudeOfPoint === 0) {\n return create(0, 0);\n } else {\n return scaleProportional(pt, 1 / magnitudeOfPoint);\n }\n}\n\n/**\n * Returns a new normal (unit) vector pointing between the two given points.\n */\nexport function normalDirectionVector(ptA: Point, ptB: Point): Point {\n return normalizeVector(subtract(ptB, ptA));\n}\n\n/**\n * Returns a vector orthogonal to the vector between the two given points.\n */\nexport function orthogonalVector(ptA: Point, ptB: Point): Point {\n const unitVectorBetweenPoints = normalDirectionVector(ptA, ptB);\n\n // Handle vectors that are parallel to the x or y axis\n if (unitVectorBetweenPoints.x === 0 || unitVectorBetweenPoints.y === 0) {\n return create(-1 * unitVectorBetweenPoints.y, unitVectorBetweenPoints.x);\n }\n\n if (\n Math.abs(unitVectorBetweenPoints.x) > Math.abs(unitVectorBetweenPoints.y)\n ) {\n const vectorXValue = 1 - Math.pow(unitVectorBetweenPoints.x, 2);\n const vectorYValue =\n -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;\n return normalizeVector(create(vectorXValue, vectorYValue));\n } else {\n const vectorXValue =\n -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;\n const vectorYValue = 1 - Math.pow(unitVectorBetweenPoints.y, 2);\n return normalizeVector(create(vectorXValue, vectorYValue));\n }\n}\n\n/**\n * Parses a JSON string representation of a Point and returns an object.\n *\n * @param json A JSON string, either in the form `[x,y]` or `{\"x\": 0, \"y\": 0}`\n * @returns A parsed Point.\n */\nexport function fromJson(json: string): Point {\n const obj = JSON.parse(json);\n if (Array.isArray(obj)) {\n const [x, y] = obj;\n return create(x, y);\n } else {\n const { x, y } = obj;\n return create(x, y);\n }\n}\n","import { Angle } from '@vertexvis/geometry';\n\nimport * as Point from '../../../../geometry/src/point';\n\nexport type LineAnchorStyle =\n 'arrow-triangle' | 'arrow-line' | 'dot' | 'hash' | 'none';\n\nexport interface LineAnchorStylePoints {\n tip: Point.Point;\n base: Point.Point;\n arrowTriangle: ArrowheadPoints;\n arrowLine: ArrowheadPoints;\n hash: ArrowheadPoints;\n radius: number;\n}\n\nexport interface ArrowheadPoints {\n leftPoint: Point.Point;\n rightPoint: Point.Point;\n}\n\nexport interface LinePoints {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n}\n\nexport interface CirclePoints {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport function createArrowheadPoints(\n start: Point.Point,\n end: Point.Point,\n arrowSideLength: number,\n arrowHeadTheta: number,\n): ArrowheadPoints {\n const arrowOrthogonalVector = Point.orthogonalVector(start, end);\n const normalizedDirection = Point.normalDirectionVector(start, end);\n\n const arrowLeft = Point.subtract(\n end,\n Point.add(\n Point.scaleProportional(\n normalizedDirection,\n arrowSideLength * Math.cos(arrowHeadTheta),\n ),\n Point.scaleProportional(\n arrowOrthogonalVector,\n arrowSideLength * Math.sin(arrowHeadTheta),\n ),\n ),\n );\n const arrowRight = Point.subtract(\n end,\n Point.subtract(\n Point.scaleProportional(\n normalizedDirection,\n arrowSideLength * Math.cos(arrowHeadTheta),\n ),\n Point.scaleProportional(\n arrowOrthogonalVector,\n arrowSideLength * Math.sin(arrowHeadTheta),\n ),\n ),\n );\n\n return {\n leftPoint: arrowLeft,\n rightPoint: arrowRight,\n };\n}\n\nexport function createLineAnchorStylePoints(\n start: Point.Point,\n end: Point.Point,\n triangleArrowAngle = 65,\n lineArrowAngle = 85,\n): LineAnchorStylePoints {\n // Adjust the size of the end style to the distance between the start and end points\n const distance = Point.distance(start, end);\n const arrowHeadHeight = Math.max(4, Math.min(16, distance * 0.25));\n const hashHeight = Math.max(4, Math.min(12, distance * 0.16));\n const radius = Math.min(5, distance * 0.1);\n\n // Triangle arrow position\n const triangleArrowRelativeHeight = arrowHeadHeight / distance;\n const triangleArrowBasePosition = Point.add(\n Point.scaleProportional(end, 1 - triangleArrowRelativeHeight),\n Point.scaleProportional(start, triangleArrowRelativeHeight),\n );\n const triangleArrowTheta = Angle.toRadians(triangleArrowAngle / 2);\n const triangleArrowSideLength =\n arrowHeadHeight / Math.cos(triangleArrowTheta);\n const triangleArrow = createArrowheadPoints(\n start,\n end,\n triangleArrowSideLength,\n triangleArrowTheta,\n );\n\n // Line arrow position\n const lineArrowTheta = Angle.toRadians(lineArrowAngle / 2);\n const lineArrowSideLength = arrowHeadHeight / Math.cos(lineArrowTheta);\n const lineArrow = createArrowheadPoints(\n start,\n end,\n lineArrowSideLength,\n lineArrowTheta,\n );\n\n // Hash position\n // Setting the arrowHeadAngle to 90 degrees results in a\n // straight hash mark perpendicular to the direction of the line\n const hashLineTheta = Angle.toRadians(90);\n const hashLine = createArrowheadPoints(start, end, hashHeight, hashLineTheta);\n\n return {\n tip: end,\n base: triangleArrowBasePosition,\n arrowTriangle: triangleArrow,\n arrowLine: lineArrow,\n hash: hashLine,\n radius: radius,\n };\n}\n\nexport function arrowheadPointsToPolygonPoints(\n points: LineAnchorStylePoints,\n scale = 1,\n): string {\n const scaledRight = scalePointProportional(\n points.tip,\n points.arrowTriangle.rightPoint,\n scale,\n );\n const scaledLeft = scalePointProportional(\n points.tip,\n points.arrowTriangle.leftPoint,\n scale,\n );\n const scaledBase = scalePointProportional(points.tip, points.base, scale);\n\n return [points.tip, scaledRight, scaledBase, scaledLeft]\n .map((pt) => `${pt.x},${pt.y}`)\n .join(' ');\n}\n\nexport function arrowheadPointsToPathPoints(\n points: LineAnchorStylePoints,\n scale = 1,\n): string {\n const scaledRight = scalePointProportional(\n points.tip,\n points.arrowLine.rightPoint,\n scale,\n );\n const scaledLeft = scalePointProportional(\n points.tip,\n points.arrowLine.leftPoint,\n scale,\n );\n\n return `M${scaledRight.x} ${scaledRight.y} L${points.tip.x} ${points.tip.y} L${scaledLeft.x} ${scaledLeft.y} L${points.tip.x} ${points.tip.y} Z`;\n}\n\nexport function arrowheadPointsToHashPoints(\n points: LineAnchorStylePoints,\n scale = 1,\n): LinePoints {\n const scaledRight = scalePointProportional(\n points.tip,\n points.hash.rightPoint,\n scale,\n );\n const scaledLeft = scalePointProportional(\n points.tip,\n points.hash.leftPoint,\n scale,\n );\n\n return {\n x1: scaledRight.x,\n y1: scaledRight.y,\n x2: scaledLeft.x,\n y2: scaledLeft.y,\n };\n}\n\nexport function arrowheadPointsToCirclePoints(\n points: LineAnchorStylePoints,\n scale = 1,\n): CirclePoints {\n return {\n cx: points.tip.x,\n cy: points.tip.y,\n r: points.radius * scale,\n };\n}\n\nexport function isVertexViewerArrowMarkup(\n el: unknown,\n): el is HTMLVertexViewerMarkupArrowElement {\n return (\n el instanceof HTMLElement && el.nodeName === 'VERTEX-VIEWER-MARKUP-ARROW'\n );\n}\n\nexport function parsePoint(\n value: string | Point.Point | undefined,\n): Point.Point | undefined {\n return typeof value === 'string' ? Point.fromJson(value) : value;\n}\n\nexport function scalePointProportional(\n basePoint: Point.Point,\n scaledPoint: Point.Point,\n scale: number,\n): Point.Point {\n return Point.add(\n basePoint,\n Point.scaleProportional(Point.subtract(scaledPoint, basePoint), scale),\n );\n}\n","import { Rectangle } from '@vertexvis/geometry';\n\nexport function isVertexViewerCircleMarkup(\n el: unknown,\n): el is HTMLVertexViewerMarkupCircleElement {\n return (\n el instanceof HTMLElement && el.nodeName === 'VERTEX-VIEWER-MARKUP-CIRCLE'\n );\n}\n\nexport function parseBounds(\n value: string | Rectangle.Rectangle | undefined,\n): Rectangle.Rectangle | undefined {\n return typeof value === 'string' ? Rectangle.fromJson(value) : value;\n}\n","import { Point } from '@vertexvis/geometry';\n\nexport function parsePoints(\n value: string | Point.Point[] | undefined,\n): Point.Point[] | undefined {\n return typeof value === 'string'\n ? JSON.parse(value).map((values: number[]) =>\n Point.fromJson(JSON.stringify(values)),\n )\n : value;\n}\n\nexport function isVertexViewerFreeformMarkup(\n el: unknown,\n): el is HTMLVertexViewerMarkupFreeformElement {\n return (\n el instanceof HTMLElement && el.nodeName === 'VERTEX-VIEWER-MARKUP-FREEFORM'\n );\n}\n","import { Dimensions, Point, Rectangle } from '@vertexvis/geometry';\n\nimport { getWindowDevicePixelRatio } from '../../lib/dom';\nimport { MarkupCenteringBehavior } from '../../lib/types';\nimport { isVertexViewerArrowMarkup } from '../viewer-markup-arrow/utils';\nimport { isVertexViewerCircleMarkup } from '../viewer-markup-circle/utils';\nimport { isVertexViewerFreeformMarkup } from '../viewer-markup-freeform/utils';\n\nexport type BoundingBox2dAnchorPosition =\n | 'left'\n | 'right'\n | 'top'\n | 'bottom'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n | 'center';\n\nexport function getBoundingBox2dAnchorPosition(\n rect: Rectangle.Rectangle,\n position: BoundingBox2dAnchorPosition,\n): Point.Point {\n switch (position) {\n case 'top-left':\n return Point.create(rect.x, rect.y);\n case 'top':\n return Point.create(rect.x + rect.width / 2, rect.y);\n case 'top-right':\n return Point.create(rect.x + rect.width, rect.y);\n case 'right':\n return Point.create(rect.x + rect.width, rect.y + rect.height / 2);\n case 'bottom-right':\n return Point.create(rect.x + rect.width, rect.y + rect.height);\n case 'bottom':\n return Point.create(rect.x + rect.width / 2, rect.y + rect.height);\n case 'bottom-left':\n return Point.create(rect.x, rect.y + rect.height);\n case 'left':\n return Point.create(rect.x, rect.y + rect.height / 2);\n case 'center':\n return Rectangle.center(rect);\n }\n}\n\nexport function translatePointToScreen(\n pt: Point.Point,\n canvasDimensions: Dimensions.Dimensions,\n contentDimensions: Dimensions.Dimensions = canvasDimensions,\n centeringBehavior: MarkupCenteringBehavior = 'none',\n scale = 1,\n): Point.Point {\n const canvasToContentScaleFactor = Math.min(\n canvasDimensions.width / contentDimensions.width,\n canvasDimensions.height / contentDimensions.height,\n );\n const effectiveScalar = canvasToContentScaleFactor * scale;\n const contentScaleFactor = getScaleFactor(contentDimensions);\n const contentRelativePoint = Point.add(\n Point.scale(pt, contentScaleFactor, contentScaleFactor),\n Dimensions.center(contentDimensions),\n );\n\n // Include an offset for width and height to account for cases where the\n // content dimensions are smaller than the canvas dimensions.\n const scaledContentWidth = contentDimensions.width * effectiveScalar;\n const scaledContentHeight = contentDimensions.height * effectiveScalar;\n const centerOffsetX =\n centeringBehavior === 'both' || centeringBehavior === 'x-only'\n ? Math.max(0, (canvasDimensions.width - scaledContentWidth) / 2)\n : 0;\n const centerOffsetY =\n centeringBehavior === 'both' || centeringBehavior === 'y-only'\n ? Math.max(0, (canvasDimensions.height - scaledContentHeight) / 2)\n : 0;\n\n return Point.create(\n contentRelativePoint.x * effectiveScalar + centerOffsetX,\n contentRelativePoint.y * effectiveScalar + centerOffsetY,\n );\n}\n\nexport function translatePointToBounds(\n pt: Point.Point,\n rect: Rectangle.Rectangle,\n canvasDimensions: Dimensions.Dimensions,\n): Point.Point {\n const rectToScreen = translateRectToScreen(rect, canvasDimensions);\n return Point.add(pt, rectToScreen);\n}\n\nexport function translateDimensionsToScreen(\n dimensions: Dimensions.Dimensions,\n canvasDimensions: Dimensions.Dimensions,\n contentDimensions: Dimensions.Dimensions = canvasDimensions,\n scale = 1,\n): Dimensions.Dimensions {\n const canvasToContentScaleFactor = Math.min(\n canvasDimensions.width / contentDimensions.width,\n canvasDimensions.height / contentDimensions.height,\n );\n const effectiveScalar = canvasToContentScaleFactor * scale;\n const contentScaleFactor = getScaleFactor(contentDimensions);\n const contentRelativeDimensions = Dimensions.scale(\n contentScaleFactor,\n contentScaleFactor,\n dimensions,\n );\n\n return Dimensions.scale(\n effectiveScalar,\n effectiveScalar,\n contentRelativeDimensions,\n );\n}\n\n/**\n * Translates a rectangle in relative units, to a rectangle in screen units.\n *\n * Shape coordinates are persisted in relative units, so they can be presented\n * at any size.\n */\nexport function translateRectToScreen(\n rect: Rectangle.Rectangle,\n canvasDimensions: Dimensions.Dimensions,\n contentDimensions?: Dimensions.Dimensions,\n centeringBehavior: MarkupCenteringBehavior = 'none',\n scale = 1,\n): Rectangle.Rectangle {\n const position = translatePointToScreen(\n rect,\n canvasDimensions,\n contentDimensions,\n centeringBehavior,\n scale,\n );\n const dimensions = translateDimensionsToScreen(\n rect,\n canvasDimensions,\n contentDimensions,\n scale,\n );\n return Rectangle.fromPointAndDimensions(position, dimensions);\n}\n\n/**\n * Translates a point in screen units, to a point in relative units.\n */\nexport function translatePointToRelative(\n pt: Point.Point,\n canvasDimensions: Dimensions.Dimensions,\n contentDimensions: Dimensions.Dimensions = canvasDimensions,\n centeringBehavior: MarkupCenteringBehavior = 'none',\n scale = 1,\n offset: Point.Point = Point.create(0, 0),\n): Point.Point {\n const canvasToContentScaleFactor = Math.min(\n canvasDimensions.width / contentDimensions.width,\n canvasDimensions.height / contentDimensions.height,\n );\n const effectiveScalar = canvasToContentScaleFactor * scale;\n\n // Include an offset for width and height to account for cases where the\n // content dimensions are smaller than the canvas dimensions.\n const scaledContentWidth = contentDimensions.width * effectiveScalar;\n const scaledContentHeight = contentDimensions.height * effectiveScalar;\n const centerOffsetX =\n centeringBehavior === 'both' || centeringBehavior === 'x-only'\n ? Math.max(0, (canvasDimensions.width - scaledContentWidth) / 2)\n : 0;\n const centerOffsetY =\n centeringBehavior === 'both' || centeringBehavior === 'y-only'\n ? Math.max(0, (canvasDimensions.height - scaledContentHeight) / 2)\n : 0;\n\n const pointWithoutOffset = Point.subtract(\n pt,\n Point.scale(\n offset,\n 1 / getWindowDevicePixelRatio(),\n 1 / getWindowDevicePixelRatio(),\n ),\n );\n const centeredContentPoint = Point.create(\n (pointWithoutOffset.x - centerOffsetX) / effectiveScalar,\n (pointWithoutOffset.y - centerOffsetY) / effectiveScalar,\n );\n const contentScaleFactor = getScaleFactor(contentDimensions);\n const contentCenterRelativePoint = Point.subtract(\n centeredContentPoint,\n Dimensions.center(contentDimensions),\n );\n\n return Point.scale(\n contentCenterRelativePoint,\n 1 / contentScaleFactor,\n 1 / contentScaleFactor,\n );\n}\n\n/**\n * Translates a set of points in relative `original` units to\n * points in relative `bounds` units.\n */\nexport function translatePointsToBounds(\n points: Point.Point[],\n original: Rectangle.Rectangle,\n bounds: Rectangle.Rectangle,\n): Point.Point[] {\n return points.map((pt) =>\n Point.add(\n Point.scale(\n Point.subtract(pt, original),\n bounds.width / (original.width || 1),\n bounds.height / (original.height || 1),\n ),\n bounds,\n ),\n );\n}\n\nexport function createRectangle(\n initialPoint: Point.Point,\n currentPoint: Point.Point,\n maintainAspectRatio: boolean,\n): Rectangle.Rectangle {\n const bounds = Rectangle.fromPoints(initialPoint, currentPoint);\n if (maintainAspectRatio) {\n const fitBoundsSize = Math.max(bounds.width, bounds.height);\n const isPortrait = bounds.height > bounds.width;\n const currentIsLeftOfInitial = currentPoint.x <= initialPoint.x;\n const currentIsAboveInitial = currentPoint.y <= initialPoint.y;\n const fitBoundsX = currentIsLeftOfInitial\n ? isPortrait\n ? initialPoint.x - fitBoundsSize\n : currentPoint.x\n : initialPoint.x;\n const fitBoundsY = currentIsAboveInitial\n ? isPortrait\n ? currentPoint.y\n : initialPoint.y - fitBoundsSize\n : initialPoint.y;\n return Rectangle.create(\n fitBoundsX,\n fitBoundsY,\n fitBoundsSize,\n fitBoundsSize,\n );\n } else {\n return bounds;\n }\n}\n\nexport function transformRectangle(\n bounds: Rectangle.Rectangle,\n start: Point.Point,\n current: Point.Point,\n anchor: BoundingBox2dAnchorPosition,\n maintainAspectRatio?: boolean,\n): Rectangle.Rectangle {\n const delta = Point.subtract(current, start);\n const { x: left, y: top, width: w, height: h } = bounds;\n const right = left + w;\n const bottom = top + h;\n const topLeft = Point.create(left, top);\n const bottomLeft = Point.create(left, bottom);\n const topRight = Point.create(right, top);\n const bottomRight = Point.create(right, bottom);\n switch (anchor) {\n case 'top-left':\n return createRectangle(bottomRight, current, !!maintainAspectRatio);\n case 'top':\n return createRectangle(\n bottomRight,\n Point.create(left, current.y),\n !!maintainAspectRatio,\n );\n case 'top-right':\n return createRectangle(bottomLeft, current, !!maintainAspectRatio);\n case 'right':\n return createRectangle(\n bottomLeft,\n Point.create(current.x, top),\n !!maintainAspectRatio,\n );\n case 'bottom-right':\n return createRectangle(topLeft, current, !!maintainAspectRatio);\n case 'bottom':\n return createRectangle(\n topLeft,\n Point.create(right, current.y),\n !!maintainAspectRatio,\n );\n case 'bottom-left':\n return createRectangle(topRight, current, !!maintainAspectRatio);\n case 'left':\n return createRectangle(\n bottomRight,\n Point.create(current.x, top),\n !!maintainAspectRatio,\n );\n case 'center':\n return Rectangle.create(\n bounds.x + delta.x,\n bounds.y + delta.y,\n bounds.width,\n bounds.height,\n );\n }\n}\n\nexport function isVertexViewerMarkupElement(\n el: HTMLElement,\n): el is\n | HTMLVertexViewerMarkupArrowElement\n | HTMLVertexViewerMarkupCircleElement\n | HTMLVertexViewerMarkupFreeformElement {\n return (\n isVertexViewerArrowMarkup(el) ||\n isVertexViewerCircleMarkup(el) ||\n isVertexViewerFreeformMarkup(el)\n );\n}\n\nexport function isValidPointData(...points: Point.Point[]): boolean {\n return points.every((pt) => !Number.isNaN(pt.x) && !Number.isNaN(pt.y));\n}\n\nexport function isValidStartEvent(event: PointerEvent): boolean {\n const el = event.target as HTMLElement;\n\n return isVertexViewerMarkupElement(el) && el.mode !== 'edit';\n}\n\nfunction getScaleFactor(dimensions: Dimensions.Dimensions): number {\n // We intentionally use the content's height when scaling to maintain a consistent coordinate\n // space for markup. This is to ensure the markup will be displayed in the same position\n // on the canvas regardless of the aspect ratio at the time the markup was created.\n // See https://github.com/Vertexvis/vertex-web-sdk/pull/429 for more details.\n return dimensions.height;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { Point } from '@vertexvis/geometry';\n\nexport interface RelativeAnchorProps {\n id?: string;\n transform?: string;\n rotation?: number;\n name: string;\n point: Point.Point;\n onPointerDown?: (event: PointerEvent) => void;\n}\n\nexport const RelativeAnchor: FunctionalComponent<RelativeAnchorProps> = (\n { id, transform, rotation, name, point, onPointerDown },\n children,\n) => {\n return (\n <div\n id={id}\n class=\"bounds-anchor-position\"\n style={{\n top: `${point.y}px`,\n left: `${point.x}px`,\n }}\n onTouchStart={(event) => event.preventDefault()}\n onPointerDown={onPointerDown}\n >\n <div style={{ transform }}>\n <div\n class=\"bounds-anchor\"\n style={{\n transform: `rotateZ(${rotation ?? 0}deg)`,\n }}\n >\n <slot name={name}>{children}</slot>\n </div>\n </div>\n </div>\n );\n};\n\nexport interface SvgShadowProps {\n id: string;\n scale?: number;\n}\n\nexport const SvgShadow: FunctionalComponent<SvgShadowProps> = ({\n id,\n scale,\n}) => {\n // Scale default values for a `<filter>` element by the provided scale.\n // This prevents the filter area from being too small when scale is greater than 1,\n // and uses the default values for a scale less than 1 to prevent the same issue.\n // See https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter\n // for more details on the default values used here.\n const effectiveScale = scale ?? 1;\n const xOffset = Math.max(10, 10 * effectiveScale);\n const yOffset = Math.max(10, 10 * effectiveScale);\n const width = Math.max(120, 110 * effectiveScale + xOffset);\n const height = Math.max(120, 110 * effectiveScale + yOffset);\n\n return (\n <filter\n id={id}\n filterUnits=\"userSpaceOnUse\"\n x={`${-xOffset}%`}\n y={`${-yOffset}%`}\n width={`${width}%`}\n height={`${height}%`}\n >\n <feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"2\" />\n <feOffset dx=\"0\" dy=\"1\" result=\"offsetblur\" />\n <feFlood flood-color=\"#000000\" flood-opacity=\"0.25\" />\n <feComposite in2=\"offsetblur\" operator=\"in\" />\n <feMerge>\n <feMergeNode />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n );\n};\n","import { Dimensions, Point } from '@vertexvis/geometry';\nimport { BasicInteractionHandler } from '@vertexvis/utils';\n\nimport { MarkupCenteringBehavior } from '../types';\n\nexport interface MarkupInteractionHandlerScalingOptions {\n scale?: number;\n offset?: Point.Point;\n originatingViewport?: Dimensions.Dimensions;\n centeringBehavior?: MarkupCenteringBehavior;\n}\n\nexport abstract class MarkupInteractionHandler implements BasicInteractionHandler {\n protected element?: HTMLElement;\n protected elementBounds?: DOMRect;\n protected scalingOptions: MarkupInteractionHandlerScalingOptions;\n\n private resizeObserver: ResizeObserver;\n\n public constructor(scalingOptions?: MarkupInteractionHandlerScalingOptions) {\n this.resizeObserver = new ResizeObserver(([entry]) => {\n this.elementBounds = this.computeBoundingRect();\n });\n\n this.scalingOptions = scalingOptions ?? {};\n }\n\n public initialize(element: HTMLElement): void {\n this.element = element;\n\n this.elementBounds = this.computeBoundingRect();\n this.resizeObserver.observe(this.element);\n\n this.element.addEventListener('pointerdown', this.handlePointerDown);\n }\n\n public dispose(): void {\n this.resizeObserver.disconnect();\n this.element?.removeEventListener('pointerdown', this.handlePointerDown);\n\n this.element = undefined;\n }\n\n public updateScalingOptions(\n scalingOptions: MarkupInteractionHandlerScalingOptions,\n ): void {\n this.scalingOptions = {\n ...this.scalingOptions,\n ...scalingOptions,\n };\n }\n\n public getScalingOptions(): MarkupInteractionHandlerScalingOptions {\n return this.scalingOptions;\n }\n\n protected acceptInteraction(): void {\n window.addEventListener('pointermove', this.handlePointerMove);\n window.addEventListener('pointerup', this.handlePointerUp);\n }\n\n private handlePointerDown = (event: PointerEvent): void => {\n this.handleInteractionAttempt(event);\n };\n\n private handlePointerMove = (event: PointerEvent): void => {\n this.handleInteractionMove(event);\n };\n\n private handlePointerUp = (event: PointerEvent): void => {\n window.removeEventListener('pointermove', this.handlePointerMove);\n window.removeEventListener('pointerup', this.handlePointerUp);\n\n this.handleInteractionEnd(event);\n };\n\n protected abstract computeBoundingRect(): DOMRect;\n\n protected abstract handleInteractionAttempt(event: PointerEvent): void;\n\n protected abstract handleInteractionMove(event: PointerEvent): void;\n\n protected abstract handleInteractionEnd(event: PointerEvent): void;\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{a as t,v as e,f as n,p as r,r as o,g as s,l as i,b as c,m as a,e as u,c as l,i as f,j as h}from"./p-CZZALKHT.js";import{v as d,p as m,L as p}from"./p-5kcpg4MZ.js";import{m as v,c as w,b as y}from"./p-CDM7zNn0.js";import{g}from"./p-CG9AChtV.js";const b=v.defineMapper((t=>{switch(t){case"perspective":return d.protobuf.stream.CameraType.CAMERA_TYPE_PERSPECTIVE;case"orthographic":return d.protobuf.stream.CameraType.CAMERA_TYPE_ORTHOGRAPHIC;default:return d.protobuf.stream.CameraType.CAMERA_TYPE_INVALID}}),(t=>t));function C(){return v.ifInvalidThrow(b)}const x=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b"),v.requiredProp("a")),(([t,e,n,r])=>w.create(t,e,n,r)));const k=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>y.fromMsbLsb(t,e)));const F=v.defineMapper(v.read(v.requiredProp("seconds"),v.requiredProp("nanos")),(([t,e])=>m({seconds:t,nanos:e})));const M=v.defineMapper(v.read(v.requiredProp("iso")),(([t])=>new Date(t)));const S=v.defineMapper(v.read(v.requiredProp("hex")),(([t])=>t));const E=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>{const n=BigInt(typeof t==="number"?t:t.toString());const r=BigInt(typeof e==="number"?e:e.toString());return y.fromMsbLsb(n,r)}));const I=v.defineMapper(v.compose((t=>y.toMsbLsb(t)),v.read(v.mapProp("msb",p.fromString),v.mapProp("lsb",p.fromString))),(([t,e])=>({msb:t,lsb:e})));function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function j(t){if(t===null||t===true||t===false){return NaN}var e=Number(t);if(isNaN(e)){return e}return e<0?Math.ceil(e):Math.floor(e)}function N(t,e){if(e.length<t){throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}}function T(t){N(1,arguments);var e=Object.prototype.toString.call(t);if(t instanceof Date||P(t)==="object"&&e==="[object Date]"){return new Date(t.getTime())}else if(typeof t==="number"||e==="[object Number]"){return new Date(t)}else{if((typeof t==="string"||e==="[object String]")&&typeof console!=="undefined"){console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");console.warn((new Error).stack)}return new Date(NaN)}}function D(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}n.setDate(n.getDate()+r);return n}function O(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}var o=n.getDate();var s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var i=s.getDate();if(o>=i){return s}else{n.setFullYear(s.getFullYear(),s.getMonth(),o);return n}}function A(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=T(t);var l=r||n?O(u,r+n*12):u;var f=s||o?D(l,s+o*7):l;var h=c+i*60;var d=a+h*60;var m=d*1e3;var p=new Date(f.getTime()+m);return p}function V(t,e){N(2,arguments);return T(t).getTime()-T(e).getTime()}function z(t,e){N(2,arguments);var n=T(t);var r=T(e);return n.getTime()>r.getTime()}function B(t,e){N(2,arguments);var n=j(e);return D(t,-n)}function R(t,e){N(2,arguments);var n=j(e);return O(t,-n)}function W(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=R(t,r+n*12);var l=B(u,s+o*7);var f=c+i*60;var h=a+f*60;var d=h*1e3;var m=new Date(l.getTime()-d);return m}class ${constructor(t,e,n){this.token=t;this.expiresIn=e;this.expiresAt=n}static create(t,e){const n=A(new Date,{seconds:e});return new $(t,e,n)}hasExpired(){return z(new Date,this.expiresAt)}remainingTimeInMs(t){return V(W(this.expiresAt,{seconds:t}),new Date)}}function _(t){if(G(t)){const n=q(t.lookAt);const r=q(t.position);const o=U(t.up);const s=n&&r&&U(e.subtract(t.lookAt,t.position));const i=t.fovY!=null&&Number.isFinite(t.fovY)&&t.fovY>=1&&t.fovY<=179;return o&&s&&i}else{const e=t;const n=U(e.viewVector);const r=q(e.lookAt);const o=U(e.up);const s=Number.isFinite(e.fovHeight)&&e.fovHeight>0;return n&&r&&o&&s}}function q(t){return t!=null&&e.isValid(t)}function U(t){return q(t)&&!e.isZeroVector(t)}function G(t){return t.position!=null&&t.fovHeight==null}function L(t){const e=t;return e.viewVector!=null&&e.fovHeight!=null}function H(t){if(L(t)){return{...t,position:e.add(t.lookAt,e.negate(t.viewVector))}}else{return{...t,viewVector:e.subtract(t.lookAt,t.position)}}}function Y(t={}){var n,r,o,s;return{position:(n=t.position)!==null&&n!==void 0?n:e.forward(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovY:(s=t.fovY)!==null&&s!==void 0?s:45}}function J(t={}){var n,r,o,s,i,c;return{viewVector:(n=t.viewVector)!==null&&n!==void 0?n:e.back(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovHeight:(s=t.fovHeight)!==null&&s!==void 0?s:1,rotationPoint:(c=(i=t.rotationPoint)!==null&&i!==void 0?i:t.lookAt)!==null&&c!==void 0?c:e.origin()}}function Z(r,o){var s;const i=e.subtract(r.lookAt,r.position);const c=n.create(o);const a=c.radius/e.magnitude(i);return{viewVector:e.scale(a,i),up:r.up,lookAt:r.lookAt,fovHeight:2*e.magnitude(i)*Math.tan(t.toRadians(((s=r.fovY)!==null&&s!==void 0?s:45)/2))}}function Q(n,r=45){const o=n.fovHeight/(2*Math.tan(t.toRadians(r/2)));const s=e.magnitude(n.viewVector);const i=o/s;return{position:e.add(n.lookAt,e.negate(e.scale(i,n.viewVector))),up:n.up,lookAt:n.lookAt,fovY:r}}function K(t){if(L(t)){return{orthographic:{viewVector:{...t.viewVector},lookAt:{...t.lookAt},up:{...t.up},fovHeight:t.fovHeight}}}else if(G(t)){return{perspective:{position:{...t.position},lookAt:{...t.lookAt},up:{...t.up},fovY:t.fovY?{value:t.fovY}:null},position:{...t.position},lookAt:{...t.lookAt},up:{...t.up}}}else{return{...t}}}var X=Object.freeze({__proto__:null,createOrthographic:J,createPerspective:Y,isOrthographicFrameCamera:L,isPerspectiveFrameCamera:G,isValidFrameCamera:_,toOrthographic:Z,toPerspective:Q,toProtobuf:K,withPositionAndViewVector:H});function tt(t,e){return L(e)?nt(t):et(t,e)}function et(t,r){const o=n.create(t);const s=o.epsilon*100;const i=e.dot(e.subtract(o.center,r.position),e.normalize(e.subtract(r.lookAt,r.position)));const c=Math.max(o.radius,s);let a=c+i<s?c*3:c+i;let u=a-c*2<s?Math.min(s,a):a-c*2;if(a-u<s){u=Math.max(u,s);a+=u+s}else if(u/a<1e-4){u=a*1e-4}if(u>a-c*2){if(u>1e3+s){a-=u-1e3;u=1e3}}return{near:u,far:a}}function nt(t,e){const r=n.create(t);const o=r.epsilon*100;const s=Math.max(r.radius,o);return{near:-s,far:s}}function rt(t={}){return{sectionPlanes:t.sectionPlanes||[],highlightColor:t.highlightColor,lineWidth:t.lineWidth}}var ot=Object.freeze({__proto__:null,create:rt});function st(t={}){return{modelViewId:t.modelViewId,sceneItemId:t.sceneItemId}}function it(t={}){return{visibleSummary:t.visibleSummary,selectedVisibleSummary:t.selectedVisibleSummary}}function ct(t,e){return at(t.scene.sceneViewSummary)?t.copy({scene:t.scene.copy({sceneViewSummary:e===null||e===void 0?void 0:e.scene.sceneViewSummary})}):t}function at(t){return t.visibleSummary==null}class ut{constructor(t,e,n){this.camera=t;this.imageAttr=e;this.pixels=n}static fromPng(t,e,n){if(t.data instanceof Uint16Array){return new ut(e,n,t.data)}else{throw new Error("Expected depth PNG to have depth of 16-bit")}}getDepthAtPoint(t,e){const{near:n,far:r}=this.camera;const o=this.camera.isPerspective();const s=this.getNormalizedDepthAtPoint(t,e);if(o){return s*(r-n)+n}else{return s*(r-n)}}getMaxDepthOfGeometry(){const{near:t,far:e}=this.camera;const n=this.camera.isPerspective();if(n){return e}else{return e-t}}getNormalizedDepthAtPoint(t,e){const{width:n,height:o}=this.imageAttr.imageRect;const s=r.subtract(t,this.imageAttr.imageRect);const i=1/this.imageAttr.imageScale;const c=r.scale(s,i,i);if(c.x>=0&&c.y>=0&&c.x<n&&c.y<o){const t=Math.floor(c.x)+Math.floor(c.y)*n;const r=this.pixels[t];const o=r===ut.MAX_DEPTH_VALUE?e!==null&&e!==void 0?e:r:r;return(o!==null&&o!==void 0?o:ut.MAX_DEPTH_VALUE)/ut.MAX_DEPTH_VALUE}else{return e!==null&&e!==void 0?e:1}}hitTest(t){return this.getNormalizedDepthAtPoint(t)<1}getWorldPoint(t,n,r){const s=this.getDepthAtPoint(t,r);const i=this.camera.isPerspective();if(i){const{position:t,viewVector:r,far:i}=this.camera;const c=o.at(n,i);const a=e.subtract(c,t);const u=e.dot(r,a)/(e.magnitude(r)*e.magnitude(a));return o.at(n,s/u)}else{return o.at(n,s)}}distanceToPoint(t){const{position:n,direction:r}=this.camera;const o=e.subtract(t,n);return Math.abs(e.dot(o,r))}depthOfClosestGeometry(t,e){const{projectionViewMatrix:n}=this.camera;const r=e.transformWorldToViewport(t,n);const o=e.transformPointToFrame(r,this);return this.getDepthAtPoint(o)}isOccluded(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=Math.abs(.02*n);const s=Math.abs(r-n);return n>r&&s>o}isDetached(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=r-n;const s=.02*n;const i=o<s;const c=this.getMaxDepthOfGeometry();const a=n>c;const u=!i||a;return u}}ut.MAX_DEPTH_VALUE=2**16-1;class lt{constructor(t){this.scale=t}convertTo(t){return t*this.scale}convertFrom(t){return t/this.scale}}class ft extends lt{constructor(){super(1)}}class ht extends lt{constructor(t=1){super(1/Math.pow(10,t))}}class dt extends lt{constructor(t=1){super(1/Math.pow(1e3,t))}}class mt extends lt{constructor(t=1){super(1/Math.pow(25.4,t))}}class pt extends lt{constructor(t=1){super(1/Math.pow(25.4*12,t))}}class vt extends lt{constructor(t=1){super(1/Math.pow(25.4*12*3,t))}}class wt{constructor(t){this.unitType=t;this.unit=wt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}convertWorldPointToReal(t){const e=this.unit.converter.convertTo(t.x);const n=this.unit.converter.convertTo(t.y);const r=this.unit.converter.convertTo(t.z);return{x:e,y:n,z:r}}convertRealPointToWorld(t){const e=this.unit.converter.convertFrom(t.x);const n=this.unit.converter.convertFrom(t.y);const r=this.unit.converter.convertFrom(t.z);return{x:e,y:n,z:r}}}wt.units={millimeters:{name:"Millimeters",abbreviatedName:"mm",converter:new ft},centimeters:{name:"Centimeters",abbreviatedName:"cm",converter:new ht},meters:{name:"Meters",abbreviatedName:"m",converter:new dt},inches:{name:"Inches",abbreviatedName:"in",converter:new mt},feet:{name:"Feet",abbreviatedName:"ft",converter:new pt},yards:{name:"Yards",abbreviatedName:"yd",converter:new vt}};class yt{convertTo(e){return t.toDegrees(e)}convertFrom(e){return t.toRadians(e)}}class gt{constructor(t){this.unitType=t;this.unit=gt.units[t]}convertTo(t){return this.unit.converter.convertTo(t)}convertFrom(t){return this.unit.converter.convertFrom(t)}}gt.units={radians:{name:"Radians",abbreviatedName:"rad",converter:new lt(1)},degrees:{name:"Degrees",abbreviatedName:"deg",converter:new yt}};class bt{constructor(t){this.unitType=t;this.unit=bt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}}bt.units={millimeters:{name:"Square Millimeters",abbreviatedName:"mm²",converter:new ft},centimeters:{name:"Square Centimeters",abbreviatedName:"cm²",converter:new ht(2)},meters:{name:"Square Meters",abbreviatedName:"m²",converter:new dt(2)},inches:{name:"Square Inches",abbreviatedName:"in²",converter:new mt(2)},feet:{name:"Square Feet",abbreviatedName:"ft²",converter:new pt(2)},yards:{name:"Square Yards",abbreviatedName:"yd²",converter:new vt(2)}};var Ct;(function(t){t[t["CROSS_SECTION"]=255]="CROSS_SECTION";t[t["PRECISE_EDGE"]=224]="PRECISE_EDGE";t[t["PRECISE_SURFACE"]=192]="PRECISE_SURFACE";t[t["IMPRECISE_EDGE"]=160]="IMPRECISE_EDGE";t[t["IMPRECISE_SURFACE"]=128]="IMPRECISE_SURFACE";t[t["GENERIC_GEOMETRY"]=96]="GENERIC_GEOMETRY";t[t["NO_GEOMETRY"]=0]="NO_GEOMETRY"})(Ct||(Ct={}));class xt{constructor(t,e){this.pixels=t;this.imageAttr=e}static fromPng(t,e){if(!(t.data instanceof Uint8Array)){throw new Error("Cannot create FeatureMap. Expected decoded PNG to be a Uint8Array.")}else if(t.channels!==4){throw new Error("Cannot create FeatureMap. Missing alpha channel.")}else{return new xt(t.data,{...e,imageRect:s.fromPointAndDimensions(e.imageRect,t)})}}getEntityType(t){const e=this.getColor(t);if((e===null||e===void 0?void 0:e.a)===Ct.CROSS_SECTION){return Ct.CROSS_SECTION}else if((e===null||e===void 0?void 0:e.a)===Ct.GENERIC_GEOMETRY){return Ct.GENERIC_GEOMETRY}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_EDGE){return Ct.IMPRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_SURFACE){return Ct.IMPRECISE_SURFACE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_EDGE){return Ct.PRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_SURFACE){return Ct.PRECISE_SURFACE}else{return Ct.NO_GEOMETRY}}getColor(t){const{width:e,height:n}=this.imageAttr.imageRect;const o=r.subtract(t,this.imageAttr.imageRect);const s=1/this.imageAttr.imageScale;const i=r.scale(o,s,s);if(i.x>=0&&i.y>=0&&i.x<e&&i.y<n){const t=Math.floor(i.x)*4+Math.floor(i.y)*4*e;const n=this.pixels[t];const r=this.pixels[t+1];const o=this.pixels[t+2];const s=this.pixels[t+3];return w.create(n,r,o,s)}else return undefined}}let kt;function Ft(){if(!kt){kt=Mt()}return kt}function Mt(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e){return St(e[0])}}return"/"}function St(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}const Et=typeof navigator!=="undefined"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const It=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function Pt(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function jt(){if(typeof Worker==="undefined"){return class t{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}}class t extends Worker{constructor(t,e){var n,r;if(typeof t==="string"&&e&&e._baseURL){t=new URL(t,e._baseURL)}else if(typeof t==="string"&&!It(t)&&Ft().match(/^file:\/\//i)){t=new URL(t,Ft().replace(/\/[^/]+$/,"/"));if((n=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&n!==void 0?n:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}if(typeof t==="string"&&It(t)){if((r=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&r!==void 0?r:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}super(t,e)}}class e extends t{constructor(t,e){const n=window.URL.createObjectURL(t);super(n,e)}static fromText(t,n){const r=new window.Blob([t],{type:"text/javascript"});return new e(r,n)}}return{blob:e,default:t}}let Nt;function Tt(){if(!Nt){Nt=jt()}return Nt}var Dt={exports:{}};var Ot;var At;function Vt(){if(At)return Ot;At=1;var t=1e3;var e=t*60;var n=e*60;var r=n*24;var o=r*7;var s=r*365.25;Ot=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0){return i(t)}else if(n==="number"&&isFinite(t)){return e.long?a(t):c(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function i(i){i=String(i);if(i.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!c){return}var a=parseFloat(c[1]);var u=(c[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*e;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function c(o){var s=Math.abs(o);if(s>=r){return Math.round(o/r)+"d"}if(s>=n){return Math.round(o/n)+"h"}if(s>=e){return Math.round(o/e)+"m"}if(s>=t){return Math.round(o/t)+"s"}return o+"ms"}function a(o){var s=Math.abs(o);if(s>=r){return u(o,s,r,"day")}if(s>=n){return u(o,s,n,"hour")}if(s>=e){return u(o,s,e,"minute")}if(s>=t){return u(o,s,t,"second")}return o+" ms"}function u(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}return Ot}var zt;var Bt;function Rt(){if(Bt)return zt;Bt=1;function t(t){n.debug=n;n.default=n;n.coerce=a;n.disable=i;n.enable=o;n.enabled=c;n.humanize=Vt();n.destroy=u;Object.keys(t).forEach((e=>{n[e]=t[e]}));n.names=[];n.skips=[];n.formatters={};function e(t){let e=0;for(let n=0;n<t.length;n++){e=(e<<5)-e+t.charCodeAt(n);e|=0}return n.colors[Math.abs(e)%n.colors.length]}n.selectColor=e;function n(t){let e;let o=null;let s;let i;function c(...t){if(!c.enabled){return}const r=c;const o=Number(new Date);const s=o-(e||o);r.diff=s;r.prev=e;r.curr=o;e=o;t[0]=n.coerce(t[0]);if(typeof t[0]!=="string"){t.unshift("%O")}let i=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,o)=>{if(e==="%%"){return"%"}i++;const s=n.formatters[o];if(typeof s==="function"){const n=t[i];e=s.call(r,n);t.splice(i,1);i--}return e}));n.formatArgs.call(r,t);const a=r.log||n.log;a.apply(r,t)}c.namespace=t;c.useColors=n.useColors();c.color=n.selectColor(t);c.extend=r;c.destroy=n.destroy;Object.defineProperty(c,"enabled",{enumerable:true,configurable:false,get:()=>{if(o!==null){return o}if(s!==n.namespaces){s=n.namespaces;i=n.enabled(t)}return i},set:t=>{o=t}});if(typeof n.init==="function"){n.init(c)}return c}function r(t,e){const r=n(this.namespace+(typeof e==="undefined"?":":e)+t);r.log=this.log;return r}function o(t){n.save(t);n.namespaces=t;n.names=[];n.skips=[];const e=(typeof t==="string"?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const t of e){if(t[0]==="-"){n.skips.push(t.slice(1))}else{n.names.push(t)}}}function s(t,e){let n=0;let r=0;let o=-1;let s=0;while(n<t.length){if(r<e.length&&(e[r]===t[n]||e[r]==="*")){if(e[r]==="*"){o=r;s=n;r++}else{n++;r++}}else if(o!==-1){r=o+1;s++;n=s}else{return false}}while(r<e.length&&e[r]==="*"){r++}return r===e.length}function i(){const t=[...n.names,...n.skips.map((t=>"-"+t))].join(",");n.enable("");return t}function c(t){for(const e of n.skips){if(s(t,e)){return false}}for(const e of n.names){if(s(t,e)){return true}}return false}function a(t){if(t instanceof Error){return t.stack||t.message}return t}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}n.enable(n.load());return n}zt=t;return zt}var Wt;function $t(){if(Wt)return Dt.exports;Wt=1;(function(t,e){e.formatArgs=r;e.save=o;e.load=s;e.useColors=n;e.storage=i();e.destroy=(()=>{let t=false;return()=>{if(!t){t=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let t;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0;let o=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{if(t==="%%"){return}r++;if(t==="%c"){o=r}}));e.splice(o,0,n)}e.log=console.debug||console.log||(()=>{});function o(t){try{if(t){e.storage.setItem("debug",t)}else{e.storage.removeItem("debug")}}catch(t){}}function s(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(t){}if(!t&&typeof process!=="undefined"&&"env"in process){t=process.env.DEBUG}return t}function i(){try{return localStorage}catch(t){}}t.exports=Rt()(e);const{formatters:c}=t.exports;c.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}})(Dt,Dt.exports);return Dt.exports}var _t=$t();var qt=g(_t);const Ut=()=>typeof Symbol==="function";const Gt=t=>Ut()&&Boolean(Symbol[t]);const Lt=t=>Gt(t)?Symbol[t]:"@@"+t;if(!Gt("asyncIterator")){Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator")}const Ht=Lt("iterator");const Yt=Lt("observable");const Jt=Lt("species");function Zt(t,e){const n=t[e];if(n==null){return undefined}if(typeof n!=="function"){throw new TypeError(n+" is not a function")}return n}function Qt(t){let e=t.constructor;if(e!==undefined){e=e[Jt];if(e===null){e=undefined}}return e!==undefined?e:ae}function Kt(t){return t instanceof ae}function Xt(t){if(Xt.log){Xt.log(t)}else{setTimeout((()=>{throw t}),0)}}function te(t){Promise.resolve().then((()=>{try{t()}catch(t){Xt(t)}}))}function ee(t){const e=t._cleanup;if(e===undefined){return}t._cleanup=undefined;if(!e){return}try{if(typeof e==="function"){e()}else{const t=Zt(e,"unsubscribe");if(t){t.call(e)}}}catch(t){Xt(t)}}function ne(t){t._observer=undefined;t._queue=undefined;t._state="closed"}function re(t){const e=t._queue;if(!e){return}t._queue=undefined;t._state="ready";for(const n of e){oe(t,n.type,n.value);if(t._state==="closed"){break}}}function oe(t,e,n){t._state="running";const r=t._observer;try{const o=r?Zt(r,e):undefined;switch(e){case"next":if(o)o.call(r,n);break;case"error":ne(t);if(o)o.call(r,n);else throw n;break;case"complete":ne(t);if(o)o.call(r);break}}catch(t){Xt(t)}if(t._state==="closed"){ee(t)}else if(t._state==="running"){t._state="ready"}}function se(t,e,n){if(t._state==="closed"){return}if(t._state==="buffering"){t._queue=t._queue||[];t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering";t._queue=[{type:e,value:n}];te((()=>re(t)));return}oe(t,e,n)}class ie{constructor(t,e){this._cleanup=undefined;this._observer=t;this._queue=undefined;this._state="initializing";const n=new ce(this);try{this._cleanup=e.call(undefined,n)}catch(t){n.error(t)}if(this._state==="initializing"){this._state="ready"}}get closed(){return this._state==="closed"}unsubscribe(){if(this._state!=="closed"){ne(this);ee(this)}}}class ce{constructor(t){this._subscription=t}get closed(){return this._subscription._state==="closed"}next(t){se(this._subscription,"next",t)}error(t){se(this._subscription,"error",t)}complete(){se(this._subscription,"complete")}}class ae{constructor(t){if(!(this instanceof ae)){throw new TypeError("Observable cannot be called as a function")}if(typeof t!=="function"){throw new TypeError("Observable initializer must be a function")}this._subscriber=t}subscribe(t,e,n){if(typeof t!=="object"||t===null){t={next:t,error:e,complete:n}}return new ie(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e]){n=r(n)}return n}tap(t,e,n){const r=typeof t!=="object"||t===null?{next:t,error:e,complete:n}:t;return new ae((t=>this.subscribe({next(e){r.next&&r.next(e);t.next(e)},error(e){r.error&&r.error(e);t.error(e)},complete(){r.complete&&r.complete();t.complete()},start(t){r.start&&r.start(t)}})))}forEach(t){return new Promise(((e,n)=>{if(typeof t!=="function"){n(new TypeError(t+" is not a function"));return}function r(){o.unsubscribe();e(undefined)}const o=this.subscribe({next(e){try{t(e,r)}catch(t){n(t);o.unsubscribe()}},error(t){n(t)},complete(){e(undefined)}})}))}map(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Qt(this);return new e((e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}})))}filter(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Qt(this);return new e((e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}})))}reduce(t,e){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const n=Qt(this);const r=arguments.length>1;let o=false;let s=e;return new n((e=>this.subscribe({next(n){const i=!o;o=true;if(!i||r){try{s=t(s,n)}catch(t){return e.error(t)}}else{s=n}},error(t){e.error(t)},complete(){if(!o&&!r){return e.error(new TypeError("Cannot reduce an empty sequence"))}e.next(s);e.complete()}})))}concat(...t){const e=Qt(this);return new e((n=>{let r;let o=0;function s(i){r=i.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){if(o===t.length){r=undefined;n.complete()}else{s(e.from(t[o++]))}}})}s(this);return()=>{if(r){r.unsubscribe();r=undefined}}}))}flatMap(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Qt(this);return new e((n=>{const r=[];const o=this.subscribe({next(o){let i;if(t){try{i=t(o)}catch(t){return n.error(t)}}else{i=o}const c=e.from(i).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(c);if(t>=0)r.splice(t,1);s()}});r.push(c)},error(t){n.error(t)},complete(){s()}});function s(){if(o.closed&&r.length===0){n.complete()}}return()=>{r.forEach((t=>t.unsubscribe()));o.unsubscribe()}}))}[Yt](){return this}static from(t){const e=typeof this==="function"?this:ae;if(t==null){throw new TypeError(t+" is not an object")}const n=Zt(t,Yt);if(n){const r=n.call(t);if(Object(r)!==r){throw new TypeError(r+" is not an object")}if(Kt(r)&&r.constructor===e){return r}return new e((t=>r.subscribe(t)))}if(Gt("iterator")){const n=Zt(t,Ht);if(n){return new e((e=>{te((()=>{if(e.closed)return;for(const r of n.call(t)){e.next(r);if(e.closed)return}e.complete()}))}))}}if(Array.isArray(t)){return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}throw new TypeError(t+" is not observable")}static of(...t){const e=typeof this==="function"?this:ae;return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}static get[Jt](){return this}}if(Ut()){Object.defineProperty(ae,Symbol("extensions"),{value:{symbol:Yt,hostReportError:Xt},configurable:true})}function ue(t){if(typeof t==="function"){t()}else if(t&&typeof t.unsubscribe==="function"){t.unsubscribe()}}class le extends ae{constructor(){super((t=>{this._observers.add(t);return()=>this._observers.delete(t)}));this._observers=new Set}next(t){for(const e of this._observers){e.next(t)}}error(t){for(const e of this._observers){e.error(t)}}complete(){for(const t of this._observers){t.complete()}}}function fe(t){const e=new le;let n;let r=0;return new ae((o=>{if(!n){n=t.subscribe(e)}const s=e.subscribe(o);r++;return()=>{r--;s.unsubscribe();if(r===0){ue(n);n=undefined}}}))}function he(t){return Promise.all(t.map((t=>{const e=t=>({status:"fulfilled",value:t});const n=t=>({status:"rejected",reason:t});const r=Promise.resolve(t);try{return r.then(e,n)}catch(t){return Promise.reject(t)}})))}var de;(function(t){t["initialized"]="initialized";t["taskCanceled"]="taskCanceled";t["taskCompleted"]="taskCompleted";t["taskFailed"]="taskFailed";t["taskQueued"]="taskQueued";t["taskQueueDrained"]="taskQueueDrained";t["taskStart"]="taskStart";t["terminated"]="terminated"})(de||(de={}));const me=Symbol("thread.errors");const pe=Symbol("thread.events");const ve=Symbol("thread.terminate");const we=Symbol("thread.transferable");const ye=Symbol("thread.worker");function ge(t){throw Error(t)}const be={errors(t){return t[me]||ge("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events(t){return t[pe]||ge("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate(t){return t[ve]()}};var Ce=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};let xe=1;function ke(t){const e=[];for(let n=0;n<t;n++){e.push(n)}return e}function Fe(t){return new Promise((e=>setTimeout(e,t)))}function Me(t,e){return t.reduce(((t,n)=>[...t,...e(n)]),[])}function Se(t){return t.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function Ee(t,e){return ke(e).map((()=>({init:t(),runningTasks:[]})))}class Ie{constructor(t,e){this.eventSubject=new le;this.initErrors=[];this.isClosing=false;this.nextTaskID=1;this.taskQueue=[];const n=typeof e==="number"?{size:e}:e||{};const{size:r=Et}=n;this.debug=qt(`threads:pool:${Se(n.name||String(xe++))}`);this.options=n;this.workers=Ee(t,r);this.eventObservable=fe(ae.from(this.eventSubject));Promise.all(this.workers.map((t=>t.init))).then((()=>this.eventSubject.next({type:de.initialized,size:this.workers.length})),(t=>{this.debug("Error while initializing pool worker:",t);this.eventSubject.error(t);this.initErrors.push(t)}))}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find((e=>e.runningTasks.length<t))}runPoolTask(t,e){return Ce(this,void 0,void 0,(function*(){const n=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${n}...`);this.eventSubject.next({type:de.taskStart,taskID:e.id,workerID:n});try{const r=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`);this.eventSubject.next({type:de.taskCompleted,returnValue:r,taskID:e.id,workerID:n})}catch(t){this.debug(`Task #${e.id} failed`);this.eventSubject.next({type:de.taskFailed,taskID:e.id,error:t,workerID:n})}}))}run(t,e){return Ce(this,void 0,void 0,(function*(){const n=(()=>Ce(this,void 0,void 0,(function*(){const r=()=>{t.runningTasks=t.runningTasks.filter((t=>t!==n))};yield Fe(0);try{yield this.runPoolTask(t,e)}finally{r();if(!this.isClosing){this.scheduleWork()}}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug(`Attempt de-queueing a task in order to run it...`);const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e){this.debug(`Task queue is empty`);this.eventSubject.next({type:de.taskQueueDrained});return}this.run(t,e)}taskCompletion(t){return new Promise(((e,n)=>{const r=this.events().subscribe((o=>{if(o.type===de.taskCompleted&&o.taskID===t){r.unsubscribe();e(o.returnValue)}else if(o.type===de.taskFailed&&o.taskID===t){r.unsubscribe();n(o.error)}else if(o.type===de.terminated){r.unsubscribe();n(Error("Pool has been terminated before task was run."))}}))}))}settled(){return Ce(this,arguments,void 0,(function*(t=false){const e=()=>Me(this.workers,(t=>t.runningTasks));const n=[];const r=this.eventObservable.subscribe((t=>{if(t.type===de.taskFailed){n.push(t.error)}}));if(this.initErrors.length>0){return Promise.reject(this.initErrors[0])}if(t&&this.taskQueue.length===0){yield he(e());return n}yield new Promise(((t,e)=>{const n=this.eventObservable.subscribe({next(e){if(e.type===de.taskQueueDrained||e.type===de.terminated){n.unsubscribe();t(void 0)}},complete(){n.unsubscribe();t(void 0)},error:e})}));yield he(e());r.unsubscribe();return n}))}completed(){return Ce(this,arguments,void 0,(function*(t=false){const e=this.settled(t);const n=new Promise(((t,n)=>{const r=this.eventObservable.subscribe({next(o){if(o.type===de.taskQueueDrained||o.type===de.terminated){r.unsubscribe();t(e)}else if(o.type===de.taskFailed){r.unsubscribe();n(o.error)}},complete(){r.unsubscribe();t(e)},error:n})}));const r=yield Promise.race([e,n]);if(r.length>0){throw r[0]}}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=Infinity}=this.options;if(this.isClosing){throw Error(`Cannot schedule pool tasks after terminate() has been called.`)}if(this.initErrors.length>0){throw this.initErrors[0]}const n=this.nextTaskID++;const r=this.taskCompletion(n);r.catch((t=>{this.debug(`Task #${n} errored:`,t)}));const o={id:n,run:t,cancel:()=>{if(this.taskQueue.indexOf(o)===-1)return;this.taskQueue=this.taskQueue.filter((t=>t!==o));this.eventSubject.next({type:de.taskCanceled,taskID:o.id})},then:r.then.bind(r)};if(this.taskQueue.length>=e){throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\n"+"This usually happens for one of two reasons: We are either at peak "+"workload right now or some tasks just won't finish, thus blocking the pool.")}this.debug(`Queueing task #${o.id}...`);this.taskQueue.push(o);this.eventSubject.next({type:de.taskQueued,taskID:o.id});this.scheduleWork();return o}terminate(t){return Ce(this,void 0,void 0,(function*(){this.isClosing=true;if(!t){yield this.completed(true)}this.eventSubject.next({type:de.terminated,remainingQueue:[...this.taskQueue]});this.eventSubject.complete();yield Promise.all(this.workers.map((t=>Ce(this,void 0,void 0,(function*(){try{yield be.terminate(yield t.init)}catch(t){this.debug("Worker did not initialize; nothing to terminate:",t)}})))))}))}}Ie.EventType=de;function Pe(t,e){return new Ie(t,e)}Pe.EventType=de;const je=Pe;const Ne={deserialize(t){return Object.assign(Error(t.message),{name:t.name,stack:t.stack})},serialize(t){return{__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack}}};const Te=t=>t&&typeof t==="object"&&"__error_marker"in t&&t.__error_marker==="$$error";const De={deserialize(t){if(Te(t)){return Ne.deserialize(t)}else{return t}},serialize(t){if(t instanceof Error){return Ne.serialize(t)}else{return t}}};let Oe=De;function Ae(t){return Oe.deserialize(t)}function Ve(t){return Oe.serialize(t)}const ze=()=>undefined;function Be(){let t=false;let e;let n=ze;const r=new Promise((r=>{if(t){r(e)}else{n=r}}));const o=r=>{t=true;e=r;n(e)};return[r,o]}var Re;(function(t){t["internalError"]="internalError";t["message"]="message";t["termination"]="termination"})(Re||(Re={}));class We extends Error{constructor(t,e){super(t);this.name="ThreadCloneError";this.cause=e;Object.setPrototypeOf(this,We.prototype)}}function $e(t){return Boolean(t&&typeof t==="object"&&t.name==="DataCloneError")}var _e;const qe=()=>undefined;const Ue=t=>t;const Ge=t=>Promise.resolve().then(t);function Le(t){throw t}function He(t){return t&&typeof t.then==="function"}class Ye extends ae{constructor(t){super((e=>{const n=this;const r=Object.assign(Object.assign({},e),{complete(){e.complete();n.onCompletion()},error(t){e.error(t);n.onError(t)},next(t){e.next(t);n.onNext(t)}});try{this.initHasRun=true;return t(r)}catch(t){r.error(t)}}));this.initHasRun=false;this.fulfillmentCallbacks=[];this.rejectionCallbacks=[];this.firstValueSet=false;this.state="pending";this[_e]="[object ObservablePromise]"}onNext(t){if(!this.firstValueSet){this.firstValue=t;this.firstValueSet=true}}onError(t){this.state="rejected";this.rejection=t;for(const e of this.rejectionCallbacks){Ge((()=>e(t)))}}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks){Ge((()=>t(this.firstValue)))}}then(t,e){const n=t||Ue;const r=e||Le;let o=false;return new Promise(((t,e)=>{const s=n=>{if(o)return;o=true;try{t(r(n))}catch(t){e(t)}};const i=e=>{try{t(n(e))}catch(t){s(t)}};if(!this.initHasRun){this.subscribe({error:s})}if(this.state==="fulfilled"){return t(n(this.firstValue))}if(this.state==="rejected"){o=true;return t(r(this.rejection))}this.fulfillmentCallbacks.push(i);this.rejectionCallbacks.push(s)}))}catch(t){return this.then(undefined,t)}finally(t){const e=t||qe;return this.then((t=>{e();return t}),(()=>e()))}static from(t){if(He(t)){return new Ye((e=>{const n=t=>{e.next(t);e.complete()};const r=t=>{e.error(t)};t.then(n,r)}))}else{return super.from(t)}}}_e=Symbol.toStringTag;function Je(t){return t&&typeof t==="object"&&t[we]}var Ze;(function(t){t["cancel"]="cancel";t["run"]="run"})(Ze||(Ze={}));var Qe;(function(t){t["error"]="error";t["init"]="init";t["result"]="result";t["running"]="running";t["uncaughtError"]="uncaughtError"})(Qe||(Qe={}));const Ke=qt("threads:master:messages");let Xe=1;const tn=t=>Array.from(new Set(t));const en=t=>t&&t.type===Qe.error;const nn=t=>t&&t.type===Qe.result;const rn=t=>t&&t.type===Qe.running;function on(t,e){return new ae((n=>{let r;let o=false;const s=()=>{t.removeEventListener("message",i);t.removeEventListener("error",c);t.removeEventListener("exit",a)};const i=t=>{Ke("Message from worker:",t.data);if(!t.data||t.data.uid!==e)return;if(rn(t.data)){r=t.data.resultType}else if(nn(t.data)){if(r==="promise"){if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}o=true;n.complete();s()}else{if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}if(t.data.complete){o=true;n.complete();s()}}}else if(en(t.data)){const e=Ae(t.data.error);o=true;n.error(e);s()}};const c=t=>{if(o)return;o=true;const e=t&&t.data instanceof Error?t.data:Error(String(t&&t.data||"Worker errored before the job completed."));n.error(e);s()};const a=t=>{if(o)return;o=true;const e=t?t.data:undefined;n.error(Error(`Worker terminated before the job completed (exit code: ${e}).`));s()};t.addEventListener("message",i);t.addEventListener("error",c);t.addEventListener("exit",a);return()=>{if(r==="observable"||!r){const n={type:Ze.cancel,uid:e};t.postMessage(n)}s()}}))}function sn(t){if(t.length===0){return{args:[],transferables:[]}}const e=[];const n=[];for(const r of t){if(Je(r)){e.push(Ve(r.send));n.push(...r.transferables)}else{e.push(Ve(r))}}return{args:e,transferables:n.length===0?n:tn(n)}}function cn(t,e){return(...n)=>{const r=Xe++;const{args:o,transferables:s}=sn(n);const i={type:Ze.run,uid:r,method:e,args:o};Ke("Sending command to run function to worker:",i);try{t.postMessage(i,s)}catch(t){if($e(t)){const e=new We(`Cannot send arguments to the worker thread: a value is not structured-cloneable. `+`Functions, class instances and other non-serializable values cannot be passed to a thread. `+`Original error: ${t.message}`,t);return Ye.from(Promise.reject(e))}return Ye.from(Promise.reject(t))}return Ye.from(fe(on(t,r)))}}function an(t,e){const n={};for(const r of e){n[r]=cn(t,r)}return n}var un=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};const ln=qt("threads:master:messages");const fn=qt("threads:master:spawn");const hn=qt("threads:master:thread-utils");const dn=t=>t&&t.type==="init";const mn=t=>t&&t.type==="uncaughtError";const pn=typeof process!=="undefined"&&typeof process.env!=="undefined"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function vn(t,e,n){return un(this,void 0,void 0,(function*(){let r;const o=new Promise(((t,o)=>{r=setTimeout((()=>o(Error(n))),e)}));try{return yield Promise.race([t,o])}finally{clearTimeout(r)}}))}function wn(t){return new Promise(((e,n)=>{const r=o=>{ln("Message from worker before finishing initialization:",o.data);if(dn(o.data)){t.removeEventListener("message",r);e(o.data)}else if(mn(o.data)){t.removeEventListener("message",r);n(Ae(o.data.error))}};t.addEventListener("message",r)}))}function yn(t,e){return new ae((n=>{const r=t=>{const e={type:Re.message,data:t.data};n.next(e)};const o=t=>{hn("Unhandled promise rejection event in thread:",t);const e={type:Re.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r);t.addEventListener("unhandledrejection",o);e.then((()=>{const e={type:Re.termination};t.removeEventListener("message",r);t.removeEventListener("unhandledrejection",o);n.next(e);n.complete()}))}))}function gn(t){const[e,n]=Be();const r=()=>un(this,void 0,void 0,(function*(){hn("Terminating worker");yield t.terminate();n()}));return{terminate:r,termination:e}}function bn(t,e,n,r){const o=n.filter((t=>t.type===Re.internalError)).map((t=>t.error));return Object.assign(t,{[me]:o,[pe]:n,[ve]:r,[ye]:e})}function Cn(t,e){return un(this,void 0,void 0,(function*(){var e,n;fn("Initializing new thread");const r=pn;let o;try{o=yield vn(wn(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)}catch(r){yield Promise.resolve((n=(e=t).terminate)===null||n===void 0?void 0:n.call(e)).catch((()=>undefined));throw r}const s=o.exposed;const{termination:i,terminate:c}=gn(t);const a=yn(t,i);if(s.type==="function"){const e=cn(t);return bn(e,t,a,c)}else if(s.type==="module"){const e=an(t,s.methods);return bn(e,t,a,c)}else{const t=s.type;throw Error(`Worker init message states unexpected type of expose(): ${t}`)}}))}Tt().blob;const xn=Tt().default;if(typeof global!=="undefined"){global.Worker=xn}else if(typeof window!=="undefined"){window.Worker=xn}const kn=new URL("./png-decoder.worker.js",import.meta.url);let Fn;const Mn=1;function Sn(){var t;if(typeof window!=="undefined"){const e=(t=window.navigator.hardwareConcurrency)!==null&&t!==void 0?t:8;return Math.ceil(e/4)}else{return Mn}}function En(){if(Fn==null){const t=Sn();console.debug(`Spawning PNG worker pool [size=${t}]`);Fn=je((()=>Cn(new Worker(kn))),{size:t})}return Fn}const In=async t=>{const e=En();return e.queue((e=>e(t)))};function Pn(t,n){const r=e.magnitude(t);const o=n.radius/r;return e.scale(o,t)}function jn(t,n,r){const o=e.subtract(r,t);const s=e.dot(n,o);const i=e.magnitudeSquared(n);const c=s/i;const a=e.scale(c,n);return e.add(a,t)}class Nn{constructor(t,e,n,r,o,s,i,c,a,u=y.create()){this.correlationIds=t;this.temporalRefinementCorrelationId=e;this.sequenceNumber=n;this.dimensions=r;this.image=o;this.scene=s;this.depthBufferBytes=i;this.featureMapBytes=c;this.partialFrame=a;this.id=u}getId(){return this.id}async depthBuffer(){if(this.cachedDepthBuffer==null){this.cachedDepthBuffer=this.depthBufferBytes!=null?this.decodeDepthBuffer(new Uint8Array(this.depthBufferBytes)):Promise.resolve(undefined)}return this.cachedDepthBuffer}async decodeDepthBuffer(t){const e=await In(t);return ut.fromPng(e,this.scene.camera,this.image.imageAttr)}async featureMap(){if(this.cachedFeatureMap==null){this.cachedFeatureMap=this.featureMapBytes!=null?this.decodeFeatureMap(new Uint8Array(this.featureMapBytes)):Promise.resolve(undefined)}return this.cachedFeatureMap}async decodeFeatureMap(t){const e=await In(t);return xt.fromPng(e,this.image.imageAttr)}copy({correlationIds:t,temporalRefinementCorrelationId:e,sequenceNumber:n,dimensions:r,image:o,scene:s,depthBufferBytes:i,featureMapBytes:c,partialFrame:a}){return new Nn(t!==null&&t!==void 0?t:this.correlationIds,e!==null&&e!==void 0?e:this.temporalRefinementCorrelationId,n!==null&&n!==void 0?n:this.sequenceNumber,r!==null&&r!==void 0?r:this.dimensions,o!==null&&o!==void 0?o:this.image,s!==null&&s!==void 0?s:this.scene,i!==null&&i!==void 0?i:this.depthBufferBytes,c!==null&&c!==void 0?c:this.featureMapBytes,a!==null&&a!==void 0?a:this.partialFrame,this.id)}}class Tn{constructor(t,e){this.imageAttr=t;this.imageBytes=e}}class Dn{constructor(t,e,n,r,o,s,i,c){this.camera=t;this.boundingBox=e;this.crossSection=n;this.worldOrientation=r;this.hasChanged=o;this.sceneViewSummary=s;this.modelViewId=i;this.itemModelView=c}copy({camera:t,boundingBox:e,crossSection:n,worldOrientation:r,hasChanged:o,sceneViewSummary:s,modelViewId:i,itemModelView:c}){return new Dn(t!==null&&t!==void 0?t:this.camera,e!==null&&e!==void 0?e:this.boundingBox,n!==null&&n!==void 0?n:this.crossSection,r!==null&&r!==void 0?r:this.worldOrientation,o!==null&&o!==void 0?o:this.hasChanged,s!==null&&s!==void 0?s:this.sceneViewSummary,i!==null&&i!==void 0?i:this.modelViewId,c!==null&&c!==void 0?c:this.itemModelView)}}class On{constructor(t,e,n,r,o,s){this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s}get direction(){return e.normalize(this.viewVector)}get viewVector(){return e.subtract(this.lookAt,this.position)}get worldMatrix(){return this.computeCameraMatrices().worldMatrix}get viewMatrix(){return this.computeCameraMatrices().viewMatrix}get projectionMatrix(){return this.computeCameraMatrices().projectionMatrix}get projectionMatrixInverse(){return this.computeCameraMatrices().projectionMatrixInverse}get projectionViewMatrix(){return this.computeCameraMatrices().projectionViewMatrix}static fromBoundingBox(t,e,r){var o;const{near:s,far:i}=tt(e,t);if(L(t)){const o=n.create(e);const c=Pn(t.viewVector,o);const a=jn(t.lookAt,c,o.center);return new Vn(c,a,t.up,s,i,r,t.fovHeight,t.rotationPoint)}else{return new An(t.position,t.lookAt,t.up,s,i,r,(o=t.fovY)!==null&&o!==void 0?o:45)}}isOrthographic(){return false}isPerspective(){return false}isPointBehindNear(t){const{position:n,direction:r,near:o}=this;const s=e.dot(e.subtract(t,n),r);return s<o}intersectLineWithNear(t){const{position:n,direction:r,near:o}=this;const s=e.subtract(t.start,n);const a=e.subtract(t.end,n);const u=i.create({start:s,end:a});const l=c.create({normal:r,constant:-o});const f=c.intersectLine(l,u);return f!=null?e.add(f,n):undefined}computeCameraMatrices(){if(this.cameraMatrices==null){return{viewMatrix:a.makeIdentity(),worldMatrix:a.makeIdentity(),projectionMatrix:a.makeIdentity(),projectionMatrixInverse:a.makeIdentity(),projectionViewMatrix:a.makeIdentity()}}return this.cameraMatrices}updateCameraMatrices(t){this.cameraMatrices=t;return this.cameraMatrices}}class An extends On{constructor(t,e,n,r,o,s,i){super(t,e,n,r,o,s);this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s;this.fovY=i}toOrthographic(t){return On.fromBoundingBox(Z(this,t),t,this.aspectRatio)}isPerspective(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makePerspective(this.near,this.far,this.fovY,this.aspectRatio);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class Vn extends On{constructor(t,n,r,o,s,i,c,a){super(e.add(n,e.negate(t)),n,r,o,s,i);this.lookAt=n;this.up=r;this.near=o;this.far=s;this.aspectRatio=i;this.fovHeight=c;this.rotationPoint=a;this.top=c*.5;this.bottom=-this.top;this.right=this.top*i;this.left=-this.right}toPerspective(t){return On.fromBoundingBox(Q(this),t,this.aspectRatio)}isOrthographic(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makeOrthographic(this.left,this.right,this.bottom,this.top,this.near,this.far);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class zn{constructor(t,e){this.y=t;this.z=e}get matrix(){const t=this.z;const n=this.y;const r=e.cross(n,t);return a.makeBasis(r,n,t)}}zn.DEFAULT=new zn(e.up(),e.back());class Bn{constructor(t,e){this.position=t;this.up=e}transformMatrix(t){const n=e.multiplyByTransformMatrixColumnMajor(this.position,t);const r=e.multiplyByTransformMatrixColumnMajor(this.up,t);return new Bn(n,r)}}Bn.FRONT=new Bn(e.back(),e.up());Bn.RIGHT=new Bn(e.right(),e.up());Bn.LEFT=new Bn(e.left(),e.up());Bn.BACK=new Bn(e.forward(),e.up());Bn.TOP=new Bn(e.up(),e.forward());Bn.BOTTOM=new Bn(e.down(),e.back());Bn.TOP_FRONT_RIGHT=new Bn(e.add(e.back(),e.up(),e.left()),e.up());Bn.TOP_FRONT_LEFT=new Bn(e.add(e.back(),e.up(),e.right()),e.up());Bn.BOTTOM_FRONT_RIGHT=new Bn(e.add(e.back(),e.down(),e.left()),e.up());Bn.BOTTOM_FRONT_LEFT=new Bn(e.add(e.back(),e.down(),e.right()),e.up());Bn.TOP_BACK_LEFT=new Bn(e.add(e.forward(),e.up(),e.right()),e.up());Bn.TOP_BACK_RIGHT=new Bn(e.add(e.forward(),e.up(),e.left()),e.up());Bn.BOTTOM_BACK_LEFT=new Bn(e.add(e.forward(),e.down(),e.right()),e.up());Bn.BOTTOM_BACK_RIGHT=new Bn(e.add(e.forward(),e.down(),e.left()),e.up());Bn.TOP_FRONT=new Bn(e.add(e.back(),e.up()),e.up());Bn.BOTTOM_FRONT=new Bn(e.add(e.back(),e.down()),e.up());Bn.FRONT_RIGHT=new Bn(e.add(e.back(),e.left()),e.up());Bn.FRONT_LEFT=new Bn(e.add(e.back(),e.right()),e.up());Bn.TOP_BACK=new Bn(e.add(e.forward(),e.up()),e.up());Bn.BOTTOM_BACK=new Bn(e.add(e.forward(),e.down()),e.up());Bn.BACK_LEFT=new Bn(e.add(e.forward(),e.right()),e.up());Bn.BACK_RIGHT=new Bn(e.add(e.forward(),e.left()),e.up());Bn.TOP_LEFT=new Bn(e.add(e.up(),e.right()),e.up());Bn.TOP_RIGHT=new Bn(e.add(e.up(),e.left()),e.up());Bn.BOTTOM_LEFT=new Bn(e.add(e.down(),e.right()),e.up());Bn.BOTTOM_RIGHT=new Bn(e.add(e.down(),e.left()),e.up());const Rn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y")),(([t,e])=>r.create(t,e)));const Wn=v.defineMapper(v.read(v.requiredProp("width"),v.requiredProp("height")),(([t,e])=>u.create(t,e)));const $n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("width"),v.requiredProp("height")),(([t,e,n,r])=>s.create(t,e,n,r)));const _n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z")),(([t,n,r])=>e.create(t,n,r)));const qn=v.defineMapper(v.read(v.requiredProp("xmin"),v.requiredProp("ymin"),v.requiredProp("zmin"),v.requiredProp("xmax"),v.requiredProp("ymax"),v.requiredProp("zmax")),(([t,n,r,o,s,i])=>l.create(e.create(t,n,r),e.create(o,s,i))));const Un=v.defineMapper(v.read(v.requiredProp("d"),v.mapRequiredProp("normal",_n)),(([t,e])=>c.create({normal:e,constant:t})));const Gn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z"),v.requiredProp("w")),(([t,e,n,r])=>f.create({x:t,y:e,z:n,w:r})));const Ln=v.defineMapper(v.read(v.mapRequiredProp("r0",Gn),v.mapRequiredProp("r1",Gn),v.mapRequiredProp("r2",Gn),v.mapRequiredProp("r3",Gn)),(([t,e,n,r])=>a.transpose(a.fromValues(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w))));const Hn=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b")),(([t,e,n])=>w.create(t,e,n)));const Yn=v.defineMapper((t=>{function e(t){return{r:t.r,g:t.g,b:t.b}}if(typeof t==="string"){const n=w.fromHexString(t);return n!=null?e(n):{errors:["String is not a valid color."]}}else if(typeof t==="number"){return e(w.fromNumber(t))}else{return e(t)}}),(t=>t));tr();const Jn=tr();const Zn=tr();const Qn=er();const Kn=er();const Xn=er();function tr(){return v.defineMapper((t=>t!=null?{value:t}:undefined),(t=>t))}function er(){return v.defineMapper((t=>(t===null||t===void 0?void 0:t.value)||undefined),(t=>t))}const nr=v.defineMapper(v.read(v.mapProp("position",v.compose(v.required("position"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.getProp("fovY")),(([t,e,n,r])=>({position:t,lookAt:e,up:n,fovY:(r===null||r===void 0?void 0:r.value)!=null?r.value:45})));const rr=v.defineMapper(v.read(v.mapProp("viewVector",v.compose(v.required("viewVector"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("fovHeight",v.required("fovHeight"))),(([t,e,n,r])=>({viewVector:t,lookAt:e,up:n,fovHeight:r})));const or=v.defineMapper(v.read(v.mapProp("position",v.ifDefined(_n)),v.mapProp("lookAt",v.ifDefined(_n)),v.mapProp("up",v.ifDefined(_n)),v.mapProp("perspective",v.ifDefined(nr)),v.mapProp("orthographic",v.ifDefined(rr))),(([t,n,r,o,s])=>{var i;return(i=o!==null&&o!==void 0?o:s)!==null&&i!==void 0?i:{position:t!==null&&t!==void 0?t:e.back(),lookAt:n!==null&&n!==void 0?n:e.origin(),up:r!==null&&r!==void 0?r:e.up(),fovY:45}}));const sr=v.defineMapper(v.read(v.mapProp("normal",v.compose(v.required("normal"),_n)),v.requiredProp("offset")),(([t,e])=>({normal:t,offset:e})));const ir=v.defineMapper(v.read(v.mapProp("frameDimensions",v.compose(v.required("frameDimensions"),Wn)),v.mapProp("imageRect",v.compose(v.required("imageRect"),$n)),v.mapProp("scaleFactor",v.required("scaleFactor"))),(([t,e,n])=>({frameDimensions:t,imageRect:e,imageScale:n})));const cr=v.defineMapper(v.read(v.mapProp("sectionPlanes",v.compose(v.required("sectionPlanes"),v.mapArray(sr))),v.mapProp("highlightColor",v.ifDefined(Hn))),(([t,e])=>rt({sectionPlanes:t,highlightColor:e||undefined})));const ar=v.defineMapper(v.read(v.requiredProp("count"),v.mapProp("boundingBox",v.ifDefined(qn))),(([t,e])=>({count:t,boundingBox:e!==null&&e!==void 0?e:undefined})));const ur=v.defineMapper(v.read(v.mapProp("visibleSummary",v.ifDefined(ar)),v.mapProp("selectedVisibleSummary",v.ifDefined(ar))),(([t,e])=>it({visibleSummary:t!==null&&t!==void 0?t:undefined,selectedVisibleSummary:e!==null&&e!==void 0?e:undefined})));const lr=v.defineMapper(v.read(v.mapProp("modelViewId",v.ifDefined(S)),v.mapProp("sceneItemId",v.ifDefined(S))),(([t,e])=>st({modelViewId:t!==null&&t!==void 0?t:undefined,sceneItemId:e!==null&&e!==void 0?e:undefined})));const fr=v.defineMapper(v.read(v.mapProp("imageAttributes",v.compose(v.required("imageAttributes"),ir))),(([t])=>t));const hr=v.defineMapper(v.read(fr,v.mapProp("image",v.required("image"))),(([t,e])=>new Tn(t,e)));const dr=v.defineMapper(v.read(v.mapRequiredProp("camera",or),v.mapRequiredProp("visibleBoundingBox",qn),v.mapRequiredProp("crossSectioning",cr),v.requiredProp("hasChanged"),v.mapRequiredProp("displayListSummary",ur),v.mapProp("modelViewId",v.ifDefined(E)),v.mapProp("itemModelView",v.ifDefined(lr))),(([t,e,n,r,o,s,i])=>({camera:t,boundingBox:e,crossSectioning:n,hasChanged:r,displayListSummary:o,modelViewId:s!==null&&s!==void 0?s:undefined,itemModelView:i!==null&&i!==void 0?i:undefined})));const mr=v.defineMapper(v.read(v.mapProp("sceneAttributes",v.compose(v.required("sceneAttributes"),dr))),(([t])=>t));const pr=v.defineMapper(v.read(mr,fr),(([t,e])=>On.fromBoundingBox(t.camera,t.boundingBox,u.aspectRatio(e.frameDimensions))));function vr(t){return v.defineMapper(v.read(mr,pr),(([e,n])=>new Dn(n,e.boundingBox,e.crossSectioning,t,e.hasChanged,e.displayListSummary,e.modelViewId,e.itemModelView)))}function wr(t){return v.defineMapper(v.read(v.mapProp("frameCorrelationIds",(t=>t!=null?t:[])),v.requiredProp("sequenceNumber"),v.compose(fr,v.getProp("frameDimensions")),vr(t),hr,v.mapProp("depthBuffer",Kn),v.mapProp("featureMap",Kn),v.mapProp("temporalRefinementCorrelationId",(t=>t!=null?S(t):null)),v.mapProp("partialFrame",v.ifDefined(Qn))),(([t,e,n,r,o,s,i,c,a])=>new Nn(t,c||"",e,n,o,r,s,i,a!==null&&a!==void 0?a:false)))}function yr(t){return v.ifInvalidThrow(wr(t))}const gr=v.defineMapper(v.compose(v.required("orientation"),v.read(v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("front",v.compose(v.required("front"),_n)))),(([t,e])=>new zn(t,e)));v.ifInvalidThrow(gr);const br=v.defineMapper(v.read(v.mapRequiredProp("imageAttributes",ir),v.requiredProp("stencilBuffer"),v.mapRequiredProp("depthBuffer",v.compose(Kn,v.required("depthBuffer")))),(([t,e,n])=>({imageAttributes:t,stencilBuffer:e,depthBuffer:n})));const Cr=kr("stencilBuffer",br);const xr=v.ifInvalidThrow(Cr);function kr(t,e){return v.mapRequiredProp(t,e)}const Fr=v.defineMapper(v.read(v.requiredProp("token"),v.requiredProp("expiresIn")),(([t,e])=>$.create(t,e)));const Mr=v.defineMapper(v.read(v.compose(v.requiredProp("startStream"),v.mapRequiredProp("streamId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneViewId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sessionId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("worldOrientation",gr)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("token",Fr))),(([t,e,n,r,o,s])=>({streamId:t,sceneId:e,sceneViewId:n,sessionId:r,worldOrientation:o,token:s})));const Sr=v.ifInvalidThrow(Mr);const Er=v.defineMapper(v.read(v.compose(v.requiredProp("reconnect"),v.mapRequiredProp("token",Fr))),(([t])=>({token:t})));const Ir=v.ifInvalidThrow(Er);const Pr=v.defineMapper(v.compose(v.requiredProp("refreshToken"),v.requiredProp("token"),Fr),(t=>t));const jr=v.ifInvalidThrow(Pr);const Nr=v.defineMapper(v.compose(v.requiredProp("syncTime"),v.requiredProp("replyTime"),v.read(v.requiredProp("seconds"),v.requiredProp("nanos"))),(([t,e])=>m({seconds:t,nanos:e})));const Tr=v.ifInvalidThrow(Nr);const Dr=v.defineMapper(v.ifDefined(v.getProp("next")),(t=>t!=null?t:undefined));const Or=v.defineMapper((t=>{switch(t){case"all":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_ALL};case"final":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_FINAL};default:return{enabled:{value:false},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_INVALID}}}),(t=>t));const Ar=v.defineMapper(v.read(v.ifDefined(v.getProp("opacity"))),(([t])=>({opacity:{value:h(t!==null&&t!==void 0?t:0,0,1)}})));const Vr=v.defineMapper(v.read(v.ifDefined(v.getProp("width")),v.ifDefined(v.mapProp("color",v.ifDefined(Yn)))),(([t,e])=>({lineWidth:t,lineColor:e})));const zr=v.defineMapper(v.read(v.ifDefined(v.mapProp("color",v.ifDefined(Yn))),v.ifDefined(v.mapProp("opacity",Jn)),v.ifDefined(v.getProp("lineWidth"))),(([t,e,n])=>{if(t||e||n){return{color:t,opacity:e,lineWidth:n}}else return undefined}));const Br=v.defineMapper(v.read(v.ifDefined(v.mapProp("highlightColor",v.ifDefined(Yn))),v.ifDefined(v.mapProp("occludedOpacity",Jn)),v.ifDefined(v.mapProp("outline",v.ifDefined(Vr)))),(([t,e,n])=>({highlightColor:t,occludedOpacity:e,outline:n})));const Rr=v.defineMapper((t=>!!t),(t=>t));const Wr=v.defineMapper((t=>t!==null&&t!==void 0?t:""),(t=>t));const $r=v.defineMapper(v.read(v.ifDefined(v.mapProp("frameBackgroundColor",v.ifDefined(Yn)))),(([t])=>({frameBackgroundColor:t})));const _r=v.defineMapper(v.read(v.ifDefined(v.mapProp("streamKeyToCompare",v.ifDefined(Zn)))),(([t])=>({streamKeyToCompare:t})));const qr=v.defineMapper(v.read(v.ifDefined(v.mapProp("endCapEnabled",(t=>!!t))),v.ifDefined(v.mapProp("endCapColor",v.ifDefined(Yn)))),(([t,e])=>({endCapEnabled:t,endCapColor:e})));const Ur=v.defineMapper(v.read(v.mapProp("depthBuffers",Or),v.mapProp("phantom",Ar),v.mapProp("noDefaultLights",Rr),v.mapProp("featureLines",Vr),v.mapProp("featureHighlighting",Br),v.mapProp("featureMaps",Or),v.mapProp("experimentalRenderingOptions",Wr),v.mapProp("selectionHighlighting",zr),v.mapProp("frames",$r),v.mapProp("sceneComparison",_r),v.mapProp("crossSectioning",qr)),(([t,e,n,r,o,s,i,c,a,u,l])=>{const f={depthBuffers:t,phantomItems:e,noDefaultLights:n,featureLines:r,featureHighlighting:o,featureMaps:s,experimentalRenderingOptions:i,selectionHighlighting:c,frames:a,sceneComparison:u,crossSectioningAttributes:l};return f}));export{gt as A,Yn as B,b as C,wt as D,Ct as E,On as F,Jn as G,yr as H,Sr as I,Ir as J,Tr as K,jr as L,ct as M,C as N,zn as O,Z as P,Q,_ as R,Bn as S,Pn as T,H as U,tt as V,Un as W,or as X,I as Y,Nn as a,Tn as b,ot as c,Dn as d,Vn as e,X as f,An as g,bt as h,xr as i,In as j,ut as k,k as l,F as m,Xn as n,_n as o,x as p,Rn as q,Hn as r,Dr as s,K as t,jn as u,M as v,Ln as w,Qn as x,qn as y,Ur as z};
5
- //# sourceMappingURL=p-DjrtwKcK.js.map
4
+ import{a as t,v as e,f as n,p as r,r as o,g as s,l as i,b as c,m as a,e as u,c as l,i as f,j as h}from"./p-2UsvOTHJ.js";import{v as d,p as m,L as p}from"./p-5kcpg4MZ.js";import{m as v,c as w,b as y}from"./p-CDM7zNn0.js";import{g}from"./p-CG9AChtV.js";const b=v.defineMapper((t=>{switch(t){case"perspective":return d.protobuf.stream.CameraType.CAMERA_TYPE_PERSPECTIVE;case"orthographic":return d.protobuf.stream.CameraType.CAMERA_TYPE_ORTHOGRAPHIC;default:return d.protobuf.stream.CameraType.CAMERA_TYPE_INVALID}}),(t=>t));function C(){return v.ifInvalidThrow(b)}const x=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b"),v.requiredProp("a")),(([t,e,n,r])=>w.create(t,e,n,r)));const k=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>y.fromMsbLsb(t,e)));const F=v.defineMapper(v.read(v.requiredProp("seconds"),v.requiredProp("nanos")),(([t,e])=>m({seconds:t,nanos:e})));const M=v.defineMapper(v.read(v.requiredProp("iso")),(([t])=>new Date(t)));const S=v.defineMapper(v.read(v.requiredProp("hex")),(([t])=>t));const E=v.defineMapper(v.read(v.requiredProp("msb"),v.requiredProp("lsb")),(([t,e])=>{const n=BigInt(typeof t==="number"?t:t.toString());const r=BigInt(typeof e==="number"?e:e.toString());return y.fromMsbLsb(n,r)}));const I=v.defineMapper(v.compose((t=>y.toMsbLsb(t)),v.read(v.mapProp("msb",p.fromString),v.mapProp("lsb",p.fromString))),(([t,e])=>({msb:t,lsb:e})));function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function j(t){if(t===null||t===true||t===false){return NaN}var e=Number(t);if(isNaN(e)){return e}return e<0?Math.ceil(e):Math.floor(e)}function N(t,e){if(e.length<t){throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}}function T(t){N(1,arguments);var e=Object.prototype.toString.call(t);if(t instanceof Date||P(t)==="object"&&e==="[object Date]"){return new Date(t.getTime())}else if(typeof t==="number"||e==="[object Number]"){return new Date(t)}else{if((typeof t==="string"||e==="[object String]")&&typeof console!=="undefined"){console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");console.warn((new Error).stack)}return new Date(NaN)}}function O(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}n.setDate(n.getDate()+r);return n}function D(t,e){N(2,arguments);var n=T(t);var r=j(e);if(isNaN(r)){return new Date(NaN)}if(!r){return n}var o=n.getDate();var s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var i=s.getDate();if(o>=i){return s}else{n.setFullYear(s.getFullYear(),s.getMonth(),o);return n}}function A(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=T(t);var l=r||n?D(u,r+n*12):u;var f=s||o?O(l,s+o*7):l;var h=c+i*60;var d=a+h*60;var m=d*1e3;var p=new Date(f.getTime()+m);return p}function V(t,e){N(2,arguments);return T(t).getTime()-T(e).getTime()}function z(t,e){N(2,arguments);var n=T(t);var r=T(e);return n.getTime()>r.getTime()}function B(t,e){N(2,arguments);var n=j(e);return O(t,-n)}function R(t,e){N(2,arguments);var n=j(e);return D(t,-n)}function W(t,e){N(2,arguments);if(!e||P(e)!=="object")return new Date(NaN);var n=e.years?j(e.years):0;var r=e.months?j(e.months):0;var o=e.weeks?j(e.weeks):0;var s=e.days?j(e.days):0;var i=e.hours?j(e.hours):0;var c=e.minutes?j(e.minutes):0;var a=e.seconds?j(e.seconds):0;var u=R(t,r+n*12);var l=B(u,s+o*7);var f=c+i*60;var h=a+f*60;var d=h*1e3;var m=new Date(l.getTime()-d);return m}class ${constructor(t,e,n){this.token=t;this.expiresIn=e;this.expiresAt=n}static create(t,e){const n=A(new Date,{seconds:e});return new $(t,e,n)}hasExpired(){return z(new Date,this.expiresAt)}remainingTimeInMs(t){return V(W(this.expiresAt,{seconds:t}),new Date)}}function _(t){if(G(t)){const n=q(t.lookAt);const r=q(t.position);const o=U(t.up);const s=n&&r&&U(e.subtract(t.lookAt,t.position));const i=t.fovY!=null&&Number.isFinite(t.fovY)&&t.fovY>=1&&t.fovY<=179;return o&&s&&i}else{const e=t;const n=U(e.viewVector);const r=q(e.lookAt);const o=U(e.up);const s=Number.isFinite(e.fovHeight)&&e.fovHeight>0;return n&&r&&o&&s}}function q(t){return t!=null&&e.isValid(t)}function U(t){return q(t)&&!e.isZeroVector(t)}function G(t){return t.position!=null&&t.fovHeight==null}function L(t){const e=t;return e.viewVector!=null&&e.fovHeight!=null}function H(t){if(L(t)){return{...t,position:e.add(t.lookAt,e.negate(t.viewVector))}}else{return{...t,viewVector:e.subtract(t.lookAt,t.position)}}}function Y(t={}){var n,r,o,s;return{position:(n=t.position)!==null&&n!==void 0?n:e.forward(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovY:(s=t.fovY)!==null&&s!==void 0?s:45}}function J(t={}){var n,r,o,s,i,c;return{viewVector:(n=t.viewVector)!==null&&n!==void 0?n:e.back(),lookAt:(r=t.lookAt)!==null&&r!==void 0?r:e.origin(),up:(o=t.up)!==null&&o!==void 0?o:e.up(),fovHeight:(s=t.fovHeight)!==null&&s!==void 0?s:1,rotationPoint:(c=(i=t.rotationPoint)!==null&&i!==void 0?i:t.lookAt)!==null&&c!==void 0?c:e.origin()}}function Q(r,o){var s;const i=e.subtract(r.lookAt,r.position);const c=n.create(o);const a=c.radius/e.magnitude(i);return{viewVector:e.scale(a,i),up:r.up,lookAt:r.lookAt,fovHeight:2*e.magnitude(i)*Math.tan(t.toRadians(((s=r.fovY)!==null&&s!==void 0?s:45)/2))}}function Z(n,r=45){const o=n.fovHeight/(2*Math.tan(t.toRadians(r/2)));const s=e.magnitude(n.viewVector);const i=o/s;return{position:e.add(n.lookAt,e.negate(e.scale(i,n.viewVector))),up:n.up,lookAt:n.lookAt,fovY:r}}function K(t){if(L(t)){return{orthographic:{viewVector:{...t.viewVector},lookAt:{...t.lookAt},up:{...t.up},fovHeight:t.fovHeight}}}else if(G(t)){return{perspective:{position:{...t.position},lookAt:{...t.lookAt},up:{...t.up},fovY:t.fovY?{value:t.fovY}:null},position:{...t.position},lookAt:{...t.lookAt},up:{...t.up}}}else{return{...t}}}var X=Object.freeze({__proto__:null,createOrthographic:J,createPerspective:Y,isOrthographicFrameCamera:L,isPerspectiveFrameCamera:G,isValidFrameCamera:_,toOrthographic:Q,toPerspective:Z,toProtobuf:K,withPositionAndViewVector:H});function tt(t,e){return L(e)?nt(t):et(t,e)}function et(t,r){const o=n.create(t);const s=o.epsilon*100;const i=e.dot(e.subtract(o.center,r.position),e.normalize(e.subtract(r.lookAt,r.position)));const c=Math.max(o.radius,s);let a=c+i<s?c*3:c+i;let u=a-c*2<s?Math.min(s,a):a-c*2;if(a-u<s){u=Math.max(u,s);a+=u+s}else if(u/a<1e-4){u=a*1e-4}if(u>a-c*2){if(u>1e3+s){a-=u-1e3;u=1e3}}return{near:u,far:a}}function nt(t,e){const r=n.create(t);const o=r.epsilon*100;const s=Math.max(r.radius,o);return{near:-s,far:s}}function rt(t={}){return{sectionPlanes:t.sectionPlanes||[],highlightColor:t.highlightColor,lineWidth:t.lineWidth}}var ot=Object.freeze({__proto__:null,create:rt});function st(t={}){return{modelViewId:t.modelViewId,sceneItemId:t.sceneItemId}}function it(t={}){return{visibleSummary:t.visibleSummary,selectedVisibleSummary:t.selectedVisibleSummary}}function ct(t,e){return at(t.scene.sceneViewSummary)?t.copy({scene:t.scene.copy({sceneViewSummary:e===null||e===void 0?void 0:e.scene.sceneViewSummary})}):t}function at(t){return t.visibleSummary==null}class ut{constructor(t,e,n){this.camera=t;this.imageAttr=e;this.pixels=n}static fromPng(t,e,n){if(t.data instanceof Uint16Array){return new ut(e,n,t.data)}else{throw new Error("Expected depth PNG to have depth of 16-bit")}}getDepthAtPoint(t,e){const{near:n,far:r}=this.camera;const o=this.camera.isPerspective();const s=this.getNormalizedDepthAtPoint(t,e);if(o){return s*(r-n)+n}else{return s*(r-n)}}getMaxDepthOfGeometry(){const{near:t,far:e}=this.camera;const n=this.camera.isPerspective();if(n){return e}else{return e-t}}getNormalizedDepthAtPoint(t,e){const{width:n,height:o}=this.imageAttr.imageRect;const s=r.subtract(t,this.imageAttr.imageRect);const i=1/this.imageAttr.imageScale;const c=r.scale(s,i,i);if(c.x>=0&&c.y>=0&&c.x<n&&c.y<o){const t=Math.floor(c.x)+Math.floor(c.y)*n;const r=this.pixels[t];const o=r===ut.MAX_DEPTH_VALUE?e!==null&&e!==void 0?e:r:r;return(o!==null&&o!==void 0?o:ut.MAX_DEPTH_VALUE)/ut.MAX_DEPTH_VALUE}else{return e!==null&&e!==void 0?e:1}}hitTest(t){return this.getNormalizedDepthAtPoint(t)<1}getWorldPoint(t,n,r){const s=this.getDepthAtPoint(t,r);const i=this.camera.isPerspective();if(i){const{position:t,viewVector:r,far:i}=this.camera;const c=o.at(n,i);const a=e.subtract(c,t);const u=e.dot(r,a)/(e.magnitude(r)*e.magnitude(a));return o.at(n,s/u)}else{return o.at(n,s)}}distanceToPoint(t){const{position:n,direction:r}=this.camera;const o=e.subtract(t,n);return Math.abs(e.dot(o,r))}depthOfClosestGeometry(t,e){const{projectionViewMatrix:n}=this.camera;const r=e.transformWorldToViewport(t,n);const o=e.transformPointToFrame(r,this);return this.getDepthAtPoint(o)}isOccluded(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=Math.abs(.02*n);const s=Math.abs(r-n);return n>r&&s>o}isDetached(t,e){const n=this.distanceToPoint(t);const r=this.depthOfClosestGeometry(t,e);const o=r-n;const s=.02*n;const i=o<s;const c=this.getMaxDepthOfGeometry();const a=n>c;const u=!i||a;return u}}ut.MAX_DEPTH_VALUE=2**16-1;class lt{constructor(t){this.scale=t}convertTo(t){return t*this.scale}convertFrom(t){return t/this.scale}}class ft extends lt{constructor(){super(1)}}class ht extends lt{constructor(t=1){super(1/Math.pow(10,t))}}class dt extends lt{constructor(t=1){super(1/Math.pow(1e3,t))}}class mt extends lt{constructor(t=1){super(1/Math.pow(25.4,t))}}class pt extends lt{constructor(t=1){super(1/Math.pow(25.4*12,t))}}class vt extends lt{constructor(t=1){super(1/Math.pow(25.4*12*3,t))}}class wt{constructor(t){this.unitType=t;this.unit=wt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}convertWorldPointToReal(t){const e=this.unit.converter.convertTo(t.x);const n=this.unit.converter.convertTo(t.y);const r=this.unit.converter.convertTo(t.z);return{x:e,y:n,z:r}}convertRealPointToWorld(t){const e=this.unit.converter.convertFrom(t.x);const n=this.unit.converter.convertFrom(t.y);const r=this.unit.converter.convertFrom(t.z);return{x:e,y:n,z:r}}}wt.units={millimeters:{name:"Millimeters",abbreviatedName:"mm",converter:new ft},centimeters:{name:"Centimeters",abbreviatedName:"cm",converter:new ht},meters:{name:"Meters",abbreviatedName:"m",converter:new dt},inches:{name:"Inches",abbreviatedName:"in",converter:new mt},feet:{name:"Feet",abbreviatedName:"ft",converter:new pt},yards:{name:"Yards",abbreviatedName:"yd",converter:new vt}};class yt{convertTo(e){return t.toDegrees(e)}convertFrom(e){return t.toRadians(e)}}class gt{constructor(t){this.unitType=t;this.unit=gt.units[t]}convertTo(t){return this.unit.converter.convertTo(t)}convertFrom(t){return this.unit.converter.convertFrom(t)}}gt.units={radians:{name:"Radians",abbreviatedName:"rad",converter:new lt(1)},degrees:{name:"Degrees",abbreviatedName:"deg",converter:new yt}};class bt{constructor(t){this.unitType=t;this.unit=bt.units[t]}convertWorldValueToReal(t){return this.unit.converter.convertTo(t)}convertRealValueToWorld(t){return this.unit.converter.convertFrom(t)}}bt.units={millimeters:{name:"Square Millimeters",abbreviatedName:"mm²",converter:new ft},centimeters:{name:"Square Centimeters",abbreviatedName:"cm²",converter:new ht(2)},meters:{name:"Square Meters",abbreviatedName:"m²",converter:new dt(2)},inches:{name:"Square Inches",abbreviatedName:"in²",converter:new mt(2)},feet:{name:"Square Feet",abbreviatedName:"ft²",converter:new pt(2)},yards:{name:"Square Yards",abbreviatedName:"yd²",converter:new vt(2)}};var Ct;(function(t){t[t["CROSS_SECTION"]=255]="CROSS_SECTION";t[t["PRECISE_EDGE"]=224]="PRECISE_EDGE";t[t["PRECISE_SURFACE"]=192]="PRECISE_SURFACE";t[t["IMPRECISE_EDGE"]=160]="IMPRECISE_EDGE";t[t["IMPRECISE_SURFACE"]=128]="IMPRECISE_SURFACE";t[t["GENERIC_GEOMETRY"]=96]="GENERIC_GEOMETRY";t[t["NO_GEOMETRY"]=0]="NO_GEOMETRY"})(Ct||(Ct={}));class xt{constructor(t,e){this.pixels=t;this.imageAttr=e}static fromPng(t,e){if(!(t.data instanceof Uint8Array)){throw new Error("Cannot create FeatureMap. Expected decoded PNG to be a Uint8Array.")}else if(t.channels!==4){throw new Error("Cannot create FeatureMap. Missing alpha channel.")}else{return new xt(t.data,{...e,imageRect:s.fromPointAndDimensions(e.imageRect,t)})}}getEntityType(t){const e=this.getColor(t);if((e===null||e===void 0?void 0:e.a)===Ct.CROSS_SECTION){return Ct.CROSS_SECTION}else if((e===null||e===void 0?void 0:e.a)===Ct.GENERIC_GEOMETRY){return Ct.GENERIC_GEOMETRY}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_EDGE){return Ct.IMPRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.IMPRECISE_SURFACE){return Ct.IMPRECISE_SURFACE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_EDGE){return Ct.PRECISE_EDGE}else if((e===null||e===void 0?void 0:e.a)===Ct.PRECISE_SURFACE){return Ct.PRECISE_SURFACE}else{return Ct.NO_GEOMETRY}}getColor(t){const{width:e,height:n}=this.imageAttr.imageRect;const o=r.subtract(t,this.imageAttr.imageRect);const s=1/this.imageAttr.imageScale;const i=r.scale(o,s,s);if(i.x>=0&&i.y>=0&&i.x<e&&i.y<n){const t=Math.floor(i.x)*4+Math.floor(i.y)*4*e;const n=this.pixels[t];const r=this.pixels[t+1];const o=this.pixels[t+2];const s=this.pixels[t+3];return w.create(n,r,o,s)}else return undefined}}let kt;function Ft(){if(!kt){kt=Mt()}return kt}function Mt(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e){return St(e[0])}}return"/"}function St(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}const Et=typeof navigator!=="undefined"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const It=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function Pt(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function jt(){if(typeof Worker==="undefined"){return class t{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}}class t extends Worker{constructor(t,e){var n,r;if(typeof t==="string"&&e&&e._baseURL){t=new URL(t,e._baseURL)}else if(typeof t==="string"&&!It(t)&&Ft().match(/^file:\/\//i)){t=new URL(t,Ft().replace(/\/[^/]+$/,"/"));if((n=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&n!==void 0?n:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}if(typeof t==="string"&&It(t)){if((r=e===null||e===void 0?void 0:e.CORSWorkaround)!==null&&r!==void 0?r:true){t=Pt(`importScripts(${JSON.stringify(t)});`)}}super(t,e)}}class e extends t{constructor(t,e){const n=window.URL.createObjectURL(t);super(n,e)}static fromText(t,n){const r=new window.Blob([t],{type:"text/javascript"});return new e(r,n)}}return{blob:e,default:t}}let Nt;function Tt(){if(!Nt){Nt=jt()}return Nt}var Ot={exports:{}};var Dt;var At;function Vt(){if(At)return Dt;At=1;var t=1e3;var e=t*60;var n=e*60;var r=n*24;var o=r*7;var s=r*365.25;Dt=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0){return i(t)}else if(n==="number"&&isFinite(t)){return e.long?a(t):c(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function i(i){i=String(i);if(i.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!c){return}var a=parseFloat(c[1]);var u=(c[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*e;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function c(o){var s=Math.abs(o);if(s>=r){return Math.round(o/r)+"d"}if(s>=n){return Math.round(o/n)+"h"}if(s>=e){return Math.round(o/e)+"m"}if(s>=t){return Math.round(o/t)+"s"}return o+"ms"}function a(o){var s=Math.abs(o);if(s>=r){return u(o,s,r,"day")}if(s>=n){return u(o,s,n,"hour")}if(s>=e){return u(o,s,e,"minute")}if(s>=t){return u(o,s,t,"second")}return o+" ms"}function u(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}return Dt}var zt;var Bt;function Rt(){if(Bt)return zt;Bt=1;function t(t){n.debug=n;n.default=n;n.coerce=a;n.disable=i;n.enable=o;n.enabled=c;n.humanize=Vt();n.destroy=u;Object.keys(t).forEach((e=>{n[e]=t[e]}));n.names=[];n.skips=[];n.formatters={};function e(t){let e=0;for(let n=0;n<t.length;n++){e=(e<<5)-e+t.charCodeAt(n);e|=0}return n.colors[Math.abs(e)%n.colors.length]}n.selectColor=e;function n(t){let e;let o=null;let s;let i;function c(...t){if(!c.enabled){return}const r=c;const o=Number(new Date);const s=o-(e||o);r.diff=s;r.prev=e;r.curr=o;e=o;t[0]=n.coerce(t[0]);if(typeof t[0]!=="string"){t.unshift("%O")}let i=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,o)=>{if(e==="%%"){return"%"}i++;const s=n.formatters[o];if(typeof s==="function"){const n=t[i];e=s.call(r,n);t.splice(i,1);i--}return e}));n.formatArgs.call(r,t);const a=r.log||n.log;a.apply(r,t)}c.namespace=t;c.useColors=n.useColors();c.color=n.selectColor(t);c.extend=r;c.destroy=n.destroy;Object.defineProperty(c,"enabled",{enumerable:true,configurable:false,get:()=>{if(o!==null){return o}if(s!==n.namespaces){s=n.namespaces;i=n.enabled(t)}return i},set:t=>{o=t}});if(typeof n.init==="function"){n.init(c)}return c}function r(t,e){const r=n(this.namespace+(typeof e==="undefined"?":":e)+t);r.log=this.log;return r}function o(t){n.save(t);n.namespaces=t;n.names=[];n.skips=[];const e=(typeof t==="string"?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const t of e){if(t[0]==="-"){n.skips.push(t.slice(1))}else{n.names.push(t)}}}function s(t,e){let n=0;let r=0;let o=-1;let s=0;while(n<t.length){if(r<e.length&&(e[r]===t[n]||e[r]==="*")){if(e[r]==="*"){o=r;s=n;r++}else{n++;r++}}else if(o!==-1){r=o+1;s++;n=s}else{return false}}while(r<e.length&&e[r]==="*"){r++}return r===e.length}function i(){const t=[...n.names,...n.skips.map((t=>"-"+t))].join(",");n.enable("");return t}function c(t){for(const e of n.skips){if(s(t,e)){return false}}for(const e of n.names){if(s(t,e)){return true}}return false}function a(t){if(t instanceof Error){return t.stack||t.message}return t}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}n.enable(n.load());return n}zt=t;return zt}var Wt;function $t(){if(Wt)return Ot.exports;Wt=1;(function(t,e){e.formatArgs=r;e.save=o;e.load=s;e.useColors=n;e.storage=i();e.destroy=(()=>{let t=false;return()=>{if(!t){t=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let t;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0;let o=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{if(t==="%%"){return}r++;if(t==="%c"){o=r}}));e.splice(o,0,n)}e.log=console.debug||console.log||(()=>{});function o(t){try{if(t){e.storage.setItem("debug",t)}else{e.storage.removeItem("debug")}}catch(t){}}function s(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(t){}if(!t&&typeof process!=="undefined"&&"env"in process){t=process.env.DEBUG}return t}function i(){try{return localStorage}catch(t){}}t.exports=Rt()(e);const{formatters:c}=t.exports;c.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}})(Ot,Ot.exports);return Ot.exports}var _t=$t();var qt=g(_t);const Ut=()=>typeof Symbol==="function";const Gt=t=>Ut()&&Boolean(Symbol[t]);const Lt=t=>Gt(t)?Symbol[t]:"@@"+t;if(!Gt("asyncIterator")){Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator")}const Ht=Lt("iterator");const Yt=Lt("observable");const Jt=Lt("species");function Qt(t,e){const n=t[e];if(n==null){return undefined}if(typeof n!=="function"){throw new TypeError(n+" is not a function")}return n}function Zt(t){let e=t.constructor;if(e!==undefined){e=e[Jt];if(e===null){e=undefined}}return e!==undefined?e:ae}function Kt(t){return t instanceof ae}function Xt(t){if(Xt.log){Xt.log(t)}else{setTimeout((()=>{throw t}),0)}}function te(t){Promise.resolve().then((()=>{try{t()}catch(t){Xt(t)}}))}function ee(t){const e=t._cleanup;if(e===undefined){return}t._cleanup=undefined;if(!e){return}try{if(typeof e==="function"){e()}else{const t=Qt(e,"unsubscribe");if(t){t.call(e)}}}catch(t){Xt(t)}}function ne(t){t._observer=undefined;t._queue=undefined;t._state="closed"}function re(t){const e=t._queue;if(!e){return}t._queue=undefined;t._state="ready";for(const n of e){oe(t,n.type,n.value);if(t._state==="closed"){break}}}function oe(t,e,n){t._state="running";const r=t._observer;try{const o=r?Qt(r,e):undefined;switch(e){case"next":if(o)o.call(r,n);break;case"error":ne(t);if(o)o.call(r,n);else throw n;break;case"complete":ne(t);if(o)o.call(r);break}}catch(t){Xt(t)}if(t._state==="closed"){ee(t)}else if(t._state==="running"){t._state="ready"}}function se(t,e,n){if(t._state==="closed"){return}if(t._state==="buffering"){t._queue=t._queue||[];t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering";t._queue=[{type:e,value:n}];te((()=>re(t)));return}oe(t,e,n)}class ie{constructor(t,e){this._cleanup=undefined;this._observer=t;this._queue=undefined;this._state="initializing";const n=new ce(this);try{this._cleanup=e.call(undefined,n)}catch(t){n.error(t)}if(this._state==="initializing"){this._state="ready"}}get closed(){return this._state==="closed"}unsubscribe(){if(this._state!=="closed"){ne(this);ee(this)}}}class ce{constructor(t){this._subscription=t}get closed(){return this._subscription._state==="closed"}next(t){se(this._subscription,"next",t)}error(t){se(this._subscription,"error",t)}complete(){se(this._subscription,"complete")}}class ae{constructor(t){if(!(this instanceof ae)){throw new TypeError("Observable cannot be called as a function")}if(typeof t!=="function"){throw new TypeError("Observable initializer must be a function")}this._subscriber=t}subscribe(t,e,n){if(typeof t!=="object"||t===null){t={next:t,error:e,complete:n}}return new ie(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e]){n=r(n)}return n}tap(t,e,n){const r=typeof t!=="object"||t===null?{next:t,error:e,complete:n}:t;return new ae((t=>this.subscribe({next(e){r.next&&r.next(e);t.next(e)},error(e){r.error&&r.error(e);t.error(e)},complete(){r.complete&&r.complete();t.complete()},start(t){r.start&&r.start(t)}})))}forEach(t){return new Promise(((e,n)=>{if(typeof t!=="function"){n(new TypeError(t+" is not a function"));return}function r(){o.unsubscribe();e(undefined)}const o=this.subscribe({next(e){try{t(e,r)}catch(t){n(t);o.unsubscribe()}},error(t){n(t)},complete(){e(undefined)}})}))}map(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}})))}filter(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}})))}reduce(t,e){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const n=Zt(this);const r=arguments.length>1;let o=false;let s=e;return new n((e=>this.subscribe({next(n){const i=!o;o=true;if(!i||r){try{s=t(s,n)}catch(t){return e.error(t)}}else{s=n}},error(t){e.error(t)},complete(){if(!o&&!r){return e.error(new TypeError("Cannot reduce an empty sequence"))}e.next(s);e.complete()}})))}concat(...t){const e=Zt(this);return new e((n=>{let r;let o=0;function s(i){r=i.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){if(o===t.length){r=undefined;n.complete()}else{s(e.from(t[o++]))}}})}s(this);return()=>{if(r){r.unsubscribe();r=undefined}}}))}flatMap(t){if(typeof t!=="function"){throw new TypeError(t+" is not a function")}const e=Zt(this);return new e((n=>{const r=[];const o=this.subscribe({next(o){let i;if(t){try{i=t(o)}catch(t){return n.error(t)}}else{i=o}const c=e.from(i).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(c);if(t>=0)r.splice(t,1);s()}});r.push(c)},error(t){n.error(t)},complete(){s()}});function s(){if(o.closed&&r.length===0){n.complete()}}return()=>{r.forEach((t=>t.unsubscribe()));o.unsubscribe()}}))}[Yt](){return this}static from(t){const e=typeof this==="function"?this:ae;if(t==null){throw new TypeError(t+" is not an object")}const n=Qt(t,Yt);if(n){const r=n.call(t);if(Object(r)!==r){throw new TypeError(r+" is not an object")}if(Kt(r)&&r.constructor===e){return r}return new e((t=>r.subscribe(t)))}if(Gt("iterator")){const n=Qt(t,Ht);if(n){return new e((e=>{te((()=>{if(e.closed)return;for(const r of n.call(t)){e.next(r);if(e.closed)return}e.complete()}))}))}}if(Array.isArray(t)){return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}throw new TypeError(t+" is not observable")}static of(...t){const e=typeof this==="function"?this:ae;return new e((e=>{te((()=>{if(e.closed)return;for(const n of t){e.next(n);if(e.closed)return}e.complete()}))}))}static get[Jt](){return this}}if(Ut()){Object.defineProperty(ae,Symbol("extensions"),{value:{symbol:Yt,hostReportError:Xt},configurable:true})}function ue(t){if(typeof t==="function"){t()}else if(t&&typeof t.unsubscribe==="function"){t.unsubscribe()}}class le extends ae{constructor(){super((t=>{this._observers.add(t);return()=>this._observers.delete(t)}));this._observers=new Set}next(t){for(const e of this._observers){e.next(t)}}error(t){for(const e of this._observers){e.error(t)}}complete(){for(const t of this._observers){t.complete()}}}function fe(t){const e=new le;let n;let r=0;return new ae((o=>{if(!n){n=t.subscribe(e)}const s=e.subscribe(o);r++;return()=>{r--;s.unsubscribe();if(r===0){ue(n);n=undefined}}}))}function he(t){return Promise.all(t.map((t=>{const e=t=>({status:"fulfilled",value:t});const n=t=>({status:"rejected",reason:t});const r=Promise.resolve(t);try{return r.then(e,n)}catch(t){return Promise.reject(t)}})))}var de;(function(t){t["initialized"]="initialized";t["taskCanceled"]="taskCanceled";t["taskCompleted"]="taskCompleted";t["taskFailed"]="taskFailed";t["taskQueued"]="taskQueued";t["taskQueueDrained"]="taskQueueDrained";t["taskStart"]="taskStart";t["terminated"]="terminated"})(de||(de={}));const me=Symbol("thread.errors");const pe=Symbol("thread.events");const ve=Symbol("thread.terminate");const we=Symbol("thread.transferable");const ye=Symbol("thread.worker");function ge(t){throw Error(t)}const be={errors(t){return t[me]||ge("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events(t){return t[pe]||ge("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate(t){return t[ve]()}};var Ce=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};let xe=1;function ke(t){const e=[];for(let n=0;n<t;n++){e.push(n)}return e}function Fe(t){return new Promise((e=>setTimeout(e,t)))}function Me(t,e){return t.reduce(((t,n)=>[...t,...e(n)]),[])}function Se(t){return t.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function Ee(t,e){return ke(e).map((()=>({init:t(),runningTasks:[]})))}class Ie{constructor(t,e){this.eventSubject=new le;this.initErrors=[];this.isClosing=false;this.nextTaskID=1;this.taskQueue=[];const n=typeof e==="number"?{size:e}:e||{};const{size:r=Et}=n;this.debug=qt(`threads:pool:${Se(n.name||String(xe++))}`);this.options=n;this.workers=Ee(t,r);this.eventObservable=fe(ae.from(this.eventSubject));Promise.all(this.workers.map((t=>t.init))).then((()=>this.eventSubject.next({type:de.initialized,size:this.workers.length})),(t=>{this.debug("Error while initializing pool worker:",t);this.eventSubject.error(t);this.initErrors.push(t)}))}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find((e=>e.runningTasks.length<t))}runPoolTask(t,e){return Ce(this,void 0,void 0,(function*(){const n=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${n}...`);this.eventSubject.next({type:de.taskStart,taskID:e.id,workerID:n});try{const r=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`);this.eventSubject.next({type:de.taskCompleted,returnValue:r,taskID:e.id,workerID:n})}catch(t){this.debug(`Task #${e.id} failed`);this.eventSubject.next({type:de.taskFailed,taskID:e.id,error:t,workerID:n})}}))}run(t,e){return Ce(this,void 0,void 0,(function*(){const n=(()=>Ce(this,void 0,void 0,(function*(){const r=()=>{t.runningTasks=t.runningTasks.filter((t=>t!==n))};yield Fe(0);try{yield this.runPoolTask(t,e)}finally{r();if(!this.isClosing){this.scheduleWork()}}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug(`Attempt de-queueing a task in order to run it...`);const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e){this.debug(`Task queue is empty`);this.eventSubject.next({type:de.taskQueueDrained});return}this.run(t,e)}taskCompletion(t){return new Promise(((e,n)=>{const r=this.events().subscribe((o=>{if(o.type===de.taskCompleted&&o.taskID===t){r.unsubscribe();e(o.returnValue)}else if(o.type===de.taskFailed&&o.taskID===t){r.unsubscribe();n(o.error)}else if(o.type===de.terminated){r.unsubscribe();n(Error("Pool has been terminated before task was run."))}}))}))}settled(){return Ce(this,arguments,void 0,(function*(t=false){const e=()=>Me(this.workers,(t=>t.runningTasks));const n=[];const r=this.eventObservable.subscribe((t=>{if(t.type===de.taskFailed){n.push(t.error)}}));if(this.initErrors.length>0){return Promise.reject(this.initErrors[0])}if(t&&this.taskQueue.length===0){yield he(e());return n}yield new Promise(((t,e)=>{const n=this.eventObservable.subscribe({next(e){if(e.type===de.taskQueueDrained||e.type===de.terminated){n.unsubscribe();t(void 0)}},complete(){n.unsubscribe();t(void 0)},error:e})}));yield he(e());r.unsubscribe();return n}))}completed(){return Ce(this,arguments,void 0,(function*(t=false){const e=this.settled(t);const n=new Promise(((t,n)=>{const r=this.eventObservable.subscribe({next(o){if(o.type===de.taskQueueDrained||o.type===de.terminated){r.unsubscribe();t(e)}else if(o.type===de.taskFailed){r.unsubscribe();n(o.error)}},complete(){r.unsubscribe();t(e)},error:n})}));const r=yield Promise.race([e,n]);if(r.length>0){throw r[0]}}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=Infinity}=this.options;if(this.isClosing){throw Error(`Cannot schedule pool tasks after terminate() has been called.`)}if(this.initErrors.length>0){throw this.initErrors[0]}const n=this.nextTaskID++;const r=this.taskCompletion(n);r.catch((t=>{this.debug(`Task #${n} errored:`,t)}));const o={id:n,run:t,cancel:()=>{if(this.taskQueue.indexOf(o)===-1)return;this.taskQueue=this.taskQueue.filter((t=>t!==o));this.eventSubject.next({type:de.taskCanceled,taskID:o.id})},then:r.then.bind(r)};if(this.taskQueue.length>=e){throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\n"+"This usually happens for one of two reasons: We are either at peak "+"workload right now or some tasks just won't finish, thus blocking the pool.")}this.debug(`Queueing task #${o.id}...`);this.taskQueue.push(o);this.eventSubject.next({type:de.taskQueued,taskID:o.id});this.scheduleWork();return o}terminate(t){return Ce(this,void 0,void 0,(function*(){this.isClosing=true;if(!t){yield this.completed(true)}this.eventSubject.next({type:de.terminated,remainingQueue:[...this.taskQueue]});this.eventSubject.complete();yield Promise.all(this.workers.map((t=>Ce(this,void 0,void 0,(function*(){try{yield be.terminate(yield t.init)}catch(t){this.debug("Worker did not initialize; nothing to terminate:",t)}})))))}))}}Ie.EventType=de;function Pe(t,e){return new Ie(t,e)}Pe.EventType=de;const je=Pe;const Ne={deserialize(t){return Object.assign(Error(t.message),{name:t.name,stack:t.stack})},serialize(t){return{__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack}}};const Te=t=>t&&typeof t==="object"&&"__error_marker"in t&&t.__error_marker==="$$error";const Oe={deserialize(t){if(Te(t)){return Ne.deserialize(t)}else{return t}},serialize(t){if(t instanceof Error){return Ne.serialize(t)}else{return t}}};let De=Oe;function Ae(t){return De.deserialize(t)}function Ve(t){return De.serialize(t)}const ze=()=>undefined;function Be(){let t=false;let e;let n=ze;const r=new Promise((r=>{if(t){r(e)}else{n=r}}));const o=r=>{t=true;e=r;n(e)};return[r,o]}var Re;(function(t){t["internalError"]="internalError";t["message"]="message";t["termination"]="termination"})(Re||(Re={}));class We extends Error{constructor(t,e){super(t);this.name="ThreadCloneError";this.cause=e;Object.setPrototypeOf(this,We.prototype)}}function $e(t){return Boolean(t&&typeof t==="object"&&t.name==="DataCloneError")}var _e;const qe=()=>undefined;const Ue=t=>t;const Ge=t=>Promise.resolve().then(t);function Le(t){throw t}function He(t){return t&&typeof t.then==="function"}class Ye extends ae{constructor(t){super((e=>{const n=this;const r=Object.assign(Object.assign({},e),{complete(){e.complete();n.onCompletion()},error(t){e.error(t);n.onError(t)},next(t){e.next(t);n.onNext(t)}});try{this.initHasRun=true;return t(r)}catch(t){r.error(t)}}));this.initHasRun=false;this.fulfillmentCallbacks=[];this.rejectionCallbacks=[];this.firstValueSet=false;this.state="pending";this[_e]="[object ObservablePromise]"}onNext(t){if(!this.firstValueSet){this.firstValue=t;this.firstValueSet=true}}onError(t){this.state="rejected";this.rejection=t;for(const e of this.rejectionCallbacks){Ge((()=>e(t)))}}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks){Ge((()=>t(this.firstValue)))}}then(t,e){const n=t||Ue;const r=e||Le;let o=false;return new Promise(((t,e)=>{const s=n=>{if(o)return;o=true;try{t(r(n))}catch(t){e(t)}};const i=e=>{try{t(n(e))}catch(t){s(t)}};if(!this.initHasRun){this.subscribe({error:s})}if(this.state==="fulfilled"){return t(n(this.firstValue))}if(this.state==="rejected"){o=true;return t(r(this.rejection))}this.fulfillmentCallbacks.push(i);this.rejectionCallbacks.push(s)}))}catch(t){return this.then(undefined,t)}finally(t){const e=t||qe;return this.then((t=>{e();return t}),(()=>e()))}static from(t){if(He(t)){return new Ye((e=>{const n=t=>{e.next(t);e.complete()};const r=t=>{e.error(t)};t.then(n,r)}))}else{return super.from(t)}}}_e=Symbol.toStringTag;function Je(t){return t&&typeof t==="object"&&t[we]}var Qe;(function(t){t["cancel"]="cancel";t["run"]="run"})(Qe||(Qe={}));var Ze;(function(t){t["error"]="error";t["init"]="init";t["result"]="result";t["running"]="running";t["uncaughtError"]="uncaughtError"})(Ze||(Ze={}));const Ke=qt("threads:master:messages");let Xe=1;const tn=t=>Array.from(new Set(t));const en=t=>t&&t.type===Ze.error;const nn=t=>t&&t.type===Ze.result;const rn=t=>t&&t.type===Ze.running;function on(t,e){return new ae((n=>{let r;let o=false;const s=()=>{t.removeEventListener("message",i);t.removeEventListener("error",c);t.removeEventListener("exit",a)};const i=t=>{Ke("Message from worker:",t.data);if(!t.data||t.data.uid!==e)return;if(rn(t.data)){r=t.data.resultType}else if(nn(t.data)){if(r==="promise"){if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}o=true;n.complete();s()}else{if(typeof t.data.payload!=="undefined"){n.next(Ae(t.data.payload))}if(t.data.complete){o=true;n.complete();s()}}}else if(en(t.data)){const e=Ae(t.data.error);o=true;n.error(e);s()}};const c=t=>{if(o)return;o=true;const e=t&&t.data instanceof Error?t.data:Error(String(t&&t.data||"Worker errored before the job completed."));n.error(e);s()};const a=t=>{if(o)return;o=true;const e=t?t.data:undefined;n.error(Error(`Worker terminated before the job completed (exit code: ${e}).`));s()};t.addEventListener("message",i);t.addEventListener("error",c);t.addEventListener("exit",a);return()=>{if(r==="observable"||!r){const n={type:Qe.cancel,uid:e};t.postMessage(n)}s()}}))}function sn(t){if(t.length===0){return{args:[],transferables:[]}}const e=[];const n=[];for(const r of t){if(Je(r)){e.push(Ve(r.send));n.push(...r.transferables)}else{e.push(Ve(r))}}return{args:e,transferables:n.length===0?n:tn(n)}}function cn(t,e){return(...n)=>{const r=Xe++;const{args:o,transferables:s}=sn(n);const i={type:Qe.run,uid:r,method:e,args:o};Ke("Sending command to run function to worker:",i);try{t.postMessage(i,s)}catch(t){if($e(t)){const e=new We(`Cannot send arguments to the worker thread: a value is not structured-cloneable. `+`Functions, class instances and other non-serializable values cannot be passed to a thread. `+`Original error: ${t.message}`,t);return Ye.from(Promise.reject(e))}return Ye.from(Promise.reject(t))}return Ye.from(fe(on(t,r)))}}function an(t,e){const n={};for(const r of e){n[r]=cn(t,r)}return n}var un=undefined&&undefined.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function i(t){try{a(r.next(t))}catch(t){s(t)}}function c(t){try{a(r["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):o(t.value).then(i,c)}a((r=r.apply(t,e||[])).next())}))};const ln=qt("threads:master:messages");const fn=qt("threads:master:spawn");const hn=qt("threads:master:thread-utils");const dn=t=>t&&t.type==="init";const mn=t=>t&&t.type==="uncaughtError";const pn=typeof process!=="undefined"&&typeof process.env!=="undefined"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function vn(t,e,n){return un(this,void 0,void 0,(function*(){let r;const o=new Promise(((t,o)=>{r=setTimeout((()=>o(Error(n))),e)}));try{return yield Promise.race([t,o])}finally{clearTimeout(r)}}))}function wn(t){return new Promise(((e,n)=>{const r=o=>{ln("Message from worker before finishing initialization:",o.data);if(dn(o.data)){t.removeEventListener("message",r);e(o.data)}else if(mn(o.data)){t.removeEventListener("message",r);n(Ae(o.data.error))}};t.addEventListener("message",r)}))}function yn(t,e){return new ae((n=>{const r=t=>{const e={type:Re.message,data:t.data};n.next(e)};const o=t=>{hn("Unhandled promise rejection event in thread:",t);const e={type:Re.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r);t.addEventListener("unhandledrejection",o);e.then((()=>{const e={type:Re.termination};t.removeEventListener("message",r);t.removeEventListener("unhandledrejection",o);n.next(e);n.complete()}))}))}function gn(t){const[e,n]=Be();const r=()=>un(this,void 0,void 0,(function*(){hn("Terminating worker");yield t.terminate();n()}));return{terminate:r,termination:e}}function bn(t,e,n,r){const o=n.filter((t=>t.type===Re.internalError)).map((t=>t.error));return Object.assign(t,{[me]:o,[pe]:n,[ve]:r,[ye]:e})}function Cn(t,e){return un(this,void 0,void 0,(function*(){var e,n;fn("Initializing new thread");const r=pn;let o;try{o=yield vn(wn(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)}catch(r){yield Promise.resolve((n=(e=t).terminate)===null||n===void 0?void 0:n.call(e)).catch((()=>undefined));throw r}const s=o.exposed;const{termination:i,terminate:c}=gn(t);const a=yn(t,i);if(s.type==="function"){const e=cn(t);return bn(e,t,a,c)}else if(s.type==="module"){const e=an(t,s.methods);return bn(e,t,a,c)}else{const t=s.type;throw Error(`Worker init message states unexpected type of expose(): ${t}`)}}))}Tt().blob;const xn=Tt().default;if(typeof global!=="undefined"){global.Worker=xn}else if(typeof window!=="undefined"){window.Worker=xn}const kn=new URL("./png-decoder.worker.js",import.meta.url);let Fn;const Mn=1;function Sn(){var t;if(typeof window!=="undefined"){const e=(t=window.navigator.hardwareConcurrency)!==null&&t!==void 0?t:8;return Math.ceil(e/4)}else{return Mn}}function En(){if(Fn==null){const t=Sn();console.debug(`Spawning PNG worker pool [size=${t}]`);Fn=je((()=>Cn(new Worker(kn))),{size:t})}return Fn}const In=async t=>{const e=En();return e.queue((e=>e(t)))};function Pn(t,n){const r=e.magnitude(t);const o=n.radius/r;return e.scale(o,t)}function jn(t,n,r){const o=e.subtract(r,t);const s=e.dot(n,o);const i=e.magnitudeSquared(n);const c=s/i;const a=e.scale(c,n);return e.add(a,t)}class Nn{constructor(t,e,n,r,o,s,i,c,a,u=y.create()){this.correlationIds=t;this.temporalRefinementCorrelationId=e;this.sequenceNumber=n;this.dimensions=r;this.image=o;this.scene=s;this.depthBufferBytes=i;this.featureMapBytes=c;this.partialFrame=a;this.id=u}getId(){return this.id}async depthBuffer(){if(this.cachedDepthBuffer==null){this.cachedDepthBuffer=this.depthBufferBytes!=null?this.decodeDepthBuffer(new Uint8Array(this.depthBufferBytes)):Promise.resolve(undefined)}return this.cachedDepthBuffer}async decodeDepthBuffer(t){const e=await In(t);return ut.fromPng(e,this.scene.camera,this.image.imageAttr)}async featureMap(){if(this.cachedFeatureMap==null){this.cachedFeatureMap=this.featureMapBytes!=null?this.decodeFeatureMap(new Uint8Array(this.featureMapBytes)):Promise.resolve(undefined)}return this.cachedFeatureMap}async decodeFeatureMap(t){const e=await In(t);return xt.fromPng(e,this.image.imageAttr)}copy({correlationIds:t,temporalRefinementCorrelationId:e,sequenceNumber:n,dimensions:r,image:o,scene:s,depthBufferBytes:i,featureMapBytes:c,partialFrame:a}){return new Nn(t!==null&&t!==void 0?t:this.correlationIds,e!==null&&e!==void 0?e:this.temporalRefinementCorrelationId,n!==null&&n!==void 0?n:this.sequenceNumber,r!==null&&r!==void 0?r:this.dimensions,o!==null&&o!==void 0?o:this.image,s!==null&&s!==void 0?s:this.scene,i!==null&&i!==void 0?i:this.depthBufferBytes,c!==null&&c!==void 0?c:this.featureMapBytes,a!==null&&a!==void 0?a:this.partialFrame,this.id)}}class Tn{constructor(t,e){this.imageAttr=t;this.imageBytes=e}}class On{constructor(t,e,n,r,o,s,i,c){this.camera=t;this.boundingBox=e;this.crossSection=n;this.worldOrientation=r;this.hasChanged=o;this.sceneViewSummary=s;this.modelViewId=i;this.itemModelView=c}copy({camera:t,boundingBox:e,crossSection:n,worldOrientation:r,hasChanged:o,sceneViewSummary:s,modelViewId:i,itemModelView:c}){return new On(t!==null&&t!==void 0?t:this.camera,e!==null&&e!==void 0?e:this.boundingBox,n!==null&&n!==void 0?n:this.crossSection,r!==null&&r!==void 0?r:this.worldOrientation,o!==null&&o!==void 0?o:this.hasChanged,s!==null&&s!==void 0?s:this.sceneViewSummary,i!==null&&i!==void 0?i:this.modelViewId,c!==null&&c!==void 0?c:this.itemModelView)}}class Dn{constructor(t,e,n,r,o,s){this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s}get direction(){return e.normalize(this.viewVector)}get viewVector(){return e.subtract(this.lookAt,this.position)}get worldMatrix(){return this.computeCameraMatrices().worldMatrix}get viewMatrix(){return this.computeCameraMatrices().viewMatrix}get projectionMatrix(){return this.computeCameraMatrices().projectionMatrix}get projectionMatrixInverse(){return this.computeCameraMatrices().projectionMatrixInverse}get projectionViewMatrix(){return this.computeCameraMatrices().projectionViewMatrix}static fromBoundingBox(t,e,r){var o;const{near:s,far:i}=tt(e,t);if(L(t)){const o=n.create(e);const c=Pn(t.viewVector,o);const a=jn(t.lookAt,c,o.center);return new Vn(c,a,t.up,s,i,r,t.fovHeight,t.rotationPoint)}else{return new An(t.position,t.lookAt,t.up,s,i,r,(o=t.fovY)!==null&&o!==void 0?o:45)}}isOrthographic(){return false}isPerspective(){return false}isPointBehindNear(t){const{position:n,direction:r,near:o}=this;const s=e.dot(e.subtract(t,n),r);return s<o}intersectLineWithNear(t){const{position:n,direction:r,near:o}=this;const s=e.subtract(t.start,n);const a=e.subtract(t.end,n);const u=i.create({start:s,end:a});const l=c.create({normal:r,constant:-o});const f=c.intersectLine(l,u);return f!=null?e.add(f,n):undefined}computeCameraMatrices(){if(this.cameraMatrices==null){return{viewMatrix:a.makeIdentity(),worldMatrix:a.makeIdentity(),projectionMatrix:a.makeIdentity(),projectionMatrixInverse:a.makeIdentity(),projectionViewMatrix:a.makeIdentity()}}return this.cameraMatrices}updateCameraMatrices(t){this.cameraMatrices=t;return this.cameraMatrices}}class An extends Dn{constructor(t,e,n,r,o,s,i){super(t,e,n,r,o,s);this.position=t;this.lookAt=e;this.up=n;this.near=r;this.far=o;this.aspectRatio=s;this.fovY=i}toOrthographic(t){return Dn.fromBoundingBox(Q(this,t),t,this.aspectRatio)}isPerspective(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makePerspective(this.near,this.far,this.fovY,this.aspectRatio);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class Vn extends Dn{constructor(t,n,r,o,s,i,c,a){super(e.add(n,e.negate(t)),n,r,o,s,i);this.lookAt=n;this.up=r;this.near=o;this.far=s;this.aspectRatio=i;this.fovHeight=c;this.rotationPoint=a;this.top=c*.5;this.bottom=-this.top;this.right=this.top*i;this.left=-this.right}toPerspective(t){return Dn.fromBoundingBox(Z(this),t,this.aspectRatio)}isOrthographic(){return true}computeCameraMatrices(){if(this.cameraMatrices==null){const t=a.makeLookAtView(this.position,this.lookAt,this.up);const e=a.invert(t);const n=a.makeOrthographic(this.left,this.right,this.bottom,this.top,this.near,this.far);const r=a.invert(n);const o=a.multiply(t,n);return super.updateCameraMatrices({viewMatrix:t,worldMatrix:e,projectionMatrix:n,projectionMatrixInverse:r,projectionViewMatrix:o})}return this.cameraMatrices}}class zn{constructor(t,e){this.y=t;this.z=e}get matrix(){const t=this.z;const n=this.y;const r=e.cross(n,t);return a.makeBasis(r,n,t)}}zn.DEFAULT=new zn(e.up(),e.back());class Bn{constructor(t,e){this.position=t;this.up=e}transformMatrix(t){const n=e.multiplyByTransformMatrixColumnMajor(this.position,t);const r=e.multiplyByTransformMatrixColumnMajor(this.up,t);return new Bn(n,r)}}Bn.FRONT=new Bn(e.back(),e.up());Bn.RIGHT=new Bn(e.right(),e.up());Bn.LEFT=new Bn(e.left(),e.up());Bn.BACK=new Bn(e.forward(),e.up());Bn.TOP=new Bn(e.up(),e.forward());Bn.BOTTOM=new Bn(e.down(),e.back());Bn.TOP_FRONT_RIGHT=new Bn(e.add(e.back(),e.up(),e.left()),e.up());Bn.TOP_FRONT_LEFT=new Bn(e.add(e.back(),e.up(),e.right()),e.up());Bn.BOTTOM_FRONT_RIGHT=new Bn(e.add(e.back(),e.down(),e.left()),e.up());Bn.BOTTOM_FRONT_LEFT=new Bn(e.add(e.back(),e.down(),e.right()),e.up());Bn.TOP_BACK_LEFT=new Bn(e.add(e.forward(),e.up(),e.right()),e.up());Bn.TOP_BACK_RIGHT=new Bn(e.add(e.forward(),e.up(),e.left()),e.up());Bn.BOTTOM_BACK_LEFT=new Bn(e.add(e.forward(),e.down(),e.right()),e.up());Bn.BOTTOM_BACK_RIGHT=new Bn(e.add(e.forward(),e.down(),e.left()),e.up());Bn.TOP_FRONT=new Bn(e.add(e.back(),e.up()),e.up());Bn.BOTTOM_FRONT=new Bn(e.add(e.back(),e.down()),e.up());Bn.FRONT_RIGHT=new Bn(e.add(e.back(),e.left()),e.up());Bn.FRONT_LEFT=new Bn(e.add(e.back(),e.right()),e.up());Bn.TOP_BACK=new Bn(e.add(e.forward(),e.up()),e.up());Bn.BOTTOM_BACK=new Bn(e.add(e.forward(),e.down()),e.up());Bn.BACK_LEFT=new Bn(e.add(e.forward(),e.right()),e.up());Bn.BACK_RIGHT=new Bn(e.add(e.forward(),e.left()),e.up());Bn.TOP_LEFT=new Bn(e.add(e.up(),e.right()),e.up());Bn.TOP_RIGHT=new Bn(e.add(e.up(),e.left()),e.up());Bn.BOTTOM_LEFT=new Bn(e.add(e.down(),e.right()),e.up());Bn.BOTTOM_RIGHT=new Bn(e.add(e.down(),e.left()),e.up());const Rn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y")),(([t,e])=>r.create(t,e)));const Wn=v.defineMapper(v.read(v.requiredProp("width"),v.requiredProp("height")),(([t,e])=>u.create(t,e)));const $n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("width"),v.requiredProp("height")),(([t,e,n,r])=>s.create(t,e,n,r)));const _n=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z")),(([t,n,r])=>e.create(t,n,r)));const qn=v.defineMapper(v.read(v.requiredProp("xmin"),v.requiredProp("ymin"),v.requiredProp("zmin"),v.requiredProp("xmax"),v.requiredProp("ymax"),v.requiredProp("zmax")),(([t,n,r,o,s,i])=>l.create(e.create(t,n,r),e.create(o,s,i))));const Un=v.defineMapper(v.read(v.requiredProp("d"),v.mapRequiredProp("normal",_n)),(([t,e])=>c.create({normal:e,constant:t})));const Gn=v.defineMapper(v.read(v.requiredProp("x"),v.requiredProp("y"),v.requiredProp("z"),v.requiredProp("w")),(([t,e,n,r])=>f.create({x:t,y:e,z:n,w:r})));const Ln=v.defineMapper(v.read(v.mapRequiredProp("r0",Gn),v.mapRequiredProp("r1",Gn),v.mapRequiredProp("r2",Gn),v.mapRequiredProp("r3",Gn)),(([t,e,n,r])=>a.transpose(a.fromValues(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w))));const Hn=v.defineMapper(v.read(v.requiredProp("r"),v.requiredProp("g"),v.requiredProp("b")),(([t,e,n])=>w.create(t,e,n)));const Yn=v.defineMapper((t=>{function e(t){return{r:t.r,g:t.g,b:t.b}}if(typeof t==="string"){const n=w.fromHexString(t);return n!=null?e(n):{errors:["String is not a valid color."]}}else if(typeof t==="number"){return e(w.fromNumber(t))}else{return e(t)}}),(t=>t));tr();const Jn=tr();const Qn=tr();const Zn=er();const Kn=er();const Xn=er();function tr(){return v.defineMapper((t=>t!=null?{value:t}:undefined),(t=>t))}function er(){return v.defineMapper((t=>(t===null||t===void 0?void 0:t.value)||undefined),(t=>t))}const nr=v.defineMapper(v.read(v.mapProp("position",v.compose(v.required("position"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.getProp("fovY")),(([t,e,n,r])=>({position:t,lookAt:e,up:n,fovY:(r===null||r===void 0?void 0:r.value)!=null?r.value:45})));const rr=v.defineMapper(v.read(v.mapProp("viewVector",v.compose(v.required("viewVector"),_n)),v.mapProp("lookAt",v.compose(v.required("lookAt"),_n)),v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("fovHeight",v.required("fovHeight"))),(([t,e,n,r])=>({viewVector:t,lookAt:e,up:n,fovHeight:r})));const or=v.defineMapper(v.read(v.mapProp("position",v.ifDefined(_n)),v.mapProp("lookAt",v.ifDefined(_n)),v.mapProp("up",v.ifDefined(_n)),v.mapProp("perspective",v.ifDefined(nr)),v.mapProp("orthographic",v.ifDefined(rr))),(([t,n,r,o,s])=>{var i;return(i=o!==null&&o!==void 0?o:s)!==null&&i!==void 0?i:{position:t!==null&&t!==void 0?t:e.back(),lookAt:n!==null&&n!==void 0?n:e.origin(),up:r!==null&&r!==void 0?r:e.up(),fovY:45}}));const sr=v.defineMapper(v.read(v.mapProp("normal",v.compose(v.required("normal"),_n)),v.requiredProp("offset")),(([t,e])=>({normal:t,offset:e})));const ir=v.defineMapper(v.read(v.mapProp("frameDimensions",v.compose(v.required("frameDimensions"),Wn)),v.mapProp("imageRect",v.compose(v.required("imageRect"),$n)),v.mapProp("scaleFactor",v.required("scaleFactor"))),(([t,e,n])=>({frameDimensions:t,imageRect:e,imageScale:n})));const cr=v.defineMapper(v.read(v.mapProp("sectionPlanes",v.compose(v.required("sectionPlanes"),v.mapArray(sr))),v.mapProp("highlightColor",v.ifDefined(Hn))),(([t,e])=>rt({sectionPlanes:t,highlightColor:e||undefined})));const ar=v.defineMapper(v.read(v.requiredProp("count"),v.mapProp("boundingBox",v.ifDefined(qn))),(([t,e])=>({count:t,boundingBox:e!==null&&e!==void 0?e:undefined})));const ur=v.defineMapper(v.read(v.mapProp("visibleSummary",v.ifDefined(ar)),v.mapProp("selectedVisibleSummary",v.ifDefined(ar))),(([t,e])=>it({visibleSummary:t!==null&&t!==void 0?t:undefined,selectedVisibleSummary:e!==null&&e!==void 0?e:undefined})));const lr=v.defineMapper(v.read(v.mapProp("modelViewId",v.ifDefined(S)),v.mapProp("sceneItemId",v.ifDefined(S))),(([t,e])=>st({modelViewId:t!==null&&t!==void 0?t:undefined,sceneItemId:e!==null&&e!==void 0?e:undefined})));const fr=v.defineMapper(v.read(v.mapProp("imageAttributes",v.compose(v.required("imageAttributes"),ir))),(([t])=>t));const hr=v.defineMapper(v.read(fr,v.mapProp("image",v.required("image"))),(([t,e])=>new Tn(t,e)));const dr=v.defineMapper(v.read(v.mapRequiredProp("camera",or),v.mapRequiredProp("visibleBoundingBox",qn),v.mapRequiredProp("crossSectioning",cr),v.requiredProp("hasChanged"),v.mapRequiredProp("displayListSummary",ur),v.mapProp("modelViewId",v.ifDefined(E)),v.mapProp("itemModelView",v.ifDefined(lr))),(([t,e,n,r,o,s,i])=>({camera:t,boundingBox:e,crossSectioning:n,hasChanged:r,displayListSummary:o,modelViewId:s!==null&&s!==void 0?s:undefined,itemModelView:i!==null&&i!==void 0?i:undefined})));const mr=v.defineMapper(v.read(v.mapProp("sceneAttributes",v.compose(v.required("sceneAttributes"),dr))),(([t])=>t));const pr=v.defineMapper(v.read(mr,fr),(([t,e])=>Dn.fromBoundingBox(t.camera,t.boundingBox,u.aspectRatio(e.frameDimensions))));function vr(t){return v.defineMapper(v.read(mr,pr),(([e,n])=>new On(n,e.boundingBox,e.crossSectioning,t,e.hasChanged,e.displayListSummary,e.modelViewId,e.itemModelView)))}function wr(t){return v.defineMapper(v.read(v.mapProp("frameCorrelationIds",(t=>t!=null?t:[])),v.requiredProp("sequenceNumber"),v.compose(fr,v.getProp("frameDimensions")),vr(t),hr,v.mapProp("depthBuffer",Kn),v.mapProp("featureMap",Kn),v.mapProp("temporalRefinementCorrelationId",(t=>t!=null?S(t):null)),v.mapProp("partialFrame",v.ifDefined(Zn))),(([t,e,n,r,o,s,i,c,a])=>new Nn(t,c||"",e,n,o,r,s,i,a!==null&&a!==void 0?a:false)))}function yr(t){return v.ifInvalidThrow(wr(t))}const gr=v.defineMapper(v.compose(v.required("orientation"),v.read(v.mapProp("up",v.compose(v.required("up"),_n)),v.mapProp("front",v.compose(v.required("front"),_n)))),(([t,e])=>new zn(t,e)));v.ifInvalidThrow(gr);const br=v.defineMapper(v.read(v.mapRequiredProp("imageAttributes",ir),v.requiredProp("stencilBuffer"),v.mapRequiredProp("depthBuffer",v.compose(Kn,v.required("depthBuffer")))),(([t,e,n])=>({imageAttributes:t,stencilBuffer:e,depthBuffer:n})));const Cr=kr("stencilBuffer",br);const xr=v.ifInvalidThrow(Cr);function kr(t,e){return v.mapRequiredProp(t,e)}const Fr=v.defineMapper(v.read(v.requiredProp("token"),v.requiredProp("expiresIn")),(([t,e])=>$.create(t,e)));const Mr=v.defineMapper(v.read(v.compose(v.requiredProp("startStream"),v.mapRequiredProp("streamId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sceneViewId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("sessionId",S)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("worldOrientation",gr)),v.compose(v.requiredProp("startStream"),v.mapRequiredProp("token",Fr))),(([t,e,n,r,o,s])=>({streamId:t,sceneId:e,sceneViewId:n,sessionId:r,worldOrientation:o,token:s})));const Sr=v.ifInvalidThrow(Mr);const Er=v.defineMapper(v.read(v.compose(v.requiredProp("reconnect"),v.mapRequiredProp("token",Fr))),(([t])=>({token:t})));const Ir=v.ifInvalidThrow(Er);const Pr=v.defineMapper(v.compose(v.requiredProp("refreshToken"),v.requiredProp("token"),Fr),(t=>t));const jr=v.ifInvalidThrow(Pr);const Nr=v.defineMapper(v.compose(v.requiredProp("syncTime"),v.requiredProp("replyTime"),v.read(v.requiredProp("seconds"),v.requiredProp("nanos"))),(([t,e])=>m({seconds:t,nanos:e})));const Tr=v.ifInvalidThrow(Nr);const Or=v.defineMapper(v.ifDefined(v.getProp("next")),(t=>t!=null?t:undefined));const Dr=v.defineMapper((t=>{switch(t){case"all":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_ALL};case"final":return{enabled:{value:true},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_FINAL};default:return{enabled:{value:false},frameType:d.protobuf.stream.FrameType.FRAME_TYPE_INVALID}}}),(t=>t));const Ar=v.defineMapper(v.read(v.ifDefined(v.getProp("opacity"))),(([t])=>({opacity:{value:h(t!==null&&t!==void 0?t:0,0,1)}})));const Vr=v.defineMapper(v.read(v.ifDefined(v.getProp("width")),v.ifDefined(v.mapProp("color",v.ifDefined(Yn)))),(([t,e])=>({lineWidth:t,lineColor:e})));const zr=v.defineMapper(v.read(v.ifDefined(v.mapProp("color",v.ifDefined(Yn))),v.ifDefined(v.mapProp("opacity",Jn)),v.ifDefined(v.getProp("lineWidth"))),(([t,e,n])=>{if(t||e||n){return{color:t,opacity:e,lineWidth:n}}else return undefined}));const Br=v.defineMapper(v.read(v.ifDefined(v.mapProp("highlightColor",v.ifDefined(Yn))),v.ifDefined(v.mapProp("occludedOpacity",Jn)),v.ifDefined(v.mapProp("outline",v.ifDefined(Vr)))),(([t,e,n])=>({highlightColor:t,occludedOpacity:e,outline:n})));const Rr=v.defineMapper((t=>!!t),(t=>t));const Wr=v.defineMapper((t=>t!==null&&t!==void 0?t:""),(t=>t));const $r=v.defineMapper(v.read(v.ifDefined(v.mapProp("frameBackgroundColor",v.ifDefined(Yn)))),(([t])=>({frameBackgroundColor:t})));const _r=v.defineMapper(v.read(v.ifDefined(v.mapProp("streamKeyToCompare",v.ifDefined(Qn)))),(([t])=>({streamKeyToCompare:t})));const qr=v.defineMapper(v.read(v.ifDefined(v.mapProp("endCapEnabled",(t=>!!t))),v.ifDefined(v.mapProp("endCapColor",v.ifDefined(Yn)))),(([t,e])=>({endCapEnabled:t,endCapColor:e})));const Ur=v.defineMapper(v.read(v.mapProp("depthBuffers",Dr),v.mapProp("phantom",Ar),v.mapProp("noDefaultLights",Rr),v.mapProp("featureLines",Vr),v.mapProp("featureHighlighting",Br),v.mapProp("featureMaps",Dr),v.mapProp("experimentalRenderingOptions",Wr),v.mapProp("selectionHighlighting",zr),v.mapProp("frames",$r),v.mapProp("sceneComparison",_r),v.mapProp("crossSectioning",qr)),(([t,e,n,r,o,s,i,c,a,u,l])=>{const f={depthBuffers:t,phantomItems:e,noDefaultLights:n,featureLines:r,featureHighlighting:o,featureMaps:s,experimentalRenderingOptions:i,selectionHighlighting:c,frames:a,sceneComparison:u,crossSectioningAttributes:l};return f}));export{gt as A,Yn as B,b as C,wt as D,Ct as E,Dn as F,Jn as G,yr as H,Sr as I,Ir as J,Tr as K,jr as L,ct as M,C as N,zn as O,Q as P,Z as Q,_ as R,Bn as S,Pn as T,H as U,tt as V,Un as W,or as X,I as Y,Nn as a,Tn as b,ot as c,On as d,Vn as e,X as f,An as g,bt as h,xr as i,In as j,ut as k,k as l,F as m,Xn as n,_n as o,x as p,Rn as q,Hn as r,Or as s,K as t,jn as u,M as v,Ln as w,Zn as x,qn as y,Ur as z};
5
+ //# sourceMappingURL=p-CvEK3ZK1.js.map
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{h as e,F as i,t,p as n,H as o}from"./p-Bb32XUUS.js";import{p as s,m as r,v as a}from"./p-2UsvOTHJ.js";import"./p-DMG1CW3A.js";import"./p-DxMDDbmh.js";import"./p-CWcvgy8e.js";import"./p-FRKLa468.js";import"./p-ux1ckSDN.js";import"./p-5kcpg4MZ.js";import"./p-CvEK3ZK1.js";import"./p-D3bzgaCV.js";import{V as l}from"./p-CeZe0Qql.js";import{d,P as c,t as p}from"./p-DTwJX9HL.js";import{g as h,i as v,a as u,P as m}from"./p-D1akPoVm.js";import{c as b}from"./p-C6gMOKYg.js";import{d as f}from"./p-BHyxBmg6.js";import{d as w}from"./p-Bkm6H5uq.js";import{d as x}from"./p-BFEV_v80.js";const g=({pin:t,selected:n,occluded:o,detached:s})=>{const{primaryColor:r}=h(t);return e(i,null,u(t)&&e("div",{id:"pin-anchor",class:b("pin-anchor",{selected:n,"pin-occluded":o,"pin-detached":s}),style:{background:r}}),v(t)&&e("vertex-viewer-icon",{name:"pin-fill",size:"lg",class:b("pin",{"pin-selected":n,"pin-occluded":o,"pin-detached":s}),style:{color:r}}))};function y(e,i,t){const n={x:e.x+t.width/2,y:e.y};const o={x:e.x+t.width/2,y:e.y+t.height};const r={x:e.x+t.width,y:e.y+t.height/2};const a={x:e.x,y:e.y+t.height/2};const l=[n,o,a,r];const d=l.map((e=>s.distance(e,i)));const c=d.indexOf(Math.min(...d));return l[c]}const k=()=>`:host{--viewer-annotations-pin-primary-color:var(--blue-700);--viewer-annotations-pin-accent-color:var(--blue-200);--viewer-annotations-pin-dot-color:var( --viewer-annotations-pin-primary-color );--viewer-annotations-pin-color:var(--viewer-annotations-pin-primary-color);--viewer-annotations-pin-font-size:0.75rem;--viewer-annotations-pin-selected-stroke:var(--white);--viewer-annotations-pin-selected-border:2px solid var(--white);--viewer-annotations-pin-label-border:2px solid var(--black);--viewer-annotations-pin-selected-stroke:var(--white);font-size:var(--viewer-annotations-pin-font-size);position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none}.pin-anchor{position:absolute;border-radius:50%;transform:translate(-50%, -50%);display:block;width:9px;height:9px;box-sizing:border-box;border:var(--viewer-annotations-pin-label-border);background:var(--viewer-annotations-pin-dot-color);pointer-events:auto;cursor:pointer}.selected{width:13px;height:13px;border:var(--viewer-annotations-pin-selected-border)}.pin{color:var(--viewer-annotations-pin-color);cursor:pointer;transition:opacity 0.3s ease-in;transform:translate(0px, -12px)}.pin-selected{stroke-width:1;stroke:var(--viewer-annotations-pin-selected-stroke)}.pin-occluded{opacity:0.3;transition:opacity 0.3s ease-in}.pin-detached{visibility:hidden}`;const P=n(class t extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.matrix=r.makeIdentity();this.projectionViewMatrix=r.makeIdentity();this.pinModel=new m;this.selected=false;this.occluded=false;this.detached=false;this.invalidateStateCounter=0;this.invalidateState=()=>{this.invalidateStateCounter=this.invalidateStateCounter+1}}componentWillLoad(){if(this.pinController==null){this.pinController=new c(this.pinModel)}}componentDidLoad(){var e;this.setLabelObserver();if(this.selected){(e=this.labelEl)===null||e===void 0?void 0:e.setFocus()}}async handleOcclusionStateChanged(e){this.occluded=e.detail}async handleDetachedStateChanged(e){this.detached=e.detail}disconnectedCallback(){var e,i;(e=this.labelEl)===null||e===void 0?void 0:e.removeEventListener("labelChanged",this.invalidateState);(i=this.resizeObserver)===null||i===void 0?void 0:i.disconnect()}render(){var t;if(this.pin==null){throw new Error("Unable to draw pin")}const{pinPoint:n,labelPoint:o}=this.computePinPoints(this.pin);return e(i,{key:"84a22b24189e46d618c7266874d6584feb4e0b93"},e("vertex-viewer-dom-element",{key:"d4b9cf5194049099b2a7a2c1ef07fc3757e91cdc","data-testid":`drawn-pin-${this.pin.id}`,position:this.pin.worldPosition,onPointerDown:async()=>{var e;await((e=this.labelEl)===null||e===void 0?void 0:e.submit());this.selectPin();this.handleAnchorPointerDown()},detachedOff:false},e(g,{key:"7312b90e959e7d61de89c80ff032c29c5d32d888",pin:this.pin,selected:this.selected,occluded:this.occluded,detached:this.detached})),u(this.pin)&&!this.occluded&&!this.detached&&e(i,{key:"975ae561cc3eb0bf6d259d99c10c48ab0bb2661a"},e("vertex-viewer-pin-label-line",{key:"cbb32a2788a89f53c5ea2e2e6abe83b0b49c0fd4",id:`pin-label-line-${(t=this.pin)===null||t===void 0?void 0:t.id}`,pinPoint:n,pin:this.pin,labelPoint:o,onPointerDown:()=>this.selectPin()}),e("vertex-viewer-pin-label",{key:"296958cff46f102cef5621c2512b71f0d4d97ff9",pin:this.pin,ref:e=>this.labelEl=e,elementBounds:this.elementBounds,pinController:this.pinController,onPointerDown:()=>this.selectPin()})))}setLabelObserver(){if(this.labelEl!=null){this.labelEl.addEventListener("labelChanged",this.invalidateState);this.resizeObserver=new ResizeObserver((()=>this.invalidateState()));this.resizeObserver.observe(this.labelEl)}}computePinPoints(e){if(this.elementBounds!=null&&this.pin!=null){return u(this.pin)&&this.pin.label.point!=null?this.computeTextPinPoints(this.pin,this.elementBounds):this.computeDefaultPinPoints(this.pin,this.elementBounds)}return{pinPoint:e.worldPosition}}computeDefaultPinPoints(e,i){return{pinPoint:this.getFromWorldPosition(e.worldPosition,this.projectionViewMatrix,i)}}computeTextPinPoints(e,i){var t,n,o,s;const{pinPoint:r}=this.computeDefaultPinPoints(e,i);const a=p(e.label.point,i);const l=((n=(t=this.labelEl)===null||t===void 0?void 0:t.firstElementChild)===null||n===void 0?void 0:n.clientWidth)||0;const d=((s=(o=this.labelEl)===null||o===void 0?void 0:o.firstElementChild)===null||s===void 0?void 0:s.clientHeight)||0;return{pinPoint:r,labelPoint:y(a,r,{width:l,height:d})}}handleAnchorPointerDown(){var e,i;if(this.elementBounds!=null&&((e=this.pinController)===null||e===void 0?void 0:e.getToolMode())==="edit"&&this.pin!=null){(i=this.pinController)===null||i===void 0?void 0:i.setDraggable({id:this.pin.id})}}selectPin(){var e,i;(e=this.pinController)===null||e===void 0?void 0:e.setSelectedPinId((i=this.pin)===null||i===void 0?void 0:i.id)}getFromWorldPosition(e,i,t){const n=a.multiplyByTransformMatrixColumnMajor(e,i);return l.fromDimensions(t).transformVectorToViewport(n)}static get style(){return k()}},[0,"vertex-viewer-pin-group",{pin:[16],matrix:[1040],projectionViewMatrix:[16],elementBounds:[1040],pinModel:[16],pinController:[1040],selected:[4],occluded:[1540],detached:[1540],invalidateStateCounter:[32]},[[0,"occlusionStateChanged","handleOcclusionStateChanged"],[0,"detachedStateChanged","handleDetachedStateChanged"]]]);function C(){if(typeof customElements==="undefined"){return}const e=["vertex-viewer-pin-group","vertex-viewer-dom-element","vertex-viewer-icon","vertex-viewer-pin-label","vertex-viewer-pin-label-line"];e.forEach((e=>{switch(e){case"vertex-viewer-pin-group":if(!customElements.get(t(e))){customElements.define(t(e),P)}break;case"vertex-viewer-dom-element":if(!customElements.get(t(e))){f()}break;case"vertex-viewer-icon":if(!customElements.get(t(e))){w()}break;case"vertex-viewer-pin-label":if(!customElements.get(t(e))){d()}break;case"vertex-viewer-pin-label-line":if(!customElements.get(t(e))){x()}break}}))}C();export{P as V,C as d};
5
+ //# sourceMappingURL=p-Cxz4L6FA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PinRenderer","pin","selected","occluded","detached","primaryColor","getPinColors","h","Fragment","isTextPin","id","class","classNames","style","background","isIconPin","name","size","color","getClosestCenterToPoint","boxPoint","pointToMeasure","dimensions","topPoint","x","width","y","bottomPoint","height","rightPoint","leftPoint","candidates","distances","map","candidate","Point","distance","candidateIndex","indexOf","Math","min","viewerPinGroupCss","ViewerPinGroup","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","matrix","Matrix4","makeIdentity","projectionViewMatrix","pinModel","PinModel","invalidateStateCounter","invalidateState","componentWillLoad","pinController","PinController","componentDidLoad","setLabelObserver","_a","labelEl","setFocus","handleOcclusionStateChanged","event","detail","handleDetachedStateChanged","disconnectedCallback","removeEventListener","_b","resizeObserver","disconnect","render","Error","pinPoint","labelPoint","computePinPoints","key","position","worldPosition","onPointerDown","async","submit","selectPin","handleAnchorPointerDown","detachedOff","ref","el","elementBounds","addEventListener","ResizeObserver","observe","label","point","computeTextPinPoints","computeDefaultPinPoints","getFromWorldPosition","screenPosition","translatePointToScreen","labelWidth","firstElementChild","clientWidth","labelHeight","_d","_c","clientHeight","getToolMode","setDraggable","setSelectedPinId","pt","ndcPt","Vector3","multiplyByTransformMatrixColumnMajor","Viewport","fromDimensions","transformVectorToViewport"],"sources":["src/components/viewer-pin-group/pin-renderer.tsx","src/components/viewer-pin-group/utils.ts","src/components/viewer-pin-group/viewer-pin-group.css?tag=vertex-viewer-pin-group","src/components/viewer-pin-group/viewer-pin-group.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Fragment, FunctionalComponent, h } from '@stencil/core';\nimport classNames from 'classnames';\n\nimport { getPinColors, isIconPin, isTextPin, Pin } from '../../lib/pins/model';\n\ninterface PinRendererProps {\n pin?: Pin;\n selected: boolean;\n occluded: boolean;\n detached: boolean;\n}\n\nexport const PinRenderer: FunctionalComponent<PinRendererProps> = ({\n pin,\n selected,\n occluded,\n detached,\n}) => {\n const { primaryColor } = getPinColors(pin);\n\n return (\n <Fragment>\n {isTextPin(pin) && (\n <div\n id=\"pin-anchor\"\n class={classNames('pin-anchor', {\n selected: selected,\n 'pin-occluded': occluded,\n 'pin-detached': detached,\n })}\n style={{\n background: primaryColor,\n }}\n ></div>\n )}\n\n {isIconPin(pin) && (\n <vertex-viewer-icon\n name=\"pin-fill\"\n size=\"lg\"\n class={classNames('pin', {\n 'pin-selected': selected,\n 'pin-occluded': occluded,\n 'pin-detached': detached,\n })}\n style={{\n color: primaryColor,\n }}\n />\n )}\n </Fragment>\n );\n};\n","import { Dimensions, Point } from '@vertexvis/geometry';\n\nexport function getClosestCenterToPoint(\n boxPoint: Point.Point,\n pointToMeasure: Point.Point,\n dimensions: Dimensions.Dimensions,\n): Point.Point {\n const topPoint = {\n x: boxPoint.x + dimensions.width / 2,\n y: boxPoint.y,\n };\n\n const bottomPoint = {\n x: boxPoint.x + dimensions.width / 2,\n y: boxPoint.y + dimensions.height,\n };\n\n const rightPoint = {\n x: boxPoint.x + dimensions.width,\n y: boxPoint.y + dimensions.height / 2,\n };\n\n const leftPoint = {\n x: boxPoint.x,\n y: boxPoint.y + dimensions.height / 2,\n };\n\n const candidates = [topPoint, bottomPoint, leftPoint, rightPoint];\n\n const distances = candidates.map((candidate) =>\n Point.distance(candidate, pointToMeasure),\n );\n\n const candidateIndex = distances.indexOf(Math.min(...distances));\n return candidates[candidateIndex];\n}\n",":host {\n /**\n * @prop --viewer-annotations-pin-primary-color: A CSS color that\n * specifies the primary color for the pins. This value gets used for the dot color \n * and borders\n */\n --viewer-annotations-pin-primary-color: var(--blue-700);\n\n /**\n * @prop --viewer-annotations-pin-accent-color: A CSS color that\n * specifies the accent color for the pins. This value gets used for background colors\n * \n */\n\n --viewer-annotations-pin-accent-color: var(--blue-200);\n /**\n * @prop viewer-annotations-pin-dot-color: A CSS color that\n * specifies the color of the anchor dot\n */\n --viewer-annotations-pin-dot-color: var(\n --viewer-annotations-pin-primary-color\n );\n\n /**\n * @prop --viewer-annotations-pin-color: A CSS color that\n * specifies the color of the pin\n */\n --viewer-annotations-pin-color: var(--viewer-annotations-pin-primary-color);\n\n /**\n * @prop --viewer-annotations-pin-font-size: A CSS property to specify\n the font size of the pin\n */\n --viewer-annotations-pin-font-size: 0.75rem;\n\n /**\n * @prop --viewer-annotations-pin-selected-stroke: A CSS color that\n * specifies the stroke color of a selected pin\n */\n --viewer-annotations-pin-selected-stroke: var(--white);\n\n /**\n * @prop --viewer-annotations-pin-selected-border: A CSS color that\n * specifies the border of a selected pin\n */\n --viewer-annotations-pin-selected-border: 2px solid var(--white);\n\n /**\n * @prop --viewer-annotations-pin-label-border: A CSS color that\n * specifies the border of a text pin anchor\n */\n --viewer-annotations-pin-label-border: 2px solid var(--black);\n\n /**\n * @prop --viewer-annotations-pin-selected-border: A CSS color that\n * specifies the stroke of a selected default pin\n */\n --viewer-annotations-pin-selected-stroke: var(--white);\n\n font-size: var(--viewer-annotations-pin-font-size);\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.pin-anchor {\n position: absolute;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: block;\n width: 9px;\n height: 9px;\n box-sizing: border-box;\n border: var(--viewer-annotations-pin-label-border);\n background: var(--viewer-annotations-pin-dot-color);\n pointer-events: auto;\n cursor: pointer;\n}\n\n.selected {\n width: 13px;\n height: 13px;\n border: var(--viewer-annotations-pin-selected-border);\n}\n\n.pin {\n color: var(--viewer-annotations-pin-color);\n cursor: pointer;\n transition: opacity 0.3s ease-in;\n\n /**\n * Place bottom point of the pin at the location instead of the middle of the pin\n */\n transform: translate(0px, -12px);\n}\n\n.pin-selected {\n stroke-width: 1;\n stroke: var(--viewer-annotations-pin-selected-stroke);\n}\n\n.pin-occluded {\n opacity: 0.3;\n transition: opacity 0.3s ease-in;\n}\n\n.pin-detached {\n visibility: hidden;\n}\n","import {\n Component,\n Fragment,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n h,\n JSX,\n Listen,\n Prop,\n State,\n} from '@stencil/core';\nimport { Dimensions, Matrix4, Point, Vector3 } from '@vertexvis/geometry';\n\nimport { Viewport } from '../..';\nimport { PinController } from '../../lib/pins/controller';\nimport { isTextPin, Pin, TextPin } from '../../lib/pins/model';\nimport { PinModel } from '../../lib/pins/model';\nimport { translatePointToScreen } from '../viewer-pin-tool/utils';\nimport { PinRenderer } from './pin-renderer';\nimport { getClosestCenterToPoint } from './utils';\n\ninterface ComputedPoints {\n pinPoint: Point.Point;\n labelPoint?: Point.Point;\n}\n\n@Component({\n tag: 'vertex-viewer-pin-group',\n styleUrl: 'viewer-pin-group.css',\n shadow: false,\n})\nexport class ViewerPinGroup {\n /**\n * The pin to draw for the group\n */\n @Prop()\n public pin?: Pin;\n\n /**\n * The local matrix of this element.\n */\n @Prop({ mutable: true, attribute: null })\n public matrix: Matrix4.Matrix4 = Matrix4.makeIdentity();\n\n /**\n * Projection view matrix used for computing the position of the pin line\n */\n @Prop()\n public projectionViewMatrix: Matrix4.Matrix4 = Matrix4.makeIdentity();\n\n /**\n * The dimensions of the canvas for the pins\n */\n @Prop({ mutable: true })\n public elementBounds?: DOMRect;\n\n /**\n * The model that contains the entities and outcomes from performing pin operations\n */\n @Prop()\n public pinModel: PinModel = new PinModel();\n\n /**\n * The controller that drives behavior for pin operations\n */\n @Prop({ mutable: true })\n public pinController?: PinController;\n\n /**\n * Whether the pin is \"selected\"\n */\n @Prop()\n public selected = false;\n\n /**\n * @internal\n * Whether the pin is occluded\n */\n @Prop({ mutable: true, reflect: true })\n public occluded = false;\n\n /**\n * @internal\n * Whether the pin is detached\n */\n @Prop({ mutable: true, reflect: true })\n public detached = false;\n\n @State()\n private invalidateStateCounter = 0;\n\n private labelEl: HTMLVertexViewerPinLabelElement | undefined;\n\n private resizeObserver?: ResizeObserver;\n\n protected componentWillLoad(): void {\n if (this.pinController == null) {\n this.pinController = new PinController(this.pinModel);\n }\n }\n\n protected componentDidLoad(): void {\n this.setLabelObserver();\n\n if (this.selected) {\n this.labelEl?.setFocus();\n }\n }\n\n /**\n * @ignore\n */\n @Listen('occlusionStateChanged')\n protected async handleOcclusionStateChanged(\n event: CustomEvent<boolean>,\n ): Promise<void> {\n this.occluded = event.detail;\n }\n\n /**\n * @ignore\n */\n @Listen('detachedStateChanged')\n protected async handleDetachedStateChanged(\n event: CustomEvent<boolean>,\n ): Promise<void> {\n this.detached = event.detail;\n }\n\n protected disconnectedCallback(): void {\n this.labelEl?.removeEventListener('labelChanged', this.invalidateState);\n this.resizeObserver?.disconnect();\n }\n\n protected render(): JSX.Element {\n if (this.pin == null) {\n throw new Error('Unable to draw pin');\n }\n\n const { pinPoint, labelPoint } = this.computePinPoints(this.pin);\n\n return (\n <Fragment>\n <vertex-viewer-dom-element\n data-testid={`drawn-pin-${this.pin.id}`}\n position={this.pin.worldPosition}\n onPointerDown={async () => {\n await this.labelEl?.submit();\n this.selectPin();\n this.handleAnchorPointerDown();\n }}\n detachedOff={false}\n >\n <PinRenderer\n pin={this.pin}\n selected={this.selected}\n occluded={this.occluded}\n detached={this.detached}\n />\n </vertex-viewer-dom-element>\n\n {isTextPin(this.pin) && !this.occluded && !this.detached && (\n <Fragment>\n <vertex-viewer-pin-label-line\n id={`pin-label-line-${this.pin?.id}`}\n pinPoint={pinPoint}\n pin={this.pin}\n labelPoint={labelPoint}\n onPointerDown={() => this.selectPin()}\n ></vertex-viewer-pin-label-line>\n\n <vertex-viewer-pin-label\n pin={this.pin}\n ref={(el) => (this.labelEl = el)}\n elementBounds={this.elementBounds}\n pinController={this.pinController}\n onPointerDown={() => this.selectPin()}\n ></vertex-viewer-pin-label>\n </Fragment>\n )}\n </Fragment>\n );\n }\n\n private invalidateState = (): void => {\n this.invalidateStateCounter = this.invalidateStateCounter + 1;\n };\n\n private setLabelObserver(): void {\n if (this.labelEl != null) {\n this.labelEl.addEventListener('labelChanged', this.invalidateState);\n\n this.resizeObserver = new ResizeObserver(() => this.invalidateState());\n this.resizeObserver.observe(this.labelEl);\n }\n }\n\n private computePinPoints(pin: Pin): ComputedPoints {\n if (this.elementBounds != null && this.pin != null) {\n return isTextPin(this.pin) && this.pin.label.point != null\n ? this.computeTextPinPoints(this.pin, this.elementBounds)\n : this.computeDefaultPinPoints(this.pin, this.elementBounds);\n }\n\n return { pinPoint: pin.worldPosition };\n }\n\n private computeDefaultPinPoints(\n pin: Pin,\n elementBounds: DOMRect,\n ): ComputedPoints {\n return {\n pinPoint: this.getFromWorldPosition(\n pin.worldPosition,\n this.projectionViewMatrix,\n elementBounds,\n ),\n };\n }\n\n private computeTextPinPoints(\n pin: TextPin,\n elementBounds: DOMRect,\n ): ComputedPoints {\n const { pinPoint } = this.computeDefaultPinPoints(pin, elementBounds);\n\n const screenPosition = translatePointToScreen(\n pin.label.point,\n elementBounds,\n );\n\n const labelWidth = this.labelEl?.firstElementChild?.clientWidth || 0;\n const labelHeight = this.labelEl?.firstElementChild?.clientHeight || 0;\n\n return {\n pinPoint,\n labelPoint: getClosestCenterToPoint(screenPosition, pinPoint, {\n width: labelWidth,\n height: labelHeight,\n }),\n };\n }\n\n private handleAnchorPointerDown(): void {\n if (\n this.elementBounds != null &&\n this.pinController?.getToolMode() === 'edit' &&\n this.pin != null\n ) {\n this.pinController?.setDraggable({ id: this.pin.id });\n }\n }\n\n private selectPin(): void {\n this.pinController?.setSelectedPinId(this.pin?.id);\n }\n\n private getFromWorldPosition(\n pt: Vector3.Vector3,\n projectionViewMatrix: Matrix4.Matrix4,\n dimensions: Dimensions.Dimensions,\n ): Point.Point {\n const ndcPt = Vector3.multiplyByTransformMatrixColumnMajor(\n pt,\n projectionViewMatrix,\n );\n return Viewport.fromDimensions(dimensions).transformVectorToViewport(ndcPt);\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{m as t,a as s,g as i}from"./p-BKQMbekH.js";import{s as e,w as n}from"./p-FRKLa468.js";import{r,c as o}from"./p-CioaIHsi.js";import{v as h}from"./p-5kcpg4MZ.js";import{m as a}from"./p-CDM7zNn0.js";import{o as c}from"./p-DjrtwKcK.js";class m{constructor(t,s,i,e){this.model=t;this.client=s;this.jwtProvider=i;this.deviceId=e;this.outcome=Promise.resolve(undefined);this.debugLogs=false}addEntity(s){if(this.debugLogs){const i=t.ModelEntity.deserializeBinary(s.modelEntity);this.log(`Adding ModelEntity. [entityId={${i.getEntityId()}}, sceneItemId={${i.getSceneItemId()}}]`)}return this.performMeasurement((()=>this.model.addEntity(s)))}clearEntities(){this.log("Clearing all ModelEntities.");return this.performMeasurement((()=>{this.model.clearEntities();this.model.clearOutcome();return true}))}removeEntity(s){if(this.debugLogs){const i=t.ModelEntity.deserializeBinary(s.modelEntity);this.log(`Removing ModelEntity. [entityId={${i.getEntityId()}}, sceneItemId={${i.getSceneItemId()}}]`)}return this.performMeasurement((()=>this.model.removeEntity(s)))}setEntities(s){if(this.debugLogs){const i=Array.from(s).map((s=>t.ModelEntity.deserializeBinary(s.modelEntity)));this.log(`Setting ${i.length} ModelEntities. [entityIds=[${i.map((t=>t.getEntityId())).join(", ")}], sceneItemIds=[${i.map((t=>t.getSceneItemId())).join(", ")}]]`)}return this.performMeasurement((()=>this.model.setEntities(s)))}setDebugLogs(t){this.debugLogs=t}performMeasurement(t){const s=this.model.getEntities();const i=t();const e=this.model.getEntities();if(i){this.measureAndUpdateModel(e);this.highlightEntities(s,e)}return this.outcome}measureAndUpdateModel(t){if(t.length>0){this.outcome=this.measureEntities(t).then((t=>{this.model.setOutcome(t);return this.model.getOutcome()}))}else{this.outcome=Promise.resolve(undefined)}}async measureEntities(t){if(t.length>0){const i=await r((async s=>{const i=await o(this.jwtProvider,this.deviceId);const n=new e.MeasureRequest;n.setEntitiesList(t.map((t=>t.toProto())));this.client.measure(n,i,s)}));return s(i.toObject())}else{return undefined}}async highlightEntities(s,i){await r((async r=>{const h=await o(this.jwtProvider,this.deviceId);const a=new Set(i);const c=s.filter((t=>!a.has(t)));const m=c.map((s=>{const i=new e.ModelEntityUpdate;i.setModelEntity(t.ModelEntity.deserializeBinary(s.modelEntity));i.setHighlight((new n.BoolValue).setValue(false));return i}));const u=i.map((s=>{const i=new e.ModelEntityUpdate;i.setModelEntity(t.ModelEntity.deserializeBinary(s.modelEntity));i.setHighlight((new n.BoolValue).setValue(true));return i}));const d=new e.UpdateModelEntitiesRequest;d.setUpdatesList([...m,...u]);this.client.updateModelEntities(d,h,r)}))}log(t,...s){if(this.debugLogs){console.debug(t,s)}}}class u{constructor(t,s){this.point=t;this.modelEntity=s}static fromHit(t){if(t.hitPoint!=null&&t.modelEntity!=null){const s=a.ifInvalidThrow(c)(t.hitPoint);const i=h.protobuf.core.ModelEntity.encode(t.modelEntity).finish();return new u(s,i)}else{throw new Error("Cannot create MeasurementEntity from Hit. Hit is missing hit point and model entity")}}toProto(){const s=new e.MeasureEntity;const n=new i.Vector3f;n.setX(this.point.x);n.setY(this.point.y);n.setZ(this.point.z);s.setPoint(n);const r=t.ModelEntity.deserializeBinary(this.modelEntity);s.setModelEntity(r);return s}}export{m as M,u as a};
5
- //# sourceMappingURL=p-MnZadXO8.js.map
4
+ import{m as t,a as s,g as i}from"./p-CWcvgy8e.js";import{s as e,w as n}from"./p-FRKLa468.js";import{r,c as o}from"./p-CioaIHsi.js";import{v as h}from"./p-5kcpg4MZ.js";import{m as a}from"./p-CDM7zNn0.js";import{o as c}from"./p-CvEK3ZK1.js";class m{constructor(t,s,i,e){this.model=t;this.client=s;this.jwtProvider=i;this.deviceId=e;this.outcome=Promise.resolve(undefined);this.debugLogs=false}addEntity(s){if(this.debugLogs){const i=t.ModelEntity.deserializeBinary(s.modelEntity);this.log(`Adding ModelEntity. [entityId={${i.getEntityId()}}, sceneItemId={${i.getSceneItemId()}}]`)}return this.performMeasurement((()=>this.model.addEntity(s)))}clearEntities(){this.log("Clearing all ModelEntities.");return this.performMeasurement((()=>{this.model.clearEntities();this.model.clearOutcome();return true}))}removeEntity(s){if(this.debugLogs){const i=t.ModelEntity.deserializeBinary(s.modelEntity);this.log(`Removing ModelEntity. [entityId={${i.getEntityId()}}, sceneItemId={${i.getSceneItemId()}}]`)}return this.performMeasurement((()=>this.model.removeEntity(s)))}setEntities(s){if(this.debugLogs){const i=Array.from(s).map((s=>t.ModelEntity.deserializeBinary(s.modelEntity)));this.log(`Setting ${i.length} ModelEntities. [entityIds=[${i.map((t=>t.getEntityId())).join(", ")}], sceneItemIds=[${i.map((t=>t.getSceneItemId())).join(", ")}]]`)}return this.performMeasurement((()=>this.model.setEntities(s)))}setDebugLogs(t){this.debugLogs=t}performMeasurement(t){const s=this.model.getEntities();const i=t();const e=this.model.getEntities();if(i){this.measureAndUpdateModel(e);this.highlightEntities(s,e)}return this.outcome}measureAndUpdateModel(t){if(t.length>0){this.outcome=this.measureEntities(t).then((t=>{this.model.setOutcome(t);return this.model.getOutcome()}))}else{this.outcome=Promise.resolve(undefined)}}async measureEntities(t){if(t.length>0){const i=await r((async s=>{const i=await o(this.jwtProvider,this.deviceId);const n=new e.MeasureRequest;n.setEntitiesList(t.map((t=>t.toProto())));this.client.measure(n,i,s)}));return s(i.toObject())}else{return undefined}}async highlightEntities(s,i){await r((async r=>{const h=await o(this.jwtProvider,this.deviceId);const a=new Set(i);const c=s.filter((t=>!a.has(t)));const m=c.map((s=>{const i=new e.ModelEntityUpdate;i.setModelEntity(t.ModelEntity.deserializeBinary(s.modelEntity));i.setHighlight((new n.BoolValue).setValue(false));return i}));const u=i.map((s=>{const i=new e.ModelEntityUpdate;i.setModelEntity(t.ModelEntity.deserializeBinary(s.modelEntity));i.setHighlight((new n.BoolValue).setValue(true));return i}));const d=new e.UpdateModelEntitiesRequest;d.setUpdatesList([...m,...u]);this.client.updateModelEntities(d,h,r)}))}log(t,...s){if(this.debugLogs){console.debug(t,s)}}}class u{constructor(t,s){this.point=t;this.modelEntity=s}static fromHit(t){if(t.hitPoint!=null&&t.modelEntity!=null){const s=a.ifInvalidThrow(c)(t.hitPoint);const i=h.protobuf.core.ModelEntity.encode(t.modelEntity).finish();return new u(s,i)}else{throw new Error("Cannot create MeasurementEntity from Hit. Hit is missing hit point and model entity")}}toProto(){const s=new e.MeasureEntity;const n=new i.Vector3f;n.setX(this.point.x);n.setY(this.point.y);n.setZ(this.point.z);s.setPoint(n);const r=t.ModelEntity.deserializeBinary(this.modelEntity);s.setModelEntity(r);return s}}export{m as M,u as a};
5
+ //# sourceMappingURL=p-D1Vdomj_.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{d as s,e as a,f as e}from"./p-FRKLa468.js";import{m as o}from"./p-CDM7zNn0.js";import{l as t,X as i,s as n,Y as m}from"./p-DjrtwKcK.js";var r=s();var d=a();const p=o.defineMapper(o.read(o.mapRequiredProp("id",t),o.getProp("displayName"),o.mapRequiredProp("partRevisionId",t),o.mapRequiredProp("camera",i)),(([s,a,e,o])=>({id:s,displayName:a,partRevisionId:e,camera:o})));const c=o.defineMapper(o.read(o.mapProp("modelViewsList",o.mapArray(p)),o.mapProp("nextPageCursor",n)),(([s,a])=>({modelViews:s,paging:{next:a}})));const l=o.ifInvalidThrow(c);const I=o.defineMapper(o.read(o.mapProp("modelViewId",m),o.mapProp("sceneItemId",m)),(([s,a])=>({modelViewId:s,sceneItemId:a})));const g=o.ifInvalidThrow(I);const v=o.defineMapper(o.read(o.mapRequiredProp("id",t),o.getProp("displayName")),(([s,a])=>({id:s,displayName:a})));const w=o.defineMapper(o.read(o.mapProp("annotationsList",o.mapArray(v)),o.mapProp("nextPageCursor",n)),(([s,a])=>({annotations:s,paging:{next:a}})));const x=o.ifInvalidThrow(w);var N=e();export{g as a,x as b,l as m,r as p,N as r,d as u};
5
- //# sourceMappingURL=p-DRGCkSEK.js.map
4
+ import{d as s,e as a,f as e}from"./p-FRKLa468.js";import{m as o}from"./p-CDM7zNn0.js";import{l as t,X as i,s as n,Y as m}from"./p-CvEK3ZK1.js";var d=s();var r=a();const p=o.defineMapper(o.read(o.mapRequiredProp("id",t),o.getProp("displayName"),o.mapRequiredProp("partRevisionId",t),o.mapRequiredProp("camera",i)),(([s,a,e,o])=>({id:s,displayName:a,partRevisionId:e,camera:o})));const c=o.defineMapper(o.read(o.mapProp("modelViewsList",o.mapArray(p)),o.mapProp("nextPageCursor",n)),(([s,a])=>({modelViews:s,paging:{next:a}})));const l=o.ifInvalidThrow(c);const I=o.defineMapper(o.read(o.mapProp("modelViewId",m),o.mapProp("sceneItemId",m)),(([s,a])=>({modelViewId:s,sceneItemId:a})));const g=o.ifInvalidThrow(I);const v=o.defineMapper(o.read(o.mapRequiredProp("id",t),o.getProp("displayName")),(([s,a])=>({id:s,displayName:a})));const x=o.defineMapper(o.read(o.mapProp("annotationsList",o.mapArray(v)),o.mapProp("nextPageCursor",n)),(([s,a])=>({annotations:s,paging:{next:a}})));const N=o.ifInvalidThrow(x);var f=e();export{g as a,N as b,l as m,d as p,f as r,r as u};
5
+ //# sourceMappingURL=p-D3bzgaCV.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{h as e,F as t,t as r,p as s,H as a,e as n}from"./p-Bb32XUUS.js";import"./p-BKQMbekH.js";import"./p-FRKLa468.js";import"./p-ux1ckSDN.js";import"./p-5kcpg4MZ.js";import"./p-DjrtwKcK.js";import{M as i}from"./p-CxzyM08j.js";import{l as o,p as l}from"./p-CZZALKHT.js";import{d as m}from"./p-oDn1DcWj.js";function v(e,t){const{camera:r,viewport:s}=t;const a=r.isPointBehindNear(e.start);const n=r.isPointBehindNear(e.end);if(a||n){const t=r.intersectLineWithNear(e);const i=o.create({start:a&&t!=null?t:e.start,end:n&&t!=null?t:e.end});const l=o.transformMatrix(i,r.projectionViewMatrix);return{start:s.transformVectorToViewport(l.start),end:s.transformVectorToViewport(l.end),hideStart:a,hideEnd:n}}else{const t=o.transformMatrix(e,r.projectionViewMatrix);return{start:s.transformVectorToViewport(t.start),end:s.transformVectorToViewport(t.end),hideStart:false,hideEnd:false}}}function c(e,t,r){const{start:s,end:a,hideStart:n,hideEnd:i}=v(e,r);const o=l.lerp(s,a,.5);const m=t!=="none"?d(e,t,r):undefined;return{startPt:s,endPt:a,labelPt:o,indicatorPt:m,hideStart:n,hideEnd:i}}function d(e,t,r){return r.viewport.transformWorldToViewport(t==="start"?e.start:e.end,r.camera.projectionViewMatrix)}const u=({overlay:t,viewport:r,camera:s})=>{if(t.type==="line"){return e(h,{overlay:t,viewport:r,camera:s})}else{return e(p,{overlay:t,viewport:r,camera:s})}};const h=({overlay:t,camera:r,viewport:s})=>{const{start:a,end:n}=v(t,{camera:r,viewport:s});return e("vertex-viewer-measurement-line",{class:"measurement-line",start:a,end:n})};const p=({overlay:{x:r,y:s,z:a},camera:n,viewport:i})=>{const o={camera:n,viewport:i};const{start:l,end:m}=v(r,o);const{start:c,end:d}=v(s,o);const{start:u,end:h}=v(a,o);return e(t,null,e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-x",start:l,end:m}),e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-y",start:c,end:d}),e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-z",start:u,end:h}))};const w=()=>`:host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;--viewer-measurement-overlays-x-axis-color:var(--x-axis-color);--viewer-measurement-overlays-y-axis-color:var(--y-axis-color);--viewer-measurement-overlays-z-axis-color:var(--z-axis-color)}.measurement-line{position:absolute;width:100%;height:100%}.measurement-line.distance-vector-x{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-x-axis-color )}.measurement-line.distance-vector-y{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-y-axis-color )}.measurement-line.distance-vector-z{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-z-axis-color )}`;const y=s(class t extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.measurementOverlays=new i;this.overlays=[];this.updateCamera=()=>{var e,t;this.camera=(t=(e=this.viewer)===null||e===void 0?void 0:e.frame)===null||t===void 0?void 0:t.scene.camera}}handleMeasurementOverlaysChanged(){this.removeModelListeners();this.addModelListeners();this.updateOverlays()}handleViewerChanged(e,t){this.removeViewerListeners(t);this.addViewerListeners();this.updateCamera()}componentWillLoad(){this.addModelListeners();this.addViewerListeners();this.updateOverlays();this.updateCamera()}addModelListeners(){this.onOverlaysChangedListener=this.measurementOverlays.onOverlaysChanged((()=>this.updateOverlays()))}removeModelListeners(){var e;(e=this.onOverlaysChangedListener)===null||e===void 0?void 0:e.dispose();this.onOverlaysChangedListener=undefined}addViewerListeners(){var e;(e=this.viewer)===null||e===void 0?void 0:e.addEventListener("frameReceived",this.updateCamera)}removeViewerListeners(e){e===null||e===void 0?void 0:e.removeEventListener("frameReceived",this.updateCamera)}updateOverlays(){this.overlays=this.measurementOverlays.getOverlays()}render(){return e(n,{key:"965a86f907cfe18797db57f488d38ac29bae8682"},this.overlays.map((t=>{if(this.camera!=null&&this.viewer!=null){return e(u,{overlay:t,viewport:this.viewer.viewport,camera:this.camera})}})))}static get watchers(){return{measurementOverlays:[{handleMeasurementOverlaysChanged:0}],viewer:[{handleViewerChanged:0}]}}static get style(){return w()}},[1,"vertex-viewer-measurement-overlays",{measurementOverlays:[16],camera:[1040],viewer:[16],overlays:[32]},undefined,{measurementOverlays:[{handleMeasurementOverlaysChanged:0}],viewer:[{handleViewerChanged:0}]}]);function f(){if(typeof customElements==="undefined"){return}const e=["vertex-viewer-measurement-overlays","vertex-viewer-measurement-line"];e.forEach((e=>{switch(e){case"vertex-viewer-measurement-overlays":if(!customElements.get(r(e))){customElements.define(r(e),y)}break;case"vertex-viewer-measurement-line":if(!customElements.get(r(e))){m()}break}}))}f();export{y as V,f as d,c as g};
5
- //# sourceMappingURL=p-DnVcQAR9.js.map
4
+ import{h as e,F as t,t as r,p as s,H as a,e as n}from"./p-Bb32XUUS.js";import"./p-CWcvgy8e.js";import"./p-FRKLa468.js";import"./p-ux1ckSDN.js";import"./p-5kcpg4MZ.js";import"./p-CvEK3ZK1.js";import{M as i}from"./p-DyL2wWm6.js";import{l as o,p as l}from"./p-2UsvOTHJ.js";import{d as m}from"./p-BZDn1Vuv.js";function v(e,t){const{camera:r,viewport:s}=t;const a=r.isPointBehindNear(e.start);const n=r.isPointBehindNear(e.end);if(a||n){const t=r.intersectLineWithNear(e);const i=o.create({start:a&&t!=null?t:e.start,end:n&&t!=null?t:e.end});const l=o.transformMatrix(i,r.projectionViewMatrix);return{start:s.transformVectorToViewport(l.start),end:s.transformVectorToViewport(l.end),hideStart:a,hideEnd:n}}else{const t=o.transformMatrix(e,r.projectionViewMatrix);return{start:s.transformVectorToViewport(t.start),end:s.transformVectorToViewport(t.end),hideStart:false,hideEnd:false}}}function c(e,t,r){const{start:s,end:a,hideStart:n,hideEnd:i}=v(e,r);const o=l.lerp(s,a,.5);const m=t!=="none"?d(e,t,r):undefined;return{startPt:s,endPt:a,labelPt:o,indicatorPt:m,hideStart:n,hideEnd:i}}function d(e,t,r){return r.viewport.transformWorldToViewport(t==="start"?e.start:e.end,r.camera.projectionViewMatrix)}const u=({overlay:t,viewport:r,camera:s})=>{if(t.type==="line"){return e(h,{overlay:t,viewport:r,camera:s})}else{return e(p,{overlay:t,viewport:r,camera:s})}};const h=({overlay:t,camera:r,viewport:s})=>{const{start:a,end:n}=v(t,{camera:r,viewport:s});return e("vertex-viewer-measurement-line",{class:"measurement-line",start:a,end:n})};const p=({overlay:{x:r,y:s,z:a},camera:n,viewport:i})=>{const o={camera:n,viewport:i};const{start:l,end:m}=v(r,o);const{start:c,end:d}=v(s,o);const{start:u,end:h}=v(a,o);return e(t,null,e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-x",start:l,end:m}),e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-y",start:c,end:d}),e("vertex-viewer-measurement-line",{class:"measurement-line distance-vector-z",start:u,end:h}))};const w=()=>`:host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;--viewer-measurement-overlays-x-axis-color:var(--x-axis-color);--viewer-measurement-overlays-y-axis-color:var(--y-axis-color);--viewer-measurement-overlays-z-axis-color:var(--z-axis-color)}.measurement-line{position:absolute;width:100%;height:100%}.measurement-line.distance-vector-x{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-x-axis-color )}.measurement-line.distance-vector-y{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-y-axis-color )}.measurement-line.distance-vector-z{--viewer-measurement-line-fill:var( --viewer-measurement-overlays-z-axis-color )}`;const y=s(class t extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.measurementOverlays=new i;this.overlays=[];this.updateCamera=()=>{var e,t;this.camera=(t=(e=this.viewer)===null||e===void 0?void 0:e.frame)===null||t===void 0?void 0:t.scene.camera}}handleMeasurementOverlaysChanged(){this.removeModelListeners();this.addModelListeners();this.updateOverlays()}handleViewerChanged(e,t){this.removeViewerListeners(t);this.addViewerListeners();this.updateCamera()}componentWillLoad(){this.addModelListeners();this.addViewerListeners();this.updateOverlays();this.updateCamera()}addModelListeners(){this.onOverlaysChangedListener=this.measurementOverlays.onOverlaysChanged((()=>this.updateOverlays()))}removeModelListeners(){var e;(e=this.onOverlaysChangedListener)===null||e===void 0?void 0:e.dispose();this.onOverlaysChangedListener=undefined}addViewerListeners(){var e;(e=this.viewer)===null||e===void 0?void 0:e.addEventListener("frameReceived",this.updateCamera)}removeViewerListeners(e){e===null||e===void 0?void 0:e.removeEventListener("frameReceived",this.updateCamera)}updateOverlays(){this.overlays=this.measurementOverlays.getOverlays()}render(){return e(n,{key:"965a86f907cfe18797db57f488d38ac29bae8682"},this.overlays.map((t=>{if(this.camera!=null&&this.viewer!=null){return e(u,{overlay:t,viewport:this.viewer.viewport,camera:this.camera})}})))}static get watchers(){return{measurementOverlays:[{handleMeasurementOverlaysChanged:0}],viewer:[{handleViewerChanged:0}]}}static get style(){return w()}},[1,"vertex-viewer-measurement-overlays",{measurementOverlays:[16],camera:[1040],viewer:[16],overlays:[32]},undefined,{measurementOverlays:[{handleMeasurementOverlaysChanged:0}],viewer:[{handleViewerChanged:0}]}]);function f(){if(typeof customElements==="undefined"){return}const e=["vertex-viewer-measurement-overlays","vertex-viewer-measurement-line"];e.forEach((e=>{switch(e){case"vertex-viewer-measurement-overlays":if(!customElements.get(r(e))){customElements.define(r(e),y)}break;case"vertex-viewer-measurement-line":if(!customElements.get(r(e))){m()}break}}))}f();export{y as V,f as d,c as g};
5
+ //# sourceMappingURL=p-D3in41xo.js.map