droidsembly 0.4.0-beta.6 → 0.5.0-beta.1

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.
Files changed (71) hide show
  1. package/README.it.md +18 -19
  2. package/README.md +18 -18
  3. package/bin/distribution.js +3 -1
  4. package/dist/assets/AccessibilitySettings-C_l9iRUv.js +32 -0
  5. package/dist/assets/{AppViewer-CkRhHzAg.js → AppViewer-BQO9JR1i.js} +1 -1
  6. package/dist/assets/{Balloon-CyA9jx7L.js → Balloon-DVvWn18l.js} +1 -1
  7. package/dist/assets/{Batched-BnwN-jIb.js → Batched-CQd1jTn0.js} +2 -2
  8. package/dist/assets/{Birds-T-cAlNXa.js → Birds-DJ4dABbV.js} +1 -1
  9. package/dist/assets/{Blimp-D5lM1i8g.js → Blimp-BJbSmwgF.js} +1 -1
  10. package/dist/assets/{BufferGeometryUtils-BQuR3FyE.js → BufferGeometryUtils-CT65PqMz.js} +1 -1
  11. package/dist/assets/{Duck-Df57hNLp.js → Duck-C5792fKA.js} +1 -1
  12. package/dist/assets/{Effects-BkJu9eYu.js → Effects-CaCXr9Js.js} +2 -2
  13. package/dist/assets/{Fireworks-BB1Mfdb3.js → Fireworks-iRvidmKy.js} +2 -2
  14. package/dist/assets/{Helicopter-B5NObfW4.js → Helicopter-D8ZNTU4I.js} +1 -1
  15. package/dist/assets/{Hurricane-CGsnFbNg.js → Hurricane-CAadFYBC.js} +2 -2
  16. package/dist/assets/{Kaiju-5SPvHn_6.js → Kaiju-C3EuNULz.js} +1 -1
  17. package/dist/assets/{Meteors-rA1sR1A3.js → Meteors-CGWkPuVY.js} +1 -1
  18. package/dist/assets/{MissionConsole-zJYkK_M1.js → MissionConsole-DZ6wViYJ.js} +1 -1
  19. package/dist/assets/{Office-fRdJ34l-.js → Office-Dmaf62nb.js} +44 -44
  20. package/dist/assets/{PhotoPanel-DiplEiL_.js → PhotoPanel-vRV9SyW6.js} +1 -1
  21. package/dist/assets/PhotoScene-CCfT0_dM.js +115 -0
  22. package/dist/assets/{Plane-CtJDMF4A.js → Plane-LzwrJzTl.js} +1 -1
  23. package/dist/assets/Pocket-CUs_Akxq.js +2 -0
  24. package/dist/assets/{Rainbow-Bbqcvhxa.js → Rainbow-Bh87z-Ca.js} +2 -2
  25. package/dist/assets/Roof-5bxB8sll.js +34 -0
  26. package/dist/assets/Shell-BurGbVOK.js +13 -0
  27. package/dist/assets/{Skywriting-CDweiNEJ.js → Skywriting-DUf57ebJ.js} +1 -1
  28. package/dist/assets/TerminalView-BXlSvVFj.js +17 -0
  29. package/dist/assets/ToyWorld-DtorYOnh.js +1 -0
  30. package/dist/assets/{Ufo-CQvPbWUN.js → Ufo-CFUHx9XE.js} +1 -1
  31. package/dist/assets/{Whale-Mz6Mfxvb.js → Whale-DeSPwwK9.js} +1 -1
  32. package/dist/assets/{all-AJNOOWx8.js → all-DOGLvkPi.js} +2 -2
  33. package/dist/assets/{bloomMarks-CWsszTY1.js → bloomMarks-C54fx8hS.js} +2 -2
  34. package/dist/assets/{cheerRules-Bs7u6fhI.js → cheerRules-Cirk-C1A.js} +1 -1
  35. package/dist/assets/{cityLayout-1I0cF38a.js → cityLayout-Ckx8BPp6.js} +1 -1
  36. package/dist/assets/{dogState-DSYyIK7C.js → dogState-COomoDy2.js} +1 -1
  37. package/dist/assets/{doors-BUM4Izj_.js → doors-bUEcoX0a.js} +1 -1
  38. package/dist/assets/floorRows-TXmh_fs7.js +1 -0
  39. package/dist/assets/{gallery-BntMgHVx.js → gallery-DRHdZni1.js} +1 -1
  40. package/dist/assets/gate-D2IhTYgP.js +2 -0
  41. package/dist/assets/index-BJhDZdUC.css +1 -0
  42. package/dist/assets/{index-BoDJkaEF.js → index-Bm599iDL.js} +3 -3
  43. package/dist/assets/{instantReplay-D8hjR3t4.js → instantReplay-DyovaQ30.js} +1 -1
  44. package/dist/assets/{interact-Bj1zja21.js → interact-5KlEmqSj.js} +1 -1
  45. package/dist/assets/{kit-iArIGJf-.js → kit-0ivWfN5y.js} +2 -2
  46. package/dist/assets/{mic-B-UxYaQY.js → mic-BhkfhZh_.js} +1 -1
  47. package/dist/assets/{photoMode-CRSRNKrX.js → photoMode-DaRgDVK0.js} +1 -1
  48. package/dist/assets/{pipeline-DvDJ46O5.js → pipeline-Bpizl8Xd.js} +50 -50
  49. package/dist/assets/{rapier-Dtx9m4Xq.js → rapier-BPbvA-KY.js} +1 -1
  50. package/dist/assets/rig-CrQ96zZT.js +1 -0
  51. package/dist/assets/{speechLanguage-CSuv5EYa.js → speechLanguage-DB5z7y_C.js} +1 -1
  52. package/dist/assets/store-D17hJxYS.js +5 -0
  53. package/dist/assets/{useDayTime-Cn8OOG-d.js → useDayTime-kseMHOa9.js} +1 -1
  54. package/dist/assets/{useGraphics-CnMUzm0p.js → useGraphics-CJhpDhqZ.js} +1 -1
  55. package/dist/assets/{voiceMessages-CvKdLaYv.js → voiceMessages-DxK9WeCn.js} +1 -1
  56. package/dist/assets/{weatherState-BGsd5Mzz.js → weatherState-DighRn7p.js} +1 -1
  57. package/dist/index.html +3 -3
  58. package/dist-server/index.js +432 -26
  59. package/dist-server/index.js.map +4 -4
  60. package/package.json +3 -3
  61. package/dist/assets/AccessibilitySettings-BLUQhCir.js +0 -32
  62. package/dist/assets/PhotoScene-DG1ui0Av.js +0 -115
  63. package/dist/assets/Pocket-x37KplGU.js +0 -2
  64. package/dist/assets/Roof-DP8gTSp6.js +0 -34
  65. package/dist/assets/Shell-BzhH2Tnv.js +0 -13
  66. package/dist/assets/TerminalView-CZkLeOi6.js +0 -17
  67. package/dist/assets/ToyWorld-ZLc2l8lQ.js +0 -1
  68. package/dist/assets/gate-B4Yyimy5.js +0 -2
  69. package/dist/assets/index-0ut5ekje.css +0 -1
  70. package/dist/assets/rig-Bs_tw8rH.js +0 -1
  71. package/dist/assets/store-D1ymxjG0.js +0 -5
@@ -1 +1 @@
1
- export{nn as ActiveCollisionTypes,M as ActiveEvents,Nt as ActiveHooks,cn as Ball,Vt as BroadPhase,Ht as CCDSolver,T as Capsule,on as CharacterCollision,w as CoefficientCombineRule,pt as Collider,Ct as ColliderDesc,qt as ColliderSet,Ot as ColliderShapeCastHit,L as Cone,Pt as ConvexPolyhedron,tn as Cuboid,rn as Cylinder,ot as DebugRenderBuffers,H as DebugRenderPipeline,F as DynamicRayCastVehicleController,tt as EventQueue,z as FeatureType,G as FixedImpulseJoint,R as FixedMultibodyJoint,et as GenericImpulseJoint,_t as HalfSpace,O as HeightFieldFlags,Wt as Heightfield,V as ImpulseJoint,Kt as ImpulseJointSet,at as IntegrationParameters,it as IslandManager,S as JointAxesMask,St as JointData,gt as JointType,K as KinematicCharacterController,nt as MassPropsMode,en as MotorModel,W as MultibodyJoint,Et as MultibodyJointSet,dt as NarrowPhase,U as PhysicsPipeline,Q as PidAxesMask,J as PidController,lt as PointColliderProjection,Ft as PointProjection,D as Polyline,vt as PrismaticImpulseJoint,Zt as PrismaticMultibodyJoint,ut as Quaternion,Ut as QueryFilterFlags,Y as Ray,bt as RayColliderHit,mt as RayColliderIntersection,wt as RayIntersection,Yt as RevoluteImpulseJoint,Gt as RevoluteMultibodyJoint,I as RigidBody,Lt as RigidBodyDesc,jt as RigidBodySet,sn as RigidBodyType,q as RopeImpulseJoint,st as RotationOps,Rt as RoundCone,j as RoundConvexPolyhedron,C as RoundCuboid,rt as RoundCylinder,k as RoundTriangle,X as SdpMatrix3,Qt as SdpMatrix3Ops,B as Segment,Mt as SerializationPipeline,$t as Shape,in as ShapeCastHit,Z as ShapeContact,kt as ShapeType,A as SolverFlags,ft as SphericalImpulseJoint,Jt as SphericalMultibodyJoint,P as SpringImpulseJoint,Xt as TempContactForceEvent,ct as TempContactManifold,N as TriMesh,E as TriMeshFlags,At as Triangle,an as UnitImpulseJoint,zt as UnitMultibodyJoint,Dt as Vector3,Bt as VectorOps,$ as Voxels,yt as World,It as default,Tt as init,xt as reserveMemory,ht as version}from"./Office-fRdJ34l-.js";
1
+ export{nn as ActiveCollisionTypes,M as ActiveEvents,Nt as ActiveHooks,cn as Ball,Vt as BroadPhase,Ht as CCDSolver,T as Capsule,on as CharacterCollision,w as CoefficientCombineRule,pt as Collider,Ct as ColliderDesc,qt as ColliderSet,Ot as ColliderShapeCastHit,L as Cone,Pt as ConvexPolyhedron,tn as Cuboid,rn as Cylinder,ot as DebugRenderBuffers,H as DebugRenderPipeline,F as DynamicRayCastVehicleController,tt as EventQueue,z as FeatureType,G as FixedImpulseJoint,R as FixedMultibodyJoint,et as GenericImpulseJoint,_t as HalfSpace,O as HeightFieldFlags,Wt as Heightfield,V as ImpulseJoint,Kt as ImpulseJointSet,at as IntegrationParameters,it as IslandManager,S as JointAxesMask,St as JointData,gt as JointType,K as KinematicCharacterController,nt as MassPropsMode,en as MotorModel,W as MultibodyJoint,Et as MultibodyJointSet,dt as NarrowPhase,U as PhysicsPipeline,Q as PidAxesMask,J as PidController,lt as PointColliderProjection,Ft as PointProjection,D as Polyline,vt as PrismaticImpulseJoint,Zt as PrismaticMultibodyJoint,ut as Quaternion,Ut as QueryFilterFlags,Y as Ray,bt as RayColliderHit,mt as RayColliderIntersection,wt as RayIntersection,Yt as RevoluteImpulseJoint,Gt as RevoluteMultibodyJoint,I as RigidBody,Lt as RigidBodyDesc,jt as RigidBodySet,sn as RigidBodyType,q as RopeImpulseJoint,st as RotationOps,Rt as RoundCone,j as RoundConvexPolyhedron,C as RoundCuboid,rt as RoundCylinder,k as RoundTriangle,X as SdpMatrix3,Qt as SdpMatrix3Ops,B as Segment,Mt as SerializationPipeline,$t as Shape,in as ShapeCastHit,Z as ShapeContact,kt as ShapeType,A as SolverFlags,ft as SphericalImpulseJoint,Jt as SphericalMultibodyJoint,P as SpringImpulseJoint,Xt as TempContactForceEvent,ct as TempContactManifold,N as TriMesh,E as TriMeshFlags,At as Triangle,an as UnitImpulseJoint,zt as UnitMultibodyJoint,Dt as Vector3,Bt as VectorOps,$ as Voxels,yt as World,It as default,Tt as init,xt as reserveMemory,ht as version}from"./Office-Dmaf62nb.js";
@@ -0,0 +1 @@
1
+ import{s as e}from"./jsx-runtime-CZP6s5wa.js";import{Fa as t,Ko as n,Vo as r,_o as i,ba as a,en as o,ir as s,l as c,p as l,vo as u}from"./store-D17hJxYS.js";import{v as d,y as f}from"./index-Bm599iDL.js";import{Ct as p,M as m,Ut as h,dt as ee,ht as g,i as _,k as v,lt as te,ot as y,ut as ne}from"./bloomMarks-C54fx8hS.js";var b=new m(new Uint8Array([110,190,255]),3,1,p);b.minFilter=ee,b.magFilter=ee,b.generateMipmaps=!1,b.needsUpdate=!0;var x=new Map;function re(e,t={}){let n=`${e}|${t.emissive??``}|${t.emissiveIntensity??``}|${t.opacity??``}`,r=x.get(n);return r||(r=new ne({color:e,gradientMap:b,emissive:t.emissive??`#000000`,emissiveIntensity:t.emissiveIntensity??1,transparent:t.transparent??(t.opacity!==void 0&&t.opacity<1),opacity:t.opacity??1}),x.set(n,r)),r}var ie=new ne({color:`#ffffff`,gradientMap:b}),ae=_(new y({color:`#ffffff`,toneMapped:!1})),oe=_(new y({color:`#ffffff`,toneMapped:!1}),`night`);function se(e,t){let n=`map|${e}`,r=x.get(n);return r||(r=new ne({map:t,gradientMap:b}),x.set(n,r)),r}function ce(e,t=`always`){let n=`glow|${e}|${t}`,r=x.get(n);return r||(r=_(new y({color:e,toneMapped:!1}),t),x.set(n,r)),r}var le=new te({color:`#bfe8ff`,transparent:!0,opacity:.22,roughness:.05,metalness:0,depthWrite:!1,side:2});function ue(e,t){let n=new v(e),r={h:0,s:0,l:0};return n.getHSL(r),n.setHSL(r.h,r.s,Math.max(0,Math.min(1,r.l+t))),`#${n.getHexString()}`}function de(e,t,n){return`#${new v(e).lerp(new v(t),n).getHexString()}`}var S=()=>({x:0,y:0,z:0,yaw:0,pitch:0,fov:72,near:.05});function C(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.yaw=e.yaw,t.pitch=e.pitch,t.fov=e.fov,t.near=e.near,t}var fe=()=>({fx:0,fy:0,fz:0,yaw:0,el:0,dist:10,fov:60});function w(e,t){return t.fx=e.fx,t.fy=e.fy,t.fz=e.fz,t.yaw=e.yaw,t.el=e.el,t.dist=e.dist,t.fov=e.fov,t}var pe=e=>Math.min(1.5,Math.max(.05,e*.02));function T(e,t){let n=Math.cos(e.el);return t.x=e.fx+Math.sin(e.yaw)*n*e.dist,t.y=e.fy+Math.sin(e.el)*e.dist,t.z=e.fz+Math.cos(e.yaw)*n*e.dist,t.yaw=e.yaw,t.pitch=-e.el,t.fov=e.fov,t.near=pe(e.dist),t}function me(e,t,n,r){let i=e.x-t,a=e.z-r;return e.yaw=Math.atan2(i,a),e.pitch=Math.atan2(n-e.y,Math.hypot(i,a)),e}var he=e=>{let t=Math.min(1,Math.max(0,e));return t<.5?4*t*t*t:1-(-2*t+2)**3/2};function ge(e,t,n,r){return r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n,r.z=e.z+(t.z-e.z)*n,r.yaw=e.yaw+s(e.yaw,t.yaw)*n,r.pitch=e.pitch+(t.pitch-e.pitch)*n,r.fov=e.fov+(t.fov-e.fov)*n,r.near=t.near>e.near?e.near+(t.near-e.near)*n**4:e.near+(t.near-e.near)*n,r}function _e(e,t,n,r,i=r){let a=1-Math.exp(-n*r);return e.fx+=(t.fx-e.fx)*a,e.fy+=(t.fy-e.fy)*a,e.fz+=(t.fz-e.fz)*a,e.yaw+=s(e.yaw,t.yaw)*(1-Math.exp(-n*i)),e.el+=(t.el-e.el)*a,e.dist+=(t.dist-e.dist)*a,e.fov+=(t.fov-e.fov)*a,e}function E(e,t,n,r){let i=Math.tan(e.fov*Math.PI/360),a=i*t,o=Math.cos(e.yaw),s=Math.sin(e.yaw),c=Math.cos(e.pitch),l=Math.sin(e.pitch),u=1-r;for(let t=0;t<n.length;t+=3){let r=n[t]-e.x,d=n[t+1]-e.y,f=n[t+2]-e.z,p=-s*c*r+l*d-o*c*f;if(p<=0)return!1;let m=o*r-s*f,h=s*l*r+c*d+o*l*f;if(Math.abs(m/(p*a))>u||Math.abs(h/(p*i))>u)return!1}return!0}var D=[-1,1].flatMap(e=>[-1,1].flatMap(t=>[0,i].flatMap(n=>[e*16,n,t*12]))),O={el:.85,fov:40,fy:.8,minDist:9,maxZoom:1.5,margin:.06,lift:.07},ve=e=>Math.PI/4+Math.PI/2*e,ye=e=>Math.round(s(Math.PI/4,e)/(Math.PI/2));function be(e,t,n=D,r=O.margin,i=S()){let a={...e},o=1,s=600;for(let e=0;e<40;e++)a.dist=(o+s)/2,E(T(a,i),t,n,r)?s=a.dist:o=a.dist;return s}function xe(e,t,n,r={minX:0,maxX:0,minY:0,maxY:0}){let i=Math.tan(e.fov*Math.PI/360),a=i*t,o=Math.cos(e.yaw),s=Math.sin(e.yaw),c=Math.cos(e.pitch),l=Math.sin(e.pitch);r.minX=r.minY=1/0,r.maxX=r.maxY=-1/0;for(let t=0;t<n.length;t+=3){let u=n[t]-e.x,d=n[t+1]-e.y,f=n[t+2]-e.z,p=Math.max(1e-6,-s*c*u+l*d-o*c*f),m=(o*u-s*f)/(p*a),h=(s*l*u+c*d+o*l*f)/(p*i);r.minX=Math.min(r.minX,m),r.maxX=Math.max(r.maxX,m),r.minY=Math.min(r.minY,h),r.maxY=Math.max(r.maxY,h)}return r}function Se(e,t,n){n.fx=0,n.fy=O.fy,n.fz=0,n.yaw=ve(ye(e)),n.el=O.el,n.fov=O.fov;let r=S(),i=Math.tan(n.fov*Math.PI/360);for(let e=0;e<4;e++){n.dist=be(n,t,D,O.margin,r);let e=xe(T(n,r),t,D),a=(e.minY+e.maxY)/2-O.lift;we(n,(e.minX+e.maxX)/2*n.dist*i*t,a*n.dist*(i/Math.sin(n.el)))}return n.dist=be(n,t,D,O.margin,r),n}function Ce(e){return e.fx=Math.min(16,Math.max(-16,e.fx)),e.fz=Math.min(12,Math.max(-12,e.fz)),e}function we(e,t,n){let r=Math.sin(e.yaw),i=Math.cos(e.yaw);return e.fx+=i*t-r*n,e.fz+=-r*t-i*n,Ce(e)}var Te=(e,t)=>2*e.dist*Math.tan(e.fov*Math.PI/360)/Math.max(1,t);function Ee(e,t){let n=Math.sin(e),r=Math.cos(e);return t.x=n>.05?1:n<-.05?-1:0,t.z=r>.05?1:r<-.05?-1:0,t}var k=12+u+.03,A=16+u,j={yaw:.32,el:.16,dist:34,minFov:30,maxFov:100,margin:.12};function De(e,t){let i=-n(e,Math.max(t,e));return{bottom:i,top:i+r(Math.max(t,e))}}function Oe(e,t,n,r,a=S()){let o=De(e,t);r.fx=0,r.fz=0,r.fy=(o.bottom+o.top)/2,r.yaw=j.yaw,r.el=j.el,r.dist=j.dist;let s=[-A,o.bottom,k,A,o.bottom,k,-A,o.top,k,A,o.top,k],c=j.minFov,l=j.maxFov;if(r.fov=l,!E(T(r,a),n,s,j.margin))return r.fy=i/2,r;for(let e=0;e<30;e++)r.fov=(c+l)/2,E(T(r,a),n,s,j.margin)?l=r.fov:c=r.fov;return r.fov=l,r}function ke(e,t,n){let r=De(t,n);return e.fy=Math.min(r.top,Math.max(r.bottom,e.fy)),e}var M={dist:3.4,el:.36,fov:62,height:1.25,minDist:1.8,maxDist:9};function Ae(e,t){let n=Math.abs(t)>16+u,r=n?a-.25:15.7,o=n?16+u+.25:-r;if(n){let n=Math.min(r,Math.max(o,Math.abs(e.x)));e.x=Math.sign(t)*n}else e.x=Math.min(r,Math.max(o,e.x));return e.z=Math.min(11.7,Math.max(-11.7,e.z)),e.y=Math.min(i-.35,Math.max(.6,e.y)),e}function je(e,t,n,r){return t-n<500&&r!==`building`?`building`:e===`first`||e===`follow`?`overview`:`first`}function N(e,t){return{id:e,label:t,read(t){let n=o(e);return n?(t.x=n.x,t.y=0,t.z=n.z,t.heading=n.heading,!0):!1}}}var P={x:0,z:0,yaw:0},F=()=>d().fov,I=.05,L=.9,Me=.65,Ne=1.5,R={mode:`first`,owns:!1,flight:1,flightTime:L,from:S(),pose:S(),goalPose:S(),orbit:fe(),goal:fe(),quad:0,fit:40,home:{x:0,z:0,yaw:0,pitch:0},target:null,seen:{x:0,y:0,z:0,heading:0},lost:0,waitUntil:0,snap:!1,arrival:null,lastTap:-1/0,lastWent:null,aspect:16/9,height:900,sides:{x:0,z:0},cut:`none`},z=null,B=()=>R.home;function Pe(e){z=e}function Fe(e,t){let n=e/Math.max(1,t);R.height=t,Math.abs(n-R.aspect)<.001||(R.aspect=n,R.mode===`overview`&&et(),R.mode===`building`&&Oe(l.getState().floor,q(),n,R.goal))}function Ie(e){B=e}var Le=()=>R.mode,Re=()=>R.cut,ze={x:0,z:0},Be=()=>R.cut===`dollhouse`?R.sides:ze,Ve=()=>R.home,He=()=>R.owns&&R.mode!==`follow`?R.home:null,Ue=()=>R.mode===`first`&&!R.arrival,We=()=>R.owns,Ge=()=>R.flight<1;function Ke(){let e=z;if(!R.owns||!e)return 0;let n=e.position;return Math.hypot(n.x-R.home.x,n.y-t,n.z-R.home.z)}var V=e(()=>({mode:`first`,following:null,hover:null}));function H(){V.setState({mode:R.mode,following:R.mode===`follow`?R.target?.label??null:null})}function qe(e){V.getState().hover!==e&&V.setState({hover:e})}var U=1e6,W=[new g(new h(0,-1,0),U),new g(new h(-1,0,0),U),new g(new h(0,0,-1),U),new g(new h(0,1,0),U)],[Je,G,K,Ye]=W,Xe=.05,Ze=(e,t,n)=>{for(let r of W)if(r.normal.x*e+r.normal.y*t+r.normal.z*n+r.constant<0)return!0;return!1};function Qe(e){R.cut=e,Je.constant=U,G.constant=U,K.constant=U,Ye.constant=U,e===`dollhouse`?(Ee(R.orbit.yaw,R.sides),Je.constant=i-.08,Ye.constant=.35,R.sides.x&&(G.normal.set(-R.sides.x,0,0),G.constant=16-Xe),R.sides.z&&(K.normal.set(0,0,-R.sides.z),K.constant=12-Xe)):e===`face`&&(K.normal.set(0,0,-1),K.constant=k+.02)}function $e(){return R.mode===`overview`?`dollhouse`:R.mode===`building`?`face`:R.mode===`first`&&R.owns&&R.flight<.8?R.cut:`none`}var q=()=>l.getState().repos.reduce((e,t)=>Math.max(e,t.floor),0);function et(){let e=R.goal.dist/R.fit;R.fit=be(R.goal,R.aspect),R.goal.dist=Math.max(O.minDist,Math.min(R.fit*O.maxZoom,R.fit*e))}function tt(e){return R.owns||!z?C(R.pose,e):(e.x=z.position.x,e.y=z.position.y,e.z=z.position.z,e.yaw=z.rotation.y,e.pitch=z.rotation.x,e.fov=z.fov,e.near=z.near,e)}function nt(){if(R.owns||!z)return;let e=B();R.home={x:z.position.x,z:z.position.z,yaw:e.yaw,pitch:e.pitch},P.x=R.home.x,P.z=R.home.z,P.yaw=R.home.yaw;let t=l.getState();t.held&&t.setHeld(null),t.focus&&t.setFocus(null),document.pointerLockElement&&document.exitPointerLock()}function J(e){tt(R.from),C(R.from,R.pose),R.flight=+!!f(),R.flightTime=e}function Y(){if(R.mode===`overview`||!z)return;let e=R.mode;nt(),J(L);let t=e===`first`?R.home.yaw:R.pose.yaw;Se(t,R.aspect,R.goal),R.quad=ye(t),R.fit=R.goal.dist,w(R.goal,R.orbit),R.mode=`overview`,R.owns=!0,R.target=null,H()}function rt(){R.mode!==`building`&&z&&(nt(),J(L),Oe(l.getState().floor,q(),R.aspect,R.goal),w(R.goal,R.orbit),R.mode=`building`,R.owns=!0,R.target=null,H())}function it(e){if(z){if(!e.read(R.seen))return void l.getState().pushToast(`info`,`${e.label} isn't on this floor right now`);nt(),J(L),R.target=e,R.lost=0,R.waitUntil=0,R.snap=!1,ht(R.goal),R.goal.dist=M.dist,w(R.goal,R.orbit),R.mode=`follow`,R.owns=!0,H()}}function at(e){let t=l.getState(),n=t.agents[e];return n?n.role===`ceo`||e===`ceo`?0:t.repos.find(e=>e.id===n.repoId)?.floor??null:null}function ot(e){let t=l.getState().agents[e],n=at(e);t&&n!==null&&st(n,N(e,t.name))}function st(e,t){let n=l.getState();e===n.floor?(it(t),n.overlay&&n.openOverlay(null)):(R.arrival={mode:`follow`,target:t,until:performance.now()+8e3},R.waitUntil=R.arrival.until,n.goToFloor(e))}var ct=()=>R.arrival?.mode===`follow`?R.arrival.target.id:R.mode===`follow`?R.target?.id??null:null;function X(){R.mode!==`first`&&(J(Me),R.mode=`first`,R.target=null,R.arrival=null,H())}function lt(e=performance.now()){if(l.getState().travel)return;let t=je(R.mode,e,R.lastTap,R.lastWent);R.lastTap=e,R.lastWent=t,t===`overview`?Y():t===`building`?rt():X()}function ut(e){R.mode===`overview`&&(R.quad+=e,R.goal.yaw=ve(R.quad))}function Z(e){let t=R.goal,n=Math.exp(e*.0012);R.mode===`overview`?t.dist=Math.max(O.minDist,Math.min(R.fit*O.maxZoom,t.dist*n)):R.mode===`follow`?t.dist=Math.max(M.minDist,Math.min(M.maxDist,t.dist*n)):R.mode===`building`&&(t.fov=Math.max(j.minFov,Math.min(j.maxFov,t.fov*n)))}function dt(e,t){let n=R.goal,r=Te(n,R.height);R.mode===`overview`?we(n,-e*r,t*r/Math.max(.3,Math.sin(n.el))):R.mode===`building`&&(n.fy+=t*r,ke(n,l.getState().floor,q()))}function ft(e){R.home={...e},P.x=e.x,P.z=e.z,P.yaw=e.yaw;let t=R.arrival;R.arrival=null,t?.mode===`follow`?(Se(e.yaw,R.aspect,R.orbit),T(R.orbit,R.pose),R.target=t.target,R.lost=0,R.waitUntil=t.until,R.snap=!0,R.mode=`follow`,R.owns=!0,R.flight=1,R.goal.dist=M.dist,H()):t?.mode===`overview`||R.mode===`overview`||R.mode===`building`?(Se(e.yaw,R.aspect,R.goal),R.quad=ye(e.yaw),R.fit=R.goal.dist,w(R.goal,R.orbit),T(R.orbit,R.pose),R.mode=`overview`,R.owns=!0,R.flight=1,H()):(R.mode===`follow`||R.owns)&&(R.mode=`first`,R.target=null,R.owns=!1,R.flight=1,Qe(`none`),z&&gt(z),H())}function pt(e){let t=l.getState();if(e===t.floor)return Y();(e===0||c(t.repos,e))&&(R.arrival={mode:`overview`},t.goToFloor(e))}var mt={right:0,forward:0,fast:!1,zoom:0};function ht(e){let t=R.seen;return e.fx=t.x,e.fy=t.y+M.height,e.fz=t.z,e.yaw=t.heading,e.el=M.el,e.fov=M.fov,e}function gt(e){(e.fov!==F()||e.near!==I)&&(e.fov=F(),e.near=I,e.updateProjectionMatrix())}function _t(e,t){e.position.set(t.x,t.y,t.z),e.rotation.set(t.pitch,t.yaw,0,`YXZ`),(Math.abs(e.fov-t.fov)>1e-4||Math.abs(e.near-t.near)>1e-5)&&(e.fov=t.fov,e.near=t.near,e.updateProjectionMatrix())}function vt(e){let n=z;if(!R.owns||!n)return;let r=R.goal,i=mt;if(R.mode===`overview`){let t=r.dist*(i.fast?1.6:.8)*e;(i.right||i.forward)&&we(r,i.right*t,i.forward*t),i.zoom&&Z(i.zoom*e*900),Ce(r),_e(R.orbit,r,e,7),T(R.orbit,R.goalPose)}else if(R.mode===`building`)i.forward&&(r.fy+=i.forward*e*10,ke(r,l.getState().floor,q())),i.zoom&&Z(i.zoom*e*900),_e(R.orbit,r,e,6),T(R.orbit,R.goalPose);else if(R.mode===`follow`){let t=R.target;if(t&&t.read(R.seen)){R.lost=0;let t=r.dist;ht(r),r.dist=t,R.snap&&w(r,R.orbit),R.snap=!1,i.zoom&&Z(i.zoom*e*900)}else if((R.lost+=e)>Ne&&performance.now()>R.waitUntil)return l.getState().pushToast(`info`,`🎥 Lost sight of ${t?.label??`them`}: back to you`),X(),vt(e);_e(R.orbit,r,e,6,2.4),T(R.orbit,R.goalPose),Ae(R.goalPose,R.orbit.fx),me(R.goalPose,R.orbit.fx,R.orbit.fy,R.orbit.fz)}else{let e=B(),n=R.goalPose;n.x=R.home.x,n.y=t,n.z=R.home.z,n.yaw=e.yaw,n.pitch=e.pitch,n.fov=F(),n.near=I}R.flight<1?(R.flight=Math.min(1,R.flight+e/R.flightTime),ge(R.from,R.goalPose,he(R.flight),R.pose)):C(R.goalPose,R.pose),_t(n,R.pose);let a=$e();(a!==R.cut||a===`dollhouse`)&&Qe(a),R.mode===`first`&&R.flight>=1&&(R.owns=!1,Qe(`none`),gt(n),H())}var Q=e=>Math.round(e*100)/100,$=new h,yt=null;function bt(e){yt=e}function xt(e,t,n){if(!z||!yt||(z.updateMatrixWorld(),$.set(e,t,n).project(z),$.z>1||Math.abs($.x)>1||Math.abs($.y)>1))return null;let r=yt.getBoundingClientRect();return{x:Math.round(r.left+($.x+1)/2*r.width),y:Math.round(r.top+(1-$.y)/2*r.height)}}typeof window<`u`&&(window.__swarmCamera={state:()=>({mode:R.mode,owns:R.owns,flying:R.flight<1,target:R.target?{id:R.target.id,label:R.target.label}:null,home:{x:Q(R.home.x),z:Q(R.home.z),yaw:Q(R.home.yaw),pitch:Q(R.home.pitch)},pose:{x:Q(R.pose.x),y:Q(R.pose.y),z:Q(R.pose.z),yaw:Q(R.pose.yaw),pitch:Q(R.pose.pitch),fov:Q(R.pose.fov)},orbit:{fx:Q(R.goal.fx),fy:Q(R.goal.fy),fz:Q(R.goal.fz),yaw:Q(R.goal.yaw),dist:Q(R.goal.dist),fov:Q(R.goal.fov)},quad:R.quad,cut:R.cut,sides:{...R.sides}}),overview:Y,building:rt,first:X,tab:()=>lt(),follow:e=>{let t=l.getState().agents[e];it(N(e,t?.name??e))},followAgent:ot,rotate:ut,zoom:Z,drag:dt,screenOf:xt,person(e){let t=o(e);return t?xt(t.x,1,t.z):null}});export{Ke as A,ce as B,ut as C,vt as D,Fe as E,k as F,ue as H,ae as I,oe as L,Be as M,Z as N,lt as O,A as P,ie as R,We as S,qe as T,re as U,de as V,se as W,Ze as _,Le as a,Ge as b,He as c,X as d,ot as f,Ve as g,ct as h,bt as i,pt as j,V as k,rt as l,st as m,ft as n,Re as o,N as p,Pe as r,dt as s,W as t,Y as u,Ue as v,Ie as w,mt as x,P as y,le as z};
@@ -1 +1 @@
1
- import{vs as e}from"./store-D1ymxjG0.js";function t(t,n,r){let i=e(r).slice(0,2),a=e=>e.lang.toLowerCase().split(/[-_]/)[0]===i;return t.find(e=>e.name===n&&a(e))??t.find(e=>a(e)&&e.default)??t.find(a)??t.find(e=>e.name===n)}export{t};
1
+ import{vs as e}from"./store-D17hJxYS.js";function t(t,n,r){let i=e(r).slice(0,2),a=e=>e.lang.toLowerCase().split(/[-_]/)[0]===i;return t.find(e=>e.name===n&&a(e))??t.find(e=>a(e)&&e.default)??t.find(a)??t.find(e=>e.name===n)}export{t};