shop-components 0.2.3 → 0.2.5

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.
@@ -4849,7 +4849,7 @@ void main(void)\r
4849
4849
  * goldfirestudios.com
4850
4850
  *
4851
4851
  * MIT License
4852
- */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var s=i._howls.length-1;s>=0;s--)i._howls[s].stereo(t);return i},HowlerGlobal.prototype.pos=function(t,i,s){var n=this;if(!n.ctx||!n.ctx.listener)return n;if(i=typeof i!="number"?n._pos[1]:i,s=typeof s!="number"?n._pos[2]:s,typeof t=="number")n._pos=[t,i,s],typeof n.ctx.listener.positionX<"u"?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]);else return n._pos;return n},HowlerGlobal.prototype.orientation=function(t,i,s,n,o,a){var h=this;if(!h.ctx||!h.ctx.listener)return h;var u=h._orientation;if(i=typeof i!="number"?u[1]:i,s=typeof s!="number"?u[2]:s,n=typeof n!="number"?u[3]:n,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof t=="number")h._orientation=[t,i,s,n,o,a],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(s,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(t,i,s,n,o,a);else return u;return h},Howl.prototype.init=function(t){return function(i){var s=this;return s._orientation=i.orientation||[1,0,0],s._stereo=i.stereo||null,s._pos=i.pos||null,s._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},s._onstereo=i.onstereo?[{fn:i.onstereo}]:[],s._onpos=i.onpos?[{fn:i.onpos}]:[],s._onorientation=i.onorientation?[{fn:i.onorientation}]:[],t.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"stereo",action:function(){s.stereo(t,i)}}),s;var n=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof t=="number")s._stereo=t,s._pos=[t,0,0];else return s._stereo;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h)if(typeof t=="number")h._stereo=t,h._pos=[t,0,0],h._node&&(h._pannerAttr.panningModel="equalpower",(!h._panner||!h._panner.pan)&&e(h,n),n==="spatial"?typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):h._panner.setPosition(t,0,0):h._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),s._emit("stereo",h._id);else return h._stereo}return s},Howl.prototype.pos=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(t,i,s,n)}}),o;if(i=typeof i!="number"?0:i,s=typeof s!="number"?-.5:s,typeof n>"u")if(typeof t=="number")o._pos=[t,i,s];else return o._pos;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._pos=[t,i,s],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setPosition(t,i,s)),o._emit("pos",u._id);else return u._pos}return o},Howl.prototype.orientation=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(t,i,s,n)}}),o;if(i=typeof i!="number"?o._orientation[1]:i,s=typeof s!="number"?o._orientation[2]:s,typeof n>"u")if(typeof t=="number")o._orientation=[t,i,s];else return o._orientation;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._orientation=[t,i,s],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setOrientation(t,i,s)),o._emit("orientation",u._id);else return u._orientation}return o},Howl.prototype.pannerAttr=function(){var t=this,i=arguments,s,n,o;if(!t._webAudio)return t;if(i.length===0)return t._pannerAttr;if(i.length===1)if(typeof i[0]=="object")s=i[0],typeof n>"u"&&(s.pannerAttr||(s.pannerAttr={coneInnerAngle:s.coneInnerAngle,coneOuterAngle:s.coneOuterAngle,coneOuterGain:s.coneOuterGain,distanceModel:s.distanceModel,maxDistance:s.maxDistance,refDistance:s.refDistance,rolloffFactor:s.rolloffFactor,panningModel:s.panningModel}),t._pannerAttr={coneInnerAngle:typeof s.pannerAttr.coneInnerAngle<"u"?s.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof s.pannerAttr.coneOuterAngle<"u"?s.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof s.pannerAttr.coneOuterGain<"u"?s.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof s.pannerAttr.distanceModel<"u"?s.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof s.pannerAttr.maxDistance<"u"?s.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof s.pannerAttr.refDistance<"u"?s.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof s.pannerAttr.rolloffFactor<"u"?s.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof s.pannerAttr.panningModel<"u"?s.pannerAttr.panningModel:t._panningModel});else return o=t._soundById(parseInt(i[0],10)),o?o._pannerAttr:t._pannerAttr;else i.length===2&&(s=i[0],n=parseInt(i[1],10));for(var a=t._getSoundIds(n),h=0;h<a.length;h++)if(o=t._soundById(a[h]),o){var u=o._pannerAttr;u={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:u.coneOuterGain,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:u.distanceModel,maxDistance:typeof s.maxDistance<"u"?s.maxDistance:u.maxDistance,refDistance:typeof s.refDistance<"u"?s.refDistance:u.refDistance,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:u.rolloffFactor,panningModel:typeof s.panningModel<"u"?s.panningModel:u.panningModel};var d=o._panner;d||(o._pos||(o._pos=t._pos||[0,0,-.5]),e(o,"spatial"),d=o._panner),d.coneInnerAngle=u.coneInnerAngle,d.coneOuterAngle=u.coneOuterAngle,d.coneOuterGain=u.coneOuterGain,d.distanceModel=u.distanceModel,d.maxDistance=u.maxDistance,d.refDistance=u.refDistance,d.rolloffFactor=u.rolloffFactor,d.panningModel=u.panningModel}return t},Sound.prototype.init=function(t){return function(){var i=this,s=i._parent;i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,t.call(this),i._stereo?s.stereo(i._stereo):i._pos&&s.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var i=this,s=i._parent;return i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,i._stereo?s.stereo(i._stereo):i._pos?s.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,s._refreshBuffer(i)),t.call(this)}}(Sound.prototype.reset);var e=function(t,i){i=i||"spatial",i==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()})(um);const VA="data:audio/mpeg;base64,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";let WA=class{constructor(){this.sound=new um.Howl({src:[VA]})}play(){this.sound.play()}};const ii=r=>{var e,t;if(typeof r.destroy=="function"){r.destroy();return}for(;r.children.length>0;)ii(r.children[0]),(e=r.children[0])==null||e.removeFromParent();if(r instanceof y.Mesh)try{(t=r.geometry)==null||t.dispose()}catch{}};function $A(r){return new y.Vector3(r[0],r[1],r[2])}function XA(){let r=3,e=Math.max(1/window.devicePixelRatio,.5);return window.innerWidth/window.innerHeight<.65&&(r=4,e=1/window.devicePixelRatio),{tiles:r,renderScale:e}}function jA(r){let e=!1,t=!1,i=!1,s=1/0,n=1/0,o=1/0,a=-1/0,h=-1/0,u=-1/0,d=0,l=0;return r.traverse(f=>{if(f.isMesh&&f.geometry){const p=f;if(p.userData.ignoreSize||p.material.userData.isLOGO)return;p.geometry.computeBoundingBox();let g=p.geometry.attributes.position;const m=p.geometry.morphAttributes.position;let _=p.morphTargetInfluences;const v=Object.keys(p.morphTargetDictionary||{});v.includes("width")&&(t=!0),v.includes("length")&&(e=!0),v.includes("height")&&(i=!0);for(let x=0;x<g.count;x++){let b=g.getX(x),w=g.getY(x),C=g.getZ(x);l=Math.max(w,l),m&&_&&m.forEach((T,M)=>{const P=_&&_[M]||0;b+=T.getX(x)*P,w+=T.getY(x)*P,C+=T.getZ(x)*P}),b<s&&(s=b),w<n&&(n=w),C<o&&(o=C),b>a&&(a=b),w>h&&(h=w),C>u&&(u=C);const S=Math.sqrt(b*b+w*w);S>d&&(d=S)}}}),{box:new y.Box3(new y.Vector3(s,n,o),new y.Vector3(a,h,u)),maxRadius:d,height:l,hasWidth:t,hasLength:e,hasHeight:i}}function YA(r,e,t=null){let i=0;return function(){let s=t||this,n=arguments;clearTimeout(i),i=window.setTimeout(function(){r.apply(s,n)},e)}}class qA{constructor(e,t,i){this.length=e,this.width=t,this.height=i}}const Ad=r=>{var i;let e=0,t=0;if(r.geometry){r.geometry.computeBoundingBox();const s=new y.Vector3;(i=r.geometry.boundingBox)==null||i.getSize(s),s.y?(t=s.y,!s.x&&s.z?e=s.z:s.x&&!s.z?e=s.x:s.x&&s.z&&(e=s.z)):(e=s.z,t=s.x)}return{width:e,height:t}};function tc(){if(typeof navigator>"u")return!1;if(ZA())return!0;const r=navigator.userAgent.toLowerCase();return/iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(r)}function ZA(){try{if(typeof wx<"u"&&wx.getSystemInfo||typeof my<"u"&&my.alert||typeof tt<"u"&&tt.getSystemInfo||typeof swan<"u"&&swan.getSystemInfo)return!0}catch{}return!1}const dm=new rg.GLTFExporter,ss=new eg.GLTFLoader,fm=new tg.DRACOLoader;let gh="./draco/";try{gh=new URL("./draco/",typeof document>"u"?require("url").pathToFileURL(__filename).href:Qr&&Qr.src||new URL("shop-components.cjs",document.baseURI).href).href}catch{gh="./draco/"}typeof window<"u"&&window.dracoPath&&(gh=window.dracoPath);fm.setDecoderConfig({type:"wasm"});ss.setDRACOLoader(fm);const KA=new ig.DRACOExporter,Td=[115,103,108,98];function QA(r,e,t){const i=JSON.stringify(e),s=new TextEncoder().encode(i),n=new Uint8Array([115,103,108,98]),o=new Uint8Array(2);o[0]=t>>8,o[1]=t&255;const a=new Uint8Array(4);a[0]=s.length>>24,a[1]=s.length>>16&255,a[2]=s.length>>8&255,a[3]=s.length&255;const h=new Uint8Array(r),u=n.length+o.length+a.length+s.length+h.length,d=new Uint8Array(u);let l=0;return d.set(n,l),l+=n.length,d.set(o,l),l+=o.length,d.set(a,l),l+=a.length,d.set(s,l),l+=s.length,d.set(h,l),d.buffer}function JA(r){const e=new Uint8Array(r.slice(0,4));let t=!0;for(let l=0;l<Td.length;l++)if(e[l]!==Td[l]){t=!1;break}if(!t)throw new Error("Invalid file format");const s=new DataView(r,4,2).getUint16(0,!1),o=new DataView(r,6,4).getUint32(0,!1),a=new Uint8Array(r.slice(10,10+o)),h=new TextDecoder().decode(a),u=JSON.parse(h),d=r.slice(10+o);return{version:s,jsonDescription:u,glbContent:d}}class No{constructor(e){this.props=e,this.cache=new Map}load(e,t,i,s){if(this.props.useCache&&this.cache.has(e)){t(this.cache.get(e));return}const n=this;fetch(e).then(o=>{if(!o.ok){s==null||s(new ErrorEvent("NetworkError",{message:"NetworkError for "+e+": "+o.statusText}));return}return o.arrayBuffer()}).then(async o=>{o||s==null||s(new ErrorEvent("Error",{message:"Not a valid sglb file."}));try{const a=n.parse(o);if(!a.glbContent){s==null||s(new ErrorEvent("Error",{message:"No glb content."}));return}const h=ph(a.glbContent,"model/gltf-binary"),u=await ss.loadAsync(h);URL.revokeObjectURL(h),a.glbContent=void 0,a.glb=u.scene,o=void 0,this.cache.set(e,a),t(a)}catch(a){s==null||s(new ErrorEvent("Error",{message:a==null?void 0:a.message}))}}).catch(o=>{s==null||s(new ErrorEvent("Error",{message:o.message}))})}async loadAsync(e){if(this.props.useCache&&this.cache.has(e))return this.cache.get(e);try{const t=await fetch(e);if(!t.ok)throw new Error(`NetworkError for ${e}: ${t.statusText}`);const i=await t.arrayBuffer();if(!i)throw new Error("Not a valid sglb file.");const s=this.parse(i);if(!s.glbContent)throw new Error("No GLB content.");const n=ph(s.glbContent,"model/gltf-binary"),o=await ss.loadAsync(n);return URL.revokeObjectURL(n),s.glbContent=void 0,s.glb=o.scene,this.cache.set(e,s),s}catch(t){throw t}}parse(e){return JA(e)}clear(){[...this.cache.values()]}}/**
4852
+ */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var s=i._howls.length-1;s>=0;s--)i._howls[s].stereo(t);return i},HowlerGlobal.prototype.pos=function(t,i,s){var n=this;if(!n.ctx||!n.ctx.listener)return n;if(i=typeof i!="number"?n._pos[1]:i,s=typeof s!="number"?n._pos[2]:s,typeof t=="number")n._pos=[t,i,s],typeof n.ctx.listener.positionX<"u"?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]);else return n._pos;return n},HowlerGlobal.prototype.orientation=function(t,i,s,n,o,a){var h=this;if(!h.ctx||!h.ctx.listener)return h;var u=h._orientation;if(i=typeof i!="number"?u[1]:i,s=typeof s!="number"?u[2]:s,n=typeof n!="number"?u[3]:n,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof t=="number")h._orientation=[t,i,s,n,o,a],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(s,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(t,i,s,n,o,a);else return u;return h},Howl.prototype.init=function(t){return function(i){var s=this;return s._orientation=i.orientation||[1,0,0],s._stereo=i.stereo||null,s._pos=i.pos||null,s._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},s._onstereo=i.onstereo?[{fn:i.onstereo}]:[],s._onpos=i.onpos?[{fn:i.onpos}]:[],s._onorientation=i.onorientation?[{fn:i.onorientation}]:[],t.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"stereo",action:function(){s.stereo(t,i)}}),s;var n=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof t=="number")s._stereo=t,s._pos=[t,0,0];else return s._stereo;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h)if(typeof t=="number")h._stereo=t,h._pos=[t,0,0],h._node&&(h._pannerAttr.panningModel="equalpower",(!h._panner||!h._panner.pan)&&e(h,n),n==="spatial"?typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):h._panner.setPosition(t,0,0):h._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),s._emit("stereo",h._id);else return h._stereo}return s},Howl.prototype.pos=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(t,i,s,n)}}),o;if(i=typeof i!="number"?0:i,s=typeof s!="number"?-.5:s,typeof n>"u")if(typeof t=="number")o._pos=[t,i,s];else return o._pos;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._pos=[t,i,s],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setPosition(t,i,s)),o._emit("pos",u._id);else return u._pos}return o},Howl.prototype.orientation=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(t,i,s,n)}}),o;if(i=typeof i!="number"?o._orientation[1]:i,s=typeof s!="number"?o._orientation[2]:s,typeof n>"u")if(typeof t=="number")o._orientation=[t,i,s];else return o._orientation;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._orientation=[t,i,s],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setOrientation(t,i,s)),o._emit("orientation",u._id);else return u._orientation}return o},Howl.prototype.pannerAttr=function(){var t=this,i=arguments,s,n,o;if(!t._webAudio)return t;if(i.length===0)return t._pannerAttr;if(i.length===1)if(typeof i[0]=="object")s=i[0],typeof n>"u"&&(s.pannerAttr||(s.pannerAttr={coneInnerAngle:s.coneInnerAngle,coneOuterAngle:s.coneOuterAngle,coneOuterGain:s.coneOuterGain,distanceModel:s.distanceModel,maxDistance:s.maxDistance,refDistance:s.refDistance,rolloffFactor:s.rolloffFactor,panningModel:s.panningModel}),t._pannerAttr={coneInnerAngle:typeof s.pannerAttr.coneInnerAngle<"u"?s.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof s.pannerAttr.coneOuterAngle<"u"?s.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof s.pannerAttr.coneOuterGain<"u"?s.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof s.pannerAttr.distanceModel<"u"?s.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof s.pannerAttr.maxDistance<"u"?s.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof s.pannerAttr.refDistance<"u"?s.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof s.pannerAttr.rolloffFactor<"u"?s.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof s.pannerAttr.panningModel<"u"?s.pannerAttr.panningModel:t._panningModel});else return o=t._soundById(parseInt(i[0],10)),o?o._pannerAttr:t._pannerAttr;else i.length===2&&(s=i[0],n=parseInt(i[1],10));for(var a=t._getSoundIds(n),h=0;h<a.length;h++)if(o=t._soundById(a[h]),o){var u=o._pannerAttr;u={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:u.coneOuterGain,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:u.distanceModel,maxDistance:typeof s.maxDistance<"u"?s.maxDistance:u.maxDistance,refDistance:typeof s.refDistance<"u"?s.refDistance:u.refDistance,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:u.rolloffFactor,panningModel:typeof s.panningModel<"u"?s.panningModel:u.panningModel};var d=o._panner;d||(o._pos||(o._pos=t._pos||[0,0,-.5]),e(o,"spatial"),d=o._panner),d.coneInnerAngle=u.coneInnerAngle,d.coneOuterAngle=u.coneOuterAngle,d.coneOuterGain=u.coneOuterGain,d.distanceModel=u.distanceModel,d.maxDistance=u.maxDistance,d.refDistance=u.refDistance,d.rolloffFactor=u.rolloffFactor,d.panningModel=u.panningModel}return t},Sound.prototype.init=function(t){return function(){var i=this,s=i._parent;i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,t.call(this),i._stereo?s.stereo(i._stereo):i._pos&&s.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var i=this,s=i._parent;return i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,i._stereo?s.stereo(i._stereo):i._pos?s.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,s._refreshBuffer(i)),t.call(this)}}(Sound.prototype.reset);var e=function(t,i){i=i||"spatial",i==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()})(um);const VA="data:audio/mpeg;base64,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";let WA=class{constructor(){this.sound=new um.Howl({src:[VA]})}play(){this.sound.play()}};const ii=r=>{var e,t;if(typeof r.destroy=="function"){r.destroy();return}for(;r.children.length>0;)ii(r.children[0]),(e=r.children[0])==null||e.removeFromParent();if(r instanceof y.Mesh)try{(t=r.geometry)==null||t.dispose()}catch{}};function $A(r){return new y.Vector3(r[0],r[1],r[2])}function XA(){let r=3,e=Math.max(1/window.devicePixelRatio,.5);return window.innerWidth/window.innerHeight<.65&&(r=4,e=1/window.devicePixelRatio),{tiles:r,renderScale:e}}function jA(r){let e=!1,t=!1,i=!1,s=1/0,n=1/0,o=1/0,a=-1/0,h=-1/0,u=-1/0,d=0,l=0;return r.traverse(f=>{if(f.isMesh&&f.geometry){const p=f;if(p.userData.ignoreSize||p.material.userData.isLOGO)return;p.geometry.computeBoundingBox();let g=p.geometry.attributes.position;const m=p.geometry.morphAttributes.position;let _=p.morphTargetInfluences;const v=Object.keys(p.morphTargetDictionary||{});v.includes("width")&&(t=!0),v.includes("length")&&(e=!0),v.includes("height")&&(i=!0);for(let x=0;x<g.count;x++){let b=g.getX(x),w=g.getY(x),C=g.getZ(x);l=Math.max(w,l),m&&_&&m.forEach((T,M)=>{const P=_&&_[M]||0;b+=T.getX(x)*P,w+=T.getY(x)*P,C+=T.getZ(x)*P}),b<s&&(s=b),w<n&&(n=w),C<o&&(o=C),b>a&&(a=b),w>h&&(h=w),C>u&&(u=C);const S=Math.sqrt(b*b+w*w);S>d&&(d=S)}}}),{box:new y.Box3(new y.Vector3(s,n,o),new y.Vector3(a,h,u)),maxRadius:d,height:l,hasWidth:t,hasLength:e,hasHeight:i}}function YA(r,e,t=null){let i=0;return function(){let s=t||this,n=arguments;clearTimeout(i),i=window.setTimeout(function(){r.apply(s,n)},e)}}class qA{constructor(e,t,i){this.length=e,this.width=t,this.height=i}}const Ad=r=>{var i;let e=0,t=0;if(r.geometry){r.geometry.computeBoundingBox();const s=new y.Vector3;(i=r.geometry.boundingBox)==null||i.getSize(s),s.y?(t=s.y,!s.x&&s.z?e=s.z:s.x&&!s.z?e=s.x:s.x&&s.z&&(e=s.z)):(e=s.z,t=s.x)}return{width:e,height:t}};function tc(){var e;if(typeof navigator>"u")return!1;if(ZA())return!0;const r=(e=navigator.userAgent)==null?void 0:e.toLowerCase();return/iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(r)}function ZA(){try{if(typeof wx<"u"&&wx.getSystemInfo||typeof my<"u"&&my.alert||typeof tt<"u"&&tt.getSystemInfo||typeof swan<"u"&&swan.getSystemInfo)return!0}catch{}return!1}const dm=new rg.GLTFExporter,ss=new eg.GLTFLoader,fm=new tg.DRACOLoader;let gh="./draco/";try{gh=new URL("./draco/",typeof document>"u"?require("url").pathToFileURL(__filename).href:Qr&&Qr.src||new URL("shop-components.cjs",document.baseURI).href).href}catch{gh="./draco/"}typeof window<"u"&&window.dracoPath&&(gh=window.dracoPath);fm.setDecoderConfig({type:"wasm"});ss.setDRACOLoader(fm);const KA=new ig.DRACOExporter,Td=[115,103,108,98];function QA(r,e,t){const i=JSON.stringify(e),s=new TextEncoder().encode(i),n=new Uint8Array([115,103,108,98]),o=new Uint8Array(2);o[0]=t>>8,o[1]=t&255;const a=new Uint8Array(4);a[0]=s.length>>24,a[1]=s.length>>16&255,a[2]=s.length>>8&255,a[3]=s.length&255;const h=new Uint8Array(r),u=n.length+o.length+a.length+s.length+h.length,d=new Uint8Array(u);let l=0;return d.set(n,l),l+=n.length,d.set(o,l),l+=o.length,d.set(a,l),l+=a.length,d.set(s,l),l+=s.length,d.set(h,l),d.buffer}function JA(r){const e=new Uint8Array(r.slice(0,4));let t=!0;for(let l=0;l<Td.length;l++)if(e[l]!==Td[l]){t=!1;break}if(!t)throw new Error("Invalid file format");const s=new DataView(r,4,2).getUint16(0,!1),o=new DataView(r,6,4).getUint32(0,!1),a=new Uint8Array(r.slice(10,10+o)),h=new TextDecoder().decode(a),u=JSON.parse(h),d=r.slice(10+o);return{version:s,jsonDescription:u,glbContent:d}}class No{constructor(e){this.props=e,this.cache=new Map}load(e,t,i,s){if(this.props.useCache&&this.cache.has(e)){t(this.cache.get(e));return}const n=this;fetch(e).then(o=>{if(!o.ok){s==null||s(new ErrorEvent("NetworkError",{message:"NetworkError for "+e+": "+o.statusText}));return}return o.arrayBuffer()}).then(async o=>{o||s==null||s(new ErrorEvent("Error",{message:"Not a valid sglb file."}));try{const a=n.parse(o);if(!a.glbContent){s==null||s(new ErrorEvent("Error",{message:"No glb content."}));return}const h=ph(a.glbContent,"model/gltf-binary"),u=await ss.loadAsync(h);URL.revokeObjectURL(h),a.glbContent=void 0,a.glb=u.scene,o=void 0,this.cache.set(e,a),t(a)}catch(a){s==null||s(new ErrorEvent("Error",{message:a==null?void 0:a.message}))}}).catch(o=>{s==null||s(new ErrorEvent("Error",{message:o.message}))})}async loadAsync(e){if(this.props.useCache&&this.cache.has(e))return this.cache.get(e);try{const t=await fetch(e);if(!t.ok)throw new Error(`NetworkError for ${e}: ${t.statusText}`);const i=await t.arrayBuffer();if(!i)throw new Error("Not a valid sglb file.");const s=this.parse(i);if(!s.glbContent)throw new Error("No GLB content.");const n=ph(s.glbContent,"model/gltf-binary"),o=await ss.loadAsync(n);return URL.revokeObjectURL(n),s.glbContent=void 0,s.glb=o.scene,this.cache.set(e,s),s}catch(t){throw t}}parse(e){return JA(e)}clear(){[...this.cache.values()]}}/**
4853
4853
  * @license
4854
4854
  * Copyright 2019 Google LLC
4855
4855
  * SPDX-License-Identifier: BSD-3-Clause
@@ -5074,4 +5074,4 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
5074
5074
  user-select: none;
5075
5075
  touch-action: none;
5076
5076
  -webkit-touch-callout: none;
5077
- `),this._controlsGizmo&&this._controlsGizmo.appendTo(e),this.stats.dom.style.bottom="0",this.stats.dom.style.top="auto",this.resize(),this._resizeObserver=new ResizeObserver(this.resize.bind(this)),this._resizeObserver.observe(e)}add(e){this._container.add(e)}updatePosition(){}removeFromParent(){var t;const e=this.renderer.domElement.parentElement;e&&((t=this._resizeObserver)==null||t.unobserve(e),e.removeChild(this.renderer.domElement))}clean(){this.amr.clean(),this._progressShadow.clear()}destroy(){var t,i,s;this._destroyed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._clock.stop(),(t=this._controlsGizmo)==null||t.destroy(),this.amr.destroy(),this.amr.removeFromParent(),this._progressShadow.destroy(),Pt.removeAll(),this.stats.dom.remove(),this._emitter.removeAllListeners(),(i=this._fitAnimation)==null||i.stop(),window.removeEventListener("drag",this._drag),document.removeEventListener("wheel",this._detectTrackpad),window.removeEventListener("pointermove",this._pointermove),this.renderer.domElement.removeEventListener("pointerdown",this._pointerdown);const e=this.renderer.domElement.parentElement;e&&((s=this._resizeObserver)==null||s.unobserve(e)),this.controls.dispose(),this.renderer.domElement.remove(),this.renderer.dispose(),this._composer.dispose(),ii(this.scene),this.scene.clear()}}class Fm{constructor(e){this.deps=e,this.canvas=null,this.pixelBuffer=null,this.orthoCamera=new y.OrthographicCamera(-1,1,1,-1,.1,1e3),this.orthoCamera.position.set(0,0,5),this.perspectiveCamera=new y.PerspectiveCamera(45,1,.1,2e3)}async capture(e){var p,g,m,_,v,x;const t=this.deps.renderer,i=(e==null?void 0:e.subject)??this.deps.subject;if(!i)throw new Error("TriViewCapture: subject is required.");const s=new y.Vector2;t.getSize(s);const n=((p=e==null?void 0:e.size)==null?void 0:p.width)??Math.round(s.x),o=((g=e==null?void 0:e.size)==null?void 0:g.height)??Math.round(s.y),a=(e==null?void 0:e.margin)??.15,h=(e==null?void 0:e.includeOverlay)??!1,u=n/o||1,d=this.resolveViews(e==null?void 0:e.views),l=new y.WebGLRenderTarget(n,o,{format:y.RGBAFormat,type:y.UnsignedByteType});l.texture.colorSpace=y.SRGBColorSpace,l.texture.generateMipmaps=!1,l.depthBuffer=!0;const c=this.storeRendererState(t),f={};try{(_=(m=this.deps).onBeforeCapture)==null||_.call(m);const b=this.computeBounds(i);this.applyRendererState(t,n,o,e==null?void 0:e.backgroundColor);for(const w of d){const C=this.configureCamera(b,w,u,a,n,o);t.setRenderTarget(l),t.clear(!0,!0,!0),t.render(this.deps.scene,C),h&&this.deps.overlayScene&&(t.clearDepth(),t.render(this.deps.overlayScene,C));const S=this.readPixels(t,l,n,o);f[w.key]=S}}finally{l.dispose(),this.restoreRendererState(t,c),(x=(v=this.deps).onAfterCapture)==null||x.call(v)}return f}resolveViews(e){return e&&e.length?e.map(t=>({key:t.key,direction:t.direction.clone(),up:t.up.clone(),plane:t.plane})):[{key:"top",direction:new y.Vector3(0,0,1),up:new y.Vector3(0,1,0),plane:{width:"x",height:"y",depth:"z"}},{key:"front",direction:new y.Vector3(0,-1,0),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"}},{key:"side",direction:new y.Vector3(1,0,0),up:new y.Vector3(0,0,1),plane:{width:"y",height:"z",depth:"x"}},{key:"perspective",direction:new y.Vector3(1,1,1),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"},mode:"perspective",fov:39.6}]}computeBounds(e){const t=new y.Box3,i=new y.Box3,s=new y.Vector3,n=new y.Vector3,o=new y.Sphere;return e.updateMatrixWorld(!0),e.traverse(a=>{if(!a.visible)return;const u=a.geometry;if(!u)return;u.boundingBox||u.computeBoundingBox();const d=u.boundingBox;d&&(i.copy(d).applyMatrix4(a.matrixWorld),t.union(i))}),t.isEmpty()?(t.setFromCenterAndSize(s,new y.Vector3(.001,.001,.001)),n.set(.001,.001,.001),o.center.copy(s),o.radius=.001):(t.getCenter(s),t.getSize(n),t.getBoundingSphere(o)),(!Number.isFinite(o.radius)||o.radius<=0)&&(o.radius=Math.max(n.length()*.5,.001)),{box:t,center:s,size:n,sphere:o}}configureCamera(e,t,i,s,n,o){const a=t.direction.clone().normalize();a.lengthSq()===0&&a.set(0,0,1);const h=t.up.clone().normalize();if(Math.abs(h.dot(a))>.999&&(h.set(0,0,1),Math.abs(h.dot(a))>.999&&h.set(0,1,0)),(t.mode??"orthographic")==="perspective"){const b=this.perspectiveCamera,w=t.fov??45,C=y.MathUtils.degToRad(w),S=Math.max(Math.tan(C/2),1e-4),T=Math.max(S*(i||1),1e-4),M=this.getPerspectiveDirection(t,e.size).normalize(),P=new y.Vector3().crossVectors(M,h).normalize();P.lengthSq()<1e-6&&P.set(1,0,0);const R=new y.Vector3().crossVectors(P,M).normalize(),E=Math.max(e.size.x*.5,1e-4),A=Math.max(e.size.y*.5,1e-4),I=Math.max(e.size.z*.5,1e-4),D=[new y.Vector3(-E,-A,-I),new y.Vector3(-E,-A,I),new y.Vector3(-E,A,-I),new y.Vector3(-E,A,I),new y.Vector3(E,-A,-I),new y.Vector3(E,-A,I),new y.Vector3(E,A,-I),new y.Vector3(E,A,I)];let B=0,k=-1/0;for(const L of D){const F=P.dot(L),G=R.dot(L),Q=M.dot(L);k=Math.max(k,Q);const ee=Q+Math.abs(F)/T,oe=Q+Math.abs(G)/S;B=Math.max(B,ee,oe)}B=Math.max(B,k+.1);const z=B*(1+s);let q=1/0;for(const L of D){const F=M.dot(L),G=z-F;G>.001&&(q=Math.min(q,G))}return b.fov=w,b.aspect=i||n/Math.max(o,1),b.near=Math.max(.1,Number.isFinite(q)?q*.5:z*.1),b.far=Math.max(b.near+1,z+e.sphere.radius*3),b.position.copy(e.center).add(M.clone().multiplyScalar(z)),b.up.copy(R),b.lookAt(e.center),b.updateProjectionMatrix(),b.updateMatrixWorld(!0),b}const d=this.orthoCamera,l=e.size,c=e.center,f=Math.max(l[t.plane.width]*.5,.01),p=Math.max(l[t.plane.height]*.5,.01),g=Math.max(l[t.plane.depth]*.5,.01);let m=f*(1+s),_=p*(1+s);m/i>_?_=m/i:m=_*i;const v=g*(1+s)+Math.max(m,_),x=c.clone().add(a.multiplyScalar(v));return d.left=-m,d.right=m,d.top=_,d.bottom=-_,d.near=.1,d.far=v*4,d.zoom=1,d.position.copy(x),d.up.copy(h),d.lookAt(c),d.updateProjectionMatrix(),d.updateMatrixWorld(!0),d}getPerspectiveDirection(e,t){const i=e.direction.clone();i.lengthSq()===0&&i.set(1,1,1);const s=new y.Vector3(Math.abs(i.x)||1,Math.abs(i.y)||1,Math.abs(i.z)||1),n=new y.Vector3(Math.sign(i.x||1),Math.sign(i.y||1),Math.sign(i.z||1)),o=.25,a=new y.Vector3(Math.max(o,s.x)*Math.max(t.x,.001),Math.max(o,s.y)*Math.max(t.y,.001),0),h=Math.max((t.x+t.y)*.5,.001),u=Math.max(t.z,.001),d=Math.max(o,s.z),l=u*.5+h*.5;return a.z=d*l,a.multiply(n),a}storeRendererState(e){const t=new y.Vector2;e.getSize(t);const i=new y.Vector4;e.getViewport(i);const s=new y.Vector4;e.getScissor(s);const n=e.getClearColor(new y.Color),o=e.getClearAlpha();return{size:t,pixelRatio:e.getPixelRatio(),viewport:i,scissor:s,scissorTest:e.getScissorTest(),autoClear:e.autoClear,target:e.getRenderTarget(),clearColor:n,clearAlpha:o}}applyRendererState(e,t,i,s){if(e.setPixelRatio(1),e.setSize(t,i,!1),e.setViewport(0,0,t,i),e.setScissor(0,0,t,i),e.setScissorTest(!1),e.autoClear=!0,s!==void 0)if(s===null){const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}else s instanceof y.Color?e.setClearColor(s,1):e.setClearColor(new y.Color(s),1);else{const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}}restoreRendererState(e,t){e.setPixelRatio(t.pixelRatio),e.setSize(t.size.x,t.size.y,!1),e.setViewport(t.viewport.x,t.viewport.y,t.viewport.z,t.viewport.w),e.setScissor(t.scissor.x,t.scissor.y,t.scissor.z,t.scissor.w),e.setScissorTest(t.scissorTest),e.autoClear=t.autoClear,e.setRenderTarget(t.target),e.setClearColor(t.clearColor,t.clearAlpha)}readPixels(e,t,i,s){const n=i*s*4;(!this.pixelBuffer||this.pixelBuffer.length!==n)&&(this.pixelBuffer=new Uint8Array(n)),e.readRenderTargetPixels(t,0,0,i,s,this.pixelBuffer);const o=this.ensureCanvas(i,s),a=o.getContext("2d");if(!a)throw new Error("TriViewCapture: failed to get 2D context.");const h=a.createImageData(i,s),u=h.data,d=this.pixelBuffer;for(let l=0;l<s;l+=1){const f=(s-l-1)*i*4,p=l*i*4;u.set(d.subarray(f,f+i*4),p)}return a.putImageData(h,0,0),o.toDataURL("image/png")}ensureCanvas(e,t){if(typeof document>"u")throw new Error("TriViewCapture: document is not available in this environment.");return this.canvas||(this.canvas=document.createElement("canvas")),(this.canvas.width!==e||this.canvas.height!==t)&&(this.canvas.width=e,this.canvas.height=t),this.canvas}}const QS="shop-components",JS="0.2.2",eE="Shop components",tE="dist/shop-components.umd.js",iE="dist/shop-components.mjs",rE="dist/main.d.ts",sE={dts:"tsc --emitDeclarationOnly & tsc & storybook build -o dist",test:'echo "Error: no test specified" && exit 1',dev:"storybook dev -p 6006",build:"storybook build -o dist",vite:"vite build",vitedev:"vite dev",version:"auto-changelog -p && git add CHANGELOG.md"},nE=["dist","package.json"],oE=[],aE="machengda<machengda@seer-group.com>",lE="ISC",hE={"@needle-tools/gltf-progressive":"^3.3.5","@storybook/addon-essentials":"^8.0.6","@storybook/addon-links":"^8.0.6","@storybook/addon-mdx-gfm":"^8.0.6","@storybook/addon-themes":"^8.0.6","@storybook/blocks":"^8.0.6","@storybook/web-components":"^8.0.6","@storybook/web-components-vite":"^8.0.6","auto-changelog":"^2.4.0",react:"^18.2.0","react-dom":"^18.2.0",storybook:"^8.0.6",vite:"^5.1.6","vite-plugin-dts":"^3.7.3"},cE={"string-width":"4.2.3"},uE={"@nodetoy/three-nodetoy":"^0.1.36","@tweakpane/core":"^2.0.3","@tweenjs/tween.js":"^23.1.2","@types/bezier-js":"^4.1.1","@types/howler":"^2.2.11","@types/three":"0.180.0","bezier-js":"^6.1.4",eventemitter3:"^5.0.1",howler:"^2.2.4",lit:"^3.1.0","pixi-viewport":"^5.0.2","pixi.js":"7.4.0","stats-fps.js":"0.0.6",stylus:"^0.63.0",terser:"^5.44.0",three:"0.180.0","three-gpu-pathtracer":"0.0.23","three-mesh-bvh":"^0.7.5","troika-three-text":"^0.49.1",tweakpane:"^4.0.3"},dE={name:QS,version:JS,description:eE,main:tE,module:iE,types:rE,scripts:sE,files:nE,keywords:oE,author:aE,license:lE,devDependencies:hE,resolutions:cE,dependencies:uE};function Qd(){const r="Nebular Engin",e=dE.version,t=`%c ${r} %c v${e} `;console.log(t,"background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;","background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;")}const Jd="__SHOP_COMPONENTS_BANNER_PRINTED__";try{const r=globalThis;r[Jd]||(r[Jd]=!0,Qd())}catch{Qd()}exports.Amr=Sm;exports.Line=CT;exports.Logo=yh;exports.SGLBLoader=No;exports.SLOT_EVENTS=Le;exports.Scene3D=KS;exports.Skin=Mh;exports.Slot=_h;exports.SlotState=Bm;exports.TriViewCapture=Fm;exports.arrayBufferToUrl=ph;exports.calculateArrayAverage=hm;exports.calculateFocalLength=HA;exports.createSGLBFile=QA;exports.downloadBlob=GA;exports.dracoExporter=KA;exports.font=YS;exports.gltfExporter=dm;exports.gltfLoader=ss;exports.imageBitmapToPixiTexture=zA;exports.imageBitmapToUrl=mh;exports.isAppleDevice=cm;exports.textureLoader=ac;
5077
+ `),this._controlsGizmo&&this._controlsGizmo.appendTo(e),this.stats.dom.style.bottom="0",this.stats.dom.style.top="auto",this.resize(),this._resizeObserver=new ResizeObserver(this.resize.bind(this)),this._resizeObserver.observe(e)}add(e){this._container.add(e)}updatePosition(){}removeFromParent(){var t;const e=this.renderer.domElement.parentElement;e&&((t=this._resizeObserver)==null||t.unobserve(e),e.removeChild(this.renderer.domElement))}clean(){this.amr.clean(),this._progressShadow.clear()}destroy(){var t,i,s;this._destroyed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._clock.stop(),(t=this._controlsGizmo)==null||t.destroy(),this.amr.destroy(),this.amr.removeFromParent(),this._progressShadow.destroy(),Pt.removeAll(),this.stats.dom.remove(),this._emitter.removeAllListeners(),(i=this._fitAnimation)==null||i.stop(),window.removeEventListener("drag",this._drag),document.removeEventListener("wheel",this._detectTrackpad),window.removeEventListener("pointermove",this._pointermove),this.renderer.domElement.removeEventListener("pointerdown",this._pointerdown);const e=this.renderer.domElement.parentElement;e&&((s=this._resizeObserver)==null||s.unobserve(e)),this.controls.dispose(),this.renderer.domElement.remove(),this.renderer.dispose(),this._composer.dispose(),ii(this.scene),this.scene.clear()}}class Fm{constructor(e){this.deps=e,this.canvas=null,this.pixelBuffer=null,this.orthoCamera=new y.OrthographicCamera(-1,1,1,-1,.1,1e3),this.orthoCamera.position.set(0,0,5),this.perspectiveCamera=new y.PerspectiveCamera(45,1,.1,2e3)}async capture(e){var p,g,m,_,v,x;const t=this.deps.renderer,i=(e==null?void 0:e.subject)??this.deps.subject;if(!i)throw new Error("TriViewCapture: subject is required.");const s=new y.Vector2;t.getSize(s);const n=((p=e==null?void 0:e.size)==null?void 0:p.width)??Math.round(s.x),o=((g=e==null?void 0:e.size)==null?void 0:g.height)??Math.round(s.y),a=(e==null?void 0:e.margin)??.15,h=(e==null?void 0:e.includeOverlay)??!1,u=n/o||1,d=this.resolveViews(e==null?void 0:e.views),l=new y.WebGLRenderTarget(n,o,{format:y.RGBAFormat,type:y.UnsignedByteType});l.texture.colorSpace=y.SRGBColorSpace,l.texture.generateMipmaps=!1,l.depthBuffer=!0;const c=this.storeRendererState(t),f={};try{(_=(m=this.deps).onBeforeCapture)==null||_.call(m);const b=this.computeBounds(i);this.applyRendererState(t,n,o,e==null?void 0:e.backgroundColor);for(const w of d){const C=this.configureCamera(b,w,u,a,n,o);t.setRenderTarget(l),t.clear(!0,!0,!0),t.render(this.deps.scene,C),h&&this.deps.overlayScene&&(t.clearDepth(),t.render(this.deps.overlayScene,C));const S=this.readPixels(t,l,n,o);f[w.key]=S}}finally{l.dispose(),this.restoreRendererState(t,c),(x=(v=this.deps).onAfterCapture)==null||x.call(v)}return f}resolveViews(e){return e&&e.length?e.map(t=>({key:t.key,direction:t.direction.clone(),up:t.up.clone(),plane:t.plane})):[{key:"top",direction:new y.Vector3(0,0,1),up:new y.Vector3(0,1,0),plane:{width:"x",height:"y",depth:"z"}},{key:"front",direction:new y.Vector3(0,-1,0),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"}},{key:"side",direction:new y.Vector3(1,0,0),up:new y.Vector3(0,0,1),plane:{width:"y",height:"z",depth:"x"}},{key:"perspective",direction:new y.Vector3(1,1,1),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"},mode:"perspective",fov:39.6}]}computeBounds(e){const t=new y.Box3,i=new y.Box3,s=new y.Vector3,n=new y.Vector3,o=new y.Sphere;return e.updateMatrixWorld(!0),e.traverse(a=>{if(!a.visible)return;const u=a.geometry;if(!u)return;u.boundingBox||u.computeBoundingBox();const d=u.boundingBox;d&&(i.copy(d).applyMatrix4(a.matrixWorld),t.union(i))}),t.isEmpty()?(t.setFromCenterAndSize(s,new y.Vector3(.001,.001,.001)),n.set(.001,.001,.001),o.center.copy(s),o.radius=.001):(t.getCenter(s),t.getSize(n),t.getBoundingSphere(o)),(!Number.isFinite(o.radius)||o.radius<=0)&&(o.radius=Math.max(n.length()*.5,.001)),{box:t,center:s,size:n,sphere:o}}configureCamera(e,t,i,s,n,o){const a=t.direction.clone().normalize();a.lengthSq()===0&&a.set(0,0,1);const h=t.up.clone().normalize();if(Math.abs(h.dot(a))>.999&&(h.set(0,0,1),Math.abs(h.dot(a))>.999&&h.set(0,1,0)),(t.mode??"orthographic")==="perspective"){const b=this.perspectiveCamera,w=t.fov??45,C=y.MathUtils.degToRad(w),S=Math.max(Math.tan(C/2),1e-4),T=Math.max(S*(i||1),1e-4),M=this.getPerspectiveDirection(t,e.size).normalize(),P=new y.Vector3().crossVectors(M,h).normalize();P.lengthSq()<1e-6&&P.set(1,0,0);const R=new y.Vector3().crossVectors(P,M).normalize(),E=Math.max(e.size.x*.5,1e-4),A=Math.max(e.size.y*.5,1e-4),I=Math.max(e.size.z*.5,1e-4),D=[new y.Vector3(-E,-A,-I),new y.Vector3(-E,-A,I),new y.Vector3(-E,A,-I),new y.Vector3(-E,A,I),new y.Vector3(E,-A,-I),new y.Vector3(E,-A,I),new y.Vector3(E,A,-I),new y.Vector3(E,A,I)];let B=0,k=-1/0;for(const L of D){const F=P.dot(L),G=R.dot(L),Q=M.dot(L);k=Math.max(k,Q);const ee=Q+Math.abs(F)/T,oe=Q+Math.abs(G)/S;B=Math.max(B,ee,oe)}B=Math.max(B,k+.1);const z=B*(1+s);let q=1/0;for(const L of D){const F=M.dot(L),G=z-F;G>.001&&(q=Math.min(q,G))}return b.fov=w,b.aspect=i||n/Math.max(o,1),b.near=Math.max(.1,Number.isFinite(q)?q*.5:z*.1),b.far=Math.max(b.near+1,z+e.sphere.radius*3),b.position.copy(e.center).add(M.clone().multiplyScalar(z)),b.up.copy(R),b.lookAt(e.center),b.updateProjectionMatrix(),b.updateMatrixWorld(!0),b}const d=this.orthoCamera,l=e.size,c=e.center,f=Math.max(l[t.plane.width]*.5,.01),p=Math.max(l[t.plane.height]*.5,.01),g=Math.max(l[t.plane.depth]*.5,.01);let m=f*(1+s),_=p*(1+s);m/i>_?_=m/i:m=_*i;const v=g*(1+s)+Math.max(m,_),x=c.clone().add(a.multiplyScalar(v));return d.left=-m,d.right=m,d.top=_,d.bottom=-_,d.near=.1,d.far=v*4,d.zoom=1,d.position.copy(x),d.up.copy(h),d.lookAt(c),d.updateProjectionMatrix(),d.updateMatrixWorld(!0),d}getPerspectiveDirection(e,t){const i=e.direction.clone();i.lengthSq()===0&&i.set(1,1,1);const s=new y.Vector3(Math.abs(i.x)||1,Math.abs(i.y)||1,Math.abs(i.z)||1),n=new y.Vector3(Math.sign(i.x||1),Math.sign(i.y||1),Math.sign(i.z||1)),o=.25,a=new y.Vector3(Math.max(o,s.x)*Math.max(t.x,.001),Math.max(o,s.y)*Math.max(t.y,.001),0),h=Math.max((t.x+t.y)*.5,.001),u=Math.max(t.z,.001),d=Math.max(o,s.z),l=u*.5+h*.5;return a.z=d*l,a.multiply(n),a}storeRendererState(e){const t=new y.Vector2;e.getSize(t);const i=new y.Vector4;e.getViewport(i);const s=new y.Vector4;e.getScissor(s);const n=e.getClearColor(new y.Color),o=e.getClearAlpha();return{size:t,pixelRatio:e.getPixelRatio(),viewport:i,scissor:s,scissorTest:e.getScissorTest(),autoClear:e.autoClear,target:e.getRenderTarget(),clearColor:n,clearAlpha:o}}applyRendererState(e,t,i,s){if(e.setPixelRatio(1),e.setSize(t,i,!1),e.setViewport(0,0,t,i),e.setScissor(0,0,t,i),e.setScissorTest(!1),e.autoClear=!0,s!==void 0)if(s===null){const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}else s instanceof y.Color?e.setClearColor(s,1):e.setClearColor(new y.Color(s),1);else{const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}}restoreRendererState(e,t){e.setPixelRatio(t.pixelRatio),e.setSize(t.size.x,t.size.y,!1),e.setViewport(t.viewport.x,t.viewport.y,t.viewport.z,t.viewport.w),e.setScissor(t.scissor.x,t.scissor.y,t.scissor.z,t.scissor.w),e.setScissorTest(t.scissorTest),e.autoClear=t.autoClear,e.setRenderTarget(t.target),e.setClearColor(t.clearColor,t.clearAlpha)}readPixels(e,t,i,s){const n=i*s*4;(!this.pixelBuffer||this.pixelBuffer.length!==n)&&(this.pixelBuffer=new Uint8Array(n)),e.readRenderTargetPixels(t,0,0,i,s,this.pixelBuffer);const o=this.ensureCanvas(i,s),a=o.getContext("2d");if(!a)throw new Error("TriViewCapture: failed to get 2D context.");const h=a.createImageData(i,s),u=h.data,d=this.pixelBuffer;for(let l=0;l<s;l+=1){const f=(s-l-1)*i*4,p=l*i*4;u.set(d.subarray(f,f+i*4),p)}return a.putImageData(h,0,0),o.toDataURL("image/png")}ensureCanvas(e,t){if(typeof document>"u")throw new Error("TriViewCapture: document is not available in this environment.");return this.canvas||(this.canvas=document.createElement("canvas")),(this.canvas.width!==e||this.canvas.height!==t)&&(this.canvas.width=e,this.canvas.height=t),this.canvas}}const QS="shop-components",JS="0.2.3",eE="Shop components",tE="dist/shop-components.umd.js",iE="dist/shop-components.mjs",rE="dist/main.d.ts",sE={dts:"tsc --emitDeclarationOnly & tsc & storybook build -o dist",test:'echo "Error: no test specified" && exit 1',dev:"storybook dev -p 6006",build:"storybook build -o dist",vite:"vite build",vitedev:"vite dev",version:"auto-changelog -p && git add CHANGELOG.md"},nE=["dist","package.json"],oE=[],aE="machengda<machengda@seer-group.com>",lE="ISC",hE={"@needle-tools/gltf-progressive":"^3.3.5","@storybook/addon-essentials":"^8.0.6","@storybook/addon-links":"^8.0.6","@storybook/addon-mdx-gfm":"^8.0.6","@storybook/addon-themes":"^8.0.6","@storybook/blocks":"^8.0.6","@storybook/web-components":"^8.0.6","@storybook/web-components-vite":"^8.0.6","auto-changelog":"^2.4.0",react:"^18.2.0","react-dom":"^18.2.0",storybook:"^8.0.6",vite:"^5.1.6","vite-plugin-dts":"^3.7.3"},cE={"string-width":"4.2.3"},uE={"@nodetoy/three-nodetoy":"^0.1.36","@tweakpane/core":"^2.0.3","@tweenjs/tween.js":"^23.1.2","@types/bezier-js":"^4.1.1","@types/howler":"^2.2.11","@types/three":"0.180.0","bezier-js":"^6.1.4",eventemitter3:"^5.0.1",howler:"^2.2.4",lit:"^3.1.0","pixi-viewport":"^5.0.2","pixi.js":"7.4.0","stats-fps.js":"0.0.6",stylus:"^0.63.0",terser:"^5.44.0",three:"0.180.0","three-gpu-pathtracer":"0.0.23","three-mesh-bvh":"^0.7.5","troika-three-text":"^0.49.1",tweakpane:"^4.0.3"},dE={name:QS,version:JS,description:eE,main:tE,module:iE,types:rE,scripts:sE,files:nE,keywords:oE,author:aE,license:lE,devDependencies:hE,resolutions:cE,dependencies:uE};function Qd(){const r="Nebular Engin",e=dE.version,t=`%c ${r} %c v${e} `;console.log(t,"background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;","background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;")}const Jd="__SHOP_COMPONENTS_BANNER_PRINTED__";try{const r=globalThis;r[Jd]||(r[Jd]=!0,Qd())}catch{Qd()}exports.Amr=Sm;exports.Line=CT;exports.Logo=yh;exports.SGLBLoader=No;exports.SLOT_EVENTS=Le;exports.Scene3D=KS;exports.Skin=Mh;exports.Slot=_h;exports.SlotState=Bm;exports.TriViewCapture=Fm;exports.arrayBufferToUrl=ph;exports.calculateArrayAverage=hm;exports.calculateFocalLength=HA;exports.createSGLBFile=QA;exports.downloadBlob=GA;exports.dracoExporter=KA;exports.font=YS;exports.gltfExporter=dm;exports.gltfLoader=ss;exports.imageBitmapToPixiTexture=zA;exports.imageBitmapToUrl=mh;exports.isAppleDevice=cm;exports.textureLoader=ac;
@@ -32498,11 +32498,12 @@ const ff = (s) => {
32498
32498
  return { width: e, height: t };
32499
32499
  };
32500
32500
  function kc() {
32501
+ var e;
32501
32502
  if (typeof navigator > "u")
32502
32503
  return !1;
32503
32504
  if (fS())
32504
32505
  return !0;
32505
- const s = navigator.userAgent.toLowerCase();
32506
+ const s = (e = navigator.userAgent) == null ? void 0 : e.toLowerCase();
32506
32507
  return /iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(s);
32507
32508
  }
32508
32509
  function fS() {
@@ -37782,7 +37783,7 @@ class fC {
37782
37783
  return this.canvas || (this.canvas = document.createElement("canvas")), (this.canvas.width !== e || this.canvas.height !== t) && (this.canvas.width = e, this.canvas.height = t), this.canvas;
37783
37784
  }
37784
37785
  }
37785
- const pC = "shop-components", mC = "0.2.2", gC = "Shop components", _C = "dist/shop-components.umd.js", yC = "dist/shop-components.mjs", vC = "dist/main.d.ts", xC = {
37786
+ const pC = "shop-components", mC = "0.2.3", gC = "Shop components", _C = "dist/shop-components.umd.js", yC = "dist/shop-components.mjs", vC = "dist/main.d.ts", xC = {
37786
37787
  dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
37787
37788
  test: 'echo "Error: no test specified" && exit 1',
37788
37789
  dev: "storybook dev -p 6006",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shop-components",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Shop components",
5
5
  "main": "dist/shop-components.umd.js",
6
6
  "module": "dist/shop-components.mjs",