@aibee/crc-bmap 0.14.4 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -698,4 +698,4 @@
698
698
  float uvx = prevUv + (vUv.y + 1.0) / 2.0 * vCustomUv;
699
699
  gl_FragColor = diffuseColor * texture2D(map, vec2(uvx, (vUv.x + 1.0) / 2.0) * repeat);
700
700
  }
701
- `};var ao=class extends mt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},mt.UniformsUtils.clone(mt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:mt.ShaderLib["custom-line"].vertexShader,fragmentShader:mt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var xa=require("three/examples/jsm/lines/LineGeometry.js"),wa=require("three/examples/jsm/lines/Line2.js");var va={texture_url:Os,lineWidth:8,color:16777215},ho=class extends ft.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return D(new ft.Vector3(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return Et(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ft.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new ft.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new xa.LineGeometry,this.geometry.setPositions(t.flat(2));let s=Et(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new ao({color:new ft.Color(this.config.color),transparent:!0,resolution:new ft.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:ft.NormalBlending,repeat:new ft.Vector2(this.getRepeat(),1),allDistance:s}),n=this.mesh=new wa.Line2(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=ft.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new ft.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=va,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},va,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Ma=require("@tweenjs/tween.js");var jt=require("three"),co=class extends jt.Object3D{meshSetMaterial(t){t instanceof jt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new jt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new jt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&I(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new jt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=x({},this.options,i),this.add(this.group),St.loadModel(e,!1).then(s=>{this.model=s;let n=new jt.Box3().setFromObject(s.scene).getSize(new jt.Vector3),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var lo=require("three");var yn=class extends X{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>x({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new ho(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Di(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=ce(t,e),s=t[i],o=t[i+1],n=new lo.Vector3(o[0]-s[0],o[1]-s[1],0).normalize(),r=new lo.Vector3(0,1,0).normalize(),h=n.angleTo(r),c=new lo.Vector3().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Ma.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let v=0;v<e.length;v++)if(e[v].distance>=l){p=v;break}else l-=e[v].distance;let d=Ze(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(v=>v.name===e[p].floor),g=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],g)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(v=>{var w;return v.name===((w=e.slice(-1)[0])==null?void 0:w.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,g=this.translatePoints([d])[0];this.startModel.position.set(g[0],g[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Pe,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new co(t,br,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var G_=require("core-js/modules/es.array.flat.js"),F_=require("core-js/modules/es.array.unscopables.flat.js"),po=require("three");var vn=class extends X{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new po.Vector2,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new po.Raycaster;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new Oi(this.bmap.context.container),this.registryEvent()}};var K_=require("core-js/modules/es.array.find-last-index.js"),X_=require("core-js/modules/es.array.find-last.js"),Y_=require("core-js/modules/es.array.push.js");var U_=require("core-js/modules/web.dom-collections.iterator.js"),H_=require("core-js/modules/es.array.push.js"),N_=require("core-js/modules/es.array.sort.js"),yi=require("three");function tc(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function ec(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function xs(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=tc(t),{start:s,end:o}=ec(e,i,t),r=360-(new yi.Vector2().subVectors(new yi.Vector2(o[0],o[1]),new yi.Vector2(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function ic(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,uo(c),r,h),t.push(c)}else t.push(0)}return t}function sc(a,t){let e=a[0],i=a.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function uo(a){return a*60*60}function vi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new yi.Vector2(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new yi.Vector2(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function oc(a){let t=[...a].sort((c,l)=>c-l),e=_a(t,25),i=_a(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function _a(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}var ws=require("lodash"),Ms=class extends st{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,ws.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=xs(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),(0,ws.isNil)(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=xs([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=xs([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=O(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=O(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if((0,ws.isNil)(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:x({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,ws.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?vi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:uo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new j,this.positionTimer=null,this.speedFilter=new Ri,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var iP=require("core-js/modules/es.json.stringify.js");var nc={};function xn(){return new Worker(new URL("./worker/recommend.worker-FFNYEN5G.js",nc.url))}var rc={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},wn=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return Z(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=xn(),this.options=x({},rc,t)}};var uP=require("core-js/modules/es.json.stringify.js"),mP=require("core-js/modules/web.dom-collections.iterator.js"),fP=require("core-js/modules/es.array.sort.js"),gP=require("core-js/modules/es.array.push.js"),yP=require("core-js/modules/web.url-search-params.js"),vP=require("core-js/modules/web.url-search-params.delete.js"),xP=require("core-js/modules/web.url-search-params.has.js"),wP=require("core-js/modules/web.url-search-params.size.js"),MP=require("core-js/modules/es.regexp.exec.js");var hP=require("core-js/modules/es.json.stringify.js");var ac={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xi=class extends st{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new j,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},ac,t||{}),this.options.url&&this.initWebsocket()}};var _n=require("lodash");var Mn=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Pn=class extends st{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!(0,_n.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new xi({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(U){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:U,y:H,time:et,floor:J,ts:re}=o.data,ae=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(re).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(ae){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:U,y:H},new Date(re).getTime()-o.lag-o.duration)}else if(ae){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Le=this.path.findIndex(Mi=>Mi.floor===J),ye=this.path[Le];if(ye){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(ye.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var g;(g=this.carInertialPosition)==null||g.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:U,y:H,time:et,floor:J,ts:re}=o.data,ae=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"beacon"}),console.log("positionFloor",J,ae),this.options.upload_position){var v;(v=this.positionWebSocket)==null||v.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(re).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var w;if(ae){var M,P,C;(C=this.pdrPosition)==null||(P=C.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(w=this.pdrPosition)==null||w.setBeaconPosition({x:U,y:H},new Date(re).getTime()-o.lag-o.duration)}else if(ae){var S;if(this.resetPdr(),(S=this.carInertialPosition)==null||S.stopPositionTimer(),this.path){let Le=this.path.findIndex(Mi=>Mi.floor===J),ye=this.path[Le];if(ye){var G;this.resetPdr(),(G=this.carInertialPosition)==null||G.setBeaconPosition(ye.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var E;(E=this.carInertialPosition)==null||E.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var nt;(nt=this.carInertialPosition)==null||nt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var Tt;(Tt=this.carInertialPosition)==null||Tt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:U,y:H,time:et,floor:J}=o.data,re=this.positionFloor!==J;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(et).getTime()});return}if(re){var gt;if(this.resetPdr(),(gt=this.carInertialPosition)==null||gt.stopPositionTimer(),this.path){let ae=this.path.findIndex(ye=>ye.floor===J),Le=this.path[ae];if(Le){var It;this.resetPdr(),(It=this.carInertialPosition)==null||It.setPosition(Le.points[0],new Date(et).getTime(),o.duration)}else{var kt;(kt=this.carInertialPosition)==null||kt.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var ne;(ne=this.carInertialPosition)==null||ne.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var Ee,ht;if((Ee=this.carInertialPosition)==null||Ee.setPosition([U,H],new Date(et).getTime(),o.duration),!((ht=this.carInertialPosition)!=null&&ht.positionTimer)){var $e;($e=this.carInertialPosition)==null||$e.startPositionTimer()}}if(this.options.upload_position){var wi;(wi=this.positionWebSocket)==null||wi.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!(0,_n.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new xi({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Ms,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new vs(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[F.COMPASS,F.ACCELERATION,F.DEVICE_MOTION].concat(this.options.use_gps?[F.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(pe)i=t.map(o=>{let[n,r]=Mn(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Mn(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(x({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(v=>v.rssi<0),g=m.reduce((v,w)=>v+w.rssi,0);i.push([c,l,p,g/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new j;let i=new URLSearchParams(location.search),s=i.get("server_env")||"prod",o={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},n="wss://"+o[s]+"/aether-walker/indoor/position",r="wss://"+o[s]+"/aether-walker/indoor/sensor";this.options=x({place_id:i.get("place_id"),access_token:i.get("access_token"),env:s,wss_position_url:n,wss_sensor_url:r,get_gps_floor_url:"https://"+o[s]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var kP=require("core-js/modules/web.dom-collections.iterator.js");var bn=class extends X{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new Ke(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Sn=class extends X{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};var GP=require("core-js/modules/web.dom-collections.iterator.js"),FP=require("core-js/modules/es.array.sort.js");var En=class extends X{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new fs;let i=new qe(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var hc="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",cc={base_url:hc},Ln=class extends X{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=x({},cc,e),this.tileLayer=new Re(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};var mo=require("three");var Cn=class extends X{addHeatmap(t,e){this.heatmap||(this.heatmap=new Yi(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new mo.Box3().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new mo.Group,this.bmap.context.scene.add(this.group)}};
701
+ `};var ao=class extends mt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},mt.UniformsUtils.clone(mt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:mt.ShaderLib["custom-line"].vertexShader,fragmentShader:mt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var xa=require("three/examples/jsm/lines/LineGeometry.js"),wa=require("three/examples/jsm/lines/Line2.js");var va={texture_url:Os,lineWidth:8,color:16777215},ho=class extends ft.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return D(new ft.Vector3(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return Et(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ft.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new ft.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new xa.LineGeometry,this.geometry.setPositions(t.flat(2));let s=Et(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new ao({color:new ft.Color(this.config.color),transparent:!0,resolution:new ft.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:ft.NormalBlending,repeat:new ft.Vector2(this.getRepeat(),1),allDistance:s}),n=this.mesh=new wa.Line2(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=ft.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new ft.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=va,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},va,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Ma=require("@tweenjs/tween.js");var jt=require("three"),co=class extends jt.Object3D{meshSetMaterial(t){t instanceof jt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new jt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new jt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&I(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new jt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=x({},this.options,i),this.add(this.group),St.loadModel(e,!1).then(s=>{this.model=s;let n=new jt.Box3().setFromObject(s.scene).getSize(new jt.Vector3),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var lo=require("three");var yn=class extends X{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>x({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new ho(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Di(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=ce(t,e),s=t[i],o=t[i+1],n=new lo.Vector3(o[0]-s[0],o[1]-s[1],0).normalize(),r=new lo.Vector3(0,1,0).normalize(),h=n.angleTo(r),c=new lo.Vector3().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Ma.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let v=0;v<e.length;v++)if(e[v].distance>=l){p=v;break}else l-=e[v].distance;let d=Ze(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(v=>v.name===e[p].floor),g=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],g)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(v=>{var w;return v.name===((w=e.slice(-1)[0])==null?void 0:w.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,g=this.translatePoints([d])[0];this.startModel.position.set(g[0],g[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Pe,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new co(t,br,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var G_=require("core-js/modules/es.array.flat.js"),F_=require("core-js/modules/es.array.unscopables.flat.js"),po=require("three");var vn=class extends X{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new po.Vector2,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new po.Raycaster;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new Oi(this.bmap.context.container),this.registryEvent()}};var K_=require("core-js/modules/es.array.find-last-index.js"),X_=require("core-js/modules/es.array.find-last.js"),Y_=require("core-js/modules/es.array.push.js");var U_=require("core-js/modules/web.dom-collections.iterator.js"),H_=require("core-js/modules/es.array.push.js"),N_=require("core-js/modules/es.array.sort.js"),yi=require("three");function tc(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function ec(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function xs(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=tc(t),{start:s,end:o}=ec(e,i,t),r=360-(new yi.Vector2().subVectors(new yi.Vector2(o[0],o[1]),new yi.Vector2(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function ic(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,uo(c),r,h),t.push(c)}else t.push(0)}return t}function sc(a,t){let e=a[0],i=a.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function uo(a){return a*60*60}function vi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new yi.Vector2(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new yi.Vector2(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function oc(a){let t=[...a].sort((c,l)=>c-l),e=_a(t,25),i=_a(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function _a(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}var ws=require("lodash"),Ms=class extends st{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,ws.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=xs(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),(0,ws.isNil)(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=xs([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=xs([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=O(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=O(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if((0,ws.isNil)(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:x({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,ws.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?vi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:uo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new j,this.positionTimer=null,this.speedFilter=new Ri,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var iP=require("core-js/modules/es.json.stringify.js");var nc={};function xn(){return new Worker(new URL("./worker/recommend.worker-FFNYEN5G.js",nc.url))}var rc={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},wn=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return Z(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=xn(),this.options=x({},rc,t)}};var uP=require("core-js/modules/es.json.stringify.js"),mP=require("core-js/modules/web.dom-collections.iterator.js"),fP=require("core-js/modules/es.array.sort.js"),gP=require("core-js/modules/es.array.push.js"),yP=require("core-js/modules/es.regexp.exec.js"),vP=require("core-js/modules/web.url-search-params.js"),xP=require("core-js/modules/web.url-search-params.delete.js"),wP=require("core-js/modules/web.url-search-params.has.js"),MP=require("core-js/modules/web.url-search-params.size.js");var hP=require("core-js/modules/es.json.stringify.js");var ac={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xi=class extends st{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new j,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},ac,t||{}),this.options.url&&this.initWebsocket()}};var _n=require("lodash");var Mn=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Pn=class extends st{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!(0,_n.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new xi({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(U){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:U,y:H,time:et,floor:J,ts:re}=o.data,ae=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(re).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(ae){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:U,y:H},new Date(re).getTime()-o.lag-o.duration)}else if(ae){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Le=this.path.findIndex(Mi=>Mi.floor===J),ye=this.path[Le];if(ye){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(ye.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var g;(g=this.carInertialPosition)==null||g.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:U,y:H,time:et,floor:J,ts:re}=o.data,ae=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"beacon"}),console.log("positionFloor",J,ae),this.options.upload_position){var v;(v=this.positionWebSocket)==null||v.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(re).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var w;if(ae){var M,P,C;(C=this.pdrPosition)==null||(P=C.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(w=this.pdrPosition)==null||w.setBeaconPosition({x:U,y:H},new Date(re).getTime()-o.lag-o.duration)}else if(ae){var S;if(this.resetPdr(),(S=this.carInertialPosition)==null||S.stopPositionTimer(),this.path){let Le=this.path.findIndex(Mi=>Mi.floor===J),ye=this.path[Le];if(ye){var G;this.resetPdr(),(G=this.carInertialPosition)==null||G.setBeaconPosition(ye.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var E;(E=this.carInertialPosition)==null||E.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var nt;(nt=this.carInertialPosition)==null||nt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var Tt;(Tt=this.carInertialPosition)==null||Tt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:U,y:H,time:et,floor:J}=o.data,re=this.positionFloor!==J;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(et).getTime()});return}if(re){var gt;if(this.resetPdr(),(gt=this.carInertialPosition)==null||gt.stopPositionTimer(),this.path){let ae=this.path.findIndex(ye=>ye.floor===J),Le=this.path[ae];if(Le){var It;this.resetPdr(),(It=this.carInertialPosition)==null||It.setPosition(Le.points[0],new Date(et).getTime(),o.duration)}else{var kt;(kt=this.carInertialPosition)==null||kt.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var ne;(ne=this.carInertialPosition)==null||ne.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var Ee,ht;if((Ee=this.carInertialPosition)==null||Ee.setPosition([U,H],new Date(et).getTime(),o.duration),!((ht=this.carInertialPosition)!=null&&ht.positionTimer)){var $e;($e=this.carInertialPosition)==null||$e.startPositionTimer()}}if(this.options.upload_position){var wi;(wi=this.positionWebSocket)==null||wi.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!(0,_n.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new xi({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Ms,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new vs(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[F.COMPASS,F.ACCELERATION,F.DEVICE_MOTION].concat(this.options.use_gps?[F.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(pe)i=t.map(o=>{let[n,r]=Mn(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Mn(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(x({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(v=>v.rssi<0),g=m.reduce((v,w)=>v+w.rssi,0);i.push([c,l,p,g/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new j;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=x({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var kP=require("core-js/modules/web.dom-collections.iterator.js");var bn=class extends X{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new Ke(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Sn=class extends X{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};var GP=require("core-js/modules/web.dom-collections.iterator.js"),FP=require("core-js/modules/es.array.sort.js");var En=class extends X{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new fs;let i=new qe(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var hc="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",cc={base_url:hc},Ln=class extends X{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=x({},cc,e),this.tileLayer=new Re(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};var mo=require("three");var Cn=class extends X{addHeatmap(t,e){this.heatmap||(this.heatmap=new Yi(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new mo.Box3().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new mo.Group,this.bmap.context.scene.add(this.group)}};
@@ -698,4 +698,4 @@ var ra=Object.create;var Gs=Object.defineProperty;var aa=Object.getOwnPropertyDe
698
698
  float uvx = prevUv + (vUv.y + 1.0) / 2.0 * vCustomUv;
699
699
  gl_FragColor = diffuseColor * texture2D(map, vec2(uvx, (vUv.x + 1.0) / 2.0) * repeat);
700
700
  }
701
- `};var Ls=class extends Sd{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},Rr.clone(Ss["custom-line"].uniforms),{map:{value:null}}),vertexShader:Ss["custom-line"].vertexShader,fragmentShader:Ss["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};import{LineGeometry as Od}from"three/examples/jsm/lines/LineGeometry.js";import{Line2 as Id}from"three/examples/jsm/lines/Line2.js";var Gr={texture_url:Pi,lineWidth:8,color:16777215},Cs=class extends Ed{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return C(new Td(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return ht(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new bo(t,1)}loadTexture(t){return new Promise((e,i)=>{new Ld().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Od,this.geometry.setPositions(t.flat(2));let s=ht(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new Ls({color:new Cd(this.config.color),transparent:!0,resolution:new bo(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:kd,repeat:new bo(this.getRepeat(),1),allDistance:s}),n=this.mesh=new Id(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Dd}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Ad().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=Gr,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},Gr,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};import{Tween as Wd}from"@tweenjs/tween.js";import{AnimationMixer as Rd,Box3 as Gd,Object3D as Fr,Vector3 as Fd,Mesh as zd,Euler as Bd}from"three";var Ts=class extends Fr{meshSetMaterial(t){t instanceof zd&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Bd;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new Rd(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&D(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Fr,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=x({},this.options,i),this.add(this.group),st.loadModel(e,!1).then(s=>{this.model=s;let n=new Gd().setFromObject(s.scene).getSize(new Fd),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};import{Vector3 as So}from"three";var zr=class extends B{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>x({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new Cs(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return mi(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=Bt(t,e),s=t[i],o=t[i+1],n=new So(o[0]-s[0],o[1]-s[1],0).normalize(),r=new So(0,1,0).normalize(),h=n.angleTo(r),c=new So().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Wd({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let v=0;v<e.length;v++)if(e[v].distance>=l){p=v;break}else l-=e[v].distance;let d=ve(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(v=>v.name===e[p].floor),g=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],g)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(v=>{var w;return v.name===((w=e.slice(-1)[0])==null?void 0:w.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,g=this.translatePoints([d])[0];this.startModel.position.set(g[0],g[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Qt,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new Ts(t,Dn,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import{Raycaster as Ud,Vector2 as Hd}from"three";var Br=class extends B{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new Hd,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new Ud;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new yi(this.bmap.context.container),this.registryEvent()}};import"core-js/modules/es.array.find-last-index.js";import"core-js/modules/es.array.find-last.js";import"core-js/modules/es.array.push.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.array.sort.js";import{Vector2 as si}from"three";function Nd(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function Zd(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function ks(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=Nd(t),{start:s,end:o}=Zd(e,i,t),r=360-(new si().subVectors(new si(o[0],o[1]),new si(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function lC(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,Eo(c),r,h),t.push(c)}else t.push(0)}return t}function pC(a,t){let e=a[0],i=a.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function Eo(a){return a*60*60}function oi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new si(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new si(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function dC(a){let t=[...a].sort((c,l)=>c-l),e=Wr(t,25),i=Wr(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Wr(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}import{isNil as Ds}from"lodash";var As=class extends X{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),Ds(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=ks(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),Ds(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=ks([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=oi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=ks([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=k(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=k(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if(Ds(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:x({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if(Ds(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?oi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:Eo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new z,this.positionTimer=null,this.speedFilter=new xi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};import"core-js/modules/es.json.stringify.js";function Lo(){return new Worker(new URL("./worker/recommend.worker-FFNYEN5G.js",import.meta.url))}var jd={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},Ur=class{setRoadData(t,e){return F(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return F(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Lo(),this.options=x({},jd,t)}};import"core-js/modules/es.json.stringify.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.push.js";import"core-js/modules/web.url-search-params.js";import"core-js/modules/web.url-search-params.delete.js";import"core-js/modules/web.url-search-params.has.js";import"core-js/modules/web.url-search-params.size.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.json.stringify.js";var Vd={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},ni=class extends X{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new z,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},Vd,t||{}),this.options.url&&this.initWebsocket()}};import{isNil as Hr}from"lodash";var Co=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Nr=class extends X{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!Hr(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new ni({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(I){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(Lt){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var g;(g=this.carInertialPosition)==null||g.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"beacon"}),console.log("positionFloor",W,Lt),this.options.upload_position){var v;(v=this.positionWebSocket)==null||v.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var w;if(Lt){var M,P,E;(E=this.pdrPosition)==null||(P=E.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(w=this.pdrPosition)==null||w.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var b;if(this.resetPdr(),(b=this.carInertialPosition)==null||b.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var A;this.resetPdr(),(A=this.carInertialPosition)==null||A.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var S;(S=this.carInertialPosition)==null||S.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var V;(V=this.carInertialPosition)==null||V.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:I,y:R,time:N,floor:W}=o.data,Et=this.positionFloor!==W;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(N).getTime()});return}if(Et){var Q;if(this.resetPdr(),(Q=this.carInertialPosition)==null||Q.stopPositionTimer(),this.path){let Lt=this.path.findIndex(It=>It.floor===W),Xt=this.path[Lt];if(Xt){var lt;this.resetPdr(),(lt=this.carInertialPosition)==null||lt.setPosition(Xt.points[0],new Date(N).getTime(),o.duration)}else{var at;(at=this.carInertialPosition)==null||at.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var St;(St=this.carInertialPosition)==null||St.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var Kt,q;if((Kt=this.carInertialPosition)==null||Kt.setPosition([I,R],new Date(N).getTime(),o.duration),!((q=this.carInertialPosition)!=null&&q.positionTimer)){var ue;(ue=this.carInertialPosition)==null||ue.startPositionTimer()}}if(this.options.upload_position){var Ge;(Ge=this.positionWebSocket)==null||Ge.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!Hr(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new ni({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new As,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new bs(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[O.COMPASS,O.ACCELERATION,O.DEVICE_MOTION].concat(this.options.use_gps?[O.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(Ut)i=t.map(o=>{let[n,r]=Co(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Co(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(x({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(v=>v.rssi<0),g=m.reduce((v,w)=>v+w.rssi,0);i.push([c,l,p,g/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new z;let i=new URLSearchParams(location.search),s=i.get("server_env")||"prod",o={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},n="wss://"+o[s]+"/aether-walker/indoor/position",r="wss://"+o[s]+"/aether-walker/indoor/sensor";this.options=x({place_id:i.get("place_id"),access_token:i.get("access_token"),env:s,wss_position_url:n,wss_sensor_url:r,get_gps_floor_url:"https://"+o[s]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};import"core-js/modules/web.dom-collections.iterator.js";var Zr=class extends B{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new be(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var jr=class extends B{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";var Vr=class extends B{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new ys;let i=new Ie(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var Kd="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",Xd={base_url:Kd},Kr=class extends B{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=x({},Xd,e),this.tileLayer=new pe(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};import{Box3 as Yd,Group as qd}from"three";var Xr=class extends B{addHeatmap(t,e){this.heatmap||(this.heatmap=new Wi(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new Yd().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new qd,this.bmap.context.scene.add(this.group)}};export{Ie as AibeeLoader,xr as BMap,Dr as BMapSelect,vt as BaseSvg,As as CarInertialPosition,yi as ClickHelper,ps as Context,cs as ContextCamera,hs as ContextScene,rs as Control,vr as CrLoader,kr as CrNavPath,wr as Equipment,X as EventDispatcher,Ko as Events,At as Floor,Xn as GlbModel,J as Graphic,Ci as GraphicLayer,he as GroundTexture,Xr as Heatmap,Wi as HeatmapElement,jr as HighlightPoi,it as HooksName,ts as HoverHelper,Se as InstancedGraphic,Oi as InstancedModel,Ke as InstancedParkingSpace,$i as InstancedWall,xi as KalmanFilter,ji as Lane,H as Layer,$e as LineElement,DS as MapTypePolar,Ye as MergeAttributeGraphic,ce as MergeAttributeGroundTexture,Yi as MergeAttributeLane,Ki as MergeAttributeWall,Jn as MergeGraphic,le as MergedAttributeGraphicLine,Ri as MergedGraphicLayer,Ai as MergedModelLayer,Li as Model,zr as MulFloorNavigation,Br as MulFloorSelect,Tr as MulFloors,ys as NavPath,Lr as Navigation,be as Overlay,Di as ParkingLayer,IS as ParkingType,Ht as PathDirection,bs as PdrPosition,ae as Poi,j as Poi2,Ti as PoiLayer,ki as PoiLayer2,Nr as Position,Qe as RENDER_VERSION,Ur as RecommendParkingSpace,as as Renderer,vn as RoadNetwork,xn as RoadNetwork2,O as SENSOR_TYPE,Kr as SatelliteTile,Vn as SelectBox,Qi as Selection,xs as Sensor,Ei as Shadow,ni as Socket,Vr as SortByDistance,Ui as SvgLine,Hi as SvgPolygon,we as TaskQueue,Vi as TextTexture,pe as TileLayer,Gi as TileLoader,z as Timer,Qt as TweenUtil,Vo as UA,Zr as UseMyPosition,Ni as Wall,vi as WorkerPool,Ou as addAlphaToHexColor,me as calc_angle,Us as calc_direction,lC as calculateInstantaneousSpeed,ks as calculateLineDirection,wn as convertToSnakeCase,He as createCircle,ui as createLine,qt as createRect,No as createSvg,di as createSvgElement,of as createThreeBox,sf as createThreeLine,Wt as darkenColor,wp as defaultConfig,Zt as defaultGraphicOptions,po as defaultOptions,sl as defaultTextTextureOptions,vu as deviceToVector3,D as dispose,en as distancePointToSegment,oe as generatorKeyByObj,Ma as getAngle,Xs as getBorderPoints,pi as getCenter,dr as getConfig,am as getDirectPath,Hs as getDirectionByAngle,sn as getDistanceByPathPos,k as getLength,xu as getLongestSideDir,wu as getMinEdgeSquare,ht as getPathLength,Bt as getPointEdgeIndex,ve as getPosByPathDistance,Uo as hasChinese,Bs as hexToRgb,Wo as initDirectionalLight,Bo as initLight,hi as initShape,ng as instancedGeometiesAttributes,Gu as isAndroid,Yt as isContain,ye as isControl,Ut as isIphone,ge as isMac,Ho as isPointInPolygon,rg as isRectangle,gr as loadBuildingGround,hS as loadExternalStreet,yr as loadGraphics,og as mergeGraphicGeometries,Va as mergeGraphicLineGeometries,rm as moveOnRoute,oi as predictFuturePosition,pC as predictFutureSpeed,fe as proxyOptions,dC as removeOutliers,Pa as removeWeightPath,se as setCirclePosition,Mt as setLineStartEnd,ot as setRectPosition,mi as simplifyPath,jo as sleepByRf,Zo as sleepOnePromise,zs as sleepOneRf,tn as smoothPath,Mn as splitStrByBracket,Au as strToNumber,ft as timeoutPromise,Jm as toWebWorker,gi as transformGraphicData,Eo as transformSpeed,xe as translatePosToCenter,F as triggerWorker,C as vector3ToDevice,Ju as xhrGet};
701
+ `};var Ls=class extends Sd{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},Rr.clone(Ss["custom-line"].uniforms),{map:{value:null}}),vertexShader:Ss["custom-line"].vertexShader,fragmentShader:Ss["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};import{LineGeometry as Od}from"three/examples/jsm/lines/LineGeometry.js";import{Line2 as Id}from"three/examples/jsm/lines/Line2.js";var Gr={texture_url:Pi,lineWidth:8,color:16777215},Cs=class extends Ed{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return C(new Td(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return ht(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new bo(t,1)}loadTexture(t){return new Promise((e,i)=>{new Ld().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Od,this.geometry.setPositions(t.flat(2));let s=ht(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new Ls({color:new Cd(this.config.color),transparent:!0,resolution:new bo(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:kd,repeat:new bo(this.getRepeat(),1),allDistance:s}),n=this.mesh=new Id(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Dd}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Ad().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=Gr,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},Gr,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};import{Tween as Wd}from"@tweenjs/tween.js";import{AnimationMixer as Rd,Box3 as Gd,Object3D as Fr,Vector3 as Fd,Mesh as zd,Euler as Bd}from"three";var Ts=class extends Fr{meshSetMaterial(t){t instanceof zd&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Bd;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new Rd(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&D(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Fr,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=x({},this.options,i),this.add(this.group),st.loadModel(e,!1).then(s=>{this.model=s;let n=new Gd().setFromObject(s.scene).getSize(new Fd),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};import{Vector3 as So}from"three";var zr=class extends B{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>x({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new Cs(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return mi(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=Bt(t,e),s=t[i],o=t[i+1],n=new So(o[0]-s[0],o[1]-s[1],0).normalize(),r=new So(0,1,0).normalize(),h=n.angleTo(r),c=new So().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Wd({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let v=0;v<e.length;v++)if(e[v].distance>=l){p=v;break}else l-=e[v].distance;let d=ve(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(v=>v.name===e[p].floor),g=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],g)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(v=>{var w;return v.name===((w=e.slice(-1)[0])==null?void 0:w.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,g=this.translatePoints([d])[0];this.startModel.position.set(g[0],g[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Qt,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new Ts(t,Dn,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import{Raycaster as Ud,Vector2 as Hd}from"three";var Br=class extends B{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new Hd,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new Ud;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new yi(this.bmap.context.container),this.registryEvent()}};import"core-js/modules/es.array.find-last-index.js";import"core-js/modules/es.array.find-last.js";import"core-js/modules/es.array.push.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.array.sort.js";import{Vector2 as si}from"three";function Nd(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function Zd(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function ks(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=Nd(t),{start:s,end:o}=Zd(e,i,t),r=360-(new si().subVectors(new si(o[0],o[1]),new si(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function lC(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,Eo(c),r,h),t.push(c)}else t.push(0)}return t}function pC(a,t){let e=a[0],i=a.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function Eo(a){return a*60*60}function oi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new si(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new si(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function dC(a){let t=[...a].sort((c,l)=>c-l),e=Wr(t,25),i=Wr(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Wr(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}import{isNil as Ds}from"lodash";var As=class extends X{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),Ds(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=ks(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),Ds(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=ks([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=oi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=ks([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=k(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=k(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if(Ds(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:x({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if(Ds(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?oi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:Eo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new z,this.positionTimer=null,this.speedFilter=new xi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};import"core-js/modules/es.json.stringify.js";function Lo(){return new Worker(new URL("./worker/recommend.worker-FFNYEN5G.js",import.meta.url))}var jd={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},Ur=class{setRoadData(t,e){return F(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return F(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Lo(),this.options=x({},jd,t)}};import"core-js/modules/es.json.stringify.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/web.url-search-params.js";import"core-js/modules/web.url-search-params.delete.js";import"core-js/modules/web.url-search-params.has.js";import"core-js/modules/web.url-search-params.size.js";import"core-js/modules/es.json.stringify.js";var Vd={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},ni=class extends X{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new z,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},Vd,t||{}),this.options.url&&this.initWebsocket()}};import{isNil as Hr}from"lodash";var Co=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Nr=class extends X{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!Hr(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new ni({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(I){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(Lt){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var g;(g=this.carInertialPosition)==null||g.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"beacon"}),console.log("positionFloor",W,Lt),this.options.upload_position){var v;(v=this.positionWebSocket)==null||v.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var w;if(Lt){var M,P,E;(E=this.pdrPosition)==null||(P=E.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(w=this.pdrPosition)==null||w.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var b;if(this.resetPdr(),(b=this.carInertialPosition)==null||b.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var A;this.resetPdr(),(A=this.carInertialPosition)==null||A.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var S;(S=this.carInertialPosition)==null||S.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var V;(V=this.carInertialPosition)==null||V.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:I,y:R,time:N,floor:W}=o.data,Et=this.positionFloor!==W;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(N).getTime()});return}if(Et){var Q;if(this.resetPdr(),(Q=this.carInertialPosition)==null||Q.stopPositionTimer(),this.path){let Lt=this.path.findIndex(It=>It.floor===W),Xt=this.path[Lt];if(Xt){var lt;this.resetPdr(),(lt=this.carInertialPosition)==null||lt.setPosition(Xt.points[0],new Date(N).getTime(),o.duration)}else{var at;(at=this.carInertialPosition)==null||at.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var St;(St=this.carInertialPosition)==null||St.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var Kt,q;if((Kt=this.carInertialPosition)==null||Kt.setPosition([I,R],new Date(N).getTime(),o.duration),!((q=this.carInertialPosition)!=null&&q.positionTimer)){var ue;(ue=this.carInertialPosition)==null||ue.startPositionTimer()}}if(this.options.upload_position){var Ge;(Ge=this.positionWebSocket)==null||Ge.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!Hr(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new ni({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new As,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new bs(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[O.COMPASS,O.ACCELERATION,O.DEVICE_MOTION].concat(this.options.use_gps?[O.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(Ut)i=t.map(o=>{let[n,r]=Co(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Co(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(x({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(v=>v.rssi<0),g=m.reduce((v,w)=>v+w.rssi,0);i.push([c,l,p,g/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new z;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=x({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};import"core-js/modules/web.dom-collections.iterator.js";var Zr=class extends B{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new be(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var jr=class extends B{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";var Vr=class extends B{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new ys;let i=new Ie(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var Kd="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",Xd={base_url:Kd},Kr=class extends B{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=x({},Xd,e),this.tileLayer=new pe(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};import{Box3 as Yd,Group as qd}from"three";var Xr=class extends B{addHeatmap(t,e){this.heatmap||(this.heatmap=new Wi(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new Yd().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new qd,this.bmap.context.scene.add(this.group)}};export{Ie as AibeeLoader,xr as BMap,Dr as BMapSelect,vt as BaseSvg,As as CarInertialPosition,yi as ClickHelper,ps as Context,cs as ContextCamera,hs as ContextScene,rs as Control,vr as CrLoader,kr as CrNavPath,wr as Equipment,X as EventDispatcher,Ko as Events,At as Floor,Xn as GlbModel,J as Graphic,Ci as GraphicLayer,he as GroundTexture,Xr as Heatmap,Wi as HeatmapElement,jr as HighlightPoi,it as HooksName,ts as HoverHelper,Se as InstancedGraphic,Oi as InstancedModel,Ke as InstancedParkingSpace,$i as InstancedWall,xi as KalmanFilter,ji as Lane,H as Layer,$e as LineElement,DS as MapTypePolar,Ye as MergeAttributeGraphic,ce as MergeAttributeGroundTexture,Yi as MergeAttributeLane,Ki as MergeAttributeWall,Jn as MergeGraphic,le as MergedAttributeGraphicLine,Ri as MergedGraphicLayer,Ai as MergedModelLayer,Li as Model,zr as MulFloorNavigation,Br as MulFloorSelect,Tr as MulFloors,ys as NavPath,Lr as Navigation,be as Overlay,Di as ParkingLayer,IS as ParkingType,Ht as PathDirection,bs as PdrPosition,ae as Poi,j as Poi2,Ti as PoiLayer,ki as PoiLayer2,Nr as Position,Qe as RENDER_VERSION,Ur as RecommendParkingSpace,as as Renderer,vn as RoadNetwork,xn as RoadNetwork2,O as SENSOR_TYPE,Kr as SatelliteTile,Vn as SelectBox,Qi as Selection,xs as Sensor,Ei as Shadow,ni as Socket,Vr as SortByDistance,Ui as SvgLine,Hi as SvgPolygon,we as TaskQueue,Vi as TextTexture,pe as TileLayer,Gi as TileLoader,z as Timer,Qt as TweenUtil,Vo as UA,Zr as UseMyPosition,Ni as Wall,vi as WorkerPool,Ou as addAlphaToHexColor,me as calc_angle,Us as calc_direction,lC as calculateInstantaneousSpeed,ks as calculateLineDirection,wn as convertToSnakeCase,He as createCircle,ui as createLine,qt as createRect,No as createSvg,di as createSvgElement,of as createThreeBox,sf as createThreeLine,Wt as darkenColor,wp as defaultConfig,Zt as defaultGraphicOptions,po as defaultOptions,sl as defaultTextTextureOptions,vu as deviceToVector3,D as dispose,en as distancePointToSegment,oe as generatorKeyByObj,Ma as getAngle,Xs as getBorderPoints,pi as getCenter,dr as getConfig,am as getDirectPath,Hs as getDirectionByAngle,sn as getDistanceByPathPos,k as getLength,xu as getLongestSideDir,wu as getMinEdgeSquare,ht as getPathLength,Bt as getPointEdgeIndex,ve as getPosByPathDistance,Uo as hasChinese,Bs as hexToRgb,Wo as initDirectionalLight,Bo as initLight,hi as initShape,ng as instancedGeometiesAttributes,Gu as isAndroid,Yt as isContain,ye as isControl,Ut as isIphone,ge as isMac,Ho as isPointInPolygon,rg as isRectangle,gr as loadBuildingGround,hS as loadExternalStreet,yr as loadGraphics,og as mergeGraphicGeometries,Va as mergeGraphicLineGeometries,rm as moveOnRoute,oi as predictFuturePosition,pC as predictFutureSpeed,fe as proxyOptions,dC as removeOutliers,Pa as removeWeightPath,se as setCirclePosition,Mt as setLineStartEnd,ot as setRectPosition,mi as simplifyPath,jo as sleepByRf,Zo as sleepOnePromise,zs as sleepOneRf,tn as smoothPath,Mn as splitStrByBracket,Au as strToNumber,ft as timeoutPromise,Jm as toWebWorker,gi as transformGraphicData,Eo as transformSpeed,xe as translatePosToCenter,F as triggerWorker,C as vector3ToDevice,Ju as xhrGet};
package/lib/meta.json CHANGED
@@ -6198,7 +6198,7 @@
6198
6198
  "format": "esm"
6199
6199
  },
6200
6200
  "../lib/src/plugins/position/position.js": {
6201
- "bytes": 31170,
6201
+ "bytes": 31386,
6202
6202
  "imports": [
6203
6203
  {
6204
6204
  "path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
@@ -6226,27 +6226,27 @@
6226
6226
  "external": true
6227
6227
  },
6228
6228
  {
6229
- "path": "core-js/modules/web.url-search-params.js",
6229
+ "path": "core-js/modules/es.regexp.exec.js",
6230
6230
  "kind": "import-statement",
6231
6231
  "external": true
6232
6232
  },
6233
6233
  {
6234
- "path": "core-js/modules/web.url-search-params.delete.js",
6234
+ "path": "core-js/modules/web.url-search-params.js",
6235
6235
  "kind": "import-statement",
6236
6236
  "external": true
6237
6237
  },
6238
6238
  {
6239
- "path": "core-js/modules/web.url-search-params.has.js",
6239
+ "path": "core-js/modules/web.url-search-params.delete.js",
6240
6240
  "kind": "import-statement",
6241
6241
  "external": true
6242
6242
  },
6243
6243
  {
6244
- "path": "core-js/modules/web.url-search-params.size.js",
6244
+ "path": "core-js/modules/web.url-search-params.has.js",
6245
6245
  "kind": "import-statement",
6246
6246
  "external": true
6247
6247
  },
6248
6248
  {
6249
- "path": "core-js/modules/es.regexp.exec.js",
6249
+ "path": "core-js/modules/web.url-search-params.size.js",
6250
6250
  "kind": "import-statement",
6251
6251
  "external": true
6252
6252
  },
@@ -9043,27 +9043,27 @@
9043
9043
  "external": true
9044
9044
  },
9045
9045
  {
9046
- "path": "core-js/modules/web.url-search-params.js",
9046
+ "path": "core-js/modules/es.regexp.exec.js",
9047
9047
  "kind": "import-statement",
9048
9048
  "external": true
9049
9049
  },
9050
9050
  {
9051
- "path": "core-js/modules/web.url-search-params.delete.js",
9051
+ "path": "core-js/modules/web.url-search-params.js",
9052
9052
  "kind": "import-statement",
9053
9053
  "external": true
9054
9054
  },
9055
9055
  {
9056
- "path": "core-js/modules/web.url-search-params.has.js",
9056
+ "path": "core-js/modules/web.url-search-params.delete.js",
9057
9057
  "kind": "import-statement",
9058
9058
  "external": true
9059
9059
  },
9060
9060
  {
9061
- "path": "core-js/modules/web.url-search-params.size.js",
9061
+ "path": "core-js/modules/web.url-search-params.has.js",
9062
9062
  "kind": "import-statement",
9063
9063
  "external": true
9064
9064
  },
9065
9065
  {
9066
- "path": "core-js/modules/es.regexp.exec.js",
9066
+ "path": "core-js/modules/web.url-search-params.size.js",
9067
9067
  "kind": "import-statement",
9068
9068
  "external": true
9069
9069
  },
@@ -9725,7 +9725,7 @@
9725
9725
  "bytesInOutput": 98
9726
9726
  },
9727
9727
  "../lib/src/plugins/position/position.js": {
9728
- "bytesInOutput": 11360
9728
+ "bytesInOutput": 11423
9729
9729
  },
9730
9730
  "../lib/src/plugins/position/socket.js": {
9731
9731
  "bytesInOutput": 2592
@@ -9749,7 +9749,7 @@
9749
9749
  "bytesInOutput": 575
9750
9750
  }
9751
9751
  },
9752
- "bytes": 404017
9752
+ "bytes": 404080
9753
9753
  }
9754
9754
  }
9755
9755
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.esm.min.js",