@realsee/five 5.0.0-alpha.13 → 5.0.0-alpha.130

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 (203) hide show
  1. package/README.md +21 -11
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/{images/icons.png → icons.png} +0 -0
  6. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  7. package/docs/assets/main.js +52 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1413 -0
  10. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  11. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  12. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  13. package/docs/classes/five.BVH.html +10 -0
  14. package/docs/classes/five.BVHIntersect.html +1 -0
  15. package/docs/classes/five.BVHNode.html +7 -0
  16. package/docs/classes/five.BVHVector3.html +1 -0
  17. package/docs/classes/five.Camera.html +11 -0
  18. package/docs/classes/five.Five.html +303 -0
  19. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  20. package/docs/classes/five.IntersectMesh.html +1 -0
  21. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  22. package/docs/classes/five.Model.html +87 -0
  23. package/docs/classes/five.NetworkSubscribe.html +50 -0
  24. package/docs/classes/five.PBMContainer.html +17 -0
  25. package/docs/classes/five.PBMGroup.html +19 -0
  26. package/docs/classes/five.PBMMaterial.html +17 -0
  27. package/docs/classes/five.PBMMesh.html +7 -0
  28. package/docs/classes/five.PanoCircleMesh.html +7 -0
  29. package/docs/classes/five.Scene.html +3 -0
  30. package/docs/classes/five.Subscribe.html +56 -0
  31. package/docs/classes/five.Tile3DModel.html +15 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +166 -422
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +100 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +18 -0
  59. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  60. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  61. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  62. package/docs/interfaces/five.Intersection.html +7 -0
  63. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  64. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  65. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  66. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  67. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  68. package/docs/interfaces/five.PBMParameters.html +17 -0
  69. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  70. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  71. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  72. package/docs/interfaces/five.Pose.html +37 -0
  73. package/docs/interfaces/five.Scissor.html +14 -0
  74. package/docs/interfaces/five.State.html +21 -0
  75. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  78. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  79. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  80. package/docs/interfaces/five.TextureOptions.html +20 -0
  81. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  82. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  83. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  84. package/docs/interfaces/five.WorkImage.html +21 -0
  85. package/docs/interfaces/five.WorkInitial.html +13 -0
  86. package/docs/interfaces/five.WorkModel.html +11 -0
  87. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  88. package/docs/interfaces/five.WorkObserver.html +25 -0
  89. package/docs/interfaces/five.WorkTile.html +1 -0
  90. package/docs/interfaces/five.WorkVideo.html +9 -0
  91. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  92. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  93. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  94. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  95. package/docs/interfaces/server.Intersection.html +7 -0
  96. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  97. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  98. package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
  99. package/docs/modules/five.SubscribeMixinType.html +1 -0
  100. package/docs/modules/five.html +482 -0
  101. package/docs/modules/gltf_loader.html +1 -0
  102. package/docs/modules/line.html +1 -0
  103. package/docs/modules/react.html +130 -1178
  104. package/docs/modules/server.html +18 -0
  105. package/docs/modules/sticker.html +1 -0
  106. package/docs/modules/vue.html +112 -0
  107. package/docs/modules.html +1 -120
  108. package/exporters/staticify.js +210 -0
  109. package/{index.d.ts → five/index.d.ts} +1178 -322
  110. package/five/index.js +372 -0
  111. package/gltf-loader/index.d.ts +75 -0
  112. package/gltf-loader/index.js +260 -0
  113. package/line/index.d.ts +68 -0
  114. package/line/index.js +260 -0
  115. package/package.json +25 -17
  116. package/react/index.d.ts +160 -92
  117. package/react/index.js +260 -1
  118. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  119. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  120. package/resource/gltf/draco_decoder.js +31 -0
  121. package/resource/gltf/draco_decoder.wasm +0 -0
  122. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  123. package/scripts/five-staticify.js +26 -0
  124. package/server/index.d.ts +194 -25
  125. package/server/index.js +367 -1
  126. package/sticker/index.d.ts +70 -0
  127. package/sticker/index.js +260 -0
  128. package/templates/quick-start/README.md +1 -1
  129. package/templates/quick-start/package.json +1 -1
  130. package/templates/react-component/lib/index.tsx +3 -3
  131. package/umd/five-gltf-loader.js +2 -0
  132. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  133. package/umd/five-line.js +2 -0
  134. package/umd/five-line.js.LICENSE.txt +14 -0
  135. package/umd/five-react.js +2 -0
  136. package/umd/five-react.js.LICENSE.txt +14 -0
  137. package/umd/five-sticker.js +2 -0
  138. package/umd/five-sticker.js.LICENSE.txt +14 -0
  139. package/umd/five-vue.js +1 -0
  140. package/umd/five.js +2 -0
  141. package/umd/five.js.LICENSE.txt +116 -0
  142. package/vue/index.d.ts +433 -0
  143. package/vue/index.js +260 -0
  144. package/bundles/five.js +0 -2
  145. package/bundles/five.js.LICENSE.txt +0 -160
  146. package/docs/assets/css/main.css +0 -2660
  147. package/docs/assets/js/main.js +0 -248
  148. package/docs/assets/js/search.js +0 -1
  149. package/docs/classes/index.five.html +0 -2498
  150. package/docs/classes/index.fivecamera.html +0 -311
  151. package/docs/classes/index.fivehashcubetexture.html +0 -240
  152. package/docs/classes/index.fiveline.html +0 -342
  153. package/docs/classes/index.fivelinegeometry.html +0 -500
  154. package/docs/classes/index.fivelinematerial.html +0 -276
  155. package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
  156. package/docs/classes/index.fivescene.html +0 -186
  157. package/docs/classes/index.internalwebglrenderer.html +0 -200
  158. package/docs/classes/index.model.html +0 -883
  159. package/docs/classes/index.pbmgroup.html +0 -415
  160. package/docs/classes/index.pbmmaterial.html +0 -521
  161. package/docs/classes/index.pbmmesh.html +0 -242
  162. package/docs/classes/index.subscribe.html +0 -556
  163. package/docs/classes/react.store.html +0 -584
  164. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
  165. package/docs/interfaces/index.eventcallback.html +0 -2452
  166. package/docs/interfaces/index.fiveinitargs.html +0 -695
  167. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
  168. package/docs/interfaces/index.imageoptions.html +0 -320
  169. package/docs/interfaces/index.intersection.html +0 -215
  170. package/docs/interfaces/index.intersectmeshinterface.html +0 -176
  171. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
  172. package/docs/interfaces/index.modeleventcallback.html +0 -316
  173. package/docs/interfaces/index.movepanooptions.html +0 -457
  174. package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
  175. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
  176. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
  177. package/docs/interfaces/index.pbmparameters.html +0 -462
  178. package/docs/interfaces/index.pose.html +0 -258
  179. package/docs/interfaces/index.scissor.html +0 -240
  180. package/docs/interfaces/index.state.html +0 -288
  181. package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
  182. package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
  183. package/docs/interfaces/index.subscribemixintype.off.html +0 -198
  184. package/docs/interfaces/index.subscribemixintype.on.html +0 -213
  185. package/docs/interfaces/index.subscribemixintype.once.html +0 -210
  186. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
  187. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
  188. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
  189. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
  190. package/docs/interfaces/react.injectfivetoprops.html +0 -259
  191. package/docs/modules/index.html +0 -3027
  192. package/docs/modules/index.subscribemixintype.html +0 -143
  193. package/five.js.LICENSE.txt +0 -160
  194. package/index.js +0 -1
  195. package/scripts/export-five-resource/chfs.exe +0 -0
  196. package/scripts/export-five-resource/fileify.js +0 -192
  197. package/scripts/export-five-resource/format-work.js +0 -71
  198. package/scripts/export-five-resource/staticify.js +0 -327
  199. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  200. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  201. package/scripts/transcode-model/MTLLoader.js +0 -602
  202. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  203. package/scripts/transcode-model/obj2pbm.js +0 -65
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-line.js.LICENSE.txt */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(function(){return(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),M=B>=-1&&B<=1,P=v.distanceTo(A)<.5*c;if(M&&P){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-react.js.LICENSE.txt */
2
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.FiveSDK_React=n():e.FiveSDK_React=n()}(self,(function(){return(()=>{var e={348:e=>{if(!("FiveSDK"in window))throw new Error('"FiveSDK" is not available. Please include "five" in your HTML.');e.exports=window.FiveSDK},751:e=>{if(!("React"in window))throw new Error('"React" is not available. Please include "react" in your HTML.');e.exports=window.React},438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const n=Number(THREE.REVISION);if(n<115||n>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var u=n[r]={exports:{}};return e[r](u,u.exports,t),u.exports}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";t.r(r),t.d(r,{FiveCanvas:()=>y,INJECTION_PROPNAME:()=>D,Store:()=>ue,createFiveFeature:()=>te,createFiveProvider:()=>p,createStore:()=>ie,unsafe__useFiveInstance:()=>m,useFiveAction:()=>F,useFiveCameraDirection:()=>O,useFiveCameraRaycaster:()=>P,useFiveCurrentObserver:()=>k,useFiveCurrentState:()=>E,useFiveEventCallback:()=>L,useFiveFloor:()=>_,useFiveHelper:()=>T,useFiveModelIntersectRaycaster:()=>j,useFiveModelReadyState:()=>W,useFiveProject2d:()=>x,useFiveScene:()=>w,useFiveSceneEffect:()=>S,useFiveState:()=>C,useFiveWork:()=>g,withFive:()=>ne});var e=function(n,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(n,t)};function n(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function u(e,n,t){if(t||2===arguments.length)for(var r,o=0,u=n.length;o<u;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}Object.create,Object.create;var i=t(751),a=t(438),f=[],c=[],s=i.createContext(null);function l(){var e=i.useContext(s);if(!e)throw new Error("FiveProvider never found.");return e.five}function d(){var e=i.useContext(s);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}var v=t(348);function p(e){return void 0===e&&(e={}),function(t){function r(n){var r,u=this;u=t.call(this,n)||this;var i=function(e){var n=void 0===e?{}:e,t=n.backgroundColor,r=void 0===t?1579548:t,o=n.backgroundAlpha,u=void 0===o?1:o,i=n.pixelRatio,s=void 0===i?1:i,l=n.webgl2,d=void 0!==l&&l;if("undefined"!=typeof window){var v=null;if(!(v=d?f.shift():c.shift())){if(d){var p=document.createElement("canvas"),h=p.getContext("webgl2");if(null===h)throw new Error("error occurred when getting webgl2 canvas context");v=new a.WebGLRenderer({antialias:!1,alpha:!0,canvas:p,context:h})}else v=new a.WebGLRenderer({antialias:!1,alpha:!0});v.outputEncoding=a.sRGBEncoding}return v.setPixelRatio(s),v.setClearColor(r,u),v.autoClear=!0,v}}({pixelRatio:1===(0,v.getViewportScale)()?window.devicePixelRatio:1,backgroundAlpha:e.backgroundAlpha,backgroundColor:e.backgroundColor,webgl2:null==e?void 0:e.webgl2});return u.five=new v.Five(o({renderer:i},e)),(n.work||n.initialWork)&&u.five.load(n.work||n.initialWork,n.initialState,void 0,null===(r=n.initialUserAction)||void 0===r||r),u.five.on("load",(function(){var e;u.props.onWorkChange&&u.props.onWorkChange(null===(e=u.five)||void 0===e?void 0:e.work)})),u.five.on("stateChange",(function(e,n){u.props.onStateChange&&u.props.onStateChange(e,n)})),u.five.on("currentStateChange",(function(e,n){u.props.onCurrentStateChange&&u.props.onCurrentStateChange(e,n)})),u.five.on("error",(function(e){u.props.onError?u.props.onError(e):console.warn(e.message)})),u}return n(r,t),r.prototype.loadWork=function(e,n,t,r){if(void 0===r&&(r=!0),this.props.work)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(e,n,t,r)},r.prototype.shouldComponentUpdate=function(e){var n,t;return e.work&&e.work!==(null===(n=this.five)||void 0===n?void 0:n.work)&&(null===(t=this.five)||void 0===t||t.load(e.work,e.initialState)),!0},r.prototype.componentWillUnmount=function(){var e;this.five&&(this.five.dispose(),(e=this.five.renderer)&&(e.capabilities.isWebGL2?-1===c.indexOf(e)&&c.push(e):-1===f.indexOf(e)&&f.push(e)),delete this.five)},r.prototype.render=function(){var e=this;return i.createElement(s.Provider,{value:{five:this.five,loadWork:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.loadWork.apply(e,n)}}},this.props.children)},r}(i.Component)}var h={display:"inline-block",overflow:"hidden"},y=function(e){var n=e.width,t=e.height,r=l(),u=i.createRef(),a=o({width:n,height:t},h);return i.useLayoutEffect((function(){if(u.current&&r.renderer){if(null!==r.renderer.domElement.parentNode&&r.renderer.domElement.parentNode!==u.current)throw new Error("There are more than 2 fiveCanvas in this context.");r.renderer.domElement.parentNode!==u.current&&u.current.appendChild(r.renderer.domElement),r.camera.aspect=n/t,r.camera.updateProjectionMatrix(),r.renderer.setSize(n,t),r.needsRender=!0}}),[n,t,u.current]),i.createElement("div",{ref:u,style:a})};function m(){return l()}function S(e,n){var t=l(),r=[t];void 0!==n&&(r=r.concat(n)),i.useLayoutEffect((function(){return e(t.scene)}),r)}var w=S;function g(){var e=l(),n=d(),t=i.useState((function(){return e.work})),r=t[0],o=t[1];return i.useLayoutEffect((function(){return e.on("load",(function(){return o(e.work)}))}),[e]),[r,n]}function b(e){return o({},e.state)}function C(){var e=l(),n=i.useState((function(){return b(e)})),t=n[0],r=n[1],o=i.useCallback((function(n,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0);var o="function"==typeof n?n(e.getCurrentState()):n;e.setState(o,t,r)}),[e]);return i.useLayoutEffect((function(){return e.on("stateChange",(function(){return r(b(e))}))}),[e]),[t,o]}function E(){var e=l(),n=i.useState((function(){return e.getCurrentState()})),t=n[0],r=n[1],o=i.useCallback((function(n,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0);var o="function"==typeof n?n(e.getCurrentState()):n;e.setState(o,t,r)}),[e]);return i.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),[t,o]}function k(){var e=l(),n=i.useState((function(){return e.getCurrentState()})),t=n[0],r=n[1];return i.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),e.work?e.work.observers[t.panoIndex]:null}function L(e,n,t){var r=l(),o=[r,e];void 0!==t&&(o=o.concat(t)),i.useLayoutEffect((function(){return r.on(e,n)}),o)}function F(){var e=l();return{updateCamera:i.useCallback((function(n,t){return e.updateCamera(n,t)}),[e]),initBasisLoader:i.useCallback((function(n){return e.initBasisLoader(n)}),[e]),getPixels:i.useCallback((function(n,t,r,o,u){return e.getPixels(n,t,r,o,u)}),[e]),render:i.useCallback((function(n){return e.render(n)}),[e]),needsRender:i.useCallback((function(){return e.needsRender=!0}),[e]),preloadPano:i.useCallback((function(n,t){return e.preloadPano(n,t)}),[e])}}function x(){var e=l(),n=i.useState((function(){return Symbol()})),t=(n[0],n[1]);return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return t(Symbol())}))}),[e]),i.useCallback((function(n,t){return e.project2d(n,t)}),[e])}function R(e){var n=e.camera.getWorldDirection(new a.Vector3);return new a.Raycaster(e.camera.position,n)}function P(){var e=l(),n=i.useState((function(){return R(e)})),t=n[0],r=n[1];return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(R(e))}))}),[e]),t}function V(e){return e.camera.getWorldDirection(new a.Vector3)}function O(){var e=l(),n=i.useState((function(){return V(e)})),t=n[0],r=n[1];return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(V(e))}))}),[e]),t}function j(){var e=l();return i.useCallback((function(n){return e.model.intersectRaycaster(n)}),[e])}function M(e){return e.model.empty?"Empty":"Loaded"}function W(){var e=l(),n=i.useState((function(){return M(e)})),t=n[0],r=n[1];return i.useLayoutEffect((function(){return e.on("modelLoaded",(function(){return r(M(e))}))}),[e]),t}function _(){var e=l(),n=i.useState(e.model.shownFloor),t=n[0],r=n[1],o=i.useState(e.model.floorLength),u=o[0],a=o[1],f=i.useCallback((function(n){"number"==typeof n?e.model.show(n):e.model.show()}),[e]);return i.useLayoutEffect((function(){var n=[];return n.push(e.on("modelShownFloorChange",(function(){return r(e.model.shownFloor)}))),n.push(e.on("modelLoaded",(function(){return a(e.model.floorLength)}))),function(){for(var e;e=n.shift();)e()}}),[e]),[t,u,f]}function T(){var e=l(),n=i.useState(e.helperVisible),t=n[0],r=n[1],o=i.useCallback((function(n){e.helperVisible=n}),[e]);return i.useLayoutEffect((function(){return e.on("helpersVisibleChange",(function(e){return r(e)}))}),[e]),[t,o]}var D="$five";function N(e,n){return n.indexOf(e)>=0}function H(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var o=r[t];void 0!==n[o]&&(e[o]=n[o])}}function A(e,n){if(N("loadWork",n))return e}function I(e,n){if(N("setState",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.setState.apply(e,n)}}function U(e,n){if(N("on",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.on.apply(e,n)}}function B(e,n){if(N("on",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.once.apply(e,n)}}function K(e,n){if(N("off",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.off.apply(e,n)}}function G(e,n){if(N("intersectRaycaster",n))return function(){for(var n,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(n=e.model).intersectRaycaster.apply(n,t)}}function $(e,n){if(N("project2d",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.project2d.apply(e,n)}}function z(e,n){if(N("updateCamera",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.updateCamera.apply(e,n)}}function J(e,n){if(N("initBasisLoader",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.initBasisLoader.apply(e,n)}}function q(e,n){if(N("getPixels",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.getPixels.apply(e,n)}}function Q(e,n){if(N("render",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.render.apply(e,n)}}function X(e,n){if(N("needsRender",n))return function(){e.needsRender=!0}}function Y(e,n){if(N("preloadPano",n))return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.preloadPano.apply(e,n)}}function Z(e,n){if(N("showFloor",n))return function(n){"number"==typeof n?e.model.show(n):e.model.show()}}function ee(e,n){if(N("toggleHelperVisible",n))return function(n){e.helperVisible=n}}function ne(e){return function(n){return i.forwardRef((function(t,r){var u=l(),f=d(),c=function(e,n){return[N("unsafe__fiveInstance",n)?e:void 0]}(u,e)[0],s=function(e,n){var t=N("state",n),r=i.useState(Symbol()),u=r[0],a=r[1],f=i.useMemo((function(){if(t)return o({},e.state)}),[e,u]);return i.useLayoutEffect((function(){if(t)return e.on("stateChange",(function(){return a(Symbol())}))}),[e]),[f,u]}(u,e),v=s[0],p=s[1],h=function(e,n){var t=N("currentState",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.getCurrentState()}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("currentStateChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),y=h[0],m=h[1],S=function(e,n){var t=N("currentObserver",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.getCurrentState()}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("currentStateChange",(function(){return u(Symbol())}))}),[e]),[a?e.work?e.work.observers[a.panoIndex]:null:void 0,o]}(u,e),w=S[0],g=S[1],b=function(e,n){var t=N("work",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.work}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("load",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),C=b[0],E=b[1],k=function(e,n){var t=N("model",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.model}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),L=k[0],F=k[1],x=function(e,n){return[N("scene",n)?e.scene:void 0]}(u,e)[0],R=function(e,n){var t=N("cameraDirection",n),r=i.useState(Symbol()),o=r[0],u=r[1],f=i.useMemo((function(){if(t)return e.camera.getWorldDirection(new a.Vector3)}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("cameraUpdate",(function(){return u(Symbol())}))}),[e]),[f,o]}(u,e),P=R[0],V=R[1],O=function(e,n){var t=N("cameraRaycaster",n),r=i.useState(Symbol()),o=r[0],u=r[1],f=i.useMemo((function(){if(t){var n=e.camera.getWorldDirection(new a.Vector3);return new a.Raycaster(e.camera.position,n)}}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("cameraUpdate",(function(){return u(Symbol())}))}),[e]),[f,o]}(u,e),j=O[0],M=O[1],W=function(e,n){var t=N("modelReadyState",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.model.empty?"Empty":"Loaded"}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),_=W[0],T=W[1],D=function(e,n){var t=N("shownFloor",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.model.shownFloor}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("modelShownFloorChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),ne=D[0],te=D[1],re=function(e,n){var t=N("totalFloorLength",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.model.hasFloors()}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),oe=re[0],ue=re[1],ie=function(e,n){var t=N("helperVisible",n),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(t)return e.helperVisible}),[e,o]);return i.useLayoutEffect((function(){if(t)return e.on("helpersVisibleChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),ae=ie[0],fe=ie[1],ce=i.useMemo((function(){var n={};return H(n,{setState:I(u,e),loadWork:A(f,e),on:U(u,e),once:B(u,e),off:K(u,e),intersectRaycaster:G(u,e),project2d:$(u,e),updateCamera:z(u,e),initBasisLoader:J(u,e),getPixels:q(u,e),render:Q(u,e),needsRender:X(u,e),preloadPano:Y(u,e),showFloor:Z(u,e),toggleHelperVisible:ee(u,e)}),n}),[u,f]),se=i.useMemo((function(){var e=o({},ce);return H(e,{unsafe__fiveInstance:c,state:v,currentState:y,currentObserver:w,work:C,model:L,scene:x,cameraDirection:P,cameraRaycaster:j,modelReadyState:_,shownFloor:ne,totalFloorLength:oe,helperVisible:ae}),e}),[u,ce,p,m,g,E,F,V,M,T,te,ue,fe]);return i.createElement(n,o({ref:r,$five:se},t))}))}}function te(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e}function re(e,n){for(var t={},r=n.length,o=-1;++o<r;){var u=n[o];u in e&&(t[u]=e[u])}return t}function oe(e,n){for(var t=0;t<e.length;t++)for(var r=0;r<n.length;r++)if(e[t]===n[r])return!0;return!1}var ue=function(){function e(e,n){this.values=e,this.listeners=[],this.onValuesChange=n}return e.prototype.on=function(e,n){var t=this,r=[e,n];return this.listeners.push(r),function(){var e=t.listeners.indexOf(r);e>=0&&t.listeners.splice(e,1)}},e.prototype.getValues=function(e){return re(this.values,e)},e.prototype.setValues=function(e,n){var t,r,u=[];for(var i in n)e.indexOf(i)>=0&&(t=n[i],r=this.values[i],!("number"==typeof t&&"number"==typeof r&&isNaN(t)&&isNaN(r)||t===r))&&u.push(i);if(0!==u.length){for(var a=o({},this.values),f=0,c=u;f<c.length;f++){var s=c[f];this.values[s]=n[s]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var v=d[l],p=v[0],h=v[1];if(oe(p,u)){var y=re(a,p);h(re(this.values,p),y)}}}},e}();function ie(e){var t=i.createContext(null);return{useStore:function(e){var n=i.useContext(t);if(null===n)throw new Error("StoreProvider never found.");var r=i.useRef(!0),o=i.useState(n.getValues(e)),a=o[0],f=o[1],c=u([n],e,!0);return i.useLayoutEffect((function(){return r.current?r.current=!1:f(n.getValues(e)),n.on(e,(function(e){return f(e)}))}),c),[a,i.useCallback((function(t){return n.setValues(e,t)}),c)]},useStoreSetter:function(e){var n=i.useContext(t);if(null===n)throw new Error("StoreProvider never found.");return i.useCallback((function(t){return n.setValues(e,t)}),u([n],e,!0))},watchStore:function(e,n,r){var o=i.useContext(t);if(null===o)throw new Error("StoreProvider never found.");var a=u([o],e,!0);void 0!==r&&(a=a.concat(r)),i.useLayoutEffect((function(){return o.on(e,n)}),a)},useStoreAction:function(n){var r=i.useContext(t);if(null===r)throw new Error("StoreProvider never found.");return i.useCallback((function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var i=e[n],a=i[0],f=i.slice(1),c=function(){return r.getValues(f)},s=function(e){return r.setValues(f,e)};return a.apply(void 0,u([c,s],t,!1))}),[])},StoreProvider:function(e){function r(n){var t=e.call(this,n)||this;return t.store=new ue(n.initialValue,(function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.props.onValuesChange&&(e=t.props).onValuesChange.apply(e,n)})),t}return n(r,e),r.prototype.shouldComponentUpdate=function(e){return e.children!==this.props.children},r.prototype.render=function(){return i.createElement(t.Provider,{value:this.store},this.props.children)},r}(i.Component)}}})(),r})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-sticker.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(function(){return(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var h=y.map=new t.VideoTexture(o);h.wrapS=t.ClampToEdgeWrapping,h.wrapT=t.ClampToEdgeWrapping,h.minFilter=t.LinearFilter,h.encoding=t.sRGBEncoding,d(h,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh)})(),r})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1 @@
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.FiveSDK_Vue=n():e.FiveSDK_Vue=n()}(self,(function(){return(()=>{var e={348:e=>{if(!("FiveSDK"in window))throw new Error('"FiveSDK" is not available. Please include "five" in your HTML.');e.exports=window.FiveSDK},438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const n=Number(THREE.REVISION);if(n<115||n>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE},928:e=>{if(!("Vue"in window))throw new Error('"Vue" is not available. Please include "vue" in your HTML.');e.exports=window.Vue}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=(e,n)=>{for(var t in n)o.o(n,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};return(()=>{"use strict";o.r(t),o.d(t,{FiveCanvas:()=>l,FiveProvider:()=>s,unsafe__useFiveInject:()=>U,useFiveAction:()=>g,useFiveCameraDirection:()=>R,useFiveCameraRaycaster:()=>S,useFiveCurrentObserver:()=>h,useFiveCurrentState:()=>w,useFiveEventCallback:()=>m,useFiveFloor:()=>O,useFiveHelper:()=>B,useFiveModel:()=>T,useFiveModelBounding:()=>L,useFiveModelIntersectRaycaster:()=>j,useFiveModelReadyState:()=>x,useFiveProject2d:()=>y,useFiveScene:()=>V,useFiveState:()=>p,useFiveWork:()=>v});var e=function(){return(e=Object.assign||function(e){for(var n,o=1,t=arguments.length;o<t;o++)for(var r in n=arguments[o])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};Object.create,Object.create;var n=o(928),r=!1,i=Symbol();function u(){var e=(0,n.inject)(i);if(!e)throw new Error("Inject five error!");return e}var a={display:"inline-block",overflow:"hidden"},l=(0,n.defineComponent)({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(o){var t=(0,n.toRef)(o,"width"),r=(0,n.toRef)(o,"height"),i=u(),l=(0,n.ref)(null);return(0,n.watch)([t,r,l],(function(){if(i.renderer&&l.value){if(null!==i.renderer.domElement.parentNode&&i.renderer.domElement.parentNode!==l.value)throw new Error("There are more than 2 fiveCanvas in this context.");i.renderer.domElement.parentNode!==l.value&&l.value.appendChild(i.renderer.domElement),i.camera.aspect=t.value/r.value,i.camera.updateProjectionMatrix(),i.renderer.setSize(t.value,r.value),i.needsRender=!0}})),function(){return(0,n.h)("div",{id:"five",style:e({width:"".concat(t.value,"px"),height:"".concat(r.value,"px")},a),ref:l})}}}),f=o(348),c=o(438),d=[],s=(0,n.defineComponent)({props:{work:Object,initialWork:Object,initialState:Object,initialUserAction:Boolean,onWorkChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(o){var t,u,a=(0,n.toRefs)(o).work,l=function(e){var n=void 0===e?{}:e,o=n.backgroundColor,t=void 0===o?1579548:o,r=n.backgroundAlpha,i=void 0===r?1:r,u=n.pixelRatio,a=void 0===u?1:u;if("undefined"!=typeof window){var l=d.shift();return l||((l=new c.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=c.sRGBEncoding),l.setPixelRatio(a),l.setClearColor(t,i),l.autoClear=!0,l}}({pixelRatio:1===(0,f.getViewportScale)()?window.devicePixelRatio:1}),s=new f.Five(e({renderer:l},o.fiveInitArgs));return(o.work||o.initialWork)&&s.load(o.work||o.initialWork,o.initialState,void 0,null===(t=o.initialUserAction)||void 0===t||t),u=!!o.work,r=u,a&&(0,n.watch)(a,(function(e,n){e&&e!==(null==s?void 0:s.work)&&(null==s||s.load(e,o.initialState))})),(0,n.onBeforeUnmount)((function(){s&&(s.dispose(),function(e){e&&-1===d.indexOf(e)&&d.push(e)}(s.renderer))})),s.on("load",(function(){o.onWorkChange&&s.work&&o.onWorkChange(null==s?void 0:s.work)})),s.on("stateChange",(function(e,n){o.onStateChange&&o.onStateChange(e,n)})),s.on("currentStateChange",(function(e,n){o.onCurrentStateChange&&o.onCurrentStateChange(e,n)})),s.on("error",(function(e){o.onError?o.onError(e):console.warn(e.message)})),(0,n.provide)(i,s),{five:(0,n.shallowReadonly)(s)}},render:function(){return(0,n.h)("div",{style:this.$props.style},this.$slots)}});function v(){var e=u(),o=(0,n.ref)(e.work),t=(0,n.readonly)(o),i=e.on("load",(function(){o.value=e.work}));return(0,n.onBeforeUnmount)((function(){i()})),[t,function(n,o,t,i){if(r)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(n,o,t,i)}]}function p(){var o=u(),t=(0,n.ref)(e({},o.state)),r=o.on("stateChange",(function(n){Object.assign(t.value,e({},n))}));return(0,n.onBeforeUnmount)((function(){r()})),[t,function(e,n,t){void 0===n&&(n=!1),void 0===t&&(t=!0);var r="function"==typeof e?e(o.getCurrentState()):e;o.setState(r,n,t)}]}function w(){var e=u(),o=(0,n.ref)(e.getCurrentState()),t=e.on("currentStateChange",(function(){Object.assign(o.value,e.getCurrentState())}));return(0,n.onBeforeUnmount)((function(){t()})),[o,function(n,o,t){var r="function"==typeof n?n(e.getCurrentState()):n;e.setState(r,o,t)}]}function h(){var e=u(),o=(0,n.reactive)(e.getCurrentState()),t=(0,n.ref)(e.work?e.work.observers[o.panoIndex]:null),r=e.on("currentStateChange",(function(){Object.assign(o,e.getCurrentState()),e.work&&(t.value=e.work.observers[o.panoIndex])}));return(0,n.onBeforeUnmount)((function(){r()})),t}function m(e,o){var t=u().on(e,o);(0,n.onBeforeUnmount)((function(){t()}))}function g(){var e=u();return{updateCamera:function(n,o){return e.updateCamera(n,o)},initBasisLoader:function(n){return e.initBasisLoader(n)},getPixels:function(n,o,t,r,i){return e.getPixels(n,o,t,r,i)},render:function(n){return e.render(n)},needsRender:function(){return e.needsRender=!0},preloadPano:function(n,o){return e.preloadPano(n,o)}}}function b(e,o){void 0===o&&(o=!1);var t=u(),r=(0,n.ref)(Symbol()),i=(0,n.shallowRef)(e?t.project2d((0,n.isRef)(e)?e.value:e,o):null),a=t.on("cameraUpdate",(function(){r.value=Symbol()}));return(0,n.onBeforeUnmount)((function(){a()})),(0,n.watch)([r,e],(function(){i.value=t.project2d((0,n.isRef)(e)?e.value:e,o)})),i}function y(){return b}function C(e){var n=e.camera.getWorldDirection(new c.Vector3);return new c.Raycaster(e.camera.position,n)}function S(){var e=u(),o=(0,n.shallowRef)(C(e)),t=e.on("cameraUpdate",(function(){o.value=C(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function F(e){return e.camera.getWorldDirection(new c.Vector3)}function R(){var e=u(),o=(0,n.shallowRef)(F(e)),t=e.on("cameraUpdate",(function(){o.value=F(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function E(e){var o=u(),t=(0,n.shallowRef)([]);return(0,n.watch)(e,(function(){t.value=o.model.intersectRaycaster((0,n.isRef)(e)?e.value:e)})),t}function j(){return E}function k(e){return e.model.empty?"Empty":"Loaded"}function x(){var e=u(),o=(0,n.ref)(k(e)),t=e.on("modelLoaded",(function(){o.value=k(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function O(){var e=u(),o=(0,n.ref)(e.model.shownFloor),t=(0,n.ref)(e.model.floorLength),r=[];return r.push(e.on("modelShownFloorChange",(function(){o.value=e.model.shownFloor}))),r.push(e.on("modelLoaded",(function(){t.value=e.model.floorLength}))),(0,n.onBeforeUnmount)((function(){for(var e;e=r.shift();)e()})),[o,t,function(n){"number"==typeof n?e.model.show(n):e.model.show()}]}function B(){var e=u(),o=(0,n.ref)(e.helperVisible),t=e.on("helpersVisibleChange",(function(e){o.value=e}));return(0,n.onBeforeUnmount)((function(){t()})),[o,function(n){e.helperVisible=n}]}function U(){return u()}function P(e){return e.model.bounding.clone()}function L(){var e=u(),o=(0,n.shallowRef)(P(e)),t=e.on("modelLoaded",(function(){o.value=P(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function V(){return u().scene}function T(){var e=u(),o=(0,n.shallowRef)(e.model),t=e.on("modelLoaded",(function(){o.value=e.model}));return(0,n.onBeforeUnmount)((function(){t()})),o}})(),t})()}));