YGG.Nanoganic2=function(e,t,n){const a=0,i=2,o=3,r=6,l=7,c=0,s=1,u=2,p=3,d=new THREE.Vector3(0,110,0),E=new THREE.Vector3(-360,0,60),T=new THREE.Vector3(3,10,2),h=100,f=100;let m,_,O,P,g,y,b,w,R,H,M,x,I=this,v=4096,N=4,C=!0,A=new YGG.Utils,S=new YGG.UtilityWASM,Y=new YGG.JJ_Object,k=new YGG.JJ_DataManager,V=a,D=a,U=new THREE.WebGLRenderer({antialias:!0}),W=new THREE.Scene,j=new THREE.PerspectiveCamera(h,window.innerWidth/window.innerHeight,.01,5e3),G=new YGG.UserControls(j,U.domElement,f),z=new YGG.OrbitControls(j,U.domElement),X=new THREE.Group,F=new THREE.Group,Z=new THREE.Group,Q=new THREE.Group,L=new THREE.Group,q=new THREE.Group,B=new THREE.Group,J=new THREE.Group,K=new THREE.Group,$=new THREE.Group,ee=new THREE.Group,te=new THREE.Group,ne=new THREE.Group,ae=new THREE.Group,ie=new THREE.Group,oe=Y.createSphere(50),re=Y.createSphere(50),le=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:0}),ce=new THREE.Raycaster,se=new THREE.Vector3,ue=null,pe=null,de=null,Ee=null,Te="m0000",he="z0000",fe="s0000",me="",_e="",Oe="",Pe=!1,ge=new THREE.Vector3,ye=new THREE.Vector3,be=new THREE.Vector2,we=new THREE.Vector2,Re=new THREE.Vector2,He=0,Me=.001*Date.now(),xe=[],Ie=0,ve=[],Ne=[],Ce=[],Ae=[],Se=[],Ye=[],ke=null,Ve=null,De=[],Ue="",We=!1,je=new THREE.Matrix4,Ge=function(){},ze=function(){},Xe=function(){},Fe=function(){},Ze=function(){},Qe=function(){},Le=function(){},qe=function(){},Be=function(){},Je=function(){},Ke=null;Ke=n||function(){};let $e=[{id:"m000a",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(-360,0,60),yaw:-18},{id:"m0001",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(0,0,-200),yaw:-93},{id:"m0002",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(200,0,10),yaw:174},{id:"m0003",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(-220,0,-10),yaw:19},{id:"m0004",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(0,0,250),yaw:84},{id:"m0005",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(50,0,-70),yaw:-126},{id:"m0006",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(50,0,70),yaw:130},{id:"m0007",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(-90,0,-180),yaw:-66},{id:"m0008",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(40,0,120),yaw:112},{id:"m0009",position:new THREE.Vector3(0,110,0),target:new THREE.Vector3(280,0,-100),yaw:-176}];function et(e,t){switch(V){case i:j.aspect=e/t,j.updateProjectionMatrix();default:j.aspect=e/t,j.updateProjectionMatrix()}}function tt(e,t){let n=e.image.src,c=n.substring(n.lastIndexOf("/")+1),s=c.substring(0,c.indexOf("_")),u="",p=c.substring(c.indexOf("_")+1,c.indexOf("-"));c.indexOf("t")>=0&&(u=parseInt(c.substring(c.indexOf("_")+2,c.indexOf("_")+4)),p=c.substring(c.indexOf("_")+5,c.indexOf("-")));let d=e.image.naturalWidth,E=e.image.naturalHeight,T=c.substring(c.indexOf("-")+1,c.lastIndexOf("-")),h=c.substring(c.lastIndexOf("-")+1,c.indexOf(".")),f=256;switch(p.length>2?(T=0,h=0,0==p.localeCompare("512")&&(f=512)):f=0==p.localeCompare("1k")?1024:0==p.localeCompare("2k")?2048:0==p.localeCompare("4k")?4096:8192,s.indexOf("m")>=0?s.indexOf("z")>=0?function(e,t,n,i,o,r,l,c){for(let s=0;s=0?function(e,t,n,a,o,r,l){rt(i,1,Ce[e],t,n,a,o,r,l,e)}(u,e,f,T,h,d,E):s.indexOf("s")>=0?function(e,t,n,a,i,o,l){rt(r,1,Se[e],t,n,a,i,o,l,e)}(u,e,f,T,h,d,E):3==s.length?D!=o&&D!=i||0!=me.localeCompare(s)||function(e,t,n,a,i,r,l){if(0!=e.localeCompare(me))return;switch(function(e){return 0==oe.name.localeCompare(e)?0:0==re.name.localeCompare(e)?1:-1}(e)){case 0:null!=b&&null!=b||(b=lt(oe)),rt(o,2,b,t,n,a,i,r,l,0);break;case 1:null!=w&&null!=w||(w=lt(re)),rt(o,2,w,t,n,a,i,r,l,0);break}}(s,e,f,T,h,d,E):D!=l&&D!=r||function(e,t,n,a,i,o,r){0==g.name.localeCompare(e)?rt(l,2,g,t,n,a,i,o,r,0):0==y.name.localeCompare(e)&&rt(l,2,y,t,n,a,i,o,r,0)}(s,e,f,T,h,d,E),D){case a:t(k.TEXTURE_MODE.T_MAP);break;case i:t(k.TEXTURE_MODE.T_ZONE);break;case o:t(k.TEXTURE_MODE.T_ZONE_WAYPOINT);break;case r:t(k.TEXTURE_MODE.T_SHOP);break;case l:t(k.TEXTURE_MODE.T_SHOP_WAYPOINT);break;default:break}}function nt(e,t,n,d,E,T,h){switch(e.scene.traverseVisible((function(e){if(e.isMesh)switch(e.material.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=function(){}),n){case c:m=e,e.material=P,e.name=d,X.add(e);break;case s:{let n=e;if(n.pointType=POINT_TYPE_ZONE,n.name=d,n.position.set(0,0,0),n.renderOrder=ZONEMESH_TRANSPARENT_ORDER,t<0)null==n.material?n.setAttribute("material",le.clone()):n.material=le.clone();else for(let e=0;eT){n.repeat.set(E,-E);let f=function(e,t,n,a,i,o){let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r);let l=U.properties.get(t);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,l.__webglTexture,0);let c=new Uint8Array(n*a*4);e.readPixels(0,t.image.height-a,n,a,e.RGBA,e.UNSIGNED_BYTE,c),e.deleteFramebuffer(r),null!=M&&null!=M||(M=document.createElement("canvas").getContext("2d",{alpha:!1})),M.canvas.width=n,M.canvas.height=a;let s=M.createImageData(n,a);return s.data.set(c),M.putImageData(s,0,0),null!=x&&null!=x||(x=document.createElement("canvas").getContext("2d",{alpha:!1})),x.canvas.width=i,x.canvas.height=o,x.save(),x.scale(1,-1),x.translate(0,-x.canvas.height),x.drawImage(M.canvas,0,0,n,a,0,0,i,o),x.restore(),x}(U.getContext(),n,n.image.width*T,n.image.height*T,n.image.width*E,n.image.height*E),m=new THREE.CanvasTexture(f.canvas);if(U.copyTextureToTexture(new THREE.Vector2(0,n.image.height-n.image.height*E),m,n),e==r)xe[d].offsetRepeat.value=[0,0,E,-E];else if(e==l)if(n==g)for(let e=0;e1/12?requestAnimationFrame(Lt):U.getContext().flush()}else if(c==s&&c==f)requestAnimationFrame(Lt);else{let e=Date.now();e*=.001,e-Me>1/12?requestAnimationFrame(Lt):U.getContext().flush()}}function lt(e){let t=at(v),n=256/v;return e.material.map=t,t.repeat.set(n,-n),t.wrapS=t.wrapT=THREE.RepeatWrapping,t.minFilter=THREE.LinearFilter,t.generateMipmaps=!1,t}function ct(e){G.enabled=!e,z.enabled=e,e?z.refresh():G.refresh()}function st(e,t,n){let a="";return e.length>=4?a+=e[4]:a+="0",t.length>=4?a+=t.substring(3,5):a+="00",a+="00",a+="0",n.length>=4?a+=n.substring(2,5):a+="000",a}function ut(e){if(null==e||null==e||9!=e.length)return{map_id:"m0000",zone_id:"z0000",shop_id:"s0000"};let t={map_id:"",zone_id:"",shop_id:""};t.map_id="m000"+e[0];let n=parseInt(e[2]);return isNaN(n)?t.zone_id="z000"+e[2].toLowerCase():t.zone_id="z00"+e.substring(1,3),t.shop_id="s0"+e.substring(6,9),t}function pt(){V==r?(pe=j.position,bt()):V==i&&(me="",ue=yt(i,j.position,!1,50),null!=ue&&(me=ue.name,function(e){let t,n=RESOURCE_PATH+"map2/"+Te+"/"+he+"/waypoints/img360/"+e+"/";if(V==o){if(0==me.localeCompare(e))return;me=ue.name,t=ae.children[1],t.name=e,k.clearTextureQueueByMode(k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,0,k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,2,k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,N,k.TEXTURE_MODE.T_ZONE_WAYPOINT),t==oe?(oe.material.map=b,null!=b&&null!=b&&(b.needsUpdate=!0)):(re.material.map=w,null!=w&&null!=w&&(w.needsUpdate=!0)),t.position.copy(ue.position),t.position.add(ue.children[0].position),t.rotation.copy(ue.rotation),jt(o)}else if(me=ue.name,0==ae.children[0].name.localeCompare(e)){let e=ae.children[0];ae.children[0]=ae.children[1],ae.children[1]=e,jt(o)}else 0==ae.children[1].name.localeCompare(e)||(t=ae.children[1],t.name=e,k.clearTextureQueueByMode(k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,0,k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,2,k.TEXTURE_MODE.T_ZONE_WAYPOINT),k.generateTextureQueue(n,e,-1,N,k.TEXTURE_MODE.T_ZONE_WAYPOINT),t==oe?(oe.material.map=b,null!=b&&null!=b&&(b.needsUpdate=!0)):(re.material.map=w,null!=w&&null!=w&&(w.needsUpdate=!0)),t.position.copy(ue.position),t.position.add(ue.children[0].position),t.rotation.copy(ue.rotation)),jt(o)}(ue.name)))}function dt(t){if(t.preventDefault(),!G.enabled&&!z.enabled)return;if(ue){switch(ue.pointType){case POINT_TYPE_ZONE_WAYPOINT:case POINT_TYPE_SHOP_TOP_ICON:case POINT_TYPE_SHOP_WAYPOINT:case POINT_TYPE_SHOP_POINT:case POINT_TYPE_PRODUCT:case POINT_TYPE_PRODUCT_GROUP:case POINT_TYPE_SHOP_ICON:case POINT_TYPE_COIN:ue.material.color.set(16777215);break;case POINT_TYPE_ZONE:ue.material?ue.material.opacity=0:ue.children.length>0&&(ue.children[0].material.opacity=0);break;case POINT_TYPE_ZONE_ICON:ue.parent.children[0].material.opacity=0;break;default:}ue=null,requestAnimationFrame(Lt)}let n=A.getMousePos(e,t),a=_t(n.x,n.y);if(null!=a&&a.length>0){let e=a.filter((function(e){return e&&e.object}))[0];if(e&&e.object){switch(ue=e.object,ue.pointType){case POINT_TYPE_ZONE_WAYPOINT:case POINT_TYPE_SHOP_TOP_ICON:case POINT_TYPE_SHOP_WAYPOINT:case POINT_TYPE_SHOP_POINT:case POINT_TYPE_PRODUCT:case POINT_TYPE_PRODUCT_GROUP:case POINT_TYPE_SHOP_ICON:case POINT_TYPE_COIN:ue.material.color.set(4513279);break;case POINT_TYPE_ZONE:ue.material.opacity=.1;break;case POINT_TYPE_ZONE_ICON:ue.parent.children[0].material.opacity=.1;break;default:}requestAnimationFrame(Lt)}}}function Et(t){if(1==t.touches.length){let n=A.getMousePos(e,t.touches[0]),a=_t(n.x,n.y);if(null!=a&&a.length>0){let e=a.filter((function(e){return e&&e.object}))[0];e&&e.object&&(ue=e.object,ue.pointType!=POINT_TYPE_ZONE&&ue.pointType!=POINT_TYPE_ZONE_ICON||(Ot(n.x,n.y),de=new THREE.Vector3,de.copy(pe),pe=null))}else Ot(n.x,n.y)}}function Tt(t){if(z.isDraging()||G.isDraging())return z.isDrag=!1,G.isDrag=!1,ue=null,void(pe=null);if(null==ue||null==ue){let n=A.getMousePos(e,t);Ot(n.x,n.y)}else if(ue.pointType==POINT_TYPE_ZONE||ue.pointType==POINT_TYPE_ZONE_ICON){let n=A.getMousePos(e,t);Ot(n.x,n.y),de=new THREE.Vector3,de.copy(pe),pe=null}ft()}function ht(e){if(z.isDraging()||G.isDraging())return z.isDrag=!1,G.isDrag=!1,ue=null,void(pe=null);ft()}function ft(){if(null!=ue){switch(V){case a:ue.pointType!=POINT_TYPE_ZONE_ICON&&(ue.material.opacity=0),ue.parent.redirect?Ge({code_name:st(ue.parent.redirect,"z0000","s0000")}):Xe({code_name:st(Te,ue.name,"s0001"),support_3d:1}),requestAnimationFrame(Lt);break;case r:switch(ue.pointType){case POINT_TYPE_SHOP_WAYPOINT:_e=ue.name,kt(ue.name,!1);break;case POINT_TYPE_PRODUCT:Fe({code_name:st(Te,he,fe),product_id:ue.name});break;case POINT_TYPE_PRODUCT_GROUP:Ze({code_name:st(Te,he,fe),product_group_id:ue.name});break}break;case l:switch(ue.pointType){case POINT_TYPE_SHOP_WAYPOINT:_e=ue.name,kt(ue.name,!1);break;case POINT_TYPE_PRODUCT:Fe({code_name:st(Te,he,fe),product_id:ue.name});break;case POINT_TYPE_PRODUCT_GROUP:if(ue.jump){let e=ue.jump.code_name;ue.jump.waypoint?Ze({code_name:st(Te,he,fe),product_group_id:ue.name,jump:ue.jump}):Xe({code_name:e,support_3d:1})}else Ze({code_name:st(Te,he,fe),product_group_id:ue.name});requestAnimationFrame(Lt);break;case POINT_TYPE_COIN:ue.parent.remove(ue),qe({cid:ue.name}),requestAnimationFrame(Lt);break}break}null!=ue&&(ue.pointType==POINT_TYPE_ZONE?ue.material.opacity=0:ue.material&&ue.material.color&&ue.material.color.set(16777215))}else null!=pe&&null!=pe&&bt();if(ue)switch(ue.pointType){case POINT_TYPE_ZONE_WAYPOINT:case POINT_TYPE_SHOP_TOP_ICON:case POINT_TYPE_SHOP_WAYPOINT:case POINT_TYPE_SHOP_POINT:case POINT_TYPE_PRODUCT:case POINT_TYPE_PRODUCT_GROUP:case POINT_TYPE_SHOP_ICON:case POINT_TYPE_COIN:ue.material.color.set(16777215);break;case POINT_TYPE_ZONE:ue.material?ue.material.opacity=0:ue.children.length>0&&(ue.children[0].material.opacity=0);break;default:}ue=null,pe=null}function mt(e){let t=[];if(null!=e&&null!=e)for(let n=0;n0?c:mt(ce.intersectObject(B,!0));case o:return c=mt(ce.intersectObject(L,!0)),null!=c&&c.length>0?c:(c=mt(ce.intersectObject(Q,!0)),null!=c&&c.length>0?c:mt(ce.intersectObject(q,!0)));case r:return c=mt(ce.intersectObject($,!0)),c;case l:return c=mt(ce.intersectObject($,!0)),null!=c&&c.length>0?c:(c=mt(ce.intersectObject(te,!0)),null!=c&&c.length>0?c:(c=mt(ce.intersectObject(ne,!0)),null!=c&&c.length>0?c:mt(ce.intersectObject(ee,!0))))}}function Ot(t,n){switch(null==e||null==e?(t=t/window.innerWidth*2-1,n=-n/window.innerHeight*2+1):(t=t/e.offsetWidth*2-1,n=-n/e.offsetHeight*2+1),se.set(t,n,.5),ce.setFromCamera(se,j),V){case a:{let e=ce.intersectObject(F,!0);null!=e&&e.length>0&&(pe=e[0].point)}break;case i:{let e=ce.intersectObject(_,!0);null!=e&&e.length>0&&(pe=e[0].point)}break;case o:{let e=ce.intersectObject(ae,!0);null!=e&&e.length>0&&(pe=e[0].point)}break;case r:{let e=ce.intersectObject(ie,!0);null!=e&&e.length>0&&(pe=e[0].point)}break;case l:{let e=ce.intersectObject(ie,!0);null!=e&&e.length>0?pe=e[0].point:(e=ce.intersectObject(ae,!0),null!=e&&e.length>0&&(pe=e[0].point))}break}}function Pt(e,t){let n=new THREE.Vector3,a=new THREE.Vector3;return n.copy(e),n.sub(j.position),n.y=0,0==n.length()||(a.copy(t),a.sub(j.position),a.y=0,n.normalize().dot(a.normalize())>=.75)}function gt(e){let t,n=null,a=1e6,i=new THREE.Vector3,o=!1;for(let r=0;r<$.children.length;r++)$.children[r].getWorldPosition(i),t=Math.abs(e.distanceTo(i)),$.children[r].isGate?o?t0){if(Q.children.length<=0)return;let i=0;i=0==a.inZone?t[n].count/Q.children.length:t[n].count*(a.inZone/(a.inZone+a.inShop))/Q.children.length;let o=i*$.children.length;for(let a=0;as&&(s=t);p.length2&&k.generateTextureQueue(i,e,t,N,k.TEXTURE_MODE.T_SHOP));k.clearModelQueueByMode(k.MESH_MODE.M_SHOP);for(let e=0;e2&&k.generateTextureQueue(a,e,-1,N,k.TEXTURE_MODE.T_SHOP_WAYPOINT);let i=ae.children[1];i.name=e,ae.position.copy(K.position),ae.rotation.copy(K.rotation),i.position.copy(ue.position),i.position.add(ue.children[0].position),i.rotation.copy(ue.rotation),je=new THREE.Matrix4,je.copy(ue.matrix),je.multiply((new THREE.Matrix4).setPosition(ue.children[0].position));let o=256/v;if(null==g||null==g){g=at(v),g.repeat.set(o,-o),g.wrapS=g.wrapT=THREE.RepeatWrapping,g.minFilter=THREE.LinearFilter,g.generateMipmaps=!1;for(let e=0;e=1?(n=ue.parent.bound.height/t,a=ue.parent.bound.width/(t*j.aspect),e=new THREE.Vector2(-Math.PI,-ue.parent.yaw*Math.PI/180)):(n=ue.parent.bound.width/t,a=ue.parent.bound.height/(t*j.aspect),e=new THREE.Vector2(-Math.PI,(90-ue.parent.yaw)*Math.PI/180));let i=new THREE.Vector3(ue.parent.bound.offsetX,0,ue.parent.bound.offsetY),o=new THREE.Quaternion;o.setFromAxisAngle(new THREE.Vector3(0,1,0),-ue.parent.yaw*Math.PI/180),i.applyQuaternion(o),ye.x+=i.x,ye.y+=Math.max(n,a),ye.z+=i.z}else{ye.copy(ue.position),j.aspect>=1?(n=ue.bound.height/t,a=ue.bound.width/(t*j.aspect),e=new THREE.Vector2(-Math.PI,-ue.yaw*Math.PI/180)):(n=ue.bound.width/t,a=ue.bound.height/(t*j.aspect),e=new THREE.Vector2(-Math.PI,(90-ue.yaw)*Math.PI/180));let i=new THREE.Vector3(ue.bound.offsetX,0,ue.bound.offsetY),o=new THREE.Quaternion;o.setFromAxisAngle(new THREE.Vector3(0,1,0),-ue.yaw*Math.PI/180),i.applyQuaternion(o),ye.x+=i.x,ye.y+=Math.max(n,a),ye.z+=i.z}we.set(e.x,e.y)}break;case o:ye.copy(ue.position),ye.add(Z.position),ye.add(ue.children[0].position),ae.position.copy(Z.position),ae.rotation.copy(Z.rotation),we.set(0,G.getEulerY());break;case r:if(Yt(Oe),null==K.camera||null==K.camera){let e=new THREE.Vector3;e.copy(T),e.applyQuaternion(K.quaternion),ye.copy(e),ye.add(K.position);let t=new THREE.Vector3;K.getWorldPosition(t);let n=Wt(ye,t);we.set(n.x,n.y)}else{let e=new THREE.Vector3;e.copy(K.camera.position),e.applyQuaternion(K.quaternion),ye.copy(e),ye.add(K.position);let t=new THREE.Vector3;t.copy(K.camera.target),t.applyQuaternion(K.quaternion),t.add(K.position);let n=Wt(ye,t);we.set(n.x,n.y)}t&&Xe({code_name:st(Te,he,Oe),support_3d:1});break;case l:{let e=new THREE.Vector3;if(e.copy(ue.position),e.applyQuaternion(K.quaternion),ye.copy(e),ye.add(K.position),ye.add(ue.children[0].position),Ee)we.set(-Ee.phi+Math.PI/2,Ee.theta);else if(t&&ue.isGate){let e=K.rotation.y+ue.rotation.y+ue.children[0].rotation.y;we.set(0,e)}else we.set(0,G.getEulerY())}break}Pe=!0,He=0;let n=(we.y-be.y)%(2*Math.PI);n>Math.PI?we.y=be.y-(2*Math.PI-n):n<-Math.PI?we.y=be.y+(2*Math.PI+n):we.y=be.y+n,requestAnimationFrame(zt)}function Gt(e,t,n){let a=e;return a=(t-(e*=G.fakeZoom))*n+e,a}function zt(){let e=He/30;if(e>=1)ue=null,function(){switch(j.position.copy(ye),function(e){e!=a&&(X.visible=!1);e!=i&&e!=o?Z.visible=!1:(e!=i&&(B.visible=!1,J.visible=!1,_.visible=!1),e!=o&&(q.visible=!1,L.visible=!1));e!=r&&e!=l?K.visible=!1:e!=l&&(te.visible=!1,ne.visible=!1,ee.visible=!1);ae.children[0].material.opacity=0,ae.children[0].children[0].material.opacity=0,ae.children[1].material.opacity=0,ae.children[1].children[0].material.opacity=0,j.fov=e==a?h:f;j.updateProjectionMatrix(),G.fakeZoom=1}(D),D){case a:G.setEuler(we),G.update(),ct(!1),X.visible=!0;break;case i:{G.setEuler(we),G.update(),j.updateProjectionMatrix(),ct(!0),Z.visible=!0,null!=_&&null!=_&&(_.visible=!0),B.visible=!0,J.visible=!0,Vt(Q),Vt(q);let e=new THREE.Vector3;Z.getWorldPosition(e),z.target.set(j.position.x,0,j.position.z),j.aspect>=1?z.setAngle(we.x-Math.PI/2,we.y):z.setAngle(we.x,we.y),z.update()}break;case o:ct(!1),Z.visible=!0,L.visible=!0,Xt(D),q.visible=!0,Dt(Q),Ut(q),Ut(L,1.1),function(e){if(null!=Ve&&null!=Ve){let t=st(Te,he,"s0000").substring(0,3);for(let n=0;n0&&(e=!0);break;default:break}Qe({state:V,map_id:Te,hasShopModel:e}),requestAnimationFrame(Lt),Ft(1)}();else{switch(requestAnimationFrame(zt),He++,j.position.lerpVectors(ge,ye,e),V){case a:D==a||(j.fov=Gt(h,f,e),j.updateProjectionMatrix());break;case i:D==a?(j.fov=Gt(f,h,e),j.updateProjectionMatrix()):(j.fov=Gt(f,f,e),j.updateProjectionMatrix());break;case o:D==a?(j.fov=Gt(f,h,e),j.updateProjectionMatrix()):(j.fov=Gt(f,f,e),j.updateProjectionMatrix()),ae.children[0].material.opacity=1*(1-e);break;case r:D==a?(j.fov=Gt(f,h,e),j.updateProjectionMatrix()):(j.fov=Gt(f,f,e),j.updateProjectionMatrix());break;case l:D==a?(j.fov=Gt(f,h,e),j.updateProjectionMatrix()):(j.fov=Gt(f,f,e),j.updateProjectionMatrix()),ae.children[0].material.opacity=1-e;break}switch(D){case a:G.setEuler(Re.lerpVectors(be,we,e)),G.update();break;case i:G.setEuler(Re.lerpVectors(be,we,e)),G.update();break;case o:ae.children[1].material.opacity=1*e,G.setEuler(Re.lerpVectors(be,we,e)),G.update();break;case r:if(V==l)if(ae.children[0].material.opacity=1-e,2==Ie)for(let t=0;t1/12&&requestAnimationFrame(Lt),Ft(e)}function Xt(e){let t=me;e==l&&(t=_e);let n=ae.children[0].name.localeCompare(t),a=ae.children[1].name.localeCompare(t);if(n==a){let e=new THREE.Vector3,t=new THREE.Vector3;ae.children[0].getWorldPosition(e),ae.children[1].getWorldPosition(t);let n=e.distanceTo(j.position);if(t.distanceTo(j.position)2&&k.generateTextureQueue(e,_e,-1,N,k.TEXTURE_MODE.T_SHOP_WAYPOINT);let t=256/v;if(g.repeat.set(t,-t),y.repeat.set(t,-t),1==Ie){y.name="0",g.name=_e;for(let e=0;e0&&n.inShop>0){let a=n.inZone/(n.inZone+n.inShop);if(Math.random()>a){let n=Y.createCoinPoint(t[e].cid);n.position.copy(Mt()),(new THREE.TextureLoader).load(t[e].icon,(function(e){n.material.map=e})),n.visible=!1,L.add(n)}}else if(n.inZone>0){let n=Y.createCoinPoint(t[e].cid);n.position.copy(Mt()),(new THREE.TextureLoader).load(t[e].icon,(function(e){n.material.map=e})),n.visible=!1,L.add(n)}}}}(he),V!=l&&V!=r||St(Nt(fe))},this.updatePin=function(e,t){let n=ut(e);switch(De=t,Ue=n.zone_id,We=!0,V){case i:xt(he)}},this.setSize=function(e,t){U.setSize(e,t),e>=t?C?(j.aspect=e/t,j.updateProjectionMatrix()):(C=!0,et(e,t)):C?(C=!1,et(e,t)):(j.aspect=e/t,j.updateProjectionMatrix()),requestAnimationFrame(Lt)},this.setPromoConfig=function(e){Ve=e},this.showLayout=function(){V==l?jt(r):V==o&&(ue=null,jt(i))},this.showWaypoint=function(){pt()},this.backStep=function(){switch(V){case a:0!=Te.localeCompare("m000a")&&this.syncTo3DCanvas("a00000000");break;case r:case l:jt(a);break}},this.syncTo3DCanvas=function(e){if(null==e||null==e)return;let t=ut(e);0!=t.map_id.localeCompare(Te)?(Te=t.map_id,Rt(),jt(a),he="z0000",fe="s0000"):0==t.zone_id.substring(3,5).localeCompare("00")?jt(a):0==t.shop_id.substring(2,5).localeCompare("000")?(ue=vt(t.zone_id),jt(i),It(t.zone_id),Z.position.copy(ue.position),null!=ue.bound&&null!=ue.bound?(Z.yaw=ue.yaw,Z.north=ue.north,Z.offsetX=ue.bound.offsetX,Z.offsetY=ue.bound.offsetY):(Z.yaw=ue.parent.yaw,Z.north=ue.parent.north,Z.offsetX=ue.parent.bound.offsetX,Z.offsetY=ue.parent.bound.offsetY)):(Oe=t.shop_id,0!=he.localeCompare(t.zone_id)?(ue=vt(t.zone_id),It(t.zone_id,!0),he=t.zone_id,Z.position.copy(ue.position),null!=ue.bound&&null!=ue.bound?(Z.yaw=ue.yaw,Z.north=ue.north,Z.offsetX=ue.bound.offsetX,Z.offsetY=ue.bound.offsetY):(Z.yaw=ue.parent.yaw,Z.north=ue.parent.north,Z.offsetX=ue.parent.bound.offsetX,Z.offsetY=ue.parent.bound.offsetY)):Yt(Oe,!0,de||j.position))},this.gotoShopWaypoint=function(e,t){if(null==e||null==e)return;let n=ut(e);0==n.zone_id.substring(3,5).localeCompare("00")||0==n.shop_id.substring(2,5).localeCompare("000")||(Oe=n.shop_id,0!=he.localeCompare(n.zone_id)?(ue=vt(n.zone_id),It(n.zone_id,!0,t),he=n.zone_id,Z.position.copy(ue.position),null!=ue.bound&&null!=ue.bound?(Z.yaw=ue.yaw,Z.north=ue.north,Z.offsetX=ue.bound.offsetX,Z.offsetY=ue.bound.offsetY):(Z.yaw=ue.parent.yaw,Z.north=ue.parent.north,Z.offsetX=ue.parent.bound.offsetX,Z.offsetY=ue.parent.bound.offsetY)):Yt(Oe,!0,de||j.position,t))},this.gotoProductGroup=function(e,t){},function(){let n=navigator.deviceMemory;n>=3?(v=4096,N=4,Ke(1)):(v=2048,N=3,Ke(n>0?-1:0)),U.domElement.addEventListener("mousemove",dt,!1),U.setClearColor(new THREE.Color(1644825)),U.setPixelRatio(window.devicePixelRatio),null==e||null==e?(U.setSize(window.innerWidth,window.innerHeight),document.body.appendChild(U.domElement),I.setSize(window.innerWidth,window.innerHeight)):(U.setSize(e.offsetWidth,e.offsetHeight),e.appendChild(U.domElement),I.setSize(e.offsetWidth,e.offsetHeight)),j.layers.enable(0),j.layers.enable(1),j.position.copy(d),j.lookAt(E),z.target.copy(E),z.update(),G.refresh(),G.addEventListener("change",Qt),z.addEventListener("change",Lt),z.maxPolarAngle=Math.PI/2-1/9,z.setOnMouseUpCallback(Tt),z.setOnTouchStartCallback(Et),z.setOnTouchEndCallback(ht),G.setOnMouseUpCallback(Tt),G.setOnTouchStartCallback(Et),G.setOnTouchEndCallback(ht),W.add(X),X.add(F),W.add(Z),Z.add(Q),Z.add(B),Z.add(q),Z.add(L),Z.add(J),L.visible=!1,W.add(K),K.add(ie),K.add($),K.add(te),K.add(ne),K.add(ee),ee.visible=!1,W.add(ae),ae.add(oe),ae.add(re);let a=Y.createGroundPoint(),i=Y.createGroundPoint();a.material.depthTest=!1,a.material.depthWrite=!1,i.material.depthTest=!1,i.material.depthWrite=!1,oe.add(a),re.add(i),requestAnimationFrame(Lt),k.setOnTextureLoadCallback(tt),k.setOnModelLoadCallback(nt),Module._setActivate(),ct(!1),function(e){null!=O&&null!=O||(O=Ht());null!=P&&null!=P||(P=new THREE.MeshBasicMaterial({color:16777215,map:O,side:THREE.DoubleSide}));null!=m&&null!=m||(m=new THREE.Mesh(new THREE.SphereGeometry(1e3,50,50),P),m.scale.set(-1,-1,1),m.position.copy(d),X.add(m));null==e||null==e?Rt():I.syncTo3DCanvas(e)}(t)}(),this.testBlend=function(e){for(let t=0;t=4?(v=2048,N=3,Ke(0)):(v=4096,N=4,Ke(1)),Zt()}};