@realsee/five 6.2.2 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/plugins/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 11/6/2024
5
- * Version: 6.2.2
4
+ * Generated: 2024/11/11
5
+ * Version: 6.2.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,13 +252,13 @@
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
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("@realsee/five"),er=require("three"),tr=require("three/examples/jsm/controls/OrbitControls"),it=require("three/examples/jsm/renderers/CSS3DRenderer"),rr=require("@realsee/five/plugins");function nr(c){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const n in c)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(c,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>c[n]})}}return o.default=c,Object.freeze(o)}const g=nr(er);function ir(c){return/^https?:\/\/|^\/\//.test(c)||/^data:/.test(c)}function ar(c,o){return ir(o)?o:"".concat(c).concat(o)}exports.BasePlugin=void 0;(function(c){var o=function(){function n(a,t){this.hooks=new nt.Subscribe,this.staticPrefix="//vr-image-4.realsee-cdn.cn",this.five=a,t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}return n.prototype.getCurrentState=function(){return this.state},n.prototype.absoluteUrl=function(a){return ar(this.staticPrefix,a)},n}();c.Controller=o})(exports.BasePlugin||(exports.BasePlugin={}));var rt=function(c,o){return rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(n[t]=a[t])},rt(c,o)};function He(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");rt(c,o);function n(){this.constructor=c}c.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}var W=function(){return W=Object.assign||function(o){for(var n,a=1,t=arguments.length;a<t;a++){n=arguments[a];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(o[l]=n[l])}return o},W.apply(this,arguments)};function Ve(c,o,n,a){function t(l){return l instanceof n?l:new n(function(h){h(l)})}return new(n||(n=Promise))(function(l,h){function u(y){try{p(a.next(y))}catch(T){h(T)}}function m(y){try{p(a.throw(y))}catch(T){h(T)}}function p(y){y.done?l(y.value):t(y.value).then(u,m)}p((a=a.apply(c,o||[])).next())})}function Ge(c,o){var n={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,t,l,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=u(0),h.throw=u(1),h.return=u(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function u(p){return function(y){return m([p,y])}}function m(p){if(a)throw new TypeError("Generator is already executing.");for(;h&&(h=0,p[0]&&(n=0)),n;)try{if(a=1,t&&(l=p[0]&2?t.return:p[0]?t.throw||((l=t.return)&&l.call(t),0):t.next)&&!(l=l.call(t,p[1])).done)return l;switch(t=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,t=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(l=n.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){n.label=p[1];break}if(p[0]===6&&n.label<l[1]){n.label=l[1],l=p;break}if(l&&n.label<l[2]){n.label=l[2],n.ops.push(p);break}l[2]&&n.ops.pop(),n.trys.pop();continue}p=o.call(c,n)}catch(y){p=[6,y],t=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Mt(c,o,n){if(n||arguments.length===2)for(var a=0,t=o.length,l;a<t;a++)(l||!(a in o))&&(l||(l=Array.prototype.slice.call(o,0,a)),l[a]=o[a]);return c.concat(l||Array.prototype.slice.call(o))}function or(c){return new Promise(function(o,n){var a=new Image;a.onload=function(){a.onload=a.onerror=function(){},o(a)},a.onerror=function(t){a.onload=a.onerror=function(){},n(t)},a.crossOrigin="",a.src=c})}var sr=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),et=typeof performance!="undefined"?function(){return sr+performance.now()}:function(){return Date.now()};function Re(c,o,n){return c+(o-c)*n}function lr(c,o,n,a){var t=(o*n+2*c)/Math.pow(n,3),l=-(2*o*n+3*c)/Math.pow(n,2),h=o,u=c;return t*Math.pow(a,3)+l*Math.pow(a,2)+h*a+u}function cr(c,o,n,a){var t=(o*n+2*c)/Math.pow(n,3),l=-(2*o*n+3*c)/Math.pow(n,2),h=o;return 3*t*Math.pow(a,2)+2*l*a+h}function ur(c,o,n,a){var t=a[1]-a[0];return c=Ye(c,a),o=Ye(o,a),o-c>t/2?Re(c+t,o,n):c-o>t/2?Re(c-t,o,n):Re(c,o,n)}function Ye(c,o){var n=o[1]-o[0];return c<o[0]?Ye(c+n,o):c>=o[1]?Ye(c-n,o):c}function hr(c,o,n,a){return a?ur(c,o,n,a):Re(c,o,n)}var Ct=function(){function c(o){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=et(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var n in o){var a=o[n];typeof a=="number"?(this.value[n]=a,this.config[n]={circle:!1}):(this.value[n]=a.value,this.config[n]={circle:a.circle})}this.keyframes=[{progress:0,value:W({},this.value)},{progress:1,value:W({},this.value)}]}return c.prototype.getProgress=function(o){var n=o-this.startTime;return n<0?0:n>=this.duration?1:1-lr(1,this.startVelocity,this.duration,n)},c.prototype.getValue=function(o){for(var n=1;n<this.keyframes.length;n++)if(this.keyframes[n].progress>o){var a=this.keyframes[n-1],t=this.keyframes[n],l={};for(var h in this.config){var u=(o-a.progress)/(t.progress-a.progress);l[h]=hr(a.value[h],t.value[h],u,this.config[h].circle)}return l}return W({},this.keyframes[this.keyframes.length-1].value)},c.prototype.getProgressVelocity=function(o){var n=o-this.startTime;return n>=this.duration?0:cr(1,this.startVelocity,this.duration,n)},c.prototype.update=function(o){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(o))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},c.prototype.getKeyFrameSegment=function(o){for(var n=this.getProgress(o),a=1;a<this.keyframes.length;a++)if(this.keyframes[a].progress>n)return[this.keyframes[a-1],this.keyframes[a]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},c.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},c.prototype.set=function(o,n,a,t){var l;a===void 0&&(a=0),isNaN(n)&&(n=0),isNaN(a)&&(a=0),t=t!=null?t:et();var h=this.getProgress(t),u=this.getValue(h),m={};for(var p in this.config)m[p]=(l=o[p])!==null&&l!==void 0?l:u[p];var y=[{progress:0,value:u},{progress:1,value:m}];return this.setKeyframes(y,n,a,t)},c.prototype.setKeyframes=function(o,n,a,t){var l=this;if(a===void 0&&(a=0),o.length<2)throw new Error("keyframes invalid.");return isNaN(n)&&(n=0),isNaN(a)&&(a=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(h,u){t=t!=null?t:et(),l.progress=0,l.ended=!1,l.startTime=t,l.startVelocity=a,l.keyframes=o,l.duration=n,n===0?(l.progress=1,l.value=W({},o[o.length-1].value)):l.value=W({},o[0].value),l.callbacks=[h,u]})},c.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},c}(),fr=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],vr=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],pr=`
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("@realsee/five"),O=require("three"),an=require("@realsee/five/plugins");function on(f){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const e in f)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(f,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:()=>f[e]})}}return o.default=f,Object.freeze(o)}const E=on(O);function sn(f){return/^https?:\/\/|^\/\//.test(f)||/^data:/.test(f)}function ln(f,o){return sn(o)?o:"".concat(f).concat(o)}exports.BasePlugin=void 0;(function(f){var o=function(){function e(a,t){this.hooks=new Tt.Subscribe,this.staticPrefix="//vr-image-4.realsee-cdn.cn",this.five=a,t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}return e.prototype.getCurrentState=function(){return this.state},e.prototype.absoluteUrl=function(a){return ln(this.staticPrefix,a)},e}();f.Controller=o})(exports.BasePlugin||(exports.BasePlugin={}));var gt=function(f,o){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])},gt(f,o)};function it(f,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");gt(f,o);function e(){this.constructor=f}f.prototype=o===null?Object.create(o):(e.prototype=o.prototype,new e)}var ae=function(){return ae=Object.assign||function(o){for(var e,a=1,t=arguments.length;a<t;a++){e=arguments[a];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},ae.apply(this,arguments)};function et(f,o,e,a){function t(l){return l instanceof e?l:new e(function(h){h(l)})}return new(e||(e=Promise))(function(l,h){function c(m){try{d(a.next(m))}catch(w){h(w)}}function g(m){try{d(a.throw(m))}catch(w){h(w)}}function d(m){m.done?l(m.value):t(m.value).then(c,g)}d((a=a.apply(f,o||[])).next())})}function tt(f,o){var e={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,t,l,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=c(0),h.throw=c(1),h.return=c(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function c(d){return function(m){return g([d,m])}}function g(d){if(a)throw new TypeError("Generator is already executing.");for(;h&&(h=0,d[0]&&(e=0)),e;)try{if(a=1,t&&(l=d[0]&2?t.return:d[0]?t.throw||((l=t.return)&&l.call(t),0):t.next)&&!(l=l.call(t,d[1])).done)return l;switch(t=0,l&&(d=[d[0]&2,l.value]),d[0]){case 0:case 1:l=d;break;case 4:return e.label++,{value:d[1],done:!1};case 5:e.label++,t=d[1],d=[0];continue;case 7:d=e.ops.pop(),e.trys.pop();continue;default:if(l=e.trys,!(l=l.length>0&&l[l.length-1])&&(d[0]===6||d[0]===2)){e=0;continue}if(d[0]===3&&(!l||d[1]>l[0]&&d[1]<l[3])){e.label=d[1];break}if(d[0]===6&&e.label<l[1]){e.label=l[1],l=d;break}if(l&&e.label<l[2]){e.label=l[2],e.ops.push(d);break}l[2]&&e.ops.pop(),e.trys.pop();continue}d=o.call(f,e)}catch(m){d=[6,m],t=0}finally{a=l=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Dt(f,o,e){if(e||arguments.length===2)for(var a=0,t=o.length,l;a<t;a++)(l||!(a in o))&&(l||(l=Array.prototype.slice.call(o,0,a)),l[a]=o[a]);return f.concat(l||Array.prototype.slice.call(o))}function cn(f){return new Promise(function(o,e){var a=new Image;a.onload=function(){a.onload=a.onerror=function(){},o(a)},a.onerror=function(t){a.onload=a.onerror=function(){},e(t)},a.crossOrigin="",a.src=f})}var un=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),vt=typeof performance!="undefined"?function(){return un+performance.now()}:function(){return Date.now()};function $e(f,o,e){return f+(o-f)*e}function hn(f,o,e,a){var t=(o*e+2*f)/Math.pow(e,3),l=-(2*o*e+3*f)/Math.pow(e,2),h=o,c=f;return t*Math.pow(a,3)+l*Math.pow(a,2)+h*a+c}function fn(f,o,e,a){var t=(o*e+2*f)/Math.pow(e,3),l=-(2*o*e+3*f)/Math.pow(e,2),h=o;return 3*t*Math.pow(a,2)+2*l*a+h}function pn(f,o,e,a){var t=a[1]-a[0];return f=nt(f,a),o=nt(o,a),o-f>t/2?$e(f+t,o,e):f-o>t/2?$e(f-t,o,e):$e(f,o,e)}function nt(f,o){var e=o[1]-o[0];return f<o[0]?nt(f+e,o):f>=o[1]?nt(f-e,o):f}function dn(f,o,e,a){return a?pn(f,o,e,a):$e(f,o,e)}var Lt=function(){function f(o){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=vt(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in o){var a=o[e];typeof a=="number"?(this.value[e]=a,this.config[e]={circle:!1}):(this.value[e]=a.value,this.config[e]={circle:a.circle})}this.keyframes=[{progress:0,value:ae({},this.value)},{progress:1,value:ae({},this.value)}]}return f.prototype.getProgress=function(o){var e=o-this.startTime;return e<0?0:e>=this.duration?1:1-hn(1,this.startVelocity,this.duration,e)},f.prototype.getValue=function(o){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>o){var a=this.keyframes[e-1],t=this.keyframes[e],l={};for(var h in this.config){var c=(o-a.progress)/(t.progress-a.progress);l[h]=dn(a.value[h],t.value[h],c,this.config[h].circle)}return l}return ae({},this.keyframes[this.keyframes.length-1].value)},f.prototype.getProgressVelocity=function(o){var e=o-this.startTime;return e>=this.duration?0:fn(1,this.startVelocity,this.duration,e)},f.prototype.update=function(o){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(o))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},f.prototype.getKeyFrameSegment=function(o){for(var e=this.getProgress(o),a=1;a<this.keyframes.length;a++)if(this.keyframes[a].progress>e)return[this.keyframes[a-1],this.keyframes[a]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},f.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},f.prototype.set=function(o,e,a,t){var l;a===void 0&&(a=0),isNaN(e)&&(e=0),isNaN(a)&&(a=0),t=t!=null?t:vt();var h=this.getProgress(t),c=this.getValue(h),g={};for(var d in this.config)g[d]=(l=o[d])!==null&&l!==void 0?l:c[d];var m=[{progress:0,value:c},{progress:1,value:g}];return this.setKeyframes(m,e,a,t)},f.prototype.setKeyframes=function(o,e,a,t){var l=this;if(a===void 0&&(a=0),o.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(a)&&(a=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(h,c){t=t!=null?t:vt(),l.progress=0,l.ended=!1,l.startTime=t,l.startVelocity=a,l.keyframes=o,l.duration=e,e===0?(l.progress=1,l.value=ae({},o[o.length-1].value)):l.value=ae({},o[0].value),l.callbacks=[h,c]})},f.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},f}(),vn=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.5,opacity:1,shadow:1}},{progress:.8,value:{scale:2,opacity:0,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],mn=[{progress:0,value:{scale:0,opacity:0,shadow:2}},{progress:.2,value:{scale:.4,opacity:1,shadow:2}},{progress:.8,value:{scale:1.6,opacity:.4,shadow:.5}},{progress:1,value:{scale:2,opacity:0,shadow:.5}}],gn=`
256
256
  varying vec2 vUv;
257
257
  void main() {
258
258
  vUv = uv;
259
259
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
260
260
  }
261
- `,dr=`
261
+ `,yn=`
262
262
  varying vec2 vUv;
263
263
  uniform sampler2D map;
264
264
  uniform vec4 color;
@@ -304,7 +304,7 @@ void main() {
304
304
  }
305
305
  }
306
306
  }
307
- `,mr=function(c){He(o,c);function o(n,a){var t=c.call(this,n)||this;t.canvas=document.createElement("canvas"),t.group=new g.Group,t.wrapper=document.createElement("div"),t.style=document.createElement("style"),t.itemMaskMesh=function(){var u=new g.Mesh(new g.SphereBufferGeometry(1,60,40),new g.ShaderMaterial({vertexShader:pr,fragmentShader:dr,uniforms:{map:{value:new g.Texture},color:{value:new g.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return u.renderOrder=-3,u.geometry.rotateY(-Math.PI/2),u.geometry.scale(-1,1,1),u}(),t.onFivePanoArrived=function(u){t.state.mode==="mask"&&t.loadPanoMask(u)},t.onFiveWantsMoveToPano=function(u){t.state.mode==="box"&&t.select()},t.loadPanoMask=function(u){return Ve(t,void 0,void 0,function(){var m,p,y,T,M,N,C,F,G,O;return Ge(this,function(j){switch(j.label){case 0:return m=this,p=m.five,y=m.canvas,T=m.itemMaskMesh,M=m.data,N=y.getContext("2d"),C=p.observers[u],F=(O=M==null?void 0:M.object_mask_list.find(function(q){return q.derived_id===String(C.derivedId)}))===null||O===void 0?void 0:O.object_mask_url,F?[4,or(F)]:[2];case 1:return G=j.sent(),y.width=G.width,y.height=G.height,N==null||N.drawImage(G,0,0,G.width,G.height),T.material.uniforms.map.value.image=G,T.material.uniforms.map.value.minFilter=g.LinearFilter,T.material.uniforms.map.value.needsUpdate=!0,T.position.copy(C.position),T.quaternion.copy(C.quaternion),p.scene.add(T),p.needsRender=!0,[2]}})})},t.onFiveMouseMove=function(u){var m;if(t.state.mode==="mask"&&t.five.state.mode==="Panorama"){var p=t,y=p.five,T=p.itemMaskMesh,M=y.observers[y.state.panoIndex],N=(m=u.pointers[0])===null||m===void 0?void 0:m.raycaster;if(N){var C=N.intersectObjects(t.group.children.filter(function(F){return F.userData.visible_viewpoint.includes(String(M.derivedId))}),!0)[0];C?T.material.uniforms.color.value=C.object.userData.color:T.material.uniforms.color.value=new g.Vector4(0,0,0,1)}}},t.onFiveTapGesture=function(u){var m=t.five,p=m.observers[m.state.panoIndex];if(u){var y=u.intersectObjects(t.group.children.filter(function(N){return N.userData.visible_viewpoint.includes(String(p.derivedId))}),!0)[0];if(y){t.select(y.object.name),t.stopAnimation&&t.stopAnimation(),t.tapPosition=y.point,t.changeTapScreenPosition();var T=new Ct({opacity:0,scale:0,shadow:2}),M=new Ct({opacity:0,scale:0,shadow:2});return T.setKeyframes(fr,1e3),M.setKeyframes(vr,1e3),t.stopAnimation=nt.AnimationFrameLoop.shared.add(function(N,C){var F,G=T.update(N),O=M.update(N);t.wrapper.firstChild.style.opacity="".concat(T.value.opacity),t.wrapper.firstChild.style.transform="scale(".concat(T.value.scale,")"),t.wrapper.firstChild.style.boxShadow="0 0 0 ".concat(T.value.shadow,"px #fff"),t.wrapper.lastChild.style.opacity="".concat(M.value.opacity),t.wrapper.lastChild.style.transform="scale(".concat(M.value.scale,")"),t.wrapper.lastChild.style.boxShadow="0 0 0 ".concat(M.value.shadow,"px #fff"),G&&O&&((F=t.stopAnimation)===null||F===void 0||F.call(t),t.stopAnimation=void 0,m.getElement().parentElement.removeChild(t.wrapper))},!1,0,10),m.getElement().parentElement.appendChild(t.wrapper),!1}}},t.changeTapScreenPosition=function(){if(t.tapPosition){var u=t.tapPosition.clone().project(t.five.camera),m=(u.x+1)/2,p=-(u.y-1)/2;t.wrapper.style.opacity=u.z>0&&u.z<1?"1":"0",t.wrapper.style.transform="translate(".concat(m*100,"%, ").concat(p*100,"%)")}},t.onFiveCameraUpdate=function(u){t.changeTapScreenPosition()},t.dispose=function(){t.disable()},t.five=n;var l={enabled:!0,visible:!0,mode:"box",selectedId:null,selectAll:!1};t.state=Object.assign(l,a==null?void 0:a.initialState);var h=W({},a==null?void 0:a.config);return t._config=h,t.group.rotateX(Math.PI),t.wrapper.className="ItemMaskPlugin",t.wrapper.innerHTML='<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>',t.style.innerHTML=`
307
+ `,Tn=function(f){it(o,f);function o(e,a){var t=f.call(this,e)||this;t.canvas=document.createElement("canvas"),t.group=new E.Group,t.wrapper=document.createElement("div"),t.style=document.createElement("style"),t.itemMaskMesh=function(){var c=new E.Mesh(new E.SphereBufferGeometry(1,60,40),new E.ShaderMaterial({vertexShader:gn,fragmentShader:yn,uniforms:{map:{value:new E.Texture},color:{value:new E.Vector4}},depthWrite:!1,depthTest:!1,transparent:!0}));return c.renderOrder=-3,c.geometry.rotateY(-Math.PI/2),c.geometry.scale(-1,1,1),c}(),t.onFivePanoArrived=function(c){t.state.mode==="mask"&&t.loadPanoMask(c)},t.onFiveWantsMoveToPano=function(c){t.state.mode==="box"&&t.select()},t.loadPanoMask=function(c){return et(t,void 0,void 0,function(){var g,d,m,w,A,k,x,D,Y,y;return tt(this,function(T){switch(T.label){case 0:return g=this,d=g.five,m=g.canvas,w=g.itemMaskMesh,A=g.data,k=m.getContext("2d"),x=d.observers[c],D=(y=A==null?void 0:A.object_mask_list.find(function(P){return P.derived_id===String(x.derivedId)}))===null||y===void 0?void 0:y.object_mask_url,D?[4,cn(D)]:[2];case 1:return Y=T.sent(),m.width=Y.width,m.height=Y.height,k==null||k.drawImage(Y,0,0,Y.width,Y.height),w.material.uniforms.map.value.image=Y,w.material.uniforms.map.value.minFilter=E.LinearFilter,w.material.uniforms.map.value.needsUpdate=!0,w.position.copy(x.position),w.quaternion.copy(x.quaternion),d.scene.add(w),d.needsRender=!0,[2]}})})},t.onFiveMouseMove=function(c){var g;if(t.state.mode==="mask"&&t.five.state.mode==="Panorama"){var d=t,m=d.five,w=d.itemMaskMesh,A=m.observers[m.state.panoIndex],k=(g=c.pointers[0])===null||g===void 0?void 0:g.raycaster;if(k){var x=k.intersectObjects(t.group.children.filter(function(D){return D.userData.visible_viewpoint.includes(String(A.derivedId))}),!0)[0];x?w.material.uniforms.color.value=x.object.userData.color:w.material.uniforms.color.value=new E.Vector4(0,0,0,1)}}},t.onFiveTapGesture=function(c){var g=t.five,d=g.observers[g.state.panoIndex];if(c){var m=c.intersectObjects(t.group.children.filter(function(k){return k.userData.visible_viewpoint.includes(String(d.derivedId))}),!0)[0];if(m){t.select(m.object.name),t.stopAnimation&&t.stopAnimation(),t.tapPosition=m.point,t.changeTapScreenPosition();var w=new Lt({opacity:0,scale:0,shadow:2}),A=new Lt({opacity:0,scale:0,shadow:2});return w.setKeyframes(vn,1e3),A.setKeyframes(mn,1e3),t.stopAnimation=Tt.AnimationFrameLoop.shared.add(function(k,x){var D,Y=w.update(k),y=A.update(k);t.wrapper.firstChild.style.opacity="".concat(w.value.opacity),t.wrapper.firstChild.style.transform="scale(".concat(w.value.scale,")"),t.wrapper.firstChild.style.boxShadow="0 0 0 ".concat(w.value.shadow,"px #fff"),t.wrapper.lastChild.style.opacity="".concat(A.value.opacity),t.wrapper.lastChild.style.transform="scale(".concat(A.value.scale,")"),t.wrapper.lastChild.style.boxShadow="0 0 0 ".concat(A.value.shadow,"px #fff"),Y&&y&&((D=t.stopAnimation)===null||D===void 0||D.call(t),t.stopAnimation=void 0,g.getElement().parentElement.removeChild(t.wrapper))},!1,0,10),g.getElement().parentElement.appendChild(t.wrapper),!1}}},t.changeTapScreenPosition=function(){if(t.tapPosition){var c=t.tapPosition.clone().project(t.five.camera),g=(c.x+1)/2,d=-(c.y-1)/2;t.wrapper.style.opacity=c.z>0&&c.z<1?"1":"0",t.wrapper.style.transform="translate(".concat(g*100,"%, ").concat(d*100,"%)")}},t.onFiveCameraUpdate=function(c){t.changeTapScreenPosition()},t.dispose=function(){t.disable()},t.five=e;var l={enabled:!0,visible:!0,mode:"box",selectedId:null,selectAll:!1};t.state=Object.assign(l,a==null?void 0:a.initialState);var h=ae({},a==null?void 0:a.config);return t._config=h,t.group.rotateX(Math.PI),t.wrapper.className="ItemMaskPlugin",t.wrapper.innerHTML='<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>',t.style.innerHTML=`
308
308
  .ItemMaskPlugin {
309
309
  position: absolute;
310
310
  top: 0;
@@ -322,7 +322,7 @@ void main() {
322
322
  border-radius: 50%;
323
323
  box-shadow: 0px 0px 0px 2px #fff;
324
324
  }
325
- `,t.state.enabled&&t._enable({userAction:!1}),t}return Object.defineProperty(o.prototype,"config",{get:function(){return W({},this._config)},enumerable:!1,configurable:!0}),o.prototype.updateState=function(n,a){var t=this.state;this.state=W(W({},this.state),n),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:a})},o.prototype.load=function(n){return Ve(this,void 0,void 0,function(){var a,t,l=this;return Ge(this,function(h){return this.data=n,a=n.data_list.map(function(u){var m,p=u.position.end.map(function(V){return Number(V)}),y=u.position.start.map(function(V){return Number(V)}),T=Math.abs(p[0]-y[0]),M=Math.abs(p[1]-y[1]),N=Math.abs(p[2]-y[2]),C=p[0]/2+y[0]/2,F=p[1]/2+y[1]/2,G=p[2]/2+y[2]/2,O=new g.Vector3(C,F,G),j=new g.BoxBufferGeometry(T,M,N),q=new g.ShaderMaterial({vertexShader:`
325
+ `,t.state.enabled&&t._enable({userAction:!1}),t}return Object.defineProperty(o.prototype,"config",{get:function(){return ae({},this._config)},enumerable:!1,configurable:!0}),o.prototype.updateState=function(e,a){var t=this.state;this.state=ae(ae({},this.state),e),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:a})},o.prototype.load=function(e){return et(this,void 0,void 0,function(){var a,t,l=this;return tt(this,function(h){return this.data=e,a=e.data_list.map(function(c){var g,d=c.position.end.map(function(S){return Number(S)}),m=c.position.start.map(function(S){return Number(S)}),w=Math.abs(d[0]-m[0]),A=Math.abs(d[1]-m[1]),k=Math.abs(d[2]-m[2]),x=d[0]/2+m[0]/2,D=d[1]/2+m[1]/2,Y=d[2]/2+m[2]/2,y=new E.Vector3(x,D,Y),T=new E.BoxBufferGeometry(w,A,k),P=new E.ShaderMaterial({vertexShader:`
326
326
  varying vec2 vUv;
327
327
  void main() {
328
328
  vUv = uv;
@@ -347,13 +347,13 @@ void main() {
347
347
  gl_FragColor = vec4(1.0, 1.0, 1.0, alpha / 4.0 * opacity);
348
348
  }
349
349
  }
350
- `,side:g.DoubleSide,visible:l.state.selectedId==="".concat(u.category_name).concat(u.index),uniforms:{opacity:{value:l.state.mode==="box"?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),f=new g.Mesh(j,q);return f.position.copy(O),f.name="".concat(u.category_name).concat(u.index),f.userData.color=new((m=g.Vector4).bind.apply(m,Mt(Mt([void 0],u.mask_color.map(function(V){return V/255}).reverse(),!1),[1],!1))),f.userData.visible_viewpoint=Object.keys(u.visible_viewpoint),f}),(t=this.group).add.apply(t,a),[2]})})},o.prototype.setState=function(n,a){a===void 0&&(a={});var t=this.state,l=a.userAction!==void 0?a.userAction:!0;if(this.updateState(n,l),n.enabled!==void 0&&t.enabled!==n.enabled){var h={userAction:l};n.enabled?this._enable(h):this._disable(h)}},o.prototype.setMode=function(n){this.updateState({mode:n},!1),n==="mask"?(this.group.children.forEach(function(a){a.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):n==="box"&&(this.itemMaskMesh.material.uniforms.color.value=new g.Vector4(0,0,0,1),this.group.children.forEach(function(a){a.material.uniforms.opacity.value=1}),this.five.needsRender=!0)},o.prototype.select=function(n,a){var t=this,l;this.updateState({selectedId:n!=null?n:null},(l=a==null?void 0:a.userAction)!==null&&l!==void 0?l:!1),this.group.children.forEach(function(h){h.material.visible=t.state.selectAll||h.name===n}),this.five.needsRender=!0},o.prototype.selectAll=function(n){n===void 0&&(n=!0),this.updateState({selectAll:!!n},!1),this.select()},o.prototype._enable=function(n){this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("gesture.mousemove",this.onFiveMouseMove),this.five.on("wantsTapGesture",this.onFiveTapGesture),this.five.on("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)},o.prototype._disable=function(n){this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("gesture.mousemove",this.onFiveMouseMove),this.five.off("wantsTapGesture",this.onFiveTapGesture),this.five.off("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)},o.prototype.enable=function(n){var a;if(!this.state.enabled){var t=(a=n==null?void 0:n.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},o.prototype.disable=function(n){var a;if(this.state.enabled!==!1){var t=(a=n==null?void 0:n.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},o}(exports.BasePlugin.Controller),gr=function(c,o){return new mr(c,o)};/*! Hammer.JS - v2.0.7 - 2016-04-22
350
+ `,side:E.DoubleSide,visible:l.state.selectedId==="".concat(c.category_name).concat(c.index),uniforms:{opacity:{value:l.state.mode==="box"?1:0}},depthWrite:!1,depthTest:!1,transparent:!0}),p=new E.Mesh(T,P);return p.position.copy(y),p.name="".concat(c.category_name).concat(c.index),p.userData.color=new((g=E.Vector4).bind.apply(g,Dt(Dt([void 0],c.mask_color.map(function(S){return S/255}).reverse(),!1),[1],!1))),p.userData.visible_viewpoint=Object.keys(c.visible_viewpoint),p}),(t=this.group).add.apply(t,a),[2]})})},o.prototype.setState=function(e,a){a===void 0&&(a={});var t=this.state,l=a.userAction!==void 0?a.userAction:!0;if(this.updateState(e,l),e.enabled!==void 0&&t.enabled!==e.enabled){var h={userAction:l};e.enabled?this._enable(h):this._disable(h)}},o.prototype.setMode=function(e){this.updateState({mode:e},!1),e==="mask"?(this.group.children.forEach(function(a){a.material.uniforms.opacity.value=0}),this.loadPanoMask(this.five.state.panoIndex)):e==="box"&&(this.itemMaskMesh.material.uniforms.color.value=new E.Vector4(0,0,0,1),this.group.children.forEach(function(a){a.material.uniforms.opacity.value=1}),this.five.needsRender=!0)},o.prototype.select=function(e,a){var t=this,l;this.updateState({selectedId:e!=null?e:null},(l=a==null?void 0:a.userAction)!==null&&l!==void 0?l:!1),this.group.children.forEach(function(h){h.material.visible=t.state.selectAll||h.name===e}),this.five.needsRender=!0},o.prototype.selectAll=function(e){e===void 0&&(e=!0),this.updateState({selectAll:!!e},!1),this.select()},o.prototype._enable=function(e){this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("gesture.mousemove",this.onFiveMouseMove),this.five.on("wantsTapGesture",this.onFiveTapGesture),this.five.on("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.add(this.group),document.head.appendChild(this.style)},o.prototype._disable=function(e){this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("gesture.mousemove",this.onFiveMouseMove),this.five.off("wantsTapGesture",this.onFiveTapGesture),this.five.off("cameraUpdate",this.onFiveCameraUpdate),this.five.scene.remove(this.group),document.head.removeChild(this.style)},o.prototype.enable=function(e){var a;if(!this.state.enabled){var t=(a=e==null?void 0:e.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!0},t),this._enable({userAction:t})}},o.prototype.disable=function(e){var a;if(this.state.enabled!==!1){var t=(a=e==null?void 0:e.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!1},t),this._disable({userAction:t})}},o}(exports.BasePlugin.Controller),bn=function(f,o){return new Tn(f,o)};/*! Hammer.JS - v2.0.7 - 2016-04-22
351
351
  * http://hammerjs.github.io/
352
352
  *
353
353
  * Copyright (c) 2016 Jorik Tangelder;
354
- * Licensed under the MIT license */var tt=function(c,o,n,a){var t=["","webkit","Moz","MS","ms","o"],l=o.createElement?o.createElement("div"):a,h="function",u=Math.round,m=Math.abs,p=Date.now;function y(e,r,i){return setTimeout(j(e,i),r)}function T(e,r,i){return Array.isArray(e)?(M(e,i[r],i),!0):!1}function M(e,r,i){var s;if(e)if(e.forEach)e.forEach(r,i);else if(e.length!==a)for(s=0;s<e.length;)r.call(i,e[s],s,e),s++;else for(s in e)e.hasOwnProperty(s)&&r.call(i,e[s],s,e)}function N(e,r,i){var s="DEPRECATED METHOD: "+r+`
354
+ * Licensed under the MIT license */var mt=function(f,o,e,a){var t=["","webkit","Moz","MS","ms","o"],l=o.createElement?o.createElement("div"):a,h="function",c=Math.round,g=Math.abs,d=Date.now;function m(n,r,i){return setTimeout(T(n,i),r)}function w(n,r,i){return Array.isArray(n)?(A(n,i[r],i),!0):!1}function A(n,r,i){var u;if(n)if(n.forEach)n.forEach(r,i);else if(n.length!==a)for(u=0;u<n.length;)r.call(i,n[u],u,n),u++;else for(u in n)n.hasOwnProperty(u)&&r.call(i,n[u],u,n)}function k(n,r,i){var u="DEPRECATED METHOD: "+r+`
355
355
  `+i+` AT
356
- `;return function(){var v=new Error("get-stack-trace"),d=v&&v.stack?v.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",b=c.console&&(c.console.warn||c.console.log);return b&&b.call(c.console,s,d),e.apply(this,arguments)}}var C;typeof Object.assign!="function"?C=function(r){if(r===a||r===null)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(r),s=1;s<arguments.length;s++){var v=arguments[s];if(v!==a&&v!==null)for(var d in v)v.hasOwnProperty(d)&&(i[d]=v[d])}return i}:C=Object.assign;var F=N(function(r,i,s){for(var v=Object.keys(i),d=0;d<v.length;)(!s||s&&r[v[d]]===a)&&(r[v[d]]=i[v[d]]),d++;return r},"extend","Use `assign`."),G=N(function(r,i){return F(r,i,!0)},"merge","Use `assign`.");function O(e,r,i){var s=r.prototype,v;v=e.prototype=Object.create(s),v.constructor=e,v._super=s,i&&C(v,i)}function j(e,r){return function(){return e.apply(r,arguments)}}function q(e,r){return typeof e==h?e.apply(r&&r[0]||a,r):e}function f(e,r){return e===a?r:e}function V(e,r,i){M(fe(r),function(s){e.addEventListener(s,i,!1)})}function P(e,r,i){M(fe(r),function(s){e.removeEventListener(s,i,!1)})}function Ce(e,r){for(;e;){if(e==r)return!0;e=e.parentNode}return!1}function ie(e,r){return e.indexOf(r)>-1}function fe(e){return e.trim().split(/\s+/g)}function se(e,r,i){if(e.indexOf&&!i)return e.indexOf(r);for(var s=0;s<e.length;){if(i&&e[s][i]==r||!i&&e[s]===r)return s;s++}return-1}function ve(e){return Array.prototype.slice.call(e,0)}function Ae(e,r,i){for(var s=[],v=[],d=0;d<e.length;){var b=e[d][r];se(v,b)<0&&s.push(e[d]),v[d]=b,d++}return s=s.sort(function(K,L){return K[r]>L[r]}),s}function le(e,r){for(var i,s,v=r[0].toUpperCase()+r.slice(1),d=0;d<t.length;){if(i=t[d],s=i?i+v:r,s in e)return s;d++}return a}var ee=1;function A(){return ee++}function E(e){var r=e.ownerDocument||e;return r.defaultView||r.parentWindow||c}var w=/mobile|tablet|ip(ad|hone|od)|android/i,x="ontouchstart"in c,D=le(c,"PointerEvent")!==a,Z=x&&w.test(navigator.userAgent),B="touch",I="pen",Y="mouse",k="kinect",S=25,_=1,z=2,U=4,R=8,xe=1,me=2,ge=4,ye=8,Te=16,te=me|ge,ue=ye|Te,at=te|ue,ot=["x","y"],Ie=["clientX","clientY"];function J(e,r){var i=this;this.manager=e,this.callback=r,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(s){q(e.options.enable,[e])&&i.handler(s)},this.init()}J.prototype={handler:function(){},init:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(E(this.element),this.evWin,this.domHandler)}};function It(e){var r,i=e.options.inputClass;return i?r=i:D?r=je:Z?r=Se:x?r=ze:r=Ne,new r(e,Ot)}function Ot(e,r,i){var s=i.pointers.length,v=i.changedPointers.length,d=r&_&&s-v===0,b=r&(U|R)&&s-v===0;i.isFirst=!!d,i.isFinal=!!b,d&&(e.session={}),i.eventType=r,Nt(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function Nt(e,r){var i=e.session,s=r.pointers,v=s.length;i.firstInput||(i.firstInput=st(r)),v>1&&!i.firstMultiple?i.firstMultiple=st(r):v===1&&(i.firstMultiple=!1);var d=i.firstInput,b=i.firstMultiple,H=b?b.center:d.center,K=r.center=lt(s);r.timeStamp=p(),r.deltaTime=r.timeStamp-d.timeStamp,r.angle=Xe(H,K),r.distance=Oe(H,K),St(i,r),r.offsetDirection=ut(r.deltaX,r.deltaY);var L=ct(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=L.x,r.overallVelocityY=L.y,r.overallVelocity=m(L.x)>m(L.y)?L.x:L.y,r.scale=b?Dt(b.pointers,s):1,r.rotation=b?Ft(b.pointers,s):0,r.maxPointers=i.prevInput?r.pointers.length>i.prevInput.maxPointers?r.pointers.length:i.prevInput.maxPointers:r.pointers.length,kt(i,r);var ne=e.element;Ce(r.srcEvent.target,ne)&&(ne=r.srcEvent.target),r.target=ne}function St(e,r){var i=r.center,s=e.offsetDelta||{},v=e.prevDelta||{},d=e.prevInput||{};(r.eventType===_||d.eventType===U)&&(v=e.prevDelta={x:d.deltaX||0,y:d.deltaY||0},s=e.offsetDelta={x:i.x,y:i.y}),r.deltaX=v.x+(i.x-s.x),r.deltaY=v.y+(i.y-s.y)}function kt(e,r){var i=e.lastInterval||r,s=r.timeStamp-i.timeStamp,v,d,b,H;if(r.eventType!=R&&(s>S||i.velocity===a)){var K=r.deltaX-i.deltaX,L=r.deltaY-i.deltaY,ne=ct(s,K,L);d=ne.x,b=ne.y,v=m(ne.x)>m(ne.y)?ne.x:ne.y,H=ut(K,L),e.lastInterval=r}else v=i.velocity,d=i.velocityX,b=i.velocityY,H=i.direction;r.velocity=v,r.velocityX=d,r.velocityY=b,r.direction=H}function st(e){for(var r=[],i=0;i<e.pointers.length;)r[i]={clientX:u(e.pointers[i].clientX),clientY:u(e.pointers[i].clientY)},i++;return{timeStamp:p(),pointers:r,center:lt(r),deltaX:e.deltaX,deltaY:e.deltaY}}function lt(e){var r=e.length;if(r===1)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var i=0,s=0,v=0;v<r;)i+=e[v].clientX,s+=e[v].clientY,v++;return{x:u(i/r),y:u(s/r)}}function ct(e,r,i){return{x:r/e||0,y:i/e||0}}function ut(e,r){return e===r?xe:m(e)>=m(r)?e<0?me:ge:r<0?ye:Te}function Oe(e,r,i){i||(i=ot);var s=r[i[0]]-e[i[0]],v=r[i[1]]-e[i[1]];return Math.sqrt(s*s+v*v)}function Xe(e,r,i){i||(i=ot);var s=r[i[0]]-e[i[0]],v=r[i[1]]-e[i[1]];return Math.atan2(v,s)*180/Math.PI}function Ft(e,r){return Xe(r[1],r[0],Ie)+Xe(e[1],e[0],Ie)}function Dt(e,r){return Oe(r[0],r[1],Ie)/Oe(e[0],e[1],Ie)}var Ut={mousedown:_,mousemove:z,mouseup:U},Bt="mousedown",Lt="mousemove mouseup";function Ne(){this.evEl=Bt,this.evWin=Lt,this.pressed=!1,J.apply(this,arguments)}O(Ne,J,{handler:function(r){var i=Ut[r.type];i&_&&(r.button===0||r.button===2)&&(this.pressed=!0),i&z&&r.which!==1&&(i=U),this.pressed&&(i&U&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[r],changedPointers:[r],pointerType:Y,srcEvent:r}))}});var ht={pointerdown:_,pointermove:z,pointerup:U,pointercancel:R,pointerout:R},Rt={2:B,3:I,4:Y,5:k},ft="pointerdown",vt="pointermove pointerup pointercancel";c.MSPointerEvent&&!c.PointerEvent&&(ft="MSPointerDown",vt="MSPointerMove MSPointerUp MSPointerCancel");function je(){this.evEl=ft,this.evWin=vt,J.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}O(je,J,{handler:function(r){var i=this.store,s=!1,v=!1,d=r.type.toLowerCase().replace("ms",""),b=ht[d],H=Rt[r.pointerType]||r.pointerType,K=H==B,L=se(i,r.pointerId,"pointerId");b&_&&(r.button===0||r.button===2||K)?L<0&&(i.push(r),L=i.length-1):b&(U|R)?s=!0:!K&&r.buttons===0&&(s=!0,v=!0,b=ht.pointerup),!(L<0)&&(v||(i[L]=r),this.callback(this.manager,b,{pointers:i,changedPointers:[r],pointerType:H,srcEvent:i[L]}),s&&i.splice(L,1))}});var Vt={touchstart:_,touchmove:z,touchend:U,touchcancel:R},Gt="touchstart",Yt="touchstart touchmove touchend touchcancel";function pt(){this.evTarget=Gt,this.evWin=Yt,this.started=!1,J.apply(this,arguments)}O(pt,J,{handler:function(r){var i=Vt[r.type];if(i===_&&(this.started=!0),!!this.started){var s=Ht.call(this,r,i);i&(U|R)&&s[0].length-s[1].length===0&&(this.started=!1),this.callback(this.manager,i,{pointers:s[0],changedPointers:s[1],pointerType:B,srcEvent:r})}}});function Ht(e,r){var i=ve(e.touches),s=ve(e.changedTouches);return r&(U|R)&&(i=Ae(i.concat(s),"identifier")),[i,s]}var Xt={touchstart:_,touchmove:z,touchend:U,touchcancel:R},jt="touchstart touchmove touchend touchcancel";function Se(){this.evTarget=jt,this.targetIds={},J.apply(this,arguments)}O(Se,J,{handler:function(r){var i=Xt[r.type],s=zt.call(this,r,i);s&&this.callback(this.manager,i,{pointers:s[0],changedPointers:s[1],pointerType:B,srcEvent:r})}});function zt(e,r){var i=ve(e.touches),s=this.targetIds;if(r&(_|z)&&i.length===1)return s[i[0].identifier]=!0,[i,i];var v,d,b=ve(e.changedTouches),H=[],K=this.target;if(d=i.filter(function(L){return Ce(L.target,K)}),r===_)for(v=0;v<d.length;)s[d[v].identifier]=!0,v++;for(v=0;v<b.length;)s[b[v].identifier]&&H.push(b[v]),r&(U|R)&&delete s[b[v].identifier],v++;if(H.length)return[Ae(d.concat(H),"identifier"),H]}var Wt=2500,dt=25;function ze(){J.apply(this,arguments);var e=j(this.handler,this);this.touch=new Se(this.manager,e),this.mouse=new Ne(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}O(ze,J,{handler:function(r,i,s){var v=s.pointerType==B,d=s.pointerType==Y;if(!(d&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(v)qt.call(this,i,s);else if(d&&Zt.call(this,s))return;this.callback(r,i,s)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function qt(e,r){e&_?(this.primaryTouch=r.changedPointers[0].identifier,mt.call(this,r)):e&(U|R)&&mt.call(this,r)}function mt(e){var r=e.changedPointers[0];if(r.identifier===this.primaryTouch){var i={x:r.clientX,y:r.clientY};this.lastTouches.push(i);var s=this.lastTouches,v=function(){var d=s.indexOf(i);d>-1&&s.splice(d,1)};setTimeout(v,Wt)}}function Zt(e){for(var r=e.srcEvent.clientX,i=e.srcEvent.clientY,s=0;s<this.lastTouches.length;s++){var v=this.lastTouches[s],d=Math.abs(r-v.x),b=Math.abs(i-v.y);if(d<=dt&&b<=dt)return!0}return!1}var gt=l?le(l.style,"touchAction"):a,yt=gt!==a,Tt="compute",wt="auto",We="manipulation",he="none",we="pan-x",be="pan-y",ke=Jt();function qe(e,r){this.manager=e,this.set(r)}qe.prototype={set:function(e){e==Tt&&(e=this.compute()),yt&&this.manager.element.style&&ke[e]&&(this.manager.element.style[gt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return M(this.manager.recognizers,function(r){q(r.options.enable,[r])&&(e=e.concat(r.getTouchAction()))}),Kt(e.join(" "))},preventDefaults:function(e){var r=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented){r.preventDefault();return}var s=this.actions,v=ie(s,he)&&!ke[he],d=ie(s,be)&&!ke[be],b=ie(s,we)&&!ke[we];if(v){var H=e.pointers.length===1,K=e.distance<2,L=e.deltaTime<250;if(H&&K&&L)return}if(!(b&&d)&&(v||d&&i&te||b&&i&ue))return this.preventSrc(r)},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function Kt(e){if(ie(e,he))return he;var r=ie(e,we),i=ie(e,be);return r&&i?he:r||i?r?we:be:ie(e,We)?We:wt}function Jt(){if(!yt)return!1;var e={},r=c.CSS&&c.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){e[i]=r?c.CSS.supports("touch-action",i):!0}),e}var Fe=1,Q=2,pe=4,ce=8,ae=ce,Ee=16,re=32;function oe(e){this.options=C({},this.defaults,e||{}),this.id=A(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=Fe,this.simultaneous={},this.requireFail=[]}oe.prototype={defaults:{},set:function(e){return C(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(T(e,"recognizeWith",this))return this;var r=this.simultaneous;return e=De(e,this),r[e.id]||(r[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return T(e,"dropRecognizeWith",this)?this:(e=De(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(T(e,"requireFailure",this))return this;var r=this.requireFail;return e=De(e,this),se(r,e)===-1&&(r.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(T(e,"dropRequireFailure",this))return this;e=De(e,this);var r=se(this.requireFail,e);return r>-1&&this.requireFail.splice(r,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var r=this,i=this.state;function s(v){r.manager.emit(v,e)}i<ce&&s(r.options.event+bt(i)),s(r.options.event),e.additionalEvent&&s(e.additionalEvent),i>=ce&&s(r.options.event+bt(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=re},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(re|Fe)))return!1;e++}return!0},recognize:function(e){var r=C({},e);if(!q(this.options.enable,[this,r])){this.reset(),this.state=re;return}this.state&(ae|Ee|re)&&(this.state=Fe),this.state=this.process(r),this.state&(Q|pe|ce|Ee)&&this.tryEmit(r)},process:function(e){},getTouchAction:function(){},reset:function(){}};function bt(e){return e&Ee?"cancel":e&ce?"end":e&pe?"move":e&Q?"start":""}function Et(e){return e==Te?"down":e==ye?"up":e==me?"left":e==ge?"right":""}function De(e,r){var i=r.manager;return i?i.get(e):e}function $(){oe.apply(this,arguments)}O($,oe,{defaults:{pointers:1},attrTest:function(e){var r=this.options.pointers;return r===0||e.pointers.length===r},process:function(e){var r=this.state,i=e.eventType,s=r&(Q|pe),v=this.attrTest(e);return s&&(i&R||!v)?r|Ee:s||v?i&U?r|ce:r&Q?r|pe:Q:re}});function Ue(){$.apply(this,arguments),this.pX=null,this.pY=null}O(Ue,$,{defaults:{event:"pan",threshold:10,pointers:1,direction:at},getTouchAction:function(){var e=this.options.direction,r=[];return e&te&&r.push(be),e&ue&&r.push(we),r},directionTest:function(e){var r=this.options,i=!0,s=e.distance,v=e.direction,d=e.deltaX,b=e.deltaY;return v&r.direction||(r.direction&te?(v=d===0?xe:d<0?me:ge,i=d!=this.pX,s=Math.abs(e.deltaX)):(v=b===0?xe:b<0?ye:Te,i=b!=this.pY,s=Math.abs(e.deltaY))),e.direction=v,i&&s>r.threshold&&v&r.direction},attrTest:function(e){return $.prototype.attrTest.call(this,e)&&(this.state&Q||!(this.state&Q)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var r=Et(e.direction);r&&(e.additionalEvent=this.options.event+r),this._super.emit.call(this,e)}});function Ze(){$.apply(this,arguments)}O(Ze,$,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[he]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Q)},emit:function(e){if(e.scale!==1){var r=e.scale<1?"in":"out";e.additionalEvent=this.options.event+r}this._super.emit.call(this,e)}});function Ke(){oe.apply(this,arguments),this._timer=null,this._input=null}O(Ke,oe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[wt]},process:function(e){var r=this.options,i=e.pointers.length===r.pointers,s=e.distance<r.threshold,v=e.deltaTime>r.time;if(this._input=e,!s||!i||e.eventType&(U|R)&&!v)this.reset();else if(e.eventType&_)this.reset(),this._timer=y(function(){this.state=ae,this.tryEmit()},r.time,this);else if(e.eventType&U)return ae;return re},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===ae&&(e&&e.eventType&U?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}});function Je(){$.apply(this,arguments)}O(Je,$,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[he]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Q)}});function Qe(){$.apply(this,arguments)}O(Qe,$,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:te|ue,pointers:1},getTouchAction:function(){return Ue.prototype.getTouchAction.call(this)},attrTest:function(e){var r=this.options.direction,i;return r&(te|ue)?i=e.overallVelocity:r&te?i=e.overallVelocityX:r&ue&&(i=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&m(i)>this.options.velocity&&e.eventType&U},emit:function(e){var r=Et(e.offsetDirection);r&&this.manager.emit(this.options.event+r,e),this.manager.emit(this.options.event,e)}});function Be(){oe.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}O(Be,oe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[We]},process:function(e){var r=this.options,i=e.pointers.length===r.pointers,s=e.distance<r.threshold,v=e.deltaTime<r.time;if(this.reset(),e.eventType&_&&this.count===0)return this.failTimeout();if(s&&v&&i){if(e.eventType!=U)return this.failTimeout();var d=this.pTime?e.timeStamp-this.pTime<r.interval:!0,b=!this.pCenter||Oe(this.pCenter,e.center)<r.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,!b||!d?this.count=1:this.count+=1,this._input=e;var H=this.count%r.taps;if(H===0)return this.hasRequireFailures()?(this._timer=y(function(){this.state=ae,this.tryEmit()},r.interval,this),Q):ae}return re},failTimeout:function(){return this._timer=y(function(){this.state=re},this.options.interval,this),re},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ae&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function de(e,r){return r=r||{},r.recognizers=f(r.recognizers,de.defaults.preset),new $e(e,r)}de.VERSION="2.0.7",de.defaults={domEvents:!1,touchAction:Tt,enable:!0,inputTarget:null,inputClass:null,preset:[[Je,{enable:!1}],[Ze,{enable:!1},["rotate"]],[Qe,{direction:te}],[Ue,{direction:te},["swipe"]],[Be],[Be,{event:"doubletap",taps:2},["tap"]],[Ke]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Qt=1,Pt=2;function $e(e,r){this.options=C({},de.defaults,r||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=It(this),this.touchAction=new qe(this,this.options.touchAction),_t(this,!0),M(this.options.recognizers,function(i){var s=this.add(new i[0](i[1]));i[2]&&s.recognizeWith(i[2]),i[3]&&s.requireFailure(i[3])},this)}$e.prototype={set:function(e){return C(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?Pt:Qt},recognize:function(e){var r=this.session;if(!r.stopped){this.touchAction.preventDefaults(e);var i,s=this.recognizers,v=r.curRecognizer;(!v||v&&v.state&ae)&&(v=r.curRecognizer=null);for(var d=0;d<s.length;)i=s[d],r.stopped!==Pt&&(!v||i==v||i.canRecognizeWith(v))?i.recognize(e):i.reset(),!v&&i.state&(Q|pe|ce)&&(v=r.curRecognizer=i),d++}},get:function(e){if(e instanceof oe)return e;for(var r=this.recognizers,i=0;i<r.length;i++)if(r[i].options.event==e)return r[i];return null},add:function(e){if(T(e,"add",this))return this;var r=this.get(e.options.event);return r&&this.remove(r),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(T(e,"remove",this))return this;if(e=this.get(e),e){var r=this.recognizers,i=se(r,e);i!==-1&&(r.splice(i,1),this.touchAction.update())}return this},on:function(e,r){if(e!==a&&r!==a){var i=this.handlers;return M(fe(e),function(s){i[s]=i[s]||[],i[s].push(r)}),this}},off:function(e,r){if(e!==a){var i=this.handlers;return M(fe(e),function(s){r?i[s]&&i[s].splice(se(i[s],r),1):delete i[s]}),this}},emit:function(e,r){this.options.domEvents&&$t(e,r);var i=this.handlers[e]&&this.handlers[e].slice();if(!(!i||!i.length)){r.type=e,r.preventDefault=function(){r.srcEvent.preventDefault()};for(var s=0;s<i.length;)i[s](r),s++}},destroy:function(){this.element&&_t(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function _t(e,r){var i=e.element;if(i.style){var s;M(e.options.cssProps,function(v,d){s=le(i.style,d),r?(e.oldCssProps[s]=i.style[s],i.style[s]=v):i.style[s]=e.oldCssProps[s]||""}),r||(e.oldCssProps={})}}function $t(e,r){var i=o.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=r,r.target.dispatchEvent(i)}return C(de,{INPUT_START:_,INPUT_MOVE:z,INPUT_END:U,INPUT_CANCEL:R,STATE_POSSIBLE:Fe,STATE_BEGAN:Q,STATE_CHANGED:pe,STATE_ENDED:ce,STATE_RECOGNIZED:ae,STATE_CANCELLED:Ee,STATE_FAILED:re,DIRECTION_NONE:xe,DIRECTION_LEFT:me,DIRECTION_RIGHT:ge,DIRECTION_UP:ye,DIRECTION_DOWN:Te,DIRECTION_HORIZONTAL:te,DIRECTION_VERTICAL:ue,DIRECTION_ALL:at,Manager:$e,Input:J,TouchAction:qe,TouchInput:Se,MouseInput:Ne,PointerEventInput:je,TouchMouseInput:ze,SingleTouchInput:pt,Recognizer:oe,AttrRecognizer:$,Tap:Be,Pan:Ue,Swipe:Qe,Pinch:Ze,Rotate:Je,Press:Ke,on:V,off:P,each:M,merge:G,extend:F,assign:C,inherit:O,bindFn:j,prefixed:le}),de}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function At(c,o,n){var a=o.getBoundingClientRect(),t=a.top,l=a.left,h=a.width,u=a.height;return new g.Vector2((c.x-l)/h*2-1,-(c.y-t)/u*2+1)}var xt=function(c){He(o,c);function o(n,a,t,l,h){var u=c.call(this)||this;u.type="RoundedBoxGeometry",h=isNaN(h)?1:Math.max(1,Math.floor(h)),n=isNaN(n)?1:n,a=isNaN(a)?1:a,t=isNaN(t)?1:t,l=isNaN(l)?.15:l,l=Math.min(l,Math.min(n,Math.min(a,Math.min(t)))/2);var m=n/2-l,p=a/2-l,y=t/2-l;u.parameters={width:n,height:a,depth:t,radius:l,radiusSegments:h};var T=h+1,M=T*h+1<<3,N=new g.BufferAttribute(new Float32Array(M*3),3),C=new g.BufferAttribute(new Float32Array(M*3),3),F=[],G=[];new g.Vector3;var O=new g.Vector3,j=[],q=[],f=[],V=T*h,P=T*h+1;Ce(),fe(),ie(),se(),Ae(),ve();function Ce(){for(var A=[new g.Vector3(1,1,1),new g.Vector3(1,1,-1),new g.Vector3(-1,1,-1),new g.Vector3(-1,1,1),new g.Vector3(1,-1,1),new g.Vector3(1,-1,-1),new g.Vector3(-1,-1,-1),new g.Vector3(-1,-1,1)],E=0;E<8;E++)F.push([]),G.push([]);for(var w=Math.PI/2,x=new g.Vector3(m,p,y),D=0;D<=h;D++){var Z=D/h,B=Z*w,I=Math.cos(B),Y=Math.sin(B);if(D==h){O.set(0,1,0);var k=O.clone().multiplyScalar(l).add(x);F[0].push(k),j.push(k);var S=O.clone();G[0].push(S),q.push(S);continue}for(var _=0;_<=h;_++){var z=_/h,U=z*w;O.x=I*Math.cos(U),O.y=Y,O.z=I*Math.sin(U);var k=O.clone().multiplyScalar(l).add(x);F[0].push(k),j.push(k);var S=O.clone().normalize();G[0].push(S),q.push(S)}}for(var R=1;R<8;R++)for(var E=0;E<F[0].length;E++){var k=F[0][E].clone().multiply(A[R]);F[R].push(k),j.push(k);var S=G[0][E].clone().multiply(A[R]);G[R].push(S),q.push(S)}}function ie(){for(var A=[!0,!1,!0,!1,!1,!0,!1,!0],E=T*(h-1),w=0;w<8;w++){for(var x=P*w,D=0;D<h-1;D++)for(var Z=D*T,B=(D+1)*T,I=0;I<h;I++){var Y=I+1,k=x+Z+I,S=x+Z+Y,_=x+B+I,z=x+B+Y;A[w]?(f.push(k),f.push(_),f.push(S),f.push(S),f.push(_),f.push(z)):(f.push(k),f.push(S),f.push(_),f.push(S),f.push(z),f.push(_))}for(var I=0;I<h;I++){var k=x+E+I,S=x+E+I+1,_=x+V;A[w]?(f.push(k),f.push(_),f.push(S)):(f.push(k),f.push(S),f.push(_))}}}function fe(){var A=V,E=V+P,w=V+P*2,x=V+P*3;f.push(A),f.push(E),f.push(w),f.push(A),f.push(w),f.push(x),A=V+P*4,E=V+P*5,w=V+P*6,x=V+P*7,f.push(A),f.push(w),f.push(E),f.push(A),f.push(x),f.push(w),A=0,E=P,w=P*4,x=P*5,f.push(A),f.push(w),f.push(E),f.push(E),f.push(w),f.push(x),A=P*2,E=P*3,w=P*6,x=P*7,f.push(A),f.push(w),f.push(E),f.push(E),f.push(w),f.push(x),A=h,E=h+P*3,w=h+P*4,x=h+P*7,f.push(A),f.push(E),f.push(w),f.push(E),f.push(x),f.push(w),A=h+P,E=h+P*2,w=h+P*5,x=h+P*6,f.push(A),f.push(w),f.push(E),f.push(E),f.push(w),f.push(x)}function se(){for(var A=0;A<4;A++)for(var E=A*P,w=4*P+E,x=(A&1)===1,D=0;D<h;D++){var Z=D+1,B=E+D,I=E+Z,Y=w+D,k=w+Z;x?(f.push(B),f.push(Y),f.push(I),f.push(I),f.push(Y),f.push(k)):(f.push(B),f.push(I),f.push(Y),f.push(I),f.push(k),f.push(Y))}}function ve(){for(var A=[0,2,4,6],E=[1,3,5,7],w=0;w<4;w++)for(var x=P*A[w],D=P*E[w],Z=1>=w,B=0;B<h;B++){var I=B*T,Y=(B+1)*T,k=x+I,S=x+Y,_=D+I,z=D+Y;Z?(f.push(k),f.push(_),f.push(S),f.push(S),f.push(_),f.push(z)):(f.push(k),f.push(S),f.push(_),f.push(S),f.push(z),f.push(_))}}function Ae(){for(var A=h-1,E=[0,1,4,5],w=[3,2,7,6],x=[0,1,1,0],D=0;D<4;D++)for(var Z=E[D]*P,B=w[D]*P,I=0;I<=A;I++){var Y=Z+h+I*T,k=Z+(I!=A?h+(I+1)*T:P-1),S=B+h+I*T,_=B+(I!=A?h+(I+1)*T:P-1);x[D]?(f.push(Y),f.push(S),f.push(k),f.push(k),f.push(S),f.push(_)):(f.push(Y),f.push(k),f.push(S),f.push(k),f.push(_),f.push(S))}}for(var le=0,ee=0;ee<j.length;ee++)N.setXYZ(le,j[ee].x,j[ee].y,j[ee].z),C.setXYZ(le,q[ee].x,q[ee].y,q[ee].z),le++;return u.setIndex(new g.BufferAttribute(new Uint16Array(f),1)),u.setAttribute("position",N),u.setAttribute("normal",C),u}return o}(g.BufferGeometry);function Pe(c,o){return typeof c!="number"||typeof o!="number"?!1:Math.abs(c-o)<.001}function _e(c,o,n,a){a===void 0&&(a=function(l){return l});var t=a(n);return c*(1-t)+o*t}var X=Number((Math.PI/2).toFixed(5));function yr(c,o,n){var a=new g.Shape;return a.moveTo(n,0),a.lineTo(c-n,0),a.absarc(c-n,n,n,-X,0,!1),a.lineTo(c,o-n),a.absarc(c-n,o-n,n,0,X,!1),a.lineTo(n,o),a.absarc(n,o-n,n,X,Math.PI,!1),a.lineTo(0,n),a.absarc(n,n,n,Math.PI,Math.PI*1.5,!1),a}var Me=function(c){var o=document.createElement("div");o.innerText=c;var n=new it.CSS3DObject(o);return n.name=c,n.scale.set(.3,.3,.3),o.style.pointerEvents="none",o.style.backfaceVisibility="hidden",n},Le=function(c){var o=new g.PlaneGeometry(5,5),n=new g.MeshBasicMaterial({transparent:!0,opacity:0}),a=new g.Mesh(o,n),t=document.createElement("div");t.innerText=c;var l=new it.CSS3DObject(t);return l.name=c,l.scale.set(.3,.3,.3),t.style.color="#ffffff",t.style.opacity="0.5",t.style.pointerEvents="none",t.style.backfaceVisibility="hidden",a.rotateX(-X),a.add(l),a},Tr=function(c){He(o,c);function o(n,a){var t=c.call(this,n)||this;t.camera=new nt.Camera(90),t.scene=new g.Scene,t.renderer=new g.WebGLRenderer({antialias:!0,alpha:!0}),t.css3drenderer=new it.CSS3DRenderer,t.ambientLight=new g.AmbientLight(16777215,.7),t.wrapper=document.createElement("div"),t.arrows=document.createElement("div"),t.arrowLeft=document.createElement("div"),t.arrowRight=document.createElement("div"),t.arrowFront=document.createElement("div"),t.arrowBack=document.createElement("div"),t.arrowTop=document.createElement("div"),t.arrowBottom=document.createElement("div"),t.spherical=null,t.dragging=!1,t.style=document.createElement("style"),t.directionalLight=new g.DirectionalLight(16777215,.2),t.box=new g.Mesh(new xt(8,8,8,.5,20),new g.MeshPhongMaterial({color:16777215})),t.faces=new g.Group,t.orient=function(u){var m=u.longitude,p=u.latitude;t.dragging=!1,t.spherical=null,t.controls.enableDamping=!1,t.five.setState(Object.assign({latitude:p},m!==void 0?{longitude:m+t.config.fixedLongitude}:{})),t.five.ready().then(function(){t.controls.enableDamping=!0,t.setState({arrowsVisible:!0})})},t.onRenderFrame=function(){var u,m,p,y,T;if(t.renderer.render(t.scene,t.camera),t.css3drenderer.render(t.scene,t.camera),t.directionalLight.position.copy(t.camera.position),(u=t.controls)===null||u===void 0||u.update(),t.dragging){t.camera.computePose(),t.updateByCamera();var M=t.camera.pose,N=M.longitude,C=M.latitude;t.five.setState({longitude:N,latitude:C},!0),t.updateArrows({longitude:N,latitude:C})}else if(t.spherical&&(!Pe(t.spherical.pi,(m=t.controls)===null||m===void 0?void 0:m.getPolarAngle())||!Pe(t.spherical.theta,(p=t.controls)===null||p===void 0?void 0:p.getAzimuthalAngle()))){t.spherical={pi:(y=t.controls)===null||y===void 0?void 0:y.getPolarAngle(),theta:(T=t.controls)===null||T===void 0?void 0:T.getAzimuthalAngle()},t.camera.computePose(),t.updateByCamera();var F=t.camera.pose,N=F.longitude,C=F.latitude;t.five.setState({longitude:N,latitude:C},!0),t.updateArrows({longitude:N,latitude:C})}else t.spherical=null},t.onTapGesture=function(u){var m=u.pointers[0].clientX,p=u.pointers[0].clientY,y=At({x:m,y:p},t.wrapper),T=new g.Raycaster;T.setFromCamera(y,t.camera);var M=T.intersectObjects(t.faces.children,!1)[0];if(M){var N=M.object.userData,C=N.longitude,F=N.latitude;t.orient({longitude:C,latitude:F})}},t.onFiveWantsGesture=function(){if(t.spherical)return!1},t.onFiveModeChange=function(u){t.controls&&(t.controls.maxPolarAngle=u==="Topview"?0:X)},t.onCameraUpdate=function(u){var m=u.state;if(!t.dragging&&!t.spherical){var p=m.longitude,y=m.latitude;t.camera.pose.longitude===p&&t.camera.pose.latitude===y||(t.camera.setFromPose({longitude:p,latitude:y,distance:20,offset:new g.Vector3(0,0,0)}),t.updateByCamera(),t.updateArrows({longitude:p,latitude:y}))}},t.onPanStart=function(u){t.dragging=!0,t.spherical={}},t.onMouseMove=function(u){if(!t.dragging){var m=At({x:u.clientX,y:u.clientY},t.wrapper),p=new g.Raycaster;p.setFromCamera(m,t.camera);var y=p.intersectObjects(t.faces.children,!1)[0];t.faces.children.forEach(function(T){T.material.opacity=0,T.children[0].element.style.color=""}),y&&(y.object.material.opacity=.3,y.object.children[0].element.style.color="#336dff")}},t.onPanEnd=function(u){t.dragging=!1,t.spherical={pi:t.controls.getPolarAngle(),theta:t.controls.getAzimuthalAngle()}},t.dispose=function(){t.disable()},t.five=n;var l={enabled:!1,visible:!0,arrowsVisible:!1};t.state=Object.assign(l,a==null?void 0:a.initialState);var h=W({fixedLongitude:0,orthoView:!0},a==null?void 0:a.config);return t._config=h,t.state.enabled&&t._enable({userAction:!1}),t.mc=new tt.Manager(t.wrapper),t.mc.add(new tt.Tap({interval:410})),t.mc.add(new tt.Pan({threshold:10,pointers:0})),t.camera.setFromPose({distance:20,offset:new g.Vector3(0,0,0),longitude:n.camera.pose.latitude,latitude:n.camera.pose.latitude}),t.cylinder=new g.Mesh(new g.CylinderGeometry(13.2,14,.01,50,1,!0),new g.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
356
+ `;return function(){var v=new Error("get-stack-trace"),b=v&&v.stack?v.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=f.console&&(f.console.warn||f.console.log);return N&&N.call(f.console,u,b),n.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(r){if(r===a||r===null)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(r),u=1;u<arguments.length;u++){var v=arguments[u];if(v!==a&&v!==null)for(var b in v)v.hasOwnProperty(b)&&(i[b]=v[b])}return i}:x=Object.assign;var D=k(function(r,i,u){for(var v=Object.keys(i),b=0;b<v.length;)(!u||u&&r[v[b]]===a)&&(r[v[b]]=i[v[b]]),b++;return r},"extend","Use `assign`."),Y=k(function(r,i){return D(r,i,!0)},"merge","Use `assign`.");function y(n,r,i){var u=r.prototype,v;v=n.prototype=Object.create(u),v.constructor=n,v._super=u,i&&x(v,i)}function T(n,r){return function(){return n.apply(r,arguments)}}function P(n,r){return typeof n==h?n.apply(r&&r[0]||a,r):n}function p(n,r){return n===a?r:n}function S(n,r,i){A(te(r),function(u){n.addEventListener(u,i,!1)})}function M(n,r,i){A(te(r),function(u){n.removeEventListener(u,i,!1)})}function ee(n,r){for(;n;){if(n==r)return!0;n=n.parentNode}return!1}function K(n,r){return n.indexOf(r)>-1}function te(n){return n.trim().split(/\s+/g)}function ce(n,r,i){if(n.indexOf&&!i)return n.indexOf(r);for(var u=0;u<n.length;){if(i&&n[u][i]==r||!i&&n[u]===r)return u;u++}return-1}function me(n){return Array.prototype.slice.call(n,0)}function Me(n,r,i){for(var u=[],v=[],b=0;b<n.length;){var N=n[b][r];ce(v,N)<0&&u.push(n[b]),v[b]=N,b++}return u=u.sort(function(le,W){return le[r]>W[r]}),u}function re(n,r){for(var i,u,v=r[0].toUpperCase()+r.slice(1),b=0;b<t.length;){if(i=t[b],u=i?i+v:r,u in n)return u;b++}return a}var oe=1;function R(){return oe++}function _(n){var r=n.ownerDocument||n;return r.defaultView||r.parentWindow||f}var C=/mobile|tablet|ip(ad|hone|od)|android/i,U="ontouchstart"in f,H=re(f,"PointerEvent")!==a,ne=U&&C.test(navigator.userAgent),z="touch",F="pen",q="mouse",B="kinect",V=25,I=1,$=2,j=4,X=8,Oe=1,Ee=2,Ae=4,xe=8,we=16,se=Ee|Ae,he=xe|we,Ie=se|he,ke=["x","y"],Ce=["clientX","clientY"];function ie(n,r){var i=this;this.manager=n,this.callback=r,this.element=n.element,this.target=n.options.inputTarget,this.domHandler=function(u){P(n.options.enable,[n])&&i.handler(u)},this.init()}ie.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(_(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(_(this.element),this.evWin,this.domHandler)}};function He(n){var r,i=n.options.inputClass;return i?r=i:H?r=ot:ne?r=Ge:U?r=st:r=Xe,new r(n,je)}function je(n,r,i){var u=i.pointers.length,v=i.changedPointers.length,b=r&I&&u-v===0,N=r&(j|X)&&u-v===0;i.isFirst=!!b,i.isFinal=!!N,b&&(n.session={}),i.eventType=r,s(n,i),n.emit("hammer.input",i),n.recognize(i),n.session.prevInput=i}function s(n,r){var i=n.session,u=r.pointers,v=u.length;i.firstInput||(i.firstInput=Z(r)),v>1&&!i.firstMultiple?i.firstMultiple=Z(r):v===1&&(i.firstMultiple=!1);var b=i.firstInput,N=i.firstMultiple,Q=N?N.center:b.center,le=r.center=pe(u);r.timeStamp=d(),r.deltaTime=r.timeStamp-b.timeStamp,r.angle=at(Q,le),r.distance=ze(Q,le),L(i,r),r.offsetDirection=ge(r.deltaX,r.deltaY);var W=De(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=W.x,r.overallVelocityY=W.y,r.overallVelocity=g(W.x)>g(W.y)?W.x:W.y,r.scale=N?Vt(N.pointers,u):1,r.rotation=N?Ft(N.pointers,u):0,r.maxPointers=i.prevInput?r.pointers.length>i.prevInput.maxPointers?r.pointers.length:i.prevInput.maxPointers:r.pointers.length,G(i,r);var ve=n.element;ee(r.srcEvent.target,ve)&&(ve=r.srcEvent.target),r.target=ve}function L(n,r){var i=r.center,u=n.offsetDelta||{},v=n.prevDelta||{},b=n.prevInput||{};(r.eventType===I||b.eventType===j)&&(v=n.prevDelta={x:b.deltaX||0,y:b.deltaY||0},u=n.offsetDelta={x:i.x,y:i.y}),r.deltaX=v.x+(i.x-u.x),r.deltaY=v.y+(i.y-u.y)}function G(n,r){var i=n.lastInterval||r,u=r.timeStamp-i.timeStamp,v,b,N,Q;if(r.eventType!=X&&(u>V||i.velocity===a)){var le=r.deltaX-i.deltaX,W=r.deltaY-i.deltaY,ve=De(u,le,W);b=ve.x,N=ve.y,v=g(ve.x)>g(ve.y)?ve.x:ve.y,Q=ge(le,W),n.lastInterval=r}else v=i.velocity,b=i.velocityX,N=i.velocityY,Q=i.direction;r.velocity=v,r.velocityX=b,r.velocityY=N,r.direction=Q}function Z(n){for(var r=[],i=0;i<n.pointers.length;)r[i]={clientX:c(n.pointers[i].clientX),clientY:c(n.pointers[i].clientY)},i++;return{timeStamp:d(),pointers:r,center:pe(r),deltaX:n.deltaX,deltaY:n.deltaY}}function pe(n){var r=n.length;if(r===1)return{x:c(n[0].clientX),y:c(n[0].clientY)};for(var i=0,u=0,v=0;v<r;)i+=n[v].clientX,u+=n[v].clientY,v++;return{x:c(i/r),y:c(u/r)}}function De(n,r,i){return{x:r/n||0,y:i/n||0}}function ge(n,r){return n===r?Oe:g(n)>=g(r)?n<0?Ee:Ae:r<0?xe:we}function ze(n,r,i){i||(i=ke);var u=r[i[0]]-n[i[0]],v=r[i[1]]-n[i[1]];return Math.sqrt(u*u+v*v)}function at(n,r,i){i||(i=ke);var u=r[i[0]]-n[i[0]],v=r[i[1]]-n[i[1]];return Math.atan2(v,u)*180/Math.PI}function Ft(n,r){return at(r[1],r[0],Ce)+at(n[1],n[0],Ce)}function Vt(n,r){return ze(r[0],r[1],Ce)/ze(n[0],n[1],Ce)}var Bt={mousedown:I,mousemove:$,mouseup:j},Yt="mousedown",Ht="mousemove mouseup";function Xe(){this.evEl=Yt,this.evWin=Ht,this.pressed=!1,ie.apply(this,arguments)}y(Xe,ie,{handler:function(r){var i=Bt[r.type];i&I&&(r.button===0||r.button===2)&&(this.pressed=!0),i&$&&r.which!==1&&(i=j),this.pressed&&(i&j&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[r],changedPointers:[r],pointerType:q,srcEvent:r}))}});var bt={pointerdown:I,pointermove:$,pointerup:j,pointercancel:X,pointerout:X},jt={2:z,3:F,4:q,5:B},Et="pointerdown",wt="pointermove pointerup pointercancel";f.MSPointerEvent&&!f.PointerEvent&&(Et="MSPointerDown",wt="MSPointerMove MSPointerUp MSPointerCancel");function ot(){this.evEl=Et,this.evWin=wt,ie.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}y(ot,ie,{handler:function(r){var i=this.store,u=!1,v=!1,b=r.type.toLowerCase().replace("ms",""),N=bt[b],Q=jt[r.pointerType]||r.pointerType,le=Q==z,W=ce(i,r.pointerId,"pointerId");N&I&&(r.button===0||r.button===2||le)?W<0&&(i.push(r),W=i.length-1):N&(j|X)?u=!0:!le&&r.buttons===0&&(u=!0,v=!0,N=bt.pointerup),!(W<0)&&(v||(i[W]=r),this.callback(this.manager,N,{pointers:i,changedPointers:[r],pointerType:Q,srcEvent:i[W]}),u&&i.splice(W,1))}});var zt={touchstart:I,touchmove:$,touchend:j,touchcancel:X},Xt="touchstart",Gt="touchstart touchmove touchend touchcancel";function Pt(){this.evTarget=Xt,this.evWin=Gt,this.started=!1,ie.apply(this,arguments)}y(Pt,ie,{handler:function(r){var i=zt[r.type];if(i===I&&(this.started=!0),!!this.started){var u=Wt.call(this,r,i);i&(j|X)&&u[0].length-u[1].length===0&&(this.started=!1),this.callback(this.manager,i,{pointers:u[0],changedPointers:u[1],pointerType:z,srcEvent:r})}}});function Wt(n,r){var i=me(n.touches),u=me(n.changedTouches);return r&(j|X)&&(i=Me(i.concat(u),"identifier")),[i,u]}var qt={touchstart:I,touchmove:$,touchend:j,touchcancel:X},Zt="touchstart touchmove touchend touchcancel";function Ge(){this.evTarget=Zt,this.targetIds={},ie.apply(this,arguments)}y(Ge,ie,{handler:function(r){var i=qt[r.type],u=Kt.call(this,r,i);u&&this.callback(this.manager,i,{pointers:u[0],changedPointers:u[1],pointerType:z,srcEvent:r})}});function Kt(n,r){var i=me(n.touches),u=this.targetIds;if(r&(I|$)&&i.length===1)return u[i[0].identifier]=!0,[i,i];var v,b,N=me(n.changedTouches),Q=[],le=this.target;if(b=i.filter(function(W){return ee(W.target,le)}),r===I)for(v=0;v<b.length;)u[b[v].identifier]=!0,v++;for(v=0;v<N.length;)u[N[v].identifier]&&Q.push(N[v]),r&(j|X)&&delete u[N[v].identifier],v++;if(Q.length)return[Me(b.concat(Q),"identifier"),Q]}var Qt=2500,Mt=25;function st(){ie.apply(this,arguments);var n=T(this.handler,this);this.touch=new Ge(this.manager,n),this.mouse=new Xe(this.manager,n),this.primaryTouch=null,this.lastTouches=[]}y(st,ie,{handler:function(r,i,u){var v=u.pointerType==z,b=u.pointerType==q;if(!(b&&u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents)){if(v)Jt.call(this,i,u);else if(b&&$t.call(this,u))return;this.callback(r,i,u)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Jt(n,r){n&I?(this.primaryTouch=r.changedPointers[0].identifier,Ot.call(this,r)):n&(j|X)&&Ot.call(this,r)}function Ot(n){var r=n.changedPointers[0];if(r.identifier===this.primaryTouch){var i={x:r.clientX,y:r.clientY};this.lastTouches.push(i);var u=this.lastTouches,v=function(){var b=u.indexOf(i);b>-1&&u.splice(b,1)};setTimeout(v,Qt)}}function $t(n){for(var r=n.srcEvent.clientX,i=n.srcEvent.clientY,u=0;u<this.lastTouches.length;u++){var v=this.lastTouches[u],b=Math.abs(r-v.x),N=Math.abs(i-v.y);if(b<=Mt&&N<=Mt)return!0}return!1}var At=l?re(l.style,"touchAction"):a,xt=At!==a,Ct="compute",_t="auto",lt="manipulation",_e="none",Le="pan-x",Re="pan-y",We=tn();function ct(n,r){this.manager=n,this.set(r)}ct.prototype={set:function(n){n==Ct&&(n=this.compute()),xt&&this.manager.element.style&&We[n]&&(this.manager.element.style[At]=n),this.actions=n.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var n=[];return A(this.manager.recognizers,function(r){P(r.options.enable,[r])&&(n=n.concat(r.getTouchAction()))}),en(n.join(" "))},preventDefaults:function(n){var r=n.srcEvent,i=n.offsetDirection;if(this.manager.session.prevented){r.preventDefault();return}var u=this.actions,v=K(u,_e)&&!We[_e],b=K(u,Re)&&!We[Re],N=K(u,Le)&&!We[Le];if(v){var Q=n.pointers.length===1,le=n.distance<2,W=n.deltaTime<250;if(Q&&le&&W)return}if(!(N&&b)&&(v||b&&i&se||N&&i&he))return this.preventSrc(r)},preventSrc:function(n){this.manager.session.prevented=!0,n.preventDefault()}};function en(n){if(K(n,_e))return _e;var r=K(n,Le),i=K(n,Re);return r&&i?_e:r||i?r?Le:Re:K(n,lt)?lt:_t}function tn(){if(!xt)return!1;var n={},r=f.CSS&&f.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){n[i]=r?f.CSS.supports("touch-action",i):!0}),n}var qe=1,ue=2,Ne=4,Pe=8,ye=Pe,Ue=16,de=32;function Te(n){this.options=x({},this.defaults,n||{}),this.id=R(),this.manager=null,this.options.enable=p(this.options.enable,!0),this.state=qe,this.simultaneous={},this.requireFail=[]}Te.prototype={defaults:{},set:function(n){return x(this.options,n),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(n){if(w(n,"recognizeWith",this))return this;var r=this.simultaneous;return n=Ze(n,this),r[n.id]||(r[n.id]=n,n.recognizeWith(this)),this},dropRecognizeWith:function(n){return w(n,"dropRecognizeWith",this)?this:(n=Ze(n,this),delete this.simultaneous[n.id],this)},requireFailure:function(n){if(w(n,"requireFailure",this))return this;var r=this.requireFail;return n=Ze(n,this),ce(r,n)===-1&&(r.push(n),n.requireFailure(this)),this},dropRequireFailure:function(n){if(w(n,"dropRequireFailure",this))return this;n=Ze(n,this);var r=ce(this.requireFail,n);return r>-1&&this.requireFail.splice(r,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(n){return!!this.simultaneous[n.id]},emit:function(n){var r=this,i=this.state;function u(v){r.manager.emit(v,n)}i<Pe&&u(r.options.event+Nt(i)),u(r.options.event),n.additionalEvent&&u(n.additionalEvent),i>=Pe&&u(r.options.event+Nt(i))},tryEmit:function(n){if(this.canEmit())return this.emit(n);this.state=de},canEmit:function(){for(var n=0;n<this.requireFail.length;){if(!(this.requireFail[n].state&(de|qe)))return!1;n++}return!0},recognize:function(n){var r=x({},n);if(!P(this.options.enable,[this,r])){this.reset(),this.state=de;return}this.state&(ye|Ue|de)&&(this.state=qe),this.state=this.process(r),this.state&(ue|Ne|Pe|Ue)&&this.tryEmit(r)},process:function(n){},getTouchAction:function(){},reset:function(){}};function Nt(n){return n&Ue?"cancel":n&Pe?"end":n&Ne?"move":n&ue?"start":""}function St(n){return n==we?"down":n==xe?"up":n==Ee?"left":n==Ae?"right":""}function Ze(n,r){var i=r.manager;return i?i.get(n):n}function fe(){Te.apply(this,arguments)}y(fe,Te,{defaults:{pointers:1},attrTest:function(n){var r=this.options.pointers;return r===0||n.pointers.length===r},process:function(n){var r=this.state,i=n.eventType,u=r&(ue|Ne),v=this.attrTest(n);return u&&(i&X||!v)?r|Ue:u||v?i&j?r|Pe:r&ue?r|Ne:ue:de}});function Ke(){fe.apply(this,arguments),this.pX=null,this.pY=null}y(Ke,fe,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ie},getTouchAction:function(){var n=this.options.direction,r=[];return n&se&&r.push(Re),n&he&&r.push(Le),r},directionTest:function(n){var r=this.options,i=!0,u=n.distance,v=n.direction,b=n.deltaX,N=n.deltaY;return v&r.direction||(r.direction&se?(v=b===0?Oe:b<0?Ee:Ae,i=b!=this.pX,u=Math.abs(n.deltaX)):(v=N===0?Oe:N<0?xe:we,i=N!=this.pY,u=Math.abs(n.deltaY))),n.direction=v,i&&u>r.threshold&&v&r.direction},attrTest:function(n){return fe.prototype.attrTest.call(this,n)&&(this.state&ue||!(this.state&ue)&&this.directionTest(n))},emit:function(n){this.pX=n.deltaX,this.pY=n.deltaY;var r=St(n.direction);r&&(n.additionalEvent=this.options.event+r),this._super.emit.call(this,n)}});function ut(){fe.apply(this,arguments)}y(ut,fe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(n){return this._super.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&ue)},emit:function(n){if(n.scale!==1){var r=n.scale<1?"in":"out";n.additionalEvent=this.options.event+r}this._super.emit.call(this,n)}});function ht(){Te.apply(this,arguments),this._timer=null,this._input=null}y(ht,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_t]},process:function(n){var r=this.options,i=n.pointers.length===r.pointers,u=n.distance<r.threshold,v=n.deltaTime>r.time;if(this._input=n,!u||!i||n.eventType&(j|X)&&!v)this.reset();else if(n.eventType&I)this.reset(),this._timer=m(function(){this.state=ye,this.tryEmit()},r.time,this);else if(n.eventType&j)return ye;return de},reset:function(){clearTimeout(this._timer)},emit:function(n){this.state===ye&&(n&&n.eventType&j?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}});function ft(){fe.apply(this,arguments)}y(ft,fe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(n){return this._super.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&ue)}});function pt(){fe.apply(this,arguments)}y(pt,fe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:se|he,pointers:1},getTouchAction:function(){return Ke.prototype.getTouchAction.call(this)},attrTest:function(n){var r=this.options.direction,i;return r&(se|he)?i=n.overallVelocity:r&se?i=n.overallVelocityX:r&he&&(i=n.overallVelocityY),this._super.attrTest.call(this,n)&&r&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers==this.options.pointers&&g(i)>this.options.velocity&&n.eventType&j},emit:function(n){var r=St(n.offsetDirection);r&&this.manager.emit(this.options.event+r,n),this.manager.emit(this.options.event,n)}});function Qe(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}y(Qe,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[lt]},process:function(n){var r=this.options,i=n.pointers.length===r.pointers,u=n.distance<r.threshold,v=n.deltaTime<r.time;if(this.reset(),n.eventType&I&&this.count===0)return this.failTimeout();if(u&&v&&i){if(n.eventType!=j)return this.failTimeout();var b=this.pTime?n.timeStamp-this.pTime<r.interval:!0,N=!this.pCenter||ze(this.pCenter,n.center)<r.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!N||!b?this.count=1:this.count+=1,this._input=n;var Q=this.count%r.taps;if(Q===0)return this.hasRequireFailures()?(this._timer=m(function(){this.state=ye,this.tryEmit()},r.interval,this),ue):ye}return de},failTimeout:function(){return this._timer=m(function(){this.state=de},this.options.interval,this),de},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ye&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Se(n,r){return r=r||{},r.recognizers=p(r.recognizers,Se.defaults.preset),new dt(n,r)}Se.VERSION="2.0.7",Se.defaults={domEvents:!1,touchAction:Ct,enable:!0,inputTarget:null,inputClass:null,preset:[[ft,{enable:!1}],[ut,{enable:!1},["rotate"]],[pt,{direction:se}],[Ke,{direction:se},["swipe"]],[Qe],[Qe,{event:"doubletap",taps:2},["tap"]],[ht]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var nn=1,It=2;function dt(n,r){this.options=x({},Se.defaults,r||{}),this.options.inputTarget=this.options.inputTarget||n,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=n,this.input=He(this),this.touchAction=new ct(this,this.options.touchAction),kt(this,!0),A(this.options.recognizers,function(i){var u=this.add(new i[0](i[1]));i[2]&&u.recognizeWith(i[2]),i[3]&&u.requireFailure(i[3])},this)}dt.prototype={set:function(n){return x(this.options,n),n.touchAction&&this.touchAction.update(),n.inputTarget&&(this.input.destroy(),this.input.target=n.inputTarget,this.input.init()),this},stop:function(n){this.session.stopped=n?It:nn},recognize:function(n){var r=this.session;if(!r.stopped){this.touchAction.preventDefaults(n);var i,u=this.recognizers,v=r.curRecognizer;(!v||v&&v.state&ye)&&(v=r.curRecognizer=null);for(var b=0;b<u.length;)i=u[b],r.stopped!==It&&(!v||i==v||i.canRecognizeWith(v))?i.recognize(n):i.reset(),!v&&i.state&(ue|Ne|Pe)&&(v=r.curRecognizer=i),b++}},get:function(n){if(n instanceof Te)return n;for(var r=this.recognizers,i=0;i<r.length;i++)if(r[i].options.event==n)return r[i];return null},add:function(n){if(w(n,"add",this))return this;var r=this.get(n.options.event);return r&&this.remove(r),this.recognizers.push(n),n.manager=this,this.touchAction.update(),n},remove:function(n){if(w(n,"remove",this))return this;if(n=this.get(n),n){var r=this.recognizers,i=ce(r,n);i!==-1&&(r.splice(i,1),this.touchAction.update())}return this},on:function(n,r){if(n!==a&&r!==a){var i=this.handlers;return A(te(n),function(u){i[u]=i[u]||[],i[u].push(r)}),this}},off:function(n,r){if(n!==a){var i=this.handlers;return A(te(n),function(u){r?i[u]&&i[u].splice(ce(i[u],r),1):delete i[u]}),this}},emit:function(n,r){this.options.domEvents&&rn(n,r);var i=this.handlers[n]&&this.handlers[n].slice();if(!(!i||!i.length)){r.type=n,r.preventDefault=function(){r.srcEvent.preventDefault()};for(var u=0;u<i.length;)i[u](r),u++}},destroy:function(){this.element&&kt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function kt(n,r){var i=n.element;if(i.style){var u;A(n.options.cssProps,function(v,b){u=re(i.style,b),r?(n.oldCssProps[u]=i.style[u],i.style[u]=v):i.style[u]=n.oldCssProps[u]||""}),r||(n.oldCssProps={})}}function rn(n,r){var i=o.createEvent("Event");i.initEvent(n,!0,!0),i.gesture=r,r.target.dispatchEvent(i)}return x(Se,{INPUT_START:I,INPUT_MOVE:$,INPUT_END:j,INPUT_CANCEL:X,STATE_POSSIBLE:qe,STATE_BEGAN:ue,STATE_CHANGED:Ne,STATE_ENDED:Pe,STATE_RECOGNIZED:ye,STATE_CANCELLED:Ue,STATE_FAILED:de,DIRECTION_NONE:Oe,DIRECTION_LEFT:Ee,DIRECTION_RIGHT:Ae,DIRECTION_UP:xe,DIRECTION_DOWN:we,DIRECTION_HORIZONTAL:se,DIRECTION_VERTICAL:he,DIRECTION_ALL:Ie,Manager:dt,Input:ie,TouchAction:ct,TouchInput:Ge,MouseInput:Xe,PointerEventInput:ot,TouchMouseInput:st,SingleTouchInput:Pt,Recognizer:Te,AttrRecognizer:fe,Tap:Qe,Pan:Ke,Swipe:pt,Pinch:ut,Rotate:ft,Press:ht,on:S,off:M,each:A,merge:Y,extend:D,assign:x,inherit:y,bindFn:T,prefixed:re}),Se}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{}),Ye=function(f,o){o===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),o===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=f,this.domElement=o,this.enabled=!0,this.target=new O.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:O.MOUSE.ROTATE,MIDDLE:O.MOUSE.DOLLY,RIGHT:O.MOUSE.PAN},this.touches={ONE:O.TOUCH.ROTATE,TWO:O.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return d.phi},this.getAzimuthalAngle=function(){return d.theta},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(a),e.update(),c=h.NONE},this.update=function(){var s=new O.Vector3,L=new O.Quaternion().setFromUnitVectors(f.up,new O.Vector3(0,1,0)),G=L.clone().inverse(),Z=new O.Vector3,pe=new O.Quaternion;return function(){var ge=e.object.position;return s.copy(ge).sub(e.target),s.applyQuaternion(L),d.setFromVector3(s),e.autoRotate&&c===h.NONE&&te(ee()),e.enableDamping?(d.theta+=m.theta*e.dampingFactor,d.phi+=m.phi*e.dampingFactor):(d.theta+=m.theta,d.phi+=m.phi),d.theta=Math.max(e.minAzimuthAngle,Math.min(e.maxAzimuthAngle,d.theta)),d.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,d.phi)),d.makeSafe(),d.radius*=w,d.radius=Math.max(e.minDistance,Math.min(e.maxDistance,d.radius)),e.enableDamping===!0?e.target.addScaledVector(A,e.dampingFactor):e.target.add(A),s.setFromSpherical(d),s.applyQuaternion(G),ge.copy(e.target).add(s),e.object.lookAt(e.target),e.enableDamping===!0?(m.theta*=1-e.dampingFactor,m.phi*=1-e.dampingFactor,A.multiplyScalar(1-e.dampingFactor)):(m.set(0,0,0),A.set(0,0,0)),w=1,k||Z.distanceToSquared(e.object.position)>g||8*(1-pe.dot(e.object.quaternion))>g?(e.dispatchEvent(a),Z.copy(e.object.position),pe.copy(e.object.quaternion),k=!1,!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",je,!1),e.domElement.removeEventListener("mousedown",we,!1),e.domElement.removeEventListener("wheel",Ie,!1),e.domElement.removeEventListener("touchstart",Ce,!1),e.domElement.removeEventListener("touchend",He,!1),e.domElement.removeEventListener("touchmove",ie,!1),document.removeEventListener("mousemove",se,!1),document.removeEventListener("mouseup",he,!1),e.domElement.removeEventListener("keydown",ke,!1)};var e=this,a={type:"change"},t={type:"start"},l={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},c=h.NONE,g=1e-6,d=new O.Spherical,m=new O.Spherical,w=1,A=new O.Vector3,k=!1,x=new O.Vector2,D=new O.Vector2,Y=new O.Vector2,y=new O.Vector2,T=new O.Vector2,P=new O.Vector2,p=new O.Vector2,S=new O.Vector2,M=new O.Vector2;function ee(){return 2*Math.PI/60/60*e.autoRotateSpeed}function K(){return Math.pow(.95,e.zoomSpeed)}function te(s){m.theta-=s}function ce(s){m.phi-=s}var me=function(){var s=new O.Vector3;return function(G,Z){s.setFromMatrixColumn(Z,0),s.multiplyScalar(-G),A.add(s)}}(),Me=function(){var s=new O.Vector3;return function(G,Z){e.screenSpacePanning===!0?s.setFromMatrixColumn(Z,1):(s.setFromMatrixColumn(Z,0),s.crossVectors(e.object.up,s)),s.multiplyScalar(G),A.add(s)}}(),re=function(){var s=new O.Vector3;return function(G,Z){var pe=e.domElement;if(e.object.isPerspectiveCamera){var De=e.object.position;s.copy(De).sub(e.target);var ge=s.length();ge*=Math.tan(e.object.fov/2*Math.PI/180),me(2*G*ge/pe.clientHeight,e.object.matrix),Me(2*Z*ge/pe.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(me(G*(e.object.right-e.object.left)/e.object.zoom/pe.clientWidth,e.object.matrix),Me(Z*(e.object.top-e.object.bottom)/e.object.zoom/pe.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function oe(s){e.object.isPerspectiveCamera?w/=s:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom*s)),e.object.updateProjectionMatrix(),k=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function R(s){e.object.isPerspectiveCamera?w*=s:e.object.isOrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/s)),e.object.updateProjectionMatrix(),k=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function _(s){x.set(s.clientX,s.clientY)}function C(s){p.set(s.clientX,s.clientY)}function U(s){y.set(s.clientX,s.clientY)}function H(s){D.set(s.clientX,s.clientY),Y.subVectors(D,x).multiplyScalar(e.rotateSpeed);var L=e.domElement;te(2*Math.PI*Y.x/L.clientHeight),ce(2*Math.PI*Y.y/L.clientHeight),x.copy(D),e.update()}function ne(s){S.set(s.clientX,s.clientY),M.subVectors(S,p),M.y>0?oe(K()):M.y<0&&R(K()),p.copy(S),e.update()}function z(s){T.set(s.clientX,s.clientY),P.subVectors(T,y).multiplyScalar(e.panSpeed),re(P.x,P.y),y.copy(T),e.update()}function F(s){s.deltaY<0?R(K()):s.deltaY>0&&oe(K()),e.update()}function q(s){var L=!1;switch(s.keyCode){case e.keys.UP:re(0,e.keyPanSpeed),L=!0;break;case e.keys.BOTTOM:re(0,-e.keyPanSpeed),L=!0;break;case e.keys.LEFT:re(e.keyPanSpeed,0),L=!0;break;case e.keys.RIGHT:re(-e.keyPanSpeed,0),L=!0;break}L&&(s.preventDefault(),e.update())}function B(s){if(s.touches.length==1)x.set(s.touches[0].pageX,s.touches[0].pageY);else{var L=.5*(s.touches[0].pageX+s.touches[1].pageX),G=.5*(s.touches[0].pageY+s.touches[1].pageY);x.set(L,G)}}function V(s){if(s.touches.length==1)y.set(s.touches[0].pageX,s.touches[0].pageY);else{var L=.5*(s.touches[0].pageX+s.touches[1].pageX),G=.5*(s.touches[0].pageY+s.touches[1].pageY);y.set(L,G)}}function I(s){var L=s.touches[0].pageX-s.touches[1].pageX,G=s.touches[0].pageY-s.touches[1].pageY,Z=Math.sqrt(L*L+G*G);p.set(0,Z)}function $(s){e.enableZoom&&I(s),e.enablePan&&V(s)}function j(s){e.enableZoom&&I(s),e.enableRotate&&B(s)}function X(s){if(s.touches.length==1)D.set(s.touches[0].pageX,s.touches[0].pageY);else{var L=.5*(s.touches[0].pageX+s.touches[1].pageX),G=.5*(s.touches[0].pageY+s.touches[1].pageY);D.set(L,G)}Y.subVectors(D,x).multiplyScalar(e.rotateSpeed);var Z=e.domElement;te(2*Math.PI*Y.x/Z.clientHeight),ce(2*Math.PI*Y.y/Z.clientHeight),x.copy(D)}function Oe(s){if(s.touches.length==1)T.set(s.touches[0].pageX,s.touches[0].pageY);else{var L=.5*(s.touches[0].pageX+s.touches[1].pageX),G=.5*(s.touches[0].pageY+s.touches[1].pageY);T.set(L,G)}P.subVectors(T,y).multiplyScalar(e.panSpeed),re(P.x,P.y),y.copy(T)}function Ee(s){var L=s.touches[0].pageX-s.touches[1].pageX,G=s.touches[0].pageY-s.touches[1].pageY,Z=Math.sqrt(L*L+G*G);S.set(0,Z),M.set(0,Math.pow(S.y/p.y,e.zoomSpeed)),oe(M.y),p.copy(S)}function Ae(s){e.enableZoom&&Ee(s),e.enablePan&&Oe(s)}function xe(s){e.enableZoom&&Ee(s),e.enableRotate&&X(s)}function we(s){if(e.enabled!==!1){s.preventDefault(),e.domElement.focus?e.domElement.focus():window.focus();var L;switch(s.button){case 0:L=e.mouseButtons.LEFT;break;case 1:L=e.mouseButtons.MIDDLE;break;case 2:L=e.mouseButtons.RIGHT;break;default:L=-1}switch(L){case O.MOUSE.DOLLY:if(e.enableZoom===!1)return;C(s),c=h.DOLLY;break;case O.MOUSE.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enablePan===!1)return;U(s),c=h.PAN}else{if(e.enableRotate===!1)return;_(s),c=h.ROTATE}break;case O.MOUSE.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enableRotate===!1)return;_(s),c=h.ROTATE}else{if(e.enablePan===!1)return;U(s),c=h.PAN}break;default:c=h.NONE}c!==h.NONE&&(document.addEventListener("mousemove",se,!1),document.addEventListener("mouseup",he,!1),e.dispatchEvent(t))}}function se(s){if(e.enabled!==!1)switch(s.preventDefault(),c){case h.ROTATE:if(e.enableRotate===!1)return;H(s);break;case h.DOLLY:if(e.enableZoom===!1)return;ne(s);break;case h.PAN:if(e.enablePan===!1)return;z(s);break}}function he(s){e.enabled!==!1&&(document.removeEventListener("mousemove",se,!1),document.removeEventListener("mouseup",he,!1),e.dispatchEvent(l),c=h.NONE)}function Ie(s){e.enabled===!1||e.enableZoom===!1||c!==h.NONE&&c!==h.ROTATE||(s.preventDefault(),s.stopPropagation(),e.dispatchEvent(t),F(s),e.dispatchEvent(l))}function ke(s){e.enabled===!1||e.enableKeys===!1||e.enablePan===!1||q(s)}function Ce(s){if(e.enabled!==!1){switch(s.preventDefault(),s.touches.length){case 1:switch(e.touches.ONE){case O.TOUCH.ROTATE:if(e.enableRotate===!1)return;B(s),c=h.TOUCH_ROTATE;break;case O.TOUCH.PAN:if(e.enablePan===!1)return;V(s),c=h.TOUCH_PAN;break;default:c=h.NONE}break;case 2:switch(e.touches.TWO){case O.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;$(s),c=h.TOUCH_DOLLY_PAN;break;case O.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;j(s),c=h.TOUCH_DOLLY_ROTATE;break;default:c=h.NONE}break;default:c=h.NONE}c!==h.NONE&&e.dispatchEvent(t)}}function ie(s){if(e.enabled!==!1)switch(s.preventDefault(),s.stopPropagation(),c){case h.TOUCH_ROTATE:if(e.enableRotate===!1)return;X(s),e.update();break;case h.TOUCH_PAN:if(e.enablePan===!1)return;Oe(s),e.update();break;case h.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Ae(s),e.update();break;case h.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;xe(s),e.update();break;default:c=h.NONE}}function He(s){e.enabled!==!1&&(e.dispatchEvent(l),c=h.NONE)}function je(s){e.enabled!==!1&&s.preventDefault()}e.domElement.addEventListener("contextmenu",je,!1),e.domElement.addEventListener("mousedown",we,!1),e.domElement.addEventListener("wheel",Ie,!1),e.domElement.addEventListener("touchstart",Ce,!1),e.domElement.addEventListener("touchend",He,!1),e.domElement.addEventListener("touchmove",ie,!1),e.domElement.addEventListener("keydown",ke,!1),e.domElement.tabIndex===-1&&(e.domElement.tabIndex=0),this.update()};Ye.prototype=Object.create(O.EventDispatcher.prototype);Ye.prototype.constructor=Ye;var yt=function(f,o){Ye.call(this,f,o),this.mouseButtons.LEFT=O.MOUSE.PAN,this.mouseButtons.RIGHT=O.MOUSE.ROTATE,this.touches.ONE=O.TOUCH.PAN,this.touches.TWO=O.TOUCH.DOLLY_ROTATE};yt.prototype=Object.create(O.EventDispatcher.prototype);yt.prototype.constructor=yt;var be=function(f){O.Object3D.call(this),this.element=f,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.addEventListener("removed",function(){this.traverse(function(o){o.element instanceof Element&&o.element.parentNode!==null&&o.element.parentNode.removeChild(o.element)})})};be.prototype=Object.create(O.Object3D.prototype);be.prototype.constructor=be;var rt=function(f){be.call(this,f)};rt.prototype=Object.create(be.prototype);rt.prototype.constructor=rt;var En=function(){var f=this,o,e,a,t,l=new O.Matrix4,h={camera:{fov:0,style:""},objects:new WeakMap},c=document.createElement("div");c.style.overflow="hidden",this.domElement=c;var g=document.createElement("div");g.style.WebkitTransformStyle="preserve-3d",g.style.transformStyle="preserve-3d",g.style.pointerEvents="none",c.appendChild(g);var d=/Trident/i.test(navigator.userAgent);this.getSize=function(){return{width:o,height:e}},this.setSize=function(y,T){o=y,e=T,a=o/2,t=e/2,c.style.width=y+"px",c.style.height=T+"px",g.style.width=y+"px",g.style.height=T+"px"};function m(y){return Math.abs(y)<1e-10?0:y}function w(y){var T=y.elements;return"matrix3d("+m(T[0])+","+m(-T[1])+","+m(T[2])+","+m(T[3])+","+m(T[4])+","+m(-T[5])+","+m(T[6])+","+m(T[7])+","+m(T[8])+","+m(-T[9])+","+m(T[10])+","+m(T[11])+","+m(T[12])+","+m(-T[13])+","+m(T[14])+","+m(T[15])+")"}function A(y,T){var P=y.elements,p="matrix3d("+m(P[0])+","+m(P[1])+","+m(P[2])+","+m(P[3])+","+m(-P[4])+","+m(-P[5])+","+m(-P[6])+","+m(-P[7])+","+m(P[8])+","+m(P[9])+","+m(P[10])+","+m(P[11])+","+m(P[12])+","+m(P[13])+","+m(P[14])+","+m(P[15])+")";return d?"translate(-50%,-50%)translate("+a+"px,"+t+"px)"+T+p:"translate(-50%,-50%)"+p}function k(y,T,P,p){if(y instanceof be){y.onBeforeRender(f,T,P);var S;y instanceof rt?(l.copy(P.matrixWorldInverse),l.transpose(),l.copyPosition(y.matrixWorld),l.scale(y.scale),l.elements[3]=0,l.elements[7]=0,l.elements[11]=0,l.elements[15]=1,S=A(l,p)):S=A(y.matrixWorld,p);var M=y.element,ee=h.objects.get(y);if(ee===void 0||ee.style!==S){M.style.WebkitTransform=S,M.style.transform=S;var K={style:S};d&&(K.distanceToCameraSquared=x(P,y)),h.objects.set(y,K)}M.style.display=y.visible?"":"none",M.parentNode!==g&&g.appendChild(M),y.onAfterRender(f,T,P)}for(var te=0,ce=y.children.length;te<ce;te++)k(y.children[te],T,P,p)}var x=function(){var y=new O.Vector3,T=new O.Vector3;return function(P,p){return y.setFromMatrixPosition(P.matrixWorld),T.setFromMatrixPosition(p.matrixWorld),y.distanceToSquared(T)}}();function D(y){var T=[];return y.traverse(function(P){P instanceof be&&T.push(P)}),T}function Y(y){for(var T=D(y).sort(function(M,ee){var K=h.objects.get(M).distanceToCameraSquared,te=h.objects.get(ee).distanceToCameraSquared;return K-te}),P=T.length,p=0,S=T.length;p<S;p++)T[p].element.style.zIndex=P-p}this.render=function(y,T){var P=T.projectionMatrix.elements[5]*t;if(h.camera.fov!==P&&(T.isPerspectiveCamera?(c.style.WebkitPerspective=P+"px",c.style.perspective=P+"px"):(c.style.WebkitPerspective="",c.style.perspective=""),h.camera.fov=P),y.autoUpdate===!0&&y.updateMatrixWorld(),T.parent===null&&T.updateMatrixWorld(),T.isOrthographicCamera)var p=-(T.right+T.left)/2,S=(T.top+T.bottom)/2;var M=T.isOrthographicCamera?"scale("+P+")translate("+m(p)+"px,"+m(S)+"px)"+w(T.matrixWorldInverse):"translateZ("+P+"px)"+w(T.matrixWorldInverse),ee=M+"translate("+a+"px,"+t+"px)";h.camera.style!==ee&&!d&&(g.style.WebkitTransform=ee,g.style.transform=ee,h.camera.style=ee),k(y,y,T,M),d&&Y(y)}};function Rt(f,o,e){var a=o.getBoundingClientRect(),t=a.top,l=a.left,h=a.width,c=a.height;return new E.Vector2((f.x-l)/h*2-1,-(f.y-t)/c*2+1)}var Ut=function(f){it(o,f);function o(e,a,t,l,h){var c=f.call(this)||this;c.type="RoundedBoxGeometry",h=isNaN(h)?1:Math.max(1,Math.floor(h)),e=isNaN(e)?1:e,a=isNaN(a)?1:a,t=isNaN(t)?1:t,l=isNaN(l)?.15:l,l=Math.min(l,Math.min(e,Math.min(a,Math.min(t)))/2);var g=e/2-l,d=a/2-l,m=t/2-l;c.parameters={width:e,height:a,depth:t,radius:l,radiusSegments:h};var w=h+1,A=w*h+1<<3,k=new E.BufferAttribute(new Float32Array(A*3),3),x=new E.BufferAttribute(new Float32Array(A*3),3),D=[],Y=[];new E.Vector3;var y=new E.Vector3,T=[],P=[],p=[],S=w*h,M=w*h+1;ee(),te(),K(),ce(),Me(),me();function ee(){for(var R=[new E.Vector3(1,1,1),new E.Vector3(1,1,-1),new E.Vector3(-1,1,-1),new E.Vector3(-1,1,1),new E.Vector3(1,-1,1),new E.Vector3(1,-1,-1),new E.Vector3(-1,-1,-1),new E.Vector3(-1,-1,1)],_=0;_<8;_++)D.push([]),Y.push([]);for(var C=Math.PI/2,U=new E.Vector3(g,d,m),H=0;H<=h;H++){var ne=H/h,z=ne*C,F=Math.cos(z),q=Math.sin(z);if(H==h){y.set(0,1,0);var B=y.clone().multiplyScalar(l).add(U);D[0].push(B),T.push(B);var V=y.clone();Y[0].push(V),P.push(V);continue}for(var I=0;I<=h;I++){var $=I/h,j=$*C;y.x=F*Math.cos(j),y.y=q,y.z=F*Math.sin(j);var B=y.clone().multiplyScalar(l).add(U);D[0].push(B),T.push(B);var V=y.clone().normalize();Y[0].push(V),P.push(V)}}for(var X=1;X<8;X++)for(var _=0;_<D[0].length;_++){var B=D[0][_].clone().multiply(R[X]);D[X].push(B),T.push(B);var V=Y[0][_].clone().multiply(R[X]);Y[X].push(V),P.push(V)}}function K(){for(var R=[!0,!1,!0,!1,!1,!0,!1,!0],_=w*(h-1),C=0;C<8;C++){for(var U=M*C,H=0;H<h-1;H++)for(var ne=H*w,z=(H+1)*w,F=0;F<h;F++){var q=F+1,B=U+ne+F,V=U+ne+q,I=U+z+F,$=U+z+q;R[C]?(p.push(B),p.push(I),p.push(V),p.push(V),p.push(I),p.push($)):(p.push(B),p.push(V),p.push(I),p.push(V),p.push($),p.push(I))}for(var F=0;F<h;F++){var B=U+_+F,V=U+_+F+1,I=U+S;R[C]?(p.push(B),p.push(I),p.push(V)):(p.push(B),p.push(V),p.push(I))}}}function te(){var R=S,_=S+M,C=S+M*2,U=S+M*3;p.push(R),p.push(_),p.push(C),p.push(R),p.push(C),p.push(U),R=S+M*4,_=S+M*5,C=S+M*6,U=S+M*7,p.push(R),p.push(C),p.push(_),p.push(R),p.push(U),p.push(C),R=0,_=M,C=M*4,U=M*5,p.push(R),p.push(C),p.push(_),p.push(_),p.push(C),p.push(U),R=M*2,_=M*3,C=M*6,U=M*7,p.push(R),p.push(C),p.push(_),p.push(_),p.push(C),p.push(U),R=h,_=h+M*3,C=h+M*4,U=h+M*7,p.push(R),p.push(_),p.push(C),p.push(_),p.push(U),p.push(C),R=h+M,_=h+M*2,C=h+M*5,U=h+M*6,p.push(R),p.push(C),p.push(_),p.push(_),p.push(C),p.push(U)}function ce(){for(var R=0;R<4;R++)for(var _=R*M,C=4*M+_,U=(R&1)===1,H=0;H<h;H++){var ne=H+1,z=_+H,F=_+ne,q=C+H,B=C+ne;U?(p.push(z),p.push(q),p.push(F),p.push(F),p.push(q),p.push(B)):(p.push(z),p.push(F),p.push(q),p.push(F),p.push(B),p.push(q))}}function me(){for(var R=[0,2,4,6],_=[1,3,5,7],C=0;C<4;C++)for(var U=M*R[C],H=M*_[C],ne=1>=C,z=0;z<h;z++){var F=z*w,q=(z+1)*w,B=U+F,V=U+q,I=H+F,$=H+q;ne?(p.push(B),p.push(I),p.push(V),p.push(V),p.push(I),p.push($)):(p.push(B),p.push(V),p.push(I),p.push(V),p.push($),p.push(I))}}function Me(){for(var R=h-1,_=[0,1,4,5],C=[3,2,7,6],U=[0,1,1,0],H=0;H<4;H++)for(var ne=_[H]*M,z=C[H]*M,F=0;F<=R;F++){var q=ne+h+F*w,B=ne+(F!=R?h+(F+1)*w:M-1),V=z+h+F*w,I=z+(F!=R?h+(F+1)*w:M-1);U[H]?(p.push(q),p.push(V),p.push(B),p.push(B),p.push(V),p.push(I)):(p.push(q),p.push(B),p.push(V),p.push(B),p.push(I),p.push(V))}}for(var re=0,oe=0;oe<T.length;oe++)k.setXYZ(re,T[oe].x,T[oe].y,T[oe].z),x.setXYZ(re,P[oe].x,P[oe].y,P[oe].z),re++;return c.setIndex(new E.BufferAttribute(new Uint16Array(p),1)),c.setAttribute("position",k),c.setAttribute("normal",x),c}return o}(E.BufferGeometry);function Fe(f,o){return typeof f!="number"||typeof o!="number"?!1:Math.abs(f-o)<.001}function Ve(f,o,e,a){a===void 0&&(a=function(l){return l});var t=a(e);return f*(1-t)+o*t}var J=Number((Math.PI/2).toFixed(5));function wn(f,o,e){var a=new E.Shape;return a.moveTo(e,0),a.lineTo(f-e,0),a.absarc(f-e,e,e,-J,0,!1),a.lineTo(f,o-e),a.absarc(f-e,o-e,e,0,J,!1),a.lineTo(e,o),a.absarc(e,o-e,e,J,Math.PI,!1),a.lineTo(0,e),a.absarc(e,e,e,Math.PI,Math.PI*1.5,!1),a}var Be=function(f){var o=document.createElement("div");o.innerText=f;var e=new be(o);return e.name=f,e.scale.set(.3,.3,.3),o.style.pointerEvents="none",o.style.backfaceVisibility="hidden",e},Je=function(f){var o=new E.PlaneGeometry(5,5),e=new E.MeshBasicMaterial({transparent:!0,opacity:0}),a=new E.Mesh(o,e),t=document.createElement("div");t.innerText=f;var l=new be(t);return l.name=f,l.scale.set(.3,.3,.3),t.style.color="#ffffff",t.style.opacity="0.5",t.style.pointerEvents="none",t.style.backfaceVisibility="hidden",a.rotateX(-J),a.add(l),a},Pn=function(f){it(o,f);function o(e,a){var t=f.call(this,e)||this;t.camera=new Tt.Camera(90),t.scene=new E.Scene,t.renderer=new E.WebGLRenderer({antialias:!0,alpha:!0}),t.css3drenderer=new En,t.ambientLight=new E.AmbientLight(16777215,.7),t.wrapper=document.createElement("div"),t.arrows=document.createElement("div"),t.arrowLeft=document.createElement("div"),t.arrowRight=document.createElement("div"),t.arrowFront=document.createElement("div"),t.arrowBack=document.createElement("div"),t.arrowTop=document.createElement("div"),t.arrowBottom=document.createElement("div"),t.spherical=null,t.dragging=!1,t.style=document.createElement("style"),t.directionalLight=new E.DirectionalLight(16777215,.2),t.box=new E.Mesh(new Ut(8,8,8,.5,20),new E.MeshPhongMaterial({color:16777215})),t.faces=new E.Group,t.orient=function(c){var g=c.longitude,d=c.latitude;t.dragging=!1,t.spherical=null,t.controls.enableDamping=!1,t.five.setState(Object.assign({latitude:d},g!==void 0?{longitude:g+t.config.fixedLongitude}:{})),t.five.ready().then(function(){t.controls.enableDamping=!0,t.setState({arrowsVisible:!0})})},t.onRenderFrame=function(){var c,g,d,m,w;if(t.renderer.render(t.scene,t.camera),t.css3drenderer.render(t.scene,t.camera),t.directionalLight.position.copy(t.camera.position),(c=t.controls)===null||c===void 0||c.update(),t.dragging){t.camera.computePose(),t.updateByCamera();var A=t.camera.pose,k=A.longitude,x=A.latitude;t.five.setState({longitude:k,latitude:x},!0),t.updateArrows({longitude:k,latitude:x})}else if(t.spherical&&(!Fe(t.spherical.pi,(g=t.controls)===null||g===void 0?void 0:g.getPolarAngle())||!Fe(t.spherical.theta,(d=t.controls)===null||d===void 0?void 0:d.getAzimuthalAngle()))){t.spherical={pi:(m=t.controls)===null||m===void 0?void 0:m.getPolarAngle(),theta:(w=t.controls)===null||w===void 0?void 0:w.getAzimuthalAngle()},t.camera.computePose(),t.updateByCamera();var D=t.camera.pose,k=D.longitude,x=D.latitude;t.five.setState({longitude:k,latitude:x},!0),t.updateArrows({longitude:k,latitude:x})}else t.spherical=null},t.onTapGesture=function(c){var g=c.pointers[0].clientX,d=c.pointers[0].clientY,m=Rt({x:g,y:d},t.wrapper),w=new E.Raycaster;w.setFromCamera(m,t.camera);var A=w.intersectObjects(t.faces.children,!1)[0];if(A){var k=A.object.userData,x=k.longitude,D=k.latitude;t.orient({longitude:x,latitude:D})}},t.onFiveWantsGesture=function(){if(t.spherical)return!1},t.onFiveModeChange=function(c){t.controls&&(t.controls.maxPolarAngle=c==="Topview"?0:J)},t.onCameraUpdate=function(c){var g=c.state;if(!t.dragging&&!t.spherical){var d=g.longitude,m=g.latitude;t.camera.pose.longitude===d&&t.camera.pose.latitude===m||(t.camera.setFromPose({longitude:d,latitude:m,distance:20,offset:new E.Vector3(0,0,0)}),t.updateByCamera(),t.updateArrows({longitude:d,latitude:m}))}},t.onPanStart=function(c){t.dragging=!0,t.spherical={}},t.onMouseMove=function(c){if(!t.dragging){var g=Rt({x:c.clientX,y:c.clientY},t.wrapper),d=new E.Raycaster;d.setFromCamera(g,t.camera);var m=d.intersectObjects(t.faces.children,!1)[0];t.faces.children.forEach(function(w){w.material.opacity=0,w.children[0].element.style.color=""}),m&&(m.object.material.opacity=.3,m.object.children[0].element.style.color="#336dff")}},t.onPanEnd=function(c){t.dragging=!1,t.spherical={pi:t.controls.getPolarAngle(),theta:t.controls.getAzimuthalAngle()}},t.dispose=function(){t.disable()},t.five=e;var l={enabled:!1,visible:!0,arrowsVisible:!1};t.state=Object.assign(l,a==null?void 0:a.initialState);var h=ae({fixedLongitude:0,orthoView:!0},a==null?void 0:a.config);return t._config=h,t.state.enabled&&t._enable({userAction:!1}),t.mc=new mt.Manager(t.wrapper),t.mc.add(new mt.Tap({interval:410})),t.mc.add(new mt.Pan({threshold:10,pointers:0})),t.camera.setFromPose({distance:20,offset:new E.Vector3(0,0,0),longitude:e.camera.pose.latitude,latitude:e.camera.pose.latitude}),t.cylinder=new E.Mesh(new E.CylinderGeometry(13.2,14,.01,50,1,!0),new E.ShaderMaterial({uniforms:{radiusTop:{value:13.2},radiusBottom:{value:14},opacity:{value:1}},vertexShader:`
357
357
  varying vec3 pos;
358
358
  varying mat4 vViewMatrix;
359
359
  void main() {
@@ -383,7 +383,7 @@ void main() {
383
383
  vec4 color = mix(color1, color2, z);
384
384
  gl_FragColor = color;
385
385
  }
386
- `,transparent:!0})),t.init(),t}return Object.defineProperty(o.prototype,"config",{get:function(){return W({},this._config)},enumerable:!1,configurable:!0}),o.prototype.updateState=function(n,a){var t=this.state;this.state=W(W({},this.state),n),typeof n.arrowsVisible=="boolean"&&this.handleArrowsVisible(n.arrowsVisible),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:a})},o.prototype.appendTo=function(n){if(n){n.appendChild(this.wrapper);var a=this.wrapper.getBoundingClientRect(),t=a.width,l=a.height;this.renderer.setSize(t,l),this.css3drenderer.setSize(t,l)}},o.prototype.init=function(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline="none",this.initDom(),this.initFaces(),this.initControls(),this.initLights();var n=this.cylinder;n.position.y=-3;var a=Le("西");a.position.set(-19,0,0),n.add(a);var t=Le("东");t.position.set(19,0,0),n.add(t);var l=Le("北");l.position.set(0,0,-19),n.add(l);var h=Le("南");h.position.set(0,0,19),n.add(h),this.updateByCamera(),this.scene.add(n,this.box,this.faces),this.scene.rotation.y=this.config.fixedLongitude},o.prototype.initDom=function(){this.style.innerHTML=`
386
+ `,transparent:!0})),t.init(),t}return Object.defineProperty(o.prototype,"config",{get:function(){return ae({},this._config)},enumerable:!1,configurable:!0}),o.prototype.updateState=function(e,a){var t=this.state;this.state=ae(ae({},this.state),e),typeof e.arrowsVisible=="boolean"&&this.handleArrowsVisible(e.arrowsVisible),this.hooks.emit("stateChange",{state:this.state,prevState:t,userAction:a})},o.prototype.appendTo=function(e){if(e){e.appendChild(this.wrapper);var a=this.wrapper.getBoundingClientRect(),t=a.width,l=a.height;this.renderer.setSize(t,l),this.css3drenderer.setSize(t,l)}},o.prototype.init=function(){this.renderer.setClearAlpha(0),this.renderer.domElement.style.outline="none",this.initDom(),this.initFaces(),this.initControls(),this.initLights();var e=this.cylinder;e.position.y=-3;var a=Je("西");a.position.set(-19,0,0),e.add(a);var t=Je("东");t.position.set(19,0,0),e.add(t);var l=Je("北");l.position.set(0,0,-19),e.add(l);var h=Je("南");h.position.set(0,0,19),e.add(h),this.updateByCamera(),this.scene.add(e,this.box,this.faces),this.scene.rotation.y=this.config.fixedLongitude},o.prototype.initDom=function(){this.style.innerHTML=`
387
387
  .OrientationPlugin .OrientationArrows {
388
388
  position: absolute;
389
389
  top: 0;
@@ -483,7 +483,7 @@ void main() {
483
483
  border-color: transparent transparent var(--color) transparent;
484
484
  transform: translate(0, -15px);
485
485
  }
486
- `,this.wrapper.className="OrientationPlugin",this.arrows.className="OrientationArrows",this.wrapper.style.cssText="position: relative; width: 100%; height: 100%",this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className="OrientationArrow",this.arrowBottom.className="OrientationArrow disabled",this.arrowBack.innerText="后",this.arrowFront.innerText="前",this.arrowLeft.innerText="左",this.arrowRight.innerText="右",this.arrowTop.innerText="上",this.arrowBottom.innerText="下",this.css3drenderer.domElement.style.cssText="position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;"},o.prototype.bindEvents=function(){var n=this;this.five.on("renderFrame",this.onRenderFrame),this.five.on("camera.update",this.onCameraUpdate),this.five.on("wantsGesture",this.onFiveWantsGesture),this.five.on("modeChange",this.onFiveModeChange),this.mc.on("tap",this.onTapGesture),this.mc.on("panstart",this.onPanStart),this.mc.on("panend",this.onPanEnd),this.wrapper.addEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=function(){return n.orient({longitude:0,latitude:X})},this.arrowLeft.onclick=function(){return n.orient({longitude:-X,latitude:0})},this.arrowRight.onclick=function(){return n.orient({longitude:X,latitude:0})},this.arrowFront.onclick=function(){return n.orient({longitude:0,latitude:0})},this.arrowBack.onclick=function(){return n.orient({longitude:Math.PI,latitude:0})}},o.prototype.unbindEvents=function(){this.five.off("renderFrame",this.onRenderFrame),this.five.off("camera.update",this.onCameraUpdate),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("modeChange",this.onFiveModeChange),this.mc.off("tap",this.onTapGesture),this.mc.off("panstart",this.onPanStart),this.mc.off("panend",this.onPanEnd),this.wrapper.removeEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null},o.prototype.updateByCamera=function(){var n=_e(.2,1,this.camera.pose.latitude/Math.PI*2,function(u){return u*u}),a=_e(11,13,this.camera.pose.latitude/Math.PI*2,function(u){return u*u}),t=_e(12,15,this.camera.pose.latitude/Math.PI*2,function(u){return u*u}),l=_e(13,19,this.camera.pose.latitude/Math.PI*2,function(u){return u*u}),h=_e(-.2,.5,this.camera.pose.latitude/Math.PI*2,function(u){return u*u});this.cylinder.geometry=new g.CylinderGeometry(a,t,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=a,this.cylinder.material.uniforms.radiusBottom.value=t,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(function(u){u.position.normalize().multiplyScalar(l),u.scale.set(n,n,n);var m=u.children[0];m&&(m.element.style.opacity=h.toString())})},o.prototype.updateArrows=function(n){n.longitude;var a=n.latitude,t=X-a<.02;this.setState({arrowsVisible:t})},o.prototype.handleArrowsVisible=function(n){var a=this;if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=n?.4:1,this.cylinder.material.needsUpdate=!0,n){var t=this.five.getCurrentState(),l=t.longitude,h=t.latitude;if(X-h<.03)this.five.state.mode==="Topview"||this.five.state.mode==="Mapview"?(this.faces.getObjectByName("上").element.className="active",this.arrows.innerHTML="",this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform="rotate(".concat((l-this.config.fixedLongitude)/Math.PI*180,"deg)")):(this.arrows.innerHTML="",this.faces.getObjectByName("上").element.className="");else{switch(this.arrows.innerHTML="",this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(function(){a.five.controller.cameraType="orthographic",a.five.ready().then(function(){return a.five.controller.cameraMotion.ended=!1})}),!0){case Pe(0,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("前").element.className="active";break;case Pe(X,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("右").element.className="active";break;case Pe(Math.PI,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("后").element.className="active";break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("左").element.className="active";break}this.arrows.style.transform=""}this.arrows.style.display="block"}else this.config.orthoView&&(this.five.controller.cameraType="auto",this.five.ready().then(function(){return a.five.controller.cameraMotion.ended=!1})),this.arrows.style.display="none",this.faces.children.forEach(function(u){u.children[0].element.className=""})},o.prototype.setState=function(n,a){a===void 0&&(a={});var t=this.state,l=a.userAction!==void 0?a.userAction:!0;if(this.updateState(n,l),n.enabled!==void 0&&t.enabled!==n.enabled){var h={userAction:l};n.enabled?this._enable(h):this._disable(h)}},o.prototype.initLights=function(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)},o.prototype.initFaces=function(){var n=yr(7,7,.5),a=new g.ShapeGeometry(n);a.translate(-3.5,-3.5,0);var t=new g.Mesh(a,new g.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));t.userData={longitude:0,latitude:0},t.position.z=4.1,t.add(Me("前"));var l=new g.Mesh(a,new g.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));l.rotateY(Math.PI),l.position.z=-4.1,l.add(Me("后")),l.userData={longitude:Math.PI,latitude:0};var h=new g.Mesh(a,new g.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));h.rotateY(X),h.position.x=4.1,h.add(Me("右")),h.userData={longitude:X,latitude:0};var u=new g.Mesh(a,new g.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));u.rotateY(-X),u.position.x=-4.1,u.add(Me("左")),u.userData={longitude:-X,latitude:0};var m=new g.Mesh(a,new g.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));m.rotateX(-X),m.position.y=4.1,m.add(Me("上")),m.userData={longitude:0,latitude:X},this.faces.add(t,l,u,h,m)},o.prototype.initControls=function(){var n=this.controls=new tr.OrbitControls(this.camera,this.renderer.domElement);n.enableZoom=!1,n.enableDamping=!0,n.enablePan=!1,n.maxPolarAngle=X,n.dampingFactor=.15,n.rotateSpeed=.25},o.prototype.load=function(n){return Ve(this,void 0,void 0,function(){return Ge(this,function(a){return[2]})})},o.prototype._enable=function(n){var a=this.five.getCurrentState(),t=a.longitude,l=a.latitude;this.camera.setFromPose({longitude:t,latitude:l,distance:20,offset:new g.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()},o.prototype._disable=function(n){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()},o.prototype.enable=function(n){var a;if(!this.state.enabled){var t=(a=n==null?void 0:n.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!0},t),this._enable({userAction:t}),document.head.appendChild(this.style)}},o.prototype.disable=function(n){var a;if(this.state.enabled!==!1){var t=(a=n==null?void 0:n.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!1},t),this._disable({userAction:t}),document.head.removeChild(this.style)}},o}(exports.BasePlugin.Controller),wr=function(c,o){return new Tr(c,o)},br=function(c){He(o,c);function o(n,a){var t=c.call(this,n)||this;return t.data={},t.pluginName="BackgroundPlugin",t._onFiveCameraUpdate=function(l){var h=(Math.PI/2-Math.max(l.latitude,0))/(Math.PI/2),u=Math.max(.2-h,0)*10;t.gradientBg&&(t.gradientBg.style.transform="translateY(-".concat((1-h)*50,"%)")),t.groundBg&&(t.groundBg.style.backgroundImage="radial-gradient(circle, #2E303350 ".concat(u*100,"%, transparent ").concat(u*120,"%)"))},t._addEventListener=function(){t.five.on("cameraUpdate",t._onFiveCameraUpdate)},t._removeEventListener=function(){t.five.off("cameraUpdate",t._onFiveCameraUpdate)},t.load=function(){return Ve(t,void 0,void 0,function(){return Ge(this,function(l){return[2]})})},t.setState=function(l,h){},t.enable=function(){var l,h=(l=t.five.getElement())===null||l===void 0?void 0:l.parentNode;if(!h){t.five.ready().then(function(){return t.enable()});return}t.state.enabled||(t._onFiveCameraUpdate(t.five.getPose(),!1),t.gradientBg&&h.appendChild(t.gradientBg),t.groundBg&&h.appendChild(t.groundBg),t.style&&document.head.appendChild(t.style),t._addEventListener(),t.hooks.emit("enable",{userAction:!0}),t.state.enabled=!0)},t.disable=function(l){var h,u,m,p;t.state.enabled&&((u=(h=t.gradientBg)===null||h===void 0?void 0:h.parentNode)===null||u===void 0||u.removeChild(t.gradientBg),(p=(m=t.groundBg)===null||m===void 0?void 0:m.parentNode)===null||p===void 0||p.removeChild(t.groundBg),t.style&&document.head.removeChild(t.style),t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1)},t.dispose=function(){t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1},t.state={enabled:!1},typeof document=="undefined"||(t.gradientBg=document.createElement("div"),t.groundBg=document.createElement("div"),t.style=document.createElement("style"),t.gradientBg.className="BackgroundPluginBg",t.groundBg.className="BackgroundPluginGroundBg",t.style.innerHTML=`
486
+ `,this.wrapper.className="OrientationPlugin",this.arrows.className="OrientationArrows",this.wrapper.style.cssText="position: relative; width: 100%; height: 100%",this.wrapper.appendChild(this.arrows),this.arrowLeft.className=this.arrowRight.className=this.arrowTop.className=this.arrowBack.className=this.arrowFront.className="OrientationArrow",this.arrowBottom.className="OrientationArrow disabled",this.arrowBack.innerText="后",this.arrowFront.innerText="前",this.arrowLeft.innerText="左",this.arrowRight.innerText="右",this.arrowTop.innerText="上",this.arrowBottom.innerText="下",this.css3drenderer.domElement.style.cssText="position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;"},o.prototype.bindEvents=function(){var e=this;this.five.on("renderFrame",this.onRenderFrame),this.five.on("camera.update",this.onCameraUpdate),this.five.on("wantsGesture",this.onFiveWantsGesture),this.five.on("modeChange",this.onFiveModeChange),this.mc.on("tap",this.onTapGesture),this.mc.on("panstart",this.onPanStart),this.mc.on("panend",this.onPanEnd),this.wrapper.addEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=function(){return e.orient({longitude:0,latitude:J})},this.arrowLeft.onclick=function(){return e.orient({longitude:-J,latitude:0})},this.arrowRight.onclick=function(){return e.orient({longitude:J,latitude:0})},this.arrowFront.onclick=function(){return e.orient({longitude:0,latitude:0})},this.arrowBack.onclick=function(){return e.orient({longitude:Math.PI,latitude:0})}},o.prototype.unbindEvents=function(){this.five.off("renderFrame",this.onRenderFrame),this.five.off("camera.update",this.onCameraUpdate),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("modeChange",this.onFiveModeChange),this.mc.off("tap",this.onTapGesture),this.mc.off("panstart",this.onPanStart),this.mc.off("panend",this.onPanEnd),this.wrapper.removeEventListener("mousemove",this.onMouseMove),this.arrowTop.onclick=null,this.arrowLeft.onclick=null,this.arrowRight.onclick=null,this.arrowFront.onclick=null,this.arrowBack.onclick=null},o.prototype.updateByCamera=function(){var e=Ve(.2,1,this.camera.pose.latitude/Math.PI*2,function(c){return c*c}),a=Ve(11,13,this.camera.pose.latitude/Math.PI*2,function(c){return c*c}),t=Ve(12,15,this.camera.pose.latitude/Math.PI*2,function(c){return c*c}),l=Ve(13,19,this.camera.pose.latitude/Math.PI*2,function(c){return c*c}),h=Ve(-.2,.5,this.camera.pose.latitude/Math.PI*2,function(c){return c*c});this.cylinder.geometry=new E.CylinderGeometry(a,t,.01,50,1,!0),this.cylinder.material.uniforms.radiusTop.value=a,this.cylinder.material.uniforms.radiusBottom.value=t,this.cylinder.material.needsUpdate=!0,this.cylinder.children.forEach(function(c){c.position.normalize().multiplyScalar(l),c.scale.set(e,e,e);var g=c.children[0];g&&(g.element.style.opacity=h.toString())})},o.prototype.updateArrows=function(e){e.longitude;var a=e.latitude,t=J-a<.02;this.setState({arrowsVisible:t})},o.prototype.handleArrowsVisible=function(e){var a=this;if(this.state.enabled)if(this.cylinder.material.uniforms.opacity.value=e?.4:1,this.cylinder.material.needsUpdate=!0,e){var t=this.five.getCurrentState(),l=t.longitude,h=t.latitude;if(J-h<.03)this.five.state.mode==="Topview"||this.five.state.mode==="Mapview"?(this.faces.getObjectByName("上").element.className="active",this.arrows.innerHTML="",this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowFront),this.arrows.style.transform="rotate(".concat((l-this.config.fixedLongitude)/Math.PI*180,"deg)")):(this.arrows.innerHTML="",this.faces.getObjectByName("上").element.className="");else{switch(this.arrows.innerHTML="",this.arrows.appendChild(this.arrowTop),this.config.orthoView&&this.five.ready().then(function(){a.five.controller.cameraType="orthographic",a.five.ready().then(function(){return a.five.controller.cameraMotion.ended=!1})}),!0){case Fe(0,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("前").element.className="active";break;case Fe(J,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("右").element.className="active";break;case Fe(Math.PI,l-this.config.fixedLongitude):this.arrows.appendChild(this.arrowRight),this.arrows.appendChild(this.arrowLeft),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("后").element.className="active";break;default:this.arrows.appendChild(this.arrowBack),this.arrows.appendChild(this.arrowFront),this.arrows.appendChild(this.arrowBottom),this.faces.getObjectByName("左").element.className="active";break}this.arrows.style.transform=""}this.arrows.style.display="block"}else this.config.orthoView&&(this.five.controller.cameraType="auto",this.five.ready().then(function(){return a.five.controller.cameraMotion.ended=!1})),this.arrows.style.display="none",this.faces.children.forEach(function(c){c.children[0].element.className=""})},o.prototype.setState=function(e,a){a===void 0&&(a={});var t=this.state,l=a.userAction!==void 0?a.userAction:!0;if(this.updateState(e,l),e.enabled!==void 0&&t.enabled!==e.enabled){var h={userAction:l};e.enabled?this._enable(h):this._disable(h)}},o.prototype.initLights=function(){this.directionalLight.target=this.box,this.scene.add(this.ambientLight,this.directionalLight)},o.prototype.initFaces=function(){var e=wn(7,7,.5),a=new E.ShapeGeometry(e);a.translate(-3.5,-3.5,0);var t=new E.Mesh(a,new E.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));t.userData={longitude:0,latitude:0},t.position.z=4.1,t.add(Be("前"));var l=new E.Mesh(a,new E.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));l.rotateY(Math.PI),l.position.z=-4.1,l.add(Be("后")),l.userData={longitude:Math.PI,latitude:0};var h=new E.Mesh(a,new E.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));h.rotateY(J),h.position.x=4.1,h.add(Be("右")),h.userData={longitude:J,latitude:0};var c=new E.Mesh(a,new E.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));c.rotateY(-J),c.position.x=-4.1,c.add(Be("左")),c.userData={longitude:-J,latitude:0};var g=new E.Mesh(a,new E.MeshBasicMaterial({transparent:!0,color:3370495,opacity:0}));g.rotateX(-J),g.position.y=4.1,g.add(Be("上")),g.userData={longitude:0,latitude:J},this.faces.add(t,l,c,h,g)},o.prototype.initControls=function(){var e=this.controls=new Ye(this.camera,this.renderer.domElement);e.enableZoom=!1,e.enableDamping=!0,e.enablePan=!1,e.maxPolarAngle=J,e.dampingFactor=.15,e.rotateSpeed=.25},o.prototype.load=function(e){return et(this,void 0,void 0,function(){return tt(this,function(a){return[2]})})},o.prototype._enable=function(e){var a=this.five.getCurrentState(),t=a.longitude,l=a.latitude;this.camera.setFromPose({longitude:t,latitude:l,distance:20,offset:new E.Vector3(0,0,0)}),this.updateByCamera(),this.wrapper.appendChild(this.renderer.domElement),this.wrapper.appendChild(this.css3drenderer.domElement),this.bindEvents()},o.prototype._disable=function(e){this.wrapper.removeChild(this.renderer.domElement),this.wrapper.removeChild(this.css3drenderer.domElement),this.unbindEvents()},o.prototype.enable=function(e){var a;if(!this.state.enabled){var t=(a=e==null?void 0:e.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!0},t),this._enable({userAction:t}),document.head.appendChild(this.style)}},o.prototype.disable=function(e){var a;if(this.state.enabled!==!1){var t=(a=e==null?void 0:e.userAction)!==null&&a!==void 0?a:!0;this.updateState({enabled:!1},t),this._disable({userAction:t}),document.head.removeChild(this.style)}},o}(exports.BasePlugin.Controller),Mn=function(f,o){return new Pn(f,o)},On=function(f){it(o,f);function o(e,a){var t=f.call(this,e)||this;return t.data={},t.pluginName="BackgroundPlugin",t._onFiveCameraUpdate=function(l){var h=(Math.PI/2-Math.max(l.latitude,0))/(Math.PI/2),c=Math.max(.2-h,0)*10;t.gradientBg&&(t.gradientBg.style.transform="translateY(-".concat((1-h)*50,"%)")),t.groundBg&&(t.groundBg.style.backgroundImage="radial-gradient(circle, #2E303350 ".concat(c*100,"%, transparent ").concat(c*120,"%)"))},t._addEventListener=function(){t.five.on("cameraUpdate",t._onFiveCameraUpdate)},t._removeEventListener=function(){t.five.off("cameraUpdate",t._onFiveCameraUpdate)},t.load=function(){return et(t,void 0,void 0,function(){return tt(this,function(l){return[2]})})},t.setState=function(l,h){},t.enable=function(){var l,h=(l=t.five.getElement())===null||l===void 0?void 0:l.parentNode;if(!h){t.five.ready().then(function(){return t.enable()});return}t.state.enabled||(t._onFiveCameraUpdate(t.five.getPose(),!1),t.gradientBg&&h.appendChild(t.gradientBg),t.groundBg&&h.appendChild(t.groundBg),t.style&&document.head.appendChild(t.style),t._addEventListener(),t.hooks.emit("enable",{userAction:!0}),t.state.enabled=!0)},t.disable=function(l){var h,c,g,d;t.state.enabled&&((c=(h=t.gradientBg)===null||h===void 0?void 0:h.parentNode)===null||c===void 0||c.removeChild(t.gradientBg),(d=(g=t.groundBg)===null||g===void 0?void 0:g.parentNode)===null||d===void 0||d.removeChild(t.groundBg),t.style&&document.head.removeChild(t.style),t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1)},t.dispose=function(){t._removeEventListener(),t.hooks.emit("disable",{userAction:!0}),t.state.enabled=!1},t.state={enabled:!1},typeof document=="undefined"||(t.gradientBg=document.createElement("div"),t.groundBg=document.createElement("div"),t.style=document.createElement("style"),t.gradientBg.className="BackgroundPluginBg",t.groundBg.className="BackgroundPluginGroundBg",t.style.innerHTML=`
487
487
  .BackgroundPluginBg {
488
488
  position: absolute;
489
489
  top: 0;
@@ -504,4 +504,4 @@ void main() {
504
504
  z-index: -1;
505
505
  pointerEvents: none;
506
506
  }
507
- `,t.enable()),t}return o}(rr.BasePlugin.Controller),Er=function(c,o){return new br(c,o)};exports.BackgroundPlugin=Er;exports.ItemMaskPlugin=gr;exports.OrientationPlugin=wr;exports.RoundedBoxGeometry=xt;
507
+ `,t.enable()),t}return o}(an.BasePlugin.Controller),An=function(f,o){return new On(f,o)};exports.BackgroundPlugin=An;exports.ItemMaskPlugin=bn;exports.OrientationPlugin=Mn;exports.RoundedBoxGeometry=Ut;