shop-components 0.1.51 → 0.1.52

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.
@@ -62580,7 +62580,7 @@ class vK extends Ie {
62580
62580
  ));
62581
62581
  }
62582
62582
  setShapeKey(A, e) {
62583
- this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = setTimeout(() => {
62583
+ this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = window.setTimeout(() => {
62584
62584
  this._container.traverse((t) => {
62585
62585
  if (!Object.keys(t.morphTargetDictionary || {}).includes(A))
62586
62586
  return;
@@ -65080,66 +65080,66 @@ class cH {
65080
65080
  metalness: 0.6,
65081
65081
  roughness: 0.3
65082
65082
  })
65083
- ), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._drag = (t) => {
65084
- this._dragging = !0, this._pointermove(t);
65085
- }, this._dragend = (t) => {
65083
+ ), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._drag = (i) => {
65084
+ this._dragging = !0, this._pointermove(i);
65085
+ }, this._dragend = (i) => {
65086
65086
  this._dragging = !1;
65087
- }, this._pointermove = (t) => {
65087
+ }, this._pointermove = (i) => {
65088
65088
  if (this._pointerDownTimeout)
65089
65089
  return clearTimeout(this._pointerDownTimeout), this._pointerDownTimeout = 0;
65090
- const { top: i, left: r } = this.renderer.domElement.getBoundingClientRect();
65091
- this.offset.set(r, i), this.mousePos.set(t.clientX - r, t.clientY - i), this.mouseCoord.set(
65092
- (t.clientX - r) / this.size.x * 2 - 1,
65093
- -((t.clientY - i) / this.size.y) * 2 + 1
65090
+ const { top: r, left: s } = this.renderer.domElement.getBoundingClientRect();
65091
+ this.offset.set(s, r), this.mousePos.set(i.clientX - s, i.clientY - r), this.mouseCoord.set(
65092
+ (i.clientX - s) / this.size.x * 2 - 1,
65093
+ -((i.clientY - r) / this.size.y) * 2 + 1
65094
65094
  ), this._raycaster.setFromCamera(this.mouseCoord, this.camera);
65095
- }, this._pointerdown = (t) => {
65096
- const i = () => {
65097
- let r = [...this._outlinePass.selectedObjects];
65098
- this._outlinePass.selectedObjects = [], this.amr.slots.forEach((a) => a.selected = !1);
65099
- const o = this._raycaster.intersectObjects(this.amr.slots, !0)[0];
65100
- o && this.amr.slots.forEach((a) => {
65101
- a.traverse((l) => {
65102
- l == o.object ? r != null && r.includes(a) ? (r = void 0, a.deviceSelected = !1) : (this._outlinePass.selectedObjects = [a], a.deviceSelected = !0) : a.deviceSelected = !1;
65095
+ }, this._pointerdown = (i) => {
65096
+ const r = () => {
65097
+ let s = [...this._outlinePass.selectedObjects];
65098
+ this._outlinePass.selectedObjects = [], this.amr.slots.forEach((l) => l.selected = !1);
65099
+ const a = this._raycaster.intersectObjects(this.amr.slots, !0)[0];
65100
+ a && this.amr.slots.forEach((l) => {
65101
+ l.traverse((u) => {
65102
+ u == a.object ? s != null && s.includes(l) ? (s = void 0, l.deviceSelected = !1) : (this._outlinePass.selectedObjects = [l], l.deviceSelected = !0) : l.deviceSelected = !1;
65103
65103
  });
65104
65104
  }), this._pointerDownTimeout = 0;
65105
65105
  };
65106
- this._pointerDownTimeout = window.setTimeout(i, 200);
65106
+ this._pointerDownTimeout = window.setTimeout(r, 200);
65107
65107
  }, this._detectTrackpad = () => {
65108
65108
  la || typeof la < "u" || (vf === 0 && (U0 = performance.now()), vf++, performance.now() - U0 > 66 && (vf > 5 ? la = !0 : la = !1, la ? this.controls.zoomSpeed = 0.2 : this.controls.zoomSpeed = 1, setTimeout(jF, 2e3)));
65109
65109
  }, this.fit = () => {
65110
65110
  new ve().setFromObject(this._container);
65111
- const i = this.amr.sizeBox.size.getSize(new O()), r = i.clone().multiplyScalar(0.5);
65112
- let s = Math.max(i.x, i.y, i.z) + Math.max(i.x, i.y);
65113
- const o = _R(this.camera.fov, 0.8) * 3 - 1.2;
65114
- s += o;
65115
- const a = Math.min(i.x, i.y, i.z) + 0.5, u = this.camera.position.clone().normalize().multiplyScalar(s);
65116
- u.setY(s * Math.sin(30 / 180 * Math.PI)), this._fitAnimation = new fd(this.camera.position).to(u, 600).easing(Ds.Easing.Quintic.InOut).onStart(() => {
65111
+ const r = this.amr.sizeBox.size.getSize(new O()), s = r.clone().multiplyScalar(0.5);
65112
+ let o = Math.max(r.x, r.y, r.z) + Math.max(r.x, r.y);
65113
+ const a = _R(this.camera.fov, 0.8) * 3 - 1.2;
65114
+ o += a;
65115
+ const l = Math.min(r.x, r.y, r.z) + 0.5, c = this.camera.position.clone().normalize().multiplyScalar(o);
65116
+ c.setY(o * Math.sin(30 / 180 * Math.PI)), this._fitAnimation = new fd(this.camera.position).to(c, 600).easing(Ds.Easing.Quintic.InOut).onStart(() => {
65117
65117
  this.controls.enabled = !1;
65118
65118
  }).onComplete(() => {
65119
65119
  this.controls.enabled = !0;
65120
- }).start(), this.controls.minDistance = a, this.controls.maxDistance = s * 2.5, !r.equals(new O()) && (r.setZ(0), this.controls.target.setY(r.y));
65120
+ }).start(), this.controls.minDistance = l, this.controls.maxDistance = o * 2.5, !s.equals(new O()) && (s.setZ(0), this.controls.target.setY(s.y));
65121
65121
  }, this.resize = () => {
65122
- var a;
65123
- const t = this.renderer.domElement.parentElement;
65124
- if (!t)
65122
+ var l;
65123
+ const i = this.renderer.domElement.parentElement;
65124
+ if (!i)
65125
65125
  return;
65126
- t.style.display = "flex", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.flexGrow = "1";
65127
- const i = t.clientWidth, r = t.clientHeight;
65128
- this.size.set(i, r), this.camera.aspect = i / r, this.camera.updateProjectionMatrix(), this.css2dRenderer.setSize(i, r);
65129
- const s = this.renderer.getPixelRatio();
65130
- (a = this.pathTracer) == null || a.updateCamera(), this.sampleCount = 0, this.renderer.setSize(i, r), this._composer.setSize(i, r), this._composer.passes.forEach((l) => l.setSize(i, r));
65131
- const o = this._fxaaPass.material.uniforms;
65132
- o.resolution.value.x = 1 / (i * s), o.resolution.value.y = 1 / (r * s);
65126
+ i.style.display = "flex", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.flexGrow = "1";
65127
+ const r = i.clientWidth, s = i.clientHeight;
65128
+ this.size.set(r, s), this.camera.aspect = r / s, this.camera.updateProjectionMatrix(), this.css2dRenderer.setSize(r, s);
65129
+ const o = this.renderer.getPixelRatio();
65130
+ (l = this.pathTracer) == null || l.updateCamera(), this.sampleCount = 0, this.renderer.setSize(r, s), this._composer.setSize(r, s), this._composer.passes.forEach((u) => u.setSize(r, s));
65131
+ const a = this._fxaaPass.material.uniforms;
65132
+ a.resolution.value.x = 1 / (r * o), a.resolution.value.y = 1 / (s * o);
65133
65133
  }, this.ticker = () => {
65134
65134
  this.stats.begin();
65135
- const t = this.stats.fps();
65136
- if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(t)), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker")), requestAnimationFrame(this.ticker), this.renderer.autoClear = !1, this.renderer.clear(), this.usePathTracing) {
65135
+ const i = this.stats.fps();
65136
+ if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(i)), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker")), requestAnimationFrame(this.ticker), this.renderer.autoClear = !1, this.renderer.clear(), this.usePathTracing) {
65137
65137
  this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
65138
- const i = this.renderer.autoClear;
65139
- this.renderer.autoClear = !1, this.scene.overrideMaterial = KF, this.renderer.clearDepth(), this.renderer.render(this.scene, this.camera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.camera), this.renderer.autoClear = i, this.renderer.render(this.overlayScene, this.camera);
65138
+ const r = this.renderer.autoClear;
65139
+ this.renderer.autoClear = !1, this.scene.overrideMaterial = KF, this.renderer.clearDepth(), this.renderer.render(this.scene, this.camera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.camera), this.renderer.autoClear = r, this.renderer.render(this.overlayScene, this.camera);
65140
65140
  } else
65141
- this.amr.slots.forEach((i) => {
65142
- this._dragging ? i.getCanInstall() && i.render(this) : i.render(this);
65141
+ this.amr.slots.forEach((r) => {
65142
+ this._dragging ? r.getCanInstall() && r.render(this) : r.render(this);
65143
65143
  }), Ds.update(), this.controls.update(), this.css2dRenderer.render(this.scene, this.camera), this.updatePosition(), this.scene.overrideMaterial = null, this._composer.render();
65144
65144
  this.stats.end();
65145
65145
  }, this.stats.showPanel(0), this.hideState(), A.fov && (this.camera.fov = A.fov, this.camera.updateProjectionMatrix()), this._ground.visible = !1, this.controls = new GE(this.camera, this.renderer.domElement), this.controls.enablePan = !1, this.controls.rotateSpeed = 0.5, this.controls.dampingFactor = t2, this.controls.enableDamping = !0, this.controls.maxDistance = 5, this.controls.minDistance = 1, this.controls.zoomSpeed = bR() ? 0.2 : 1, this.renderer.setPixelRatio(window.devicePixelRatio || 1), this.renderer.autoClear = !0, this.renderer.toneMapping = W0, this.renderer.toneMappingExposure = 1.2, this.renderer.outputColorSpace = ke, this.renderer.localClippingEnabled = !0, this.css2dRenderer.domElement.style.pointerEvents = "none", this.css2dRenderer.domElement.style.position = "absolute", this.css2dRenderer.domElement.style.top = "0px", ae.tonemapping_pars_fragment = ae.tonemapping_pars_fragment.replace(
@@ -65166,9 +65166,11 @@ class cH {
65166
65166
  }`
65167
65167
  ), this.camera.position.set(10, 6, -10), this.camera.lookAt(new O());
65168
65168
  const { tiles: e } = TR();
65169
- this.pathTracer = new NO(this.renderer), this.pathTracer.filterGlossyFactor = 0.6, this.pathTracer.renderScale = window.devicePixelRatio, this.pathTracer.bounces = 10, this.pathTracer.transmissiveBounces = 3, this.pathTracer.tiles.set(e, e), this.pathTracer.fadeDuration = 0, this.pathTracer.setBVHWorker(new CF()), this.controls.addEventListener("change", () => {
65170
- var t;
65171
- this.sampleCount = 0, this.usePathTracing && (this.pathTracer.pausePathTracing = !1, (t = this.pathTracer) == null || t.updateCamera());
65169
+ this.pathTracer = new NO(this.renderer), this.pathTracer.filterGlossyFactor = 0.6;
65170
+ let t = window.devicePixelRatio;
65171
+ t < 2 && (t = 2), this.pathTracer.renderScale = t, this.pathTracer.bounces = 10, this.pathTracer.transmissiveBounces = 3, this.pathTracer.tiles.set(e, e), this.pathTracer.fadeDuration = 0, this.pathTracer.setBVHWorker(new CF()), this.controls.addEventListener("change", () => {
65172
+ var i;
65173
+ this.sampleCount = 0, this.usePathTracing && (this.pathTracer.pausePathTracing = !1, (i = this.pathTracer) == null || i.updateCamera());
65172
65174
  }), this._composer = new zO(this.renderer), this._composer.setPixelRatio(window.devicePixelRatio), this._composer.addPass(new jE(this.scene, this.camera)), this._composer.addPass(new YE()), this._outlinePass = new Zn(new uA(window.innerWidth, window.innerHeight), this.scene, this.camera), this._outlinePass.visibleEdgeColor.set(26367), this._outlinePass.edgeThickness = 0.5, this._outlinePass.hiddenEdgeColor.set(26367), this._outlinePass.edgeStrength = 3, this._outlinePass.edgeGlow = 0, this._composer.addPass(this._outlinePass), this._outlinePassError = new Zn(new uA(window.innerWidth, window.innerHeight), this.scene, this.camera), this._outlinePassError.visibleEdgeColor.set(16711680), this._outlinePassError.edgeThickness = 0.5, this._outlinePassError.hiddenEdgeColor.set(16711680), this._outlinePassError.edgeStrength = 3, this._outlinePassError.edgeGlow = 0, this._composer.addPass(this._outlinePassError), this._composer.renderTarget1.texture.colorSpace = ke, this._composer.renderTarget2.texture.colorSpace = ke, this._fxaaPass = new V2(KE), this._composer.addPass(this._fxaaPass), this._container.add(this.amr), this.scene.add(this._container), this.ticker(), this._loadEnv(), this._initEvents(), this._ground.rotateX(-Math.PI / 2), this.scene.add(this._ground);
65173
65175
  }
65174
65176
  get usePathTracing() {