@realsee/five 6.8.0-alpha.16 → 6.8.0-alpha.18

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 (164) hide show
  1. package/docs/assets/hierarchy.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
  4. package/docs/classes/five.BoundingMesh.html +1 -1
  5. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  6. package/docs/classes/five.Five.html +1 -1
  7. package/docs/classes/five.FivePass.html +1 -1
  8. package/docs/classes/five.Histogram.html +4 -1
  9. package/docs/classes/five.Model.html +1 -1
  10. package/docs/classes/five.ModelScene.html +1 -1
  11. package/docs/classes/five.NetworkSubscribe.html +1 -1
  12. package/docs/classes/five.PBMContainer.html +1 -1
  13. package/docs/classes/five.PBMCustomShader.html +1 -1
  14. package/docs/classes/five.PBMGSObject.html +1 -1
  15. package/docs/classes/five.PBMGroup.html +1 -1
  16. package/docs/classes/five.PBMMesh.html +1 -1
  17. package/docs/classes/five.PBMMeshMaterial.html +6 -6
  18. package/docs/classes/five.PBMPanoFilter.html +8 -8
  19. package/docs/classes/five.PBMPointCloud.html +1 -1
  20. package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
  21. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  22. package/docs/classes/five.PBMUpdateable.html +1 -1
  23. package/docs/classes/five.PanoCircleMesh.html +1 -1
  24. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  25. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  26. package/docs/classes/five.Parameter.html +1 -1
  27. package/docs/classes/five.Subscribe.html +1 -1
  28. package/docs/classes/five.Tile3D.html +1 -1
  29. package/docs/classes/five.TileNode.html +1 -1
  30. package/docs/classes/five.TrajectoryNode.html +1 -1
  31. package/docs/classes/five.WorkResolvedObserver.html +1 -1
  32. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  33. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  34. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  35. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  36. package/docs/classes/line.LineGeometry.html +1 -1
  37. package/docs/classes/line.LineMaterial.html +1 -1
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  39. package/docs/classes/line.THREE_Line2.html +1 -1
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  41. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  42. package/docs/classes/vfx.Airflow.html +1 -1
  43. package/docs/classes/vfx.Flame.html +1 -1
  44. package/docs/classes/vfx.Particle.html +1 -1
  45. package/docs/classes/vfx.ParticleGPU.html +1 -1
  46. package/docs/classes/vfx.SpotLight.html +1 -1
  47. package/docs/documents/api.html +15 -15
  48. package/docs/documents/features_flowing-light-2d-pass.html +6 -6
  49. package/docs/documents/features_flowing-light-3d-pass.html +6 -6
  50. package/docs/documents/features_gaussian-blur-pass.html +5 -5
  51. package/docs/hierarchy.html +1 -1
  52. package/docs/interfaces/five.AddableObject.html +1 -1
  53. package/docs/interfaces/five.AjaxOptions.html +1 -1
  54. package/docs/interfaces/five.BaseEvent.html +1 -1
  55. package/docs/interfaces/five.EventCallback.html +1 -1
  56. package/docs/interfaces/five.GestureEvent.html +1 -1
  57. package/docs/interfaces/five.ImageOptions.html +1 -1
  58. package/docs/interfaces/five.IntersectEvent.html +1 -1
  59. package/docs/interfaces/five.IntersectMesh.html +1 -1
  60. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  61. package/docs/interfaces/five.Intersection.html +1 -1
  62. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
  63. package/docs/interfaces/five.ModeChangeEvent.html +1 -1
  64. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  65. package/docs/interfaces/five.ModelEvent.html +1 -1
  66. package/docs/interfaces/five.ModelSceneEvent.html +1 -1
  67. package/docs/interfaces/five.ModelTileEvent.html +1 -1
  68. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  69. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  70. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  71. package/docs/interfaces/five.NetworkOptions.html +1 -1
  72. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  73. package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
  74. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  75. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  76. package/docs/interfaces/five.ObjectEvent.html +1 -1
  77. package/docs/interfaces/five.PBMClipperParameter.html +2 -2
  78. package/docs/interfaces/five.PBMMaterial.html +1 -1
  79. package/docs/interfaces/five.PBMMeshMaterialParameters.html +2 -2
  80. package/docs/interfaces/five.PBMPanoDepth.html +5 -5
  81. package/docs/interfaces/five.PBMPanoFilterValue.html +6 -5
  82. package/docs/interfaces/five.PBMPanoPicture.html +7 -7
  83. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
  84. package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
  85. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  86. package/docs/interfaces/five.PanoEvent.html +1 -1
  87. package/docs/interfaces/five.PanoTextureEvent.html +1 -1
  88. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  89. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  90. package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
  91. package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
  92. package/docs/interfaces/five.ParameterValue.html +1 -1
  93. package/docs/interfaces/five.Pose.html +1 -1
  94. package/docs/interfaces/five.RenderEvent.html +1 -1
  95. package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
  96. package/docs/interfaces/five.State.html +1 -1
  97. package/docs/interfaces/five.StateEvent.html +1 -1
  98. package/docs/interfaces/five.TextureOptions.html +1 -1
  99. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  100. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  101. package/docs/interfaces/five.ViewLayer.html +1 -1
  102. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  103. package/docs/interfaces/five.WorkImage.html +1 -1
  104. package/docs/interfaces/five.WorkObserver.html +1 -1
  105. package/docs/interfaces/five.WorkTile.html +1 -1
  106. package/docs/interfaces/five.WorksEvent.html +1 -1
  107. package/docs/interfaces/five.XRControllerEvent.html +1 -1
  108. package/docs/interfaces/five.XRGestureEvent.html +1 -1
  109. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  110. package/docs/interfaces/five.XRSessionEvent.html +1 -1
  111. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  112. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  113. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  114. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  115. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  116. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  117. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  118. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  119. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  120. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  121. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  122. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  123. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  124. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  125. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  126. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  127. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  128. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  129. package/docs/types/five.ParseOptions.html +1 -1
  130. package/five/index.js +144 -665
  131. package/five/index.mjs +26212 -32279
  132. package/five/model/materials/pbmMaterial.d.ts +7 -16
  133. package/five/texture/histogram.d.ts +7 -0
  134. package/five/thirdparty/hammer.d.ts +371 -255
  135. package/five/thirdparty/jsrsasign.d.ts +5 -20
  136. package/gltf-loader/index.js +9 -9
  137. package/gltf-loader/index.mjs +1351 -1451
  138. package/line/index.js +4 -4
  139. package/line/index.mjs +334 -513
  140. package/package.json +2 -2
  141. package/plugins/index.js +17 -21
  142. package/plugins/index.mjs +3342 -4245
  143. package/react/index.js +3 -3
  144. package/react/index.mjs +572 -783
  145. package/shader-lib/index.js +13 -14
  146. package/shader-lib/index.mjs +424 -824
  147. package/sticker/index.js +3 -3
  148. package/sticker/index.mjs +102 -142
  149. package/umd/five-gltf-loader.js +9 -9
  150. package/umd/five-line.js +4 -4
  151. package/umd/five-plugins.js +17 -21
  152. package/umd/five-react.js +3 -3
  153. package/umd/five-shader-lib.js +13 -14
  154. package/umd/five-sticker.js +3 -3
  155. package/umd/five-vfx.js +21 -21
  156. package/umd/five-vue.js +3 -3
  157. package/umd/five.js +139 -660
  158. package/vfx/index.js +21 -21
  159. package/vfx/index.mjs +454 -910
  160. package/vue/index.js +3 -3
  161. package/vue/index.mjs +309 -301
  162. package/work-downloader/index.js +3 -3
  163. package/work-downloader/index.mjs +317 -556
  164. /package/five/assets/{realsee-pmg-data-url.d.ts → realsee-png-data-url.d.ts} +0 -0
package/umd/five-vfx.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 3/12/2026
5
- * Version: 6.8.0-alpha.16
4
+ * Generated: 3/17/2026
5
+ * Version: 6.8.0-alpha.18
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,7 +252,7 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(S,$){typeof exports=="object"&&typeof module!="undefined"?$(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],$):(S=typeof globalThis!="undefined"?globalThis:S||self,$(S.FiveSDK_VFX={},S.THREE))})(this,(function(S,$){"use strict";function Ee(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const n=Ee($);var re=function(r,i){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},re(r,i)};function Y(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");re(r,i);function e(){this.constructor=r}r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;for(var ve=`
255
+ */(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`three`)):typeof define==`function`&&define.amd?define([`exports`,`three`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.FiveSDK_VFX={},e.THREE))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};t=((e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(t);var l=`
256
256
  uniform vec3 uColor1;
257
257
  uniform vec3 uColor2;
258
258
  uniform float uOpacity;
@@ -272,7 +272,7 @@ void main() {
272
272
  color.g = color.g * (1.0 + gradient * vNoise);
273
273
  gl_FragColor = vec4(color, alpha * uOpacity);
274
274
  }
275
- `,oe=`
275
+ `,u=`
276
276
  // Simplex 4D Noise
277
277
  // by Ian McEwan, Ashima Arts
278
278
  //
@@ -376,11 +376,11 @@ float simplexNoise(vec4 v) {
376
376
  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
377
377
 
378
378
  }
379
- `,ae=`
379
+ `,d=`
380
380
  float scale(float value, float fromMin, float fromMax, float toMin, float toMax) {
381
381
  return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);
382
382
  }
383
- `,fe=`
383
+ `,f=`
384
384
  uniform float uTime;
385
385
  uniform float uNoise;
386
386
  uniform float uSpeed;
@@ -388,8 +388,8 @@ uniform float uSpeed;
388
388
  varying vec3 vPosition;
389
389
  varying float vNoise;
390
390
 
391
- `.concat(oe,`
392
- `).concat(ae,`
391
+ ${u}
392
+ ${d}
393
393
 
394
394
  float fbm(vec4 x) {
395
395
  float v = 0.0;
@@ -412,7 +412,7 @@ void main() {
412
412
 
413
413
  gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);
414
414
  }
415
- `),Be=new n.SphereBufferGeometry(1,300,300),pe=[],Q=0;Q<2;Q++)pe.push(new n.Vector2(Math.sin(Q)/2+1,Q*2-.8));var Fe=new n.LatheBufferGeometry(pe,300),Pe=(function(r){Y(i,r);function i(e){var t=r.call(this)||this;t.needsRender=!0;var o;if(e instanceof n.BufferGeometry)o=e;else switch(e){case"ring":o=Fe;break;case"circle":default:o=Be;break}t.uniforms={uTime:{value:0},uColor1:{value:new n.Color("rgb(255, 177, 20)")},uColor2:{value:new n.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},t.defines={FRAGMENTATION_DEGREE:2};var u=new n.Mesh(o,new n.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:fe,fragmentShader:ve,transparent:!0,depthWrite:!1,side:n.BackSide})),a=new n.Mesh(o,new n.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:fe,fragmentShader:ve,transparent:!0,depthWrite:!1,side:n.FrontSide}));return u.scale.setScalar(.1),a.scale.setScalar(.1),t.add(u),t.add(a),t}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(i.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(function(t){t instanceof n.Mesh&&t.material instanceof n.ShaderMaterial&&(t.material.needsUpdate=!0)}),this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group),Te=`
415
+ `,p=new t.SphereBufferGeometry(1,300,300),m=[];for(let e=0;e<2;e++)m.push(new t.Vector2(Math.sin(e)/2+1,e*2-.8));var h=new t.LatheBufferGeometry(m,300),g=class extends t.Group{constructor(e){super(),this.needsRender=!0;let n;if(e instanceof t.BufferGeometry)n=e;else switch(e){case`ring`:n=h;break;default:n=p;break}this.uniforms={uTime:{value:0},uColor1:{value:new t.Color(`rgb(255, 177, 20)`)},uColor2:{value:new t.Color(`rgb(255, 0, 0)`)},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},this.defines={FRAGMENTATION_DEGREE:2};let r=new t.Mesh(n,new t.ShaderMaterial({uniforms:this.uniforms,defines:this.defines,vertexShader:f,fragmentShader:l,transparent:!0,depthWrite:!1,side:t.BackSide})),i=new t.Mesh(n,new t.ShaderMaterial({uniforms:this.uniforms,defines:this.defines,vertexShader:f,fragmentShader:l,transparent:!0,depthWrite:!1,side:t.FrontSide}));r.scale.setScalar(.1),i.scale.setScalar(.1),this.add(r),this.add(i)}setTime(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0}set color1(e){this.uniforms.uColor1.value=e,this.needsRender=!0}get color1(){return this.uniforms.uColor1.value}set color2(e){this.uniforms.uColor2.value=e,this.needsRender=!0}get color2(){return this.uniforms.uColor2.value}set speed(e){this.uniforms.uSpeed.value=e}get speed(){return this.uniforms.uSpeed.value}set noise(e){this.uniforms.uSpeed.value=e,this.needsRender=!0}get noise(){return this.uniforms.uSpeed.value}set opacity(e){this.uniforms.uOpacity.value=e,this.needsRender=!0}get opacity(){return this.uniforms.opacity.value}set fragmentationDegree(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(e=>{e instanceof t.Mesh&&e.material instanceof t.ShaderMaterial&&(e.material.needsUpdate=!0)}),this.needsRender=!0}get fragmentationDegree(){return this.defines.FRAGMENTATION_DEGREE}},_=`
416
416
  uniform vec3 uLightColor;
417
417
  uniform vec3 uSpotPosition;
418
418
  uniform float uAttenuation;
@@ -432,7 +432,7 @@ void main() {
432
432
  intensity = intensity * angleIntensity * vNoise;
433
433
  gl_FragColor = vec4( uLightColor, intensity );
434
434
  }
435
- `,Me=`
435
+ `,v=`
436
436
 
437
437
  uniform float uTime;
438
438
 
@@ -440,8 +440,8 @@ varying vec3 vNormal;
440
440
  varying vec3 vWorldPosition;
441
441
  varying float vNoise;
442
442
 
443
- `.concat(oe,`
444
- `).concat(ae,`
443
+ ${u}
444
+ ${d}
445
445
 
446
446
  void main(){
447
447
 
@@ -453,7 +453,7 @@ void main(){
453
453
 
454
454
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
455
455
  }
456
- `),ze=(function(r){Y(i,r);function i(e,t,o){e===void 0&&(e=1),t===void 0&&(t=.1),o===void 0&&(o=.2);var u=r.call(this)||this;u.needsRender=!0,u.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:u.position},uLightColor:{value:new n.Color(16777215)}};var a=new n.CylinderBufferGeometry(t,o,e,64,20,!0);a.applyMatrix4(new n.Matrix4().makeTranslation(0,-e/2,0)),a.applyMatrix4(new n.Matrix4().makeRotationX(-Math.PI/2));var s=new n.Mesh(a,new n.ShaderMaterial({uniforms:u.uniforms,vertexShader:Me,fragmentShader:Te,transparent:!0,side:n.FrontSide,depthWrite:!1}));return u.add(s),u}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(i.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group),me=`
456
+ `,y=class extends t.Group{constructor(e=1,n=.1,r=.2){super(),this.needsRender=!0,this.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:this.position},uLightColor:{value:new t.Color(16777215)}};let i=new t.CylinderBufferGeometry(n,r,e,64,20,!0);i.applyMatrix4(new t.Matrix4().makeTranslation(0,-e/2,0)),i.applyMatrix4(new t.Matrix4().makeRotationX(-Math.PI/2));let a=new t.Mesh(i,new t.ShaderMaterial({uniforms:this.uniforms,vertexShader:v,fragmentShader:_,transparent:!0,side:t.FrontSide,depthWrite:!1}));this.add(a)}setTime(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0}set attenuation(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0}get attenuation(){return this.uniforms.uAttenuation.value}set anglePower(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0}get anglePower(){return this.uniforms.uAnglePower.value}set color(e){this.uniforms.uLightColor.value=e,this.needsRender=!0}get color(){return this.uniforms.uLightColor.value}},b=`
457
457
  uniform vec3 uColor;
458
458
  uniform float uOpacity;
459
459
  varying vec3 vPosition;
@@ -463,7 +463,7 @@ void main() {
463
463
  float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);
464
464
  gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);
465
465
  }
466
- `,he=`
466
+ `,x=`
467
467
 
468
468
  uniform float uTime;
469
469
  uniform float uSpeed;
@@ -472,8 +472,8 @@ uniform float uExpand;
472
472
  varying float vNoise;
473
473
  varying vec3 vPosition;
474
474
 
475
- `.concat(oe,`
476
- `).concat(ae,`
475
+ ${u}
476
+ ${d}
477
477
 
478
478
  void main(){
479
479
 
@@ -486,7 +486,7 @@ void main(){
486
486
 
487
487
  gl_Position = projectionMatrix * modelViewMatrix * transformed;
488
488
  }
489
- `),ue=new n.PlaneBufferGeometry(1,1,200,200);ue.translate(0,-.5,0);var Ve=(function(r){Y(i,r);function i(){var e=r.call(this)||this;e.needsRender=!0;var t=e.outer=new n.Mesh(ue,new n.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new n.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:he,fragmentShader:me,transparent:!0,side:n.DoubleSide,depthWrite:!1})),o=e.inner=new n.Mesh(ue,new n.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new n.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:he,fragmentShader:me,transparent:!0,side:n.DoubleSide,depthWrite:!1}));return t.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),e.add(t),e.add(o),e}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(i.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group);function q(r,i){return r+i*(Math.random()-.5)}function K(r,i){var e=new n.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new n.Vector3().addVectors(r,new n.Vector3().multiplyVectors(i,e))}function ee(r,i,e){return r*e+i*e*e/2}function De(r,i,e){return new n.Vector3(ee(r.x,i.x,e),ee(r.y,i.y,e),ee(r.z,i.z,e))}function le(r,i){for(var e=r.times.length,t=0;t<e&&i>r.times[t];)t++;if(t==0)return r.values[0];if(t==e)return r.values[e-1];var o=(i-r.times[t-1])/(r.times[t]-r.times[t-1]),u=r.values[t-1],a=r.values[t];return typeof r.values[0]=="number"?u+o*(a-u):u.clone().lerp(a,o)}var Re=(function(){function r(i,e,t,o,u,a,s,c,f,m,h,d,y,b){this.birthTime=i,this.deathAge=e,this.position=t.clone(),this.velocity=o.clone(),this.acceleration=u.clone(),this.angle=a,this.angleVelocity=s,this.angleAcceleration=c,this.color=f,this.colorTween=m,this.size=h,this.sizeTween=d,this.opacity=y,this.opacityTween=b}return r.prototype.getAlive=function(i){return this.deathAge>i-this.birthTime},r.prototype.getState=function(i){var e=this.getAlive(i),t=Math.min(this.deathAge,i-this.birthTime),o=De(this.velocity,this.acceleration,t).add(this.position),u=ee(this.angleVelocity,this.angleAcceleration,t)+this.angle,a=(this.sizeTween?le(this.sizeTween,t):0)+this.size,s=(this.colorTween?le(this.colorTween,t):new n.Vector3).add(this.color),c=new n.Color().setHSL(s.x,s.y,s.z),f=(this.opacityTween?le(this.opacityTween,t):0)+this.opacity;return{alive:e,age:t,position:o,angle:u,size:a,color:c,opacity:f}},r})(),Ne=`
489
+ `,S=new t.PlaneBufferGeometry(1,1,200,200);S.translate(0,-.5,0);var C=class extends t.Group{constructor(){super(),this.needsRender=!0;let e=this.outer=new t.Mesh(S,new t.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new t.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:x,fragmentShader:b,transparent:!0,side:t.DoubleSide,depthWrite:!1})),n=this.inner=new t.Mesh(S,new t.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new t.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:x,fragmentShader:b,transparent:!0,side:t.DoubleSide,depthWrite:!1}));e.rotateX(-Math.PI/2),n.rotateX(-Math.PI/2),this.add(e),this.add(n)}setTime(e){this.startTime===void 0&&(this.startTime=e);let t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0}get expand(){return this.outer.material.uniforms.uExpand.value}set expand(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0}get speed(){return this.inner.material.uniforms.speed.value}set speed(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0}get color(){return this.outer.material.uniforms.color.value}set color(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0}get flowColor(){return this.inner.material.uniforms.color.value}set flowColor(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0}};function w(e,t){return e+t*(Math.random()-.5)}function T(e,n){let r=new t.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new t.Vector3().addVectors(e,new t.Vector3().multiplyVectors(n,r))}function E(e,t,n){return e*n+t*n*n/2}function D(e,n,r){return new t.Vector3(E(e.x,n.x,r),E(e.y,n.y,r),E(e.z,n.z,r))}function O(e,t){let n=e.times.length,r=0;for(;r<n&&t>e.times[r];)r++;if(r==0)return e.values[0];if(r==n)return e.values[n-1];let i=(t-e.times[r-1])/(e.times[r]-e.times[r-1]),a=e.values[r-1],o=e.values[r];return typeof e.values[0]==`number`?a+i*(o-a):a.clone().lerp(o,i)}var k=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){this.birthTime=e,this.deathAge=t,this.position=n.clone(),this.velocity=r.clone(),this.acceleration=i.clone(),this.angle=a,this.angleVelocity=o,this.angleAcceleration=s,this.color=c,this.colorTween=l,this.size=u,this.sizeTween=d,this.opacity=f,this.opacityTween=p}getAlive(e){return this.deathAge>e-this.birthTime}getState(e){let n=this.getAlive(e),r=Math.min(this.deathAge,e-this.birthTime),i=D(this.velocity,this.acceleration,r).add(this.position),a=E(this.angleVelocity,this.angleAcceleration,r)+this.angle,o=(this.sizeTween?O(this.sizeTween,r):0)+this.size,s=(this.colorTween?O(this.colorTween,r):new t.Vector3).add(this.color);return{alive:n,age:r,position:i,angle:a,size:o,color:new t.Color().setHSL(s.x,s.y,s.z),opacity:(this.opacityTween?O(this.opacityTween,r):0)+this.opacity}}},A=`
490
490
  attribute vec3 color;
491
491
  attribute float opacity;
492
492
  attribute float size;
@@ -512,7 +512,7 @@ void main() {
512
512
  gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );
513
513
  gl_Position = projectionMatrix * mvPosition;
514
514
  }
515
- `,Oe=`
515
+ `,j=`
516
516
  varying vec4 vColor;
517
517
 
518
518
  #if defined(USE_MAP)
@@ -536,7 +536,7 @@ void main() {
536
536
  gl_FragColor = vColor * rotatedTexture;
537
537
  #endif
538
538
  }
539
- `,Ue=(function(r){Y(i,r);function i(e){var t=this,o,u,a,s,c,f,m,h,d,y,b,w,g,C,E,B,F,P,T,M,z,V,D,R,N,O,U,j,G,I,X,H,k,L,v,p,x,_,A=new n.BufferGeometry;A.setAttribute("position",new n.BufferAttribute(new Float32Array,3)),A.setAttribute("alive",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("color",new n.BufferAttribute(new Float32Array,3)),A.setAttribute("opacity",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("size",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("angle",new n.BufferAttribute(new Float32Array,1));var ne=new n.ShaderMaterial({uniforms:{map:{value:(o=e.texture)!==null&&o!==void 0?o:null}},defines:{USE_MAP:!!e.texture},vertexShader:Ne,fragmentShader:Oe,transparent:!0,blending:(u=e.blending)!==null&&u!==void 0?u:n.NormalBlending,depthWrite:!1});return t=r.call(this,A,ne)||this,t.instances=[],t.needsRender=!0,t.birthTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.positionBase=(s=(a=e.positionBase)===null||a===void 0?void 0:a.clone())!==null&&s!==void 0?s:new n.Vector3,t.positionStyle=(c=e.positionStyle)!==null&&c!==void 0?c:"CUBE",t.positionCubeSpread=(m=(f=e.positionCubeSpread)===null||f===void 0?void 0:f.clone())!==null&&m!==void 0?m:new n.Vector3,t.positionSphereSpread=(h=e.positionSphereSpread)!==null&&h!==void 0?h:0,t.velocityStyle=(d=e.velocityStyle)!==null&&d!==void 0?d:"CUBE",t.velocityCubeBase=(b=(y=e.velocityCubeBase)===null||y===void 0?void 0:y.clone())!==null&&b!==void 0?b:new n.Vector3,t.velocityCubeSpread=(g=(w=e.velocityCubeSpread)===null||w===void 0?void 0:w.clone())!==null&&g!==void 0?g:new n.Vector3,t.velocitySphereBase=(C=e.velocitySphereBase)!==null&&C!==void 0?C:0,t.velocitySphereSpread=(E=e.velocitySphereSpread)!==null&&E!==void 0?E:0,t.accelerationBase=(F=(B=e.accelerationBase)===null||B===void 0?void 0:B.clone())!==null&&F!==void 0?F:new n.Vector3,t.accelerationSpread=(T=(P=e.accelerationSpread)===null||P===void 0?void 0:P.clone())!==null&&T!==void 0?T:new n.Vector3,t.angleBase=(M=e.angleBase)!==null&&M!==void 0?M:0,t.angleSpread=(z=e.angleSpread)!==null&&z!==void 0?z:0,t.angleVelocityBase=(V=e.angleVelocityBase)!==null&&V!==void 0?V:0,t.angleVelocitySpread=(D=e.angleVelocitySpread)!==null&&D!==void 0?D:0,t.angleAccelerationBase=(R=e.angleAccelerationBase)!==null&&R!==void 0?R:0,t.angleAccelerationSpread=(N=e.angleAccelerationSpread)!==null&&N!==void 0?N:0,t.sizeBase=(O=e.sizeBase)!==null&&O!==void 0?O:.1,t.sizeSpread=(U=e.sizeSpread)!==null&&U!==void 0?U:0,t.sizeTween=(j=e.sizeTween)!==null&&j!==void 0?j:null,t.colorBase=(I=(G=e.colorBase)===null||G===void 0?void 0:G.clone())!==null&&I!==void 0?I:new n.Vector3,t.colorSpread=(H=(X=e.colorSpread)===null||X===void 0?void 0:X.clone())!==null&&H!==void 0?H:new n.Vector3,t.colorTween=(k=e.colorTween)!==null&&k!==void 0?k:null,t.opacityBase=((L=e.opacityBase)!==null&&L!==void 0?L:e.opacityTween)?0:1,t.opacitySpread=(v=e.opacitySpread)!==null&&v!==void 0?v:0,t.opacityTween=(p=e.opacityTween)!==null&&p!==void 0?p:null,t.particlesPerSecond=(x=e.particlesPerSecond)!==null&&x!==void 0?x:60,t.particleDeathAge=(_=e.particleDeathAge)!==null&&_!==void 0?_:1,t}return Object.defineProperty(i.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),i.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":{t=K(this.positionBase,this.positionCubeSpread);break}case"SPHERE":{var o=2*Math.random()-1,u=Math.PI*2*Math.random(),a=Math.sqrt(1-o*o),s=new n.Vector3(a*Math.cos(u),a*Math.sin(u),o);t=new n.Vector3().addVectors(this.positionBase,s.multiplyScalar(this.positionSphereSpread));break}}var c=new n.Vector3;switch(this.velocityStyle){case"CUBE":{c=K(this.velocityCubeBase,this.velocityCubeSpread);break}case"SPHERE":{var f=new n.Vector3().subVectors(t,this.positionBase),m=q(this.velocitySphereBase,this.velocitySphereSpread);c=f.normalize().multiplyScalar(m);break}}var h=new Re(e,this.particleDeathAge,t,c,K(this.accelerationBase,this.accelerationSpread),q(this.angleBase,this.angleSpread),q(this.angleVelocityBase,this.angleVelocitySpread),q(this.angleAccelerationBase,this.angleAccelerationSpread),K(this.colorBase,this.colorSpread),this.colorTween,q(this.sizeBase,this.sizeSpread),this.sizeTween,q(this.opacityBase,this.opacitySpread),this.opacityTween);return h},i.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)},i.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)},i.prototype.setTime=function(e){if(!this.disposed){e/=1e3;var t=e-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o){var u=new Float32Array(o*3);u.set(this.geometry.attributes.position.array,0);var a=new n.BufferAttribute(u,3);a.needsUpdate=!0,this.geometry.setAttribute("position",a)}if(this.geometry.attributes.alive.count<o){var s=new Float32Array(o);s.set(this.geometry.attributes.alive.array,0);var a=new n.BufferAttribute(s,1);a.needsUpdate=!0,this.geometry.setAttribute("alive",a)}if(this.geometry.attributes.color.count<o){var c=new Float32Array(o*3);c.set(this.geometry.attributes.color.array,0);var a=new n.BufferAttribute(c,3);a.needsUpdate=!0,this.geometry.setAttribute("color",a)}if(this.geometry.attributes.opacity.count<o){var f=new Float32Array(o);f.set(this.geometry.attributes.opacity.array,0);var a=new n.BufferAttribute(f,1);a.needsUpdate=!0,this.geometry.setAttribute("opacity",a)}if(this.geometry.attributes.size.count<o){var m=new Float32Array(o);m.set(this.geometry.attributes.size.array,0);var a=new n.BufferAttribute(m,1);a.needsUpdate=!0,this.geometry.setAttribute("size",a)}if(this.geometry.attributes.angle.count<o){var h=new Float32Array(o);h.set(this.geometry.attributes.angle.array,0);var a=new n.BufferAttribute(h,1);a.needsUpdate=!0,this.geometry.setAttribute("angle",a)}this.instances.length<o&&(this.instances.length=o);for(var d=0;d<this.instances.length;d++){var y=this.instances[d];if(d<o&&this.paused===!1&&(y===void 0||y.getAlive(e)===!1)){var b=this.particleDeathAge/o*d;if(t>b){var w=e-(t-b)%this.particleDeathAge;this.instances[d]=y=this.createInstance(w)}}if(y){var g=y.getState(e),u=g.position,s=g.alive,c=g.color,f=g.opacity,m=g.size,h=g.angle;this.geometry.attributes.position.setXYZ(d,u.x,u.y,u.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(d,s?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(d,c.r,c.g,c.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(d,f),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(d,m),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(d,h),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new n.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},i.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},i})(n.Points);function Z(r,i){return r+i*(Math.random()-.5)}function te(r,i){var e=new n.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new n.Vector3().addVectors(r,new n.Vector3().multiplyVectors(i,e))}var je=`
539
+ `,M=class extends t.Points{constructor(e){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,M,N,P,F,I,L,R,z,B,V;let H=new t.BufferGeometry;H.setAttribute(`position`,new t.BufferAttribute(new Float32Array,3)),H.setAttribute(`alive`,new t.BufferAttribute(new Float32Array,1)),H.setAttribute(`color`,new t.BufferAttribute(new Float32Array,3)),H.setAttribute(`opacity`,new t.BufferAttribute(new Float32Array,1)),H.setAttribute(`size`,new t.BufferAttribute(new Float32Array,1)),H.setAttribute(`angle`,new t.BufferAttribute(new Float32Array,1));let U=new t.ShaderMaterial({uniforms:{map:{value:(n=e.texture)==null?null:n}},defines:{USE_MAP:!!e.texture},vertexShader:A,fragmentShader:j,transparent:!0,blending:(r=e.blending)==null?t.NormalBlending:r,depthWrite:!1});super(H,U),this.instances=[],this.needsRender=!0,this.birthTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.positionBase=(a=(i=e.positionBase)==null?void 0:i.clone())==null?new t.Vector3:a,this.positionStyle=(o=e.positionStyle)==null?`CUBE`:o,this.positionCubeSpread=(c=(s=e.positionCubeSpread)==null?void 0:s.clone())==null?new t.Vector3:c,this.positionSphereSpread=(l=e.positionSphereSpread)==null?0:l,this.velocityStyle=(u=e.velocityStyle)==null?`CUBE`:u,this.velocityCubeBase=(f=(d=e.velocityCubeBase)==null?void 0:d.clone())==null?new t.Vector3:f,this.velocityCubeSpread=(m=(p=e.velocityCubeSpread)==null?void 0:p.clone())==null?new t.Vector3:m,this.velocitySphereBase=(h=e.velocitySphereBase)==null?0:h,this.velocitySphereSpread=(g=e.velocitySphereSpread)==null?0:g,this.accelerationBase=(v=(_=e.accelerationBase)==null?void 0:_.clone())==null?new t.Vector3:v,this.accelerationSpread=(b=(y=e.accelerationSpread)==null?void 0:y.clone())==null?new t.Vector3:b,this.angleBase=(x=e.angleBase)==null?0:x,this.angleSpread=(S=e.angleSpread)==null?0:S,this.angleVelocityBase=(C=e.angleVelocityBase)==null?0:C,this.angleVelocitySpread=(w=e.angleVelocitySpread)==null?0:w,this.angleAccelerationBase=(T=e.angleAccelerationBase)==null?0:T,this.angleAccelerationSpread=(E=e.angleAccelerationSpread)==null?0:E,this.sizeBase=(D=e.sizeBase)==null?.1:D,this.sizeSpread=(O=e.sizeSpread)==null?0:O,this.sizeTween=(k=e.sizeTween)==null?null:k,this.colorBase=(N=(M=e.colorBase)==null?void 0:M.clone())==null?new t.Vector3:N,this.colorSpread=(F=(P=e.colorSpread)==null?void 0:P.clone())==null?new t.Vector3:F,this.colorTween=(I=e.colorTween)==null?null:I,this.opacityBase=((L=e.opacityBase)==null?e.opacityTween:L)?0:1,this.opacitySpread=(R=e.opacitySpread)==null?0:R,this.opacityTween=(z=e.opacityTween)==null?null:z,this.particlesPerSecond=(B=e.particlesPerSecond)==null?60:B,this.particleDeathAge=(V=e.particleDeathAge)==null?1:V}get texture(){return this.material.uniforms.map.value}set texture(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}createInstance(e){let n=this.positionBase.clone();switch(this.positionStyle){case`CUBE`:n=T(this.positionBase,this.positionCubeSpread);break;case`SPHERE`:{let e=2*Math.random()-1,r=Math.PI*2*Math.random(),i=Math.sqrt(1-e*e),a=new t.Vector3(i*Math.cos(r),i*Math.sin(r),e);n=new t.Vector3().addVectors(this.positionBase,a.multiplyScalar(this.positionSphereSpread));break}default:break}let r=new t.Vector3;switch(this.velocityStyle){case`CUBE`:r=T(this.velocityCubeBase,this.velocityCubeSpread);break;case`SPHERE`:{let e=new t.Vector3().subVectors(n,this.positionBase),i=w(this.velocitySphereBase,this.velocitySphereSpread);r=e.normalize().multiplyScalar(i);break}default:break}return new k(e,this.particleDeathAge,n,r,T(this.accelerationBase,this.accelerationSpread),w(this.angleBase,this.angleSpread),w(this.angleVelocityBase,this.angleVelocitySpread),w(this.angleAccelerationBase,this.angleAccelerationSpread),T(this.colorBase,this.colorSpread),this.colorTween,w(this.sizeBase,this.sizeSpread),this.sizeTween,w(this.opacityBase,this.opacitySpread),this.opacityTween)}pause(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)}setTime(e){if(this.disposed)return;e/=1e3;let n=e-this.birthTime,r=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<r){let e=new Float32Array(r*3);e.set(this.geometry.attributes.position.array,0);let n=new t.BufferAttribute(e,3);n.needsUpdate=!0,this.geometry.setAttribute(`position`,n)}if(this.geometry.attributes.alive.count<r){let e=new Float32Array(r);e.set(this.geometry.attributes.alive.array,0);let n=new t.BufferAttribute(e,1);n.needsUpdate=!0,this.geometry.setAttribute(`alive`,n)}if(this.geometry.attributes.color.count<r){let e=new Float32Array(r*3);e.set(this.geometry.attributes.color.array,0);let n=new t.BufferAttribute(e,3);n.needsUpdate=!0,this.geometry.setAttribute(`color`,n)}if(this.geometry.attributes.opacity.count<r){let e=new Float32Array(r);e.set(this.geometry.attributes.opacity.array,0);let n=new t.BufferAttribute(e,1);n.needsUpdate=!0,this.geometry.setAttribute(`opacity`,n)}if(this.geometry.attributes.size.count<r){let e=new Float32Array(r);e.set(this.geometry.attributes.size.array,0);let n=new t.BufferAttribute(e,1);n.needsUpdate=!0,this.geometry.setAttribute(`size`,n)}if(this.geometry.attributes.angle.count<r){let e=new Float32Array(r);e.set(this.geometry.attributes.angle.array,0);let n=new t.BufferAttribute(e,1);n.needsUpdate=!0,this.geometry.setAttribute(`angle`,n)}this.instances.length<r&&(this.instances.length=r);for(let t=0;t<this.instances.length;t++){let i=this.instances[t];if(t<r&&this.paused===!1&&(i===void 0||i.getAlive(e)===!1)){let a=this.particleDeathAge/r*t;if(n>a){let r=e-(n-a)%this.particleDeathAge;this.instances[t]=i=this.createInstance(r)}}if(i){let{position:n,alive:r,color:a,opacity:o,size:s,angle:c}=i.getState(e);this.geometry.attributes.position.setXYZ(t,n.x,n.y,n.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(t,r?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(t,a.r,a.g,a.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(t,o),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(t,s),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(t,c),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new t.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};function N(e,t){return e+t*(Math.random()-.5)}function P(e,n){let r=new t.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new t.Vector3().addVectors(e,new t.Vector3().multiplyVectors(n,r))}var F=`
540
540
  // 粒子初始属性
541
541
  attribute vec3 initialVelocity;
542
542
  attribute vec3 acceleration;
@@ -613,7 +613,7 @@ void main() {
613
613
  gl_PointSize = currentSize * (300.0 / length(mvPosition.xyz));
614
614
  gl_Position = projectionMatrix * mvPosition;
615
615
  }
616
- `,Ge=`
616
+ `,I=`
617
617
  varying vec4 vColor;
618
618
  varying float vAngle;
619
619
 
@@ -643,4 +643,4 @@ void main() {
643
643
  gl_FragColor = vColor * textureColor;
644
644
  #endif
645
645
  }
646
- `,Ie=(function(r){Y(i,r);function i(e){for(var t=this,o,u,a,s,c,f,m,h,d,y,b,w,g,C,E,B,F,P,T,M,z,V,D,R,N,O,U,j,G,I,X,H,k,L,v=Math.ceil(((o=e.particlesPerSecond)!==null&&o!==void 0?o:60)*((u=e.particleDeathAge)!==null&&u!==void 0?u:1)),p=new n.BufferGeometry,x=new Float32Array(v*3),_=new Float32Array(v*3),A=new Float32Array(v*3),ne=new Float32Array(v),ye=new Float32Array(v),ge=new Float32Array(v),be=new Float32Array(v),ie=new Float32Array(v*3),Ae=new Float32Array(v),Se=new Float32Array(v),we=new Float32Array(v),xe=new Float32Array(v),l=0;l<v;l++){var Xe=((a=e.particleDeathAge)!==null&&a!==void 0?a:1)/v*l;ne[l]=Xe,ye[l]=(s=e.particleDeathAge)!==null&&s!==void 0?s:1,xe[l]=l;var W=(f=(c=e.positionBase)===null||c===void 0?void 0:c.clone())!==null&&f!==void 0?f:new n.Vector3;switch((m=e.positionStyle)!==null&&m!==void 0?m:"CUBE"){case"CUBE":{W=te((h=e.positionBase)!==null&&h!==void 0?h:new n.Vector3,(d=e.positionCubeSpread)!==null&&d!==void 0?d:new n.Vector3);break}case"SPHERE":{var se=2*Math.random()-1,_e=Math.PI*2*Math.random(),Ce=Math.sqrt(1-se*se),He=new n.Vector3(Ce*Math.cos(_e),Ce*Math.sin(_e),se);W=new n.Vector3().addVectors((y=e.positionBase)!==null&&y!==void 0?y:new n.Vector3,He.multiplyScalar((b=e.positionSphereSpread)!==null&&b!==void 0?b:0));break}}x[l*3]=W.x,x[l*3+1]=W.y,x[l*3+2]=W.z;var J=new n.Vector3;switch((w=e.velocityStyle)!==null&&w!==void 0?w:"CUBE"){case"CUBE":{J=te((g=e.velocityCubeBase)!==null&&g!==void 0?g:new n.Vector3,(C=e.velocityCubeSpread)!==null&&C!==void 0?C:new n.Vector3);break}case"SPHERE":{var ke=new n.Vector3().subVectors(W,(E=e.positionBase)!==null&&E!==void 0?E:new n.Vector3),Le=Z((B=e.velocitySphereBase)!==null&&B!==void 0?B:0,(F=e.velocitySphereSpread)!==null&&F!==void 0?F:0);J=ke.normalize().multiplyScalar(Le);break}}_[l*3]=J.x,_[l*3+1]=J.y,_[l*3+2]=J.z;var ce=te((P=e.accelerationBase)!==null&&P!==void 0?P:new n.Vector3,(T=e.accelerationSpread)!==null&&T!==void 0?T:new n.Vector3);A[l*3]=ce.x,A[l*3+1]=ce.y,A[l*3+2]=ce.z,ge[l]=Z((M=e.sizeBase)!==null&&M!==void 0?M:.1,(z=e.sizeSpread)!==null&&z!==void 0?z:0),be[l]=(V=e.sizeGrowth)!==null&&V!==void 0?V:0;var de=te((D=e.colorBase)!==null&&D!==void 0?D:new n.Vector3,(R=e.colorSpread)!==null&&R!==void 0?R:new n.Vector3);ie[l*3]=de.x,ie[l*3+1]=de.y,ie[l*3+2]=de.z,Ae[l]=Z((N=e.opacityBase)!==null&&N!==void 0?N:1,(O=e.opacitySpread)!==null&&O!==void 0?O:0),Se[l]=Z((U=e.angleBase)!==null&&U!==void 0?U:0,(j=e.angleSpread)!==null&&j!==void 0?j:0),we[l]=Z((G=e.angleVelocityBase)!==null&&G!==void 0?G:0,(I=e.angleVelocitySpread)!==null&&I!==void 0?I:0)}p.setAttribute("position",new n.BufferAttribute(x,3)),p.setAttribute("initialVelocity",new n.BufferAttribute(_,3)),p.setAttribute("acceleration",new n.BufferAttribute(A,3)),p.setAttribute("birthTime",new n.BufferAttribute(ne,1)),p.setAttribute("lifeTime",new n.BufferAttribute(ye,1)),p.setAttribute("initialSize",new n.BufferAttribute(ge,1)),p.setAttribute("sizeGrowth",new n.BufferAttribute(be,1)),p.setAttribute("initialColor",new n.BufferAttribute(ie,3)),p.setAttribute("initialOpacity",new n.BufferAttribute(Ae,1)),p.setAttribute("initialAngle",new n.BufferAttribute(Se,1)),p.setAttribute("angleVelocity",new n.BufferAttribute(we,1)),p.setAttribute("particleIndex",new n.BufferAttribute(xe,1));var qe=new n.ShaderMaterial({uniforms:{map:{value:(X=e.texture)!==null&&X!==void 0?X:null},uTime:{value:0}},defines:{USE_MAP:!!e.texture},vertexShader:je,fragmentShader:Ge,transparent:!0,blending:(H=e.blending)!==null&&H!==void 0?H:n.NormalBlending,depthWrite:!1});return t=r.call(this,p,qe)||this,t.needsRender=!0,t.startTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.particleCount=v,t.particlesPerSecond=(k=e.particlesPerSecond)!==null&&k!==void 0?k:60,t.particleDeathAge=(L=e.particleDeathAge)!==null&&L!==void 0?L:1,t}return Object.defineProperty(i.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),i.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.startTime=Date.now()/1e3)},i.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.startTime=Date.now()/1e3)},i.prototype.setTime=function(e){if(!(this.disposed||this.paused)){var t=e/1e3,o=t-this.startTime;this.material.uniforms.uTime.value=o,this.needsRender=!0}},i.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},i})(n.Points);S.Airflow=Ve,S.Flame=Pe,S.Particle=Ue,S.ParticleGPU=Ie,S.SpotLight=ze,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
646
+ `,L=class extends t.Points{constructor(e){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,L,R,z;let B=Math.ceil(((n=e.particlesPerSecond)==null?60:n)*((r=e.particleDeathAge)==null?1:r)),V=new t.BufferGeometry,H=new Float32Array(B*3),U=new Float32Array(B*3),W=new Float32Array(B*3),G=new Float32Array(B),K=new Float32Array(B),q=new Float32Array(B),J=new Float32Array(B),Y=new Float32Array(B*3),X=new Float32Array(B),Z=new Float32Array(B),Q=new Float32Array(B),$=new Float32Array(B);for(let n=0;n<B;n++){G[n]=((i=e.particleDeathAge)==null?1:i)/B*n,K[n]=(a=e.particleDeathAge)==null?1:a,$[n]=n;let r=(s=(o=e.positionBase)==null?void 0:o.clone())==null?new t.Vector3:s;switch((c=e.positionStyle)==null?`CUBE`:c){case`CUBE`:r=P((l=e.positionBase)==null?new t.Vector3:l,(u=e.positionCubeSpread)==null?new t.Vector3:u);break;case`SPHERE`:{let n=2*Math.random()-1,i=Math.PI*2*Math.random(),a=Math.sqrt(1-n*n),o=new t.Vector3(a*Math.cos(i),a*Math.sin(i),n);r=new t.Vector3().addVectors((d=e.positionBase)==null?new t.Vector3:d,o.multiplyScalar((f=e.positionSphereSpread)==null?0:f));break}}H[n*3]=r.x,H[n*3+1]=r.y,H[n*3+2]=r.z;let M=new t.Vector3;switch((p=e.velocityStyle)==null?`CUBE`:p){case`CUBE`:M=P((m=e.velocityCubeBase)==null?new t.Vector3:m,(h=e.velocityCubeSpread)==null?new t.Vector3:h);break;case`SPHERE`:{let n=new t.Vector3().subVectors(r,(g=e.positionBase)==null?new t.Vector3:g),i=N((_=e.velocitySphereBase)==null?0:_,(v=e.velocitySphereSpread)==null?0:v);M=n.normalize().multiplyScalar(i);break}}U[n*3]=M.x,U[n*3+1]=M.y,U[n*3+2]=M.z;let F=P((y=e.accelerationBase)==null?new t.Vector3:y,(b=e.accelerationSpread)==null?new t.Vector3:b);W[n*3]=F.x,W[n*3+1]=F.y,W[n*3+2]=F.z,q[n]=N((x=e.sizeBase)==null?.1:x,(S=e.sizeSpread)==null?0:S),J[n]=(C=e.sizeGrowth)==null?0:C;let I=P((w=e.colorBase)==null?new t.Vector3:w,(T=e.colorSpread)==null?new t.Vector3:T);Y[n*3]=I.x,Y[n*3+1]=I.y,Y[n*3+2]=I.z,X[n]=N((E=e.opacityBase)==null?1:E,(D=e.opacitySpread)==null?0:D),Z[n]=N((O=e.angleBase)==null?0:O,(k=e.angleSpread)==null?0:k),Q[n]=N((A=e.angleVelocityBase)==null?0:A,(j=e.angleVelocitySpread)==null?0:j)}V.setAttribute(`position`,new t.BufferAttribute(H,3)),V.setAttribute(`initialVelocity`,new t.BufferAttribute(U,3)),V.setAttribute(`acceleration`,new t.BufferAttribute(W,3)),V.setAttribute(`birthTime`,new t.BufferAttribute(G,1)),V.setAttribute(`lifeTime`,new t.BufferAttribute(K,1)),V.setAttribute(`initialSize`,new t.BufferAttribute(q,1)),V.setAttribute(`sizeGrowth`,new t.BufferAttribute(J,1)),V.setAttribute(`initialColor`,new t.BufferAttribute(Y,3)),V.setAttribute(`initialOpacity`,new t.BufferAttribute(X,1)),V.setAttribute(`initialAngle`,new t.BufferAttribute(Z,1)),V.setAttribute(`angleVelocity`,new t.BufferAttribute(Q,1)),V.setAttribute(`particleIndex`,new t.BufferAttribute($,1));let ee=new t.ShaderMaterial({uniforms:{map:{value:(M=e.texture)==null?null:M},uTime:{value:0}},defines:{USE_MAP:!!e.texture},vertexShader:F,fragmentShader:I,transparent:!0,blending:(L=e.blending)==null?t.NormalBlending:L,depthWrite:!1});super(V,ee),this.needsRender=!0,this.startTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.particleCount=B,this.particlesPerSecond=(R=e.particlesPerSecond)==null?60:R,this.particleDeathAge=(z=e.particleDeathAge)==null?1:z}get texture(){return this.material.uniforms.map.value}set texture(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}pause(){this.paused!==!0&&(this.paused=!0,this.startTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.startTime=Date.now()/1e3)}setTime(e){if(this.disposed||this.paused)return;let t=e/1e3-this.startTime;this.material.uniforms.uTime.value=t,this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};e.Airflow=C,e.Flame=g,e.Particle=M,e.ParticleGPU=L,e.SpotLight=y});
package/umd/five-vue.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 3/12/2026
5
- * Version: 6.8.0-alpha.16
4
+ * Generated: 3/17/2026
5
+ * Version: 6.8.0-alpha.18
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(u,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","@realsee/five","three"],t):(u=typeof globalThis!="undefined"?globalThis:u||self,t(u.FiveSDK_Vue={},u.Vue,u.FiveSDK,u.THREE))})(this,(function(u,t,p,O){"use strict";function P(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const d=P(O);var g=function(){return g=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var f in r)Object.prototype.hasOwnProperty.call(r,f)&&(n[f]=r[f])}return n},g.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var b=!1;function U(e){b=e}var F=Symbol();function s(){var e=t.inject(F);if(!e)throw new Error("Inject five error!");return e}var W={display:"inline-block",overflow:"hidden"},_=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var n=t.toRef(e,"width"),r=t.toRef(e,"height"),o=s(),a=t.ref(null);return t.watch([n,r,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=n.value/r.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(n.value,r.value),o.refresh({width:n.value,height:r.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(n.value,"px"),height:"".concat(r.value,"px")},W),ref:a})}}}),m=[],w=[];function D(e){var n=e===void 0?{}:e,r=n.backgroundColor,o=r===void 0?1579548:r,a=n.backgroundAlpha,f=a===void 0?1:a,i=n.preserveDrawingBuffer,c=i===void 0?!0:i,l=n.pixelRatio,h=l===void 0?1:l,k=n.webgl2,j=k===void 0?!1:k;if(typeof window!="undefined"){var v=null;if(j?v=m.shift():v=w.shift(),!v){if(j){var E=document.createElement("canvas"),B=E.getContext("webgl2");B?v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!0,alpha:!0,stencil:!0,canvas:E,context:B}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0}))}else v=new d.WebGLRenderer({preserveDrawingBuffer:c,antialias:!1,alpha:!0,stencil:!0});v.outputEncoding=d.sRGBEncoding}return v.setPixelRatio(h),v.setClearColor(o,f),v.autoClear=!0,v}}function A(e){if(e){var n=e.capabilities.isWebGL2;n?w.indexOf(e)===-1&&w.push(e):m.indexOf(e)===-1&&m.push(e)}}function L(e,n){var r=Array.isArray(e)?e:[e],o=Array.isArray(n)?n:[n];if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==o[a])return!1;return!0}var I=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var n,r=t.toRefs(e).works,o=p.getViewportScale(),a=o===1?window.devicePixelRatio:1,f=D({pixelRatio:a}),i=new p.Five(g({renderer:f},e.fiveInitArgs)),c=e.works||e.initialWorks;return c&&i.load(c,e.initialState,void 0,(n=e.initialUserAction)!==null&&n!==void 0?n:!0),U(!!e.works),r&&t.watch(r,function(l,h){l&&!L(l,i.works)&&i.load(l,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),A(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(l,h){e.onStateChange&&e.onStateChange(l,h)}),i.on("currentStateChange",function(l,h){e.onCurrentStateChange&&e.onCurrentStateChange(l,h)}),i.on("error",function(l){e.onError?e.onError(l):console.warn(l.message)}),t.provide(F,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function V(){var e=s(),n=t.ref(e.works),r=t.readonly(n),o=function(f,i,c,l){if(b)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(f,i,c,l)},a=e.on("load",function(){n.value=e.works});return t.onBeforeUnmount(function(){a()}),[r,o]}function H(){var e=s(),n=t.ref(g({},e.state)),r=e.on("stateChange",function(a){Object.assign(n.value,g({},a))});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){f===void 0&&(f=!1),i===void 0&&(i=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function M(){var e=s(),n=t.ref(e.getCurrentState()),r=e.on("currentStateChange",function(){Object.assign(n.value,e.getCurrentState())});t.onBeforeUnmount(function(){r()});var o=function(a,f,i){var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,f,i)};return[n,o]}function T(){var e=s(),n=t.reactive(e.getCurrentState()),r=t.ref(e.works.getObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(n,e.getCurrentState()),r.value=e.works.getObserver({workCode:n.workCode,panoIndex:n.panoIndex})});return t.onBeforeUnmount(function(){o()}),r}function q(e,n){var r=s(),o=r.on(e,n);t.onBeforeUnmount(function(){o()})}function N(){var e=s(),n=function(c,l){return e.updateCamera(c,l)},r=e.getPixels.bind(e),o=function(c){return e.render(c)},a=function(){return e.needsRender=!0},f=function(c,l){return e.preloadPano(c,l)},i=function(c,l){return l===void 0&&(l=!1),e.project2d(c,l)};return{updateCamera:n,getPixels:r,render:o,needsRender:a,preloadPano:f,project2d:i}}function x(e,n){n===void 0&&(n=!1);var r=s(),o=t.ref(Symbol()),a=t.shallowRef(e?r.project2d(t.isRef(e)?e.value:e,n):null),f=r.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){f()}),t.watch([o,e],function(){a.value=r.project2d(t.isRef(e)?e.value:e,n)}),a}function G(){return x}function C(e){var n=e.camera.getWorldDirection(new d.Vector3),r=new d.Raycaster(e.camera.position,n);return r}function K(){var e=s(),n=t.shallowRef(C(e)),r=e.on("cameraUpdate",function(){n.value=C(e)});return t.onBeforeUnmount(function(){r()}),n}function y(e){return e.camera.getWorldDirection(new d.Vector3)}function $(){var e=s(),n=t.shallowRef(y(e)),r=e.on("cameraUpdate",function(){n.value=y(e)});return t.onBeforeUnmount(function(){r()}),n}function z(e){var n=s(),r=t.shallowRef([]);return t.watch(e,function(){r.value=n.model.intersectRaycaster(t.isRef(e)?e.value:e)}),r}function J(){return z}function S(e){return e.model.empty?"Empty":"Loaded"}function Q(){var e=s(),n=t.ref(S(e)),r=e.on("modelLoaded",function(){n.value=S(e)});return t.onBeforeUnmount(function(){r()}),n}function X(){var e=s(),n=t.ref(e.model.shownFloor),r=t.ref(e.model.floorLength),o=function(f){typeof f=="number"?e.model.show(f):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){n.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){r.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var f;f=a.shift();)f()}),[n,r,o]}function Y(){var e=s(),n=t.ref(e.helperVisible),r=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){n.value=a});return t.onBeforeUnmount(function(){o()}),[n,r]}function Z(){return s()}function R(e){return e.model.bounding.clone()}function ee(){var e=s(),n=t.shallowRef(R(e)),r=e.on("modelLoaded",function(){n.value=R(e)});return t.onBeforeUnmount(function(){r()}),n}function ne(){var e=s();return e.scene}function re(){var e=s(),n=t.shallowRef(e.model),r=e.on("modelLoaded",function(){n.value=e.model});return t.onBeforeUnmount(function(){r()}),n}u.FiveCanvas=_,u.FiveProvider=I,u.unsafe__useFiveInject=Z,u.useFiveAction=N,u.useFiveCameraDirection=$,u.useFiveCameraRaycaster=K,u.useFiveCurrentObserver=T,u.useFiveCurrentState=M,u.useFiveEventCallback=q,u.useFiveFloor=X,u.useFiveHelper=Y,u.useFiveModel=re,u.useFiveModelBounding=ee,u.useFiveModelIntersectRaycaster=J,u.useFiveModelReadyState=Q,u.useFiveProject2d=G,u.useFiveScene=ne,u.useFiveState=H,u.useFiveWorks=V,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
255
+ */(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`@realsee/five`),require(`three`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@realsee/five`,`three`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.FiveSDK_Vue={},e.Vue,e.FiveSDK,e.THREE))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e};r=((e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)))(r);var d=!1;function f(e){d=e}var p=Symbol();function m(){let e=(0,t.inject)(p);if(!e)throw Error(`Inject five error!`);return e}var h={display:`inline-block`,overflow:`hidden`},g=(0,t.defineComponent)({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup(e){let n=(0,t.toRef)(e,`width`),r=(0,t.toRef)(e,`height`),i=m(),a=(0,t.ref)(null);return(0,t.watch)([n,r,a],()=>{if(i.renderer&&a.value){if(i.renderer.domElement.parentNode!==null&&i.renderer.domElement.parentNode!==a.value)throw Error(`There are more than 2 fiveCanvas in this context.`);i.renderer.domElement.parentNode!==a.value&&a.value.appendChild(i.renderer.domElement),i.camera.aspect=n.value/r.value,i.camera.updateProjectionMatrix(),i.renderer.setSize(n.value,r.value),i.refresh({width:n.value,height:r.value}),i.needsRender=!0}}),()=>(0,t.h)(`div`,{id:`five`,style:Object.assign({width:`${n.value}px`,height:`${r.value}px`},h),ref:a})}}),_=[],v=[];function y({backgroundColor:e=1579548,backgroundAlpha:t=1,preserveDrawingBuffer:n=!0,pixelRatio:i=1,webgl2:a=!1}={}){if(typeof window>`u`)return;let o=null;if(o=a?_.shift():v.shift(),!o){if(a){let e=document.createElement(`canvas`),t=e.getContext(`webgl2`);t?o=new r.WebGLRenderer({preserveDrawingBuffer:n,antialias:!0,alpha:!0,stencil:!0,canvas:e,context:t}):(console.error(`error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl.`),o=new r.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0}))}else o=new r.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0});o.outputEncoding=r.sRGBEncoding}return o.setPixelRatio(i),o.setClearColor(e,t),o.autoClear=!0,o}function b(e){e&&(e.capabilities.isWebGL2?v.indexOf(e)===-1&&v.push(e):_.indexOf(e)===-1&&_.push(e))}function x(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var S=(0,t.defineComponent)({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:()=>({})},style:Object},setup(e){var r;let{works:i}=(0,t.toRefs)(e),a=y({pixelRatio:(0,n.getViewportScale)()===1?window.devicePixelRatio:1}),o=new n.Five(Object.assign({renderer:a},e.fiveInitArgs)),s=e.works||e.initialWorks;return s&&o.load(s,e.initialState,void 0,(r=e.initialUserAction)==null?!0:r),f(!!e.works),i&&(0,t.watch)(i,(t,n)=>{t&&!x(t,o.works)&&o.load(t,e.initialState)}),(0,t.onBeforeUnmount)(()=>{o&&(o.dispose(),b(o.renderer))}),o.on(`load`,()=>{e.onWorksChange&&o.works&&e.onWorksChange(o==null?void 0:o.works)}),o.on(`stateChange`,(t,n)=>{e.onStateChange&&e.onStateChange(t,n)}),o.on(`currentStateChange`,(t,n)=>{e.onCurrentStateChange&&e.onCurrentStateChange(t,n)}),o.on(`error`,t=>{e.onError?e.onError(t):console.warn(t.message)}),(0,t.provide)(p,o),{five:(0,t.shallowReadonly)(o)}},render(){return(0,t.h)(`div`,{style:this.$props.style},this.$slots)}});function C(){let e=m(),n=(0,t.ref)(e.works),r=(0,t.readonly)(n),i=(t,n,r,i)=>{if(d)throw Error(`props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.`);return e.load(t,n,r,i)},a=e.on(`load`,()=>{n.value=e.works});return(0,t.onBeforeUnmount)(()=>{a()}),[r,i]}function w(){let e=m(),n=(0,t.ref)(Object.assign({},e.state)),r=e.on(`stateChange`,e=>{Object.assign(n.value,Object.assign({},e))});return(0,t.onBeforeUnmount)(()=>{r()}),[n,(t,n=!1,r=!0)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function T(){let e=m(),n=(0,t.ref)(e.getCurrentState()),r=e.on(`currentStateChange`,()=>{Object.assign(n.value,e.getCurrentState())});return(0,t.onBeforeUnmount)(()=>{r()}),[n,(t,n,r)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function E(){let e=m(),n=(0,t.reactive)(e.getCurrentState()),r=(0,t.ref)(e.works.getObserver(e.pano)),i=e.on(`currentStateChange`,()=>{Object.assign(n,e.getCurrentState()),r.value=e.works.getObserver({workCode:n.workCode,panoIndex:n.panoIndex})});return(0,t.onBeforeUnmount)(()=>{i()}),r}function D(e,n){let r=m().on(e,n);(0,t.onBeforeUnmount)(()=>{r()})}function O(){let e=m();return{updateCamera:(t,n)=>e.updateCamera(t,n),getPixels:e.getPixels.bind(e),render:t=>e.render(t),needsRender:()=>e.needsRender=!0,preloadPano:(t,n)=>e.preloadPano(t,n),project2d:(t,n=!1)=>e.project2d(t,n)}}function k(e,n=!1){let r=m(),i=(0,t.ref)(Symbol()),a=(0,t.shallowRef)(e?r.project2d((0,t.isRef)(e)?e.value:e,n):null),o=r.on(`cameraUpdate`,()=>{i.value=Symbol()});return(0,t.onBeforeUnmount)(()=>{o()}),(0,t.watch)([i,e],()=>{a.value=r.project2d((0,t.isRef)(e)?e.value:e,n)}),a}function A(){return k}function j(e){let t=e.camera.getWorldDirection(new r.Vector3);return new r.Raycaster(e.camera.position,t)}function M(){let e=m(),n=(0,t.shallowRef)(j(e)),r=e.on(`cameraUpdate`,()=>{n.value=j(e)});return(0,t.onBeforeUnmount)(()=>{r()}),n}function N(e){return e.camera.getWorldDirection(new r.Vector3)}function P(){let e=m(),n=(0,t.shallowRef)(N(e)),r=e.on(`cameraUpdate`,()=>{n.value=N(e)});return(0,t.onBeforeUnmount)(()=>{r()}),n}function F(e){let n=m(),r=(0,t.shallowRef)([]);return(0,t.watch)(e,()=>{r.value=n.model.intersectRaycaster((0,t.isRef)(e)?e.value:e)}),r}function I(){return F}function L(e){return e.model.empty?`Empty`:`Loaded`}function R(){let e=m(),n=(0,t.ref)(L(e)),r=e.on(`modelLoaded`,()=>{n.value=L(e)});return(0,t.onBeforeUnmount)(()=>{r()}),n}function z(){let e=m(),n=(0,t.ref)(e.model.shownFloor),r=(0,t.ref)(e.model.floorLength),i=t=>{typeof t==`number`?e.model.show(t):e.model.show()},a=[];return a.push(e.on(`modelShownFloorChange`,()=>{n.value=e.model.shownFloor})),a.push(e.on(`modelLoaded`,()=>{r.value=e.model.floorLength})),(0,t.onBeforeUnmount)(()=>{let e;for(;e=a.shift();)e()}),[n,r,i]}function B(){let e=m(),n=(0,t.ref)(e.helperVisible),r=t=>{e.helperVisible=t},i=e.on(`helpersVisibleChange`,e=>{n.value=e});return(0,t.onBeforeUnmount)(()=>{i()}),[n,r]}function V(){return m()}function H(e){return e.model.bounding.clone()}function U(){let e=m(),n=(0,t.shallowRef)(H(e)),r=e.on(`modelLoaded`,()=>{n.value=H(e)});return(0,t.onBeforeUnmount)(()=>{r()}),n}function W(){return m().scene}function G(){let e=m(),n=(0,t.shallowRef)(e.model),r=e.on(`modelLoaded`,()=>{n.value=e.model});return(0,t.onBeforeUnmount)(()=>{r()}),n}e.FiveCanvas=g,e.FiveProvider=S,e.unsafe__useFiveInject=V,e.useFiveAction=O,e.useFiveCameraDirection=P,e.useFiveCameraRaycaster=M,e.useFiveCurrentObserver=E,e.useFiveCurrentState=T,e.useFiveEventCallback=D,e.useFiveFloor=z,e.useFiveHelper=B,e.useFiveModel=G,e.useFiveModelBounding=U,e.useFiveModelIntersectRaycaster=I,e.useFiveModelReadyState=R,e.useFiveProject2d=A,e.useFiveScene=W,e.useFiveState=w,e.useFiveWorks=C});